CN109783321B - Monitoring data management method and device and terminal equipment - Google Patents

Monitoring data management method and device and terminal equipment Download PDF

Info

Publication number
CN109783321B
CN109783321B CN201910068113.8A CN201910068113A CN109783321B CN 109783321 B CN109783321 B CN 109783321B CN 201910068113 A CN201910068113 A CN 201910068113A CN 109783321 B CN109783321 B CN 109783321B
Authority
CN
China
Prior art keywords
monitoring data
file
data
acquiring
monitoring
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910068113.8A
Other languages
Chinese (zh)
Other versions
CN109783321A (en
Inventor
吴汉俊
黄敏强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Jingyang Information Technology Co ltd
Original Assignee
Shenzhen Jingyang Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Jingyang Information Technology Co ltd filed Critical Shenzhen Jingyang Information Technology Co ltd
Priority to CN201910068113.8A priority Critical patent/CN109783321B/en
Publication of CN109783321A publication Critical patent/CN109783321A/en
Application granted granted Critical
Publication of CN109783321B publication Critical patent/CN109783321B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention is suitable for the technical field of computers, and provides a monitoring data management method, a monitoring data management device and terminal equipment, wherein the monitoring data management method comprises the following steps: acquiring monitoring data and a monitoring data writing request; acquiring a write address of the monitoring data according to the monitoring data and the monitoring data write request; and writing the monitoring data into the storage space corresponding to the write address in a data block form, wherein the data volume of the data block is an integral multiple of 4K. By the method, disk fragmentation can be avoided, and the utilization rate of the disk is improved.

Description

Monitoring data management method and device and terminal equipment
Technical Field
The present invention relates to the field of data management technologies, and in particular, to a monitoring data management method and apparatus, a terminal device, and a computer-readable storage medium.
Background
In the monitoring field, monitoring data is usually required to be stored, when a disk is full of monitoring data, an original file needs to be deleted, and then a new file needs to be written, and long-term operation of the disk causes fragmentation of the disk, that is, idle sectors in the disk are scattered to discontinuous physical positions in the whole disk, so that the monitoring data belonging to the same file cannot exist in continuous sectors, and the utilization rate of the disk is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a monitoring data management method, an apparatus, a terminal device, and a computer-readable storage medium, so as to solve the problems of disk fragmentation and reduction of disk utilization rate in the process of monitoring data storage in the prior art.
A first aspect of an embodiment of the present invention provides a monitoring data management method, including:
acquiring monitoring data and a monitoring data writing request;
acquiring a write address of the monitoring data according to the monitoring data and the monitoring data write request;
and writing the monitoring data into a storage space corresponding to the write address in a data block form, wherein the data volume of the data block is an integral multiple of 4K.
A second aspect of an embodiment of the present invention provides a monitoring data management apparatus, including:
the first acquisition unit is used for acquiring the monitoring data and the monitoring data writing request;
a second obtaining unit, configured to obtain a write address of the monitoring data according to the monitoring data and the monitoring data write request;
and the monitoring data writing unit is used for writing the monitoring data into the storage space corresponding to the writing address in a data block form, and the data volume of the data block is an integral multiple of 4K. A third aspect of an embodiment of the present invention provides a terminal device, including: a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps as the monitoring data management when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the monitoring data management method as described.
Compared with the prior art, the embodiment of the application has the advantages that: the method comprises the steps of obtaining a write address of monitoring data according to monitoring data and a monitoring data write request by obtaining the monitoring data and the monitoring data write request, and writing the monitoring data into a storage space corresponding to the write address in a data block mode, wherein the data volume of the data block is an integral multiple of 4K. Because the monitoring data is written into the storage space corresponding to the write address in the form of data blocks, the data volume of the data blocks is integral multiple of 4K, disk fragmentation can be avoided, and the utilization rate of the disk is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a monitoring data management method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a disk file system provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a monitoring data management apparatus according to an embodiment of the present application;
fig. 4 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In particular implementations, the terminal devices described in embodiments of the present application include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers having touch sensitive surfaces (e.g., touch screen displays and/or touch pads). It should also be understood that in some embodiments, the devices described above are not portable communication devices, but are desktop computers having touch-sensitive surfaces (e.g., touch screen displays and/or touch pads).
In the discussion that follows, a terminal device that includes a display and a touch-sensitive surface is described. However, it should be understood that the terminal device may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
The terminal device supports various applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disc burning application, a spreadsheet application, a gaming application, a telephone application, a video conferencing application, an email application, an instant messaging application, an exercise support application, a photo management application, a digital camera application, a web browsing application, a digital music player application, and/or a digital video player application.
Various applications that may be executed on the terminal device may use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal can be adjusted and/or changed between applications and/or within respective applications. In this way, a common physical architecture (e.g., touch-sensitive surface) of the terminal can support various applications with user interfaces that are intuitive and transparent to the user.
The first embodiment is as follows:
fig. 1 shows a schematic flow chart of a first monitoring data management method provided in an embodiment of the present application, which is detailed as follows:
step S11, acquiring the monitoring data and the monitoring data write request.
Optionally, before the step S11, the method includes: and initializing a disk file system. Taking a 4TByte disk as an example, as shown in fig. 2, the disk is divided into 1 130M file system area, 1 126M tail reserved area, and (32k-2) 128M files, the file system includes a file header and (32k-2) file indexes, the file indexes are three-level indexes, each file index corresponds to one 128M file storage information, and each file index includes 1 file index header of 12 bytes and 1021 48Byte index entries. The file index header includes: the monitoring data stream comprises a channel identification number, a monitoring data stream identification number, a file time span and a file writing start time, wherein the channel identification number is used for distinguishing the source of the monitoring data, for example, the channel identification number is used for distinguishing different camera devices. Each index item corresponds to one write operation, so that each file carries out 1021 write operations at most, and each index item comprises: the offset of the written data in the corresponding file, the time span of the written data and the write operation starting time corresponding to the index entry, if the index entry is empty, the index entry is not used.
Because the disk file system can be constructed by adopting a pre-distribution mode for the disk, disk fragments are avoided, additional indexes are reduced, and the difficulty of monitoring data query is reduced.
Step S12, obtaining a write address of the monitoring data according to the monitoring data and the monitoring data write request.
Optionally, before the step S12, determining whether the monitoring data satisfies writing conditions, where the writing conditions include: the time length of the monitoring data is larger than a preset time length, or/and the data volume of the monitoring data is larger than a preset data volume; and if the monitoring data meets the writing condition, executing the writing request according to the monitoring data and the monitoring data to obtain the writing address of the monitoring data.
By judging whether the monitoring data meet the writing condition or not, if the monitoring data meet the writing condition, the writing address of the monitoring data can be obtained, so that the monitoring data with smaller data volume or shorter time length can be prevented from being written into a disk, disk fragmentation is effectively avoided, and the utilization rate of the disk is improved.
Optionally, the step S12 specifically includes: judging whether the file to which the monitoring data belongs is a used file or not; if the file to which the monitoring data belongs is a used file, acquiring a file index of the used file, and acquiring a write address of the monitoring data according to the file index; if the file to which the monitoring data belongs is not a used file, acquiring an empty file index head, initializing the file index head, and acquiring the write address of the monitoring data according to the file index head.
Specifically, determining a file to which the monitoring data belongs, querying a file index corresponding to the file to which the monitoring data belongs, if the file index corresponding to the file to which the monitoring data belongs can be queried, determining that the file to which the monitoring data belongs is a used file, acquiring the file index of the used file, and acquiring the write address of the monitoring data according to the file index; if the file index corresponding to the file to which the monitoring data belongs cannot be inquired, judging that the file to which the monitoring data belongs is not a used file, traversing according to the file sequence to find an unused file, initializing a file index head corresponding to the unused file, and acquiring the write address of the monitoring data according to the file index head.
Step S13, writing the monitoring data into the storage space corresponding to the write address in the form of data blocks, where the data amount of the data blocks is an integer multiple of 4K.
Optionally, the step S13 specifically includes: determining the data volume of a data block, wherein the data volume of the data block is an integral multiple of 4K; dividing the monitoring data into data blocks having the data volume; and writing the monitoring data into a storage space corresponding to the write address in a data block form.
Monitoring data is written in by adopting a mode of directly writing data blocks, so that the cache consumption can be reduced.
For example, the data amount of the data block is determined to be 8K, the monitoring data is monitoring video stream data, continuous video frames of the monitoring video stream data are classified into a frame group frame by frame, the sum of the data amount of the next frame video frame and the data amount of the existing frame group is calculated, and when the sum of the data amount of the next frame video frame and the data amount of the existing frame group is greater than 8K, the next frame video frame is not classified into the existing frame group. Wherein each video frame comprises: media mark head, video data, the media mark head includes: channel identification number, video data stream identification number, video data time length and video data type. Judging whether the data volume of the existing frame group is equal to 8K, if the data volume of the existing frame group is equal to 8K, determining the existing frame group as a data block with the data volume, and writing the existing frame group into a storage space corresponding to the write address; if the data amount of the existing frame group is less than 8K, performing data filling on the existing frame group, wherein the data filling represents that: and filling a gap in the data tail of the existing frame group, adding an end mark to ensure that the data volume of the existing frame group is equal to 8K, determining the existing frame group subjected to data filling as a data block with the data volume, and writing the existing frame group into the storage space corresponding to the write address. And by analogy, dividing the monitoring video stream data into a plurality of data blocks with 8K data volume, and sequentially writing the data blocks into corresponding storage spaces.
Optionally, before writing each data block, calculating a sum of data amounts of the data block to be written and the file to which the monitoring data belongs, and if the sum of the data amounts is not greater than a preset file data amount, writing the data block to be written into a storage space corresponding to the file to which the monitoring data belongs; and if the sum of the data volume is larger than the preset file data volume, writing the data block to be subjected to the write operation into a storage space corresponding to the new file. The preset file data volume corresponds to the maximum data volume of each file divided on the disk by the disk file system. Taking a 4TByte disk as an example, as shown in fig. 2, the disk is divided into a 130M file system area, a 126M tail reserved area, and (32k-2) 128M files, and the data size of the preset file is 128M.
Optionally, after the step S13, the method includes: and updating the file index item and the file index head according to the time span of the monitoring data.
Specifically, a file index entry and a time span corresponding to a data block divided by monitoring data are determined, and the corresponding file index entry is updated according to the time span of the data block. And determining the time span of the monitoring data according to the time spans of all the data blocks, determining a file corresponding to the monitoring data, and updating the file index header according to the time span of the monitoring data.
For example, the monitoring data is divided into two monitoring video stream data blocks, the starting time of a first monitoring video stream data block is 09/month and 22/month 00:00 in 2018, and the time for writing the last frame of video frame of the first monitoring video stream data block is 09/month and 22/month and 00:00:40 in 2018, which means that the time span of the first monitoring video stream data block is 40 seconds, the file index entry corresponding to the first monitoring video stream data block is updated according to the time span of 40 seconds, and the recording value of the file index entry in the memory is increased by 1; similarly, the time span of the first monitored video stream data block is obtained as 20 seconds, the file index entry corresponding to the second monitored video stream data block is updated according to the time span of 20 seconds, the record value of the file index entry in the memory is increased by 1, as can be seen from the above, the time span of the monitored data is 60 seconds, and the file time span of the file index header is updated according to the time span of 60 seconds.
Optionally, after the step S13, the method includes: acquiring a query request for file information to which monitoring data belongs, wherein the file information to which the monitoring data belongs comprises: monitoring data stream information, file starting time and file ending time; acquiring a file index head of a file to which the monitoring data belongs according to the query request; and acquiring the file information of the monitoring data according to the file index head of the file to which the monitoring data belongs.
Specifically, a query request for file information to which monitoring data belongs is acquired, where the file information to which the monitoring data belongs includes: monitoring data stream information, file start time, file end time and monitoring data content types, wherein the monitoring data stream information comprises: the channel identification number and the monitoring data stream identification number, wherein the monitoring data content type comprises: alarm scenario, and illegal intrusion scenario by foreign objects. Determining the files to which the monitoring files belong according to the query request, and acquiring file index headers of the files to which the monitoring data belong; and acquiring the file information of the monitoring data according to the file index head of the file to which the monitoring data belongs.
Optionally, after the step S13, the method includes: acquiring a query request for a data block; determining monitoring data to which the data block belongs according to the query request for the data block, acquiring a file index head of a file to which the monitoring data belongs according to the monitoring data to which the data block belongs, acquiring a file index entry of the data block corresponding to the monitoring data according to the file index head of the file to which the monitoring data belongs, acquiring a write address and a data length of the data block corresponding to the monitoring data according to the file index entry, and acquiring the data block corresponding to the monitoring data according to the write address and the data length.
Optionally, after the step S13, the method includes: acquiring a query request for monitoring data; acquiring a file index head of a file to which the monitoring data belongs according to the query request; acquiring a file index entry of the monitoring data according to a file index header of a file to which the monitoring data belongs; and acquiring the monitoring data according to the file index item of the monitoring data.
Specifically, a query request for monitoring data is obtained, a file index header of a file to which the monitoring data belongs is obtained according to the query request, a file index entry of a data block corresponding to the monitoring data is obtained according to the file index header of the file to which the monitoring data belongs, a write address and a data length of the data block corresponding to the monitoring data are obtained according to the file index entry, a data block corresponding to the monitoring data is obtained according to the write address and the data length, and so on, all data blocks belonging to the monitoring data are obtained, that is, the monitoring data are obtained.
By acquiring the file index head of the file to which the monitoring data belongs and then acquiring the file index item of the data block corresponding to the monitoring data according to the file index head of the file to which the monitoring data belongs, the query efficiency of the monitoring data can be improved.
Optionally, after the acquiring the monitoring data according to the file index entry of the monitoring data, the method includes: and analyzing the monitoring data.
In the embodiment of the invention, by acquiring monitoring data and a monitoring data writing request, a writing address of the monitoring data is acquired according to the monitoring data and the monitoring data writing request, and the monitoring data is written into a storage space corresponding to the writing address in a data block form, wherein the data volume of the data block is an integral multiple of 4K. Because the monitoring data is written into the storage space corresponding to the write address in the form of data blocks, the data volume of the data blocks is integral multiple of 4K, disk fragmentation can be avoided, and the utilization rate of the disk is improved.
The second embodiment:
corresponding to the first embodiment, fig. 3 shows a schematic structural diagram of a monitoring data management device according to an embodiment of the present application, and for convenience of description, only the portions related to the embodiment of the present application are shown.
The monitoring data management device includes: a first acquiring unit 31, a second acquiring unit 32, and a monitoring data writing unit 33. Wherein:
a first obtaining unit 31, configured to obtain the monitoring data and the monitoring data write request.
Optionally, the monitoring data management apparatus includes: and a disk file system initialization unit.
And the disk file system initialization unit is used for initializing the disk file system before the monitoring data acquisition and monitoring data write request. The disk file system initialization unit can adopt a pre-allocation mode to the disk to construct a disk file system, so that disk fragments are avoided, extra indexes are reduced, and the difficulty of monitoring data query is reduced.
A second obtaining unit 32, configured to obtain a write address of the monitoring data according to the monitoring data and the monitoring data write request.
Optionally, the monitoring data management apparatus includes: and a judging unit.
The determining unit is configured to determine whether the monitoring data meets a writing condition before the obtaining of the writing address of the monitoring data according to the monitoring data and the monitoring data writing request, where the writing condition includes: the time length of the monitoring data is larger than a preset time length, or/and the data volume of the monitoring data is larger than a preset data volume; and if the monitoring data meets the writing condition, executing the writing request according to the monitoring data and the monitoring data to obtain the writing address of the monitoring data.
The judging unit judges whether the monitoring data meets the writing condition or not, if the monitoring data meets the writing condition, the writing address of the monitoring data can be obtained, and therefore the monitoring data with smaller data volume or shorter time length can be prevented from being written into a disk, disk fragmentation is effectively avoided, and the utilization rate of the disk is improved.
Optionally, the second obtaining unit 32 is specifically configured to: judging whether the file to which the monitoring data belongs is a used file or not; if the file to which the monitoring data belongs is a used file, acquiring a file index of the used file, and acquiring a write address of the monitoring data according to the file index; if the file to which the monitoring data belongs is not a used file, acquiring an empty file index head, initializing the file index head, and acquiring the write address of the monitoring data according to the file index head.
And a monitoring data writing unit 33, configured to write the monitoring data into the storage space corresponding to the write address in the form of a data block, where the data amount of the data block is an integer multiple of 4K.
Optionally, the monitoring data writing unit 33 is specifically configured to: determining the data volume of a data block, wherein the data volume of the data block is an integral multiple of 4K; dividing the monitoring data into data blocks having the data volume; and writing the monitoring data into a storage space corresponding to the write address in a data block form.
The monitoring data writing unit 33 writes the monitoring data by directly writing the data blocks, so that the cache consumption can be reduced.
Alternatively, the monitor data writing unit 33 includes; and a calculation module.
The calculation module is configured to: before writing each data block, calculating the sum of data quantity of the data block to be written and the written data of the file to which the monitoring data belongs, and if the sum of the data quantity is not more than the data quantity of a preset file, writing the data block to be written into a storage space corresponding to the file to which the monitoring data belongs; and if the sum of the data volume is larger than the preset file data volume, writing the data block to be subjected to the write operation into a storage space corresponding to the new file.
Optionally, the monitoring data management apparatus includes: and an updating unit.
And the updating unit is used for updating the file index entry and the file index header according to the time span of the monitoring data after the monitoring data is written into the storage space corresponding to the write address in the form of a data block.
Optionally, the monitoring data management apparatus includes: and a file information query unit.
The file information querying unit is configured to obtain a query request for file information to which the monitoring data belongs after the monitoring data is written into the storage space corresponding to the write address in a data block form, where the file information to which the monitoring data belongs includes: monitoring data stream information, file starting time and file ending time; acquiring a file index head of a file to which the monitoring data belongs according to the query request; and acquiring the file information of the monitoring data according to the file index head of the file to which the monitoring data belongs.
Optionally, the monitoring data management apparatus includes: and a data block query unit.
The data block query unit is configured to obtain a query request for a data block after the monitoring data is written in the storage space corresponding to the write address in a data block form; determining monitoring data to which the data block belongs according to the query request for the data block, acquiring a file index head of a file to which the monitoring data belongs according to the monitoring data to which the data block belongs, acquiring a file index entry of the data block corresponding to the monitoring data according to the file index head of the file to which the monitoring data belongs, acquiring a write address and a data length of the data block corresponding to the monitoring data according to the file index entry, and acquiring the data block corresponding to the monitoring data according to the write address and the data length.
Optionally, the monitoring data management apparatus includes: and monitoring the data query unit.
The monitoring data query unit is used for acquiring a query request for monitoring data; acquiring a file index head of a file to which the monitoring data belongs according to the query request; acquiring a file index item of the monitoring data according to a file index header of a file to which the monitoring data belongs; and acquiring the monitoring data according to the file index item of the monitoring data.
The monitoring data query unit can improve the query efficiency of the monitoring data by acquiring the file index header of the file to which the monitoring data belongs and then acquiring the file index item of the data block corresponding to the monitoring data according to the file index header of the file to which the monitoring data belongs.
Optionally, the monitoring data management apparatus includes: and a monitoring data analysis unit.
The monitoring data analyzing unit is used for analyzing the monitoring data after the monitoring data is obtained according to the file index item of the monitoring data.
In the embodiment of the invention, by acquiring monitoring data and a monitoring data writing request, a writing address of the monitoring data is acquired according to the monitoring data and the monitoring data writing request, and the monitoring data is written into a storage space corresponding to the writing address in a data block form, wherein the data volume of the data block is an integral multiple of 4K. Because the monitoring data is written into the storage space corresponding to the write address in the form of data blocks, the data volume of the data blocks is integral multiple of 4K, disk fragmentation can be avoided, and the utilization rate of the disk is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Example three:
fig. 4 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 4, the terminal device 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42 stored in said memory 41 and executable on said processor 40. The processor 40 implements the steps in the various embodiments of the monitoring data management method described above, such as the steps S11 to S13 shown in fig. 1, when executing the computer program 42. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the units in the device embodiments described above, such as the functions of the units 31 to 33 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 42 in the terminal device 4. For example, the computer program 42 may be divided into a first acquiring unit, a second acquiring unit, and a monitoring data writing unit, and each unit has the following specific functions:
the first acquisition unit is used for acquiring the monitoring data and the monitoring data writing request;
a second obtaining unit, configured to obtain a write address of the monitoring data according to the monitoring data and the monitoring data write request;
and the monitoring data writing unit is used for writing the monitoring data into the storage space corresponding to the writing address in a data block form, and the data volume of the data block is an integral multiple of 4K.
The terminal device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of a terminal device 4 and does not constitute a limitation of terminal device 4 and may include more or fewer components than shown, or some components may be combined, or different components, for example, the terminal device may also include input output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing the computer program and other programs and data required by the terminal device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
It should be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is only used for illustration, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the apparatus may be divided into different functional units or modules to perform all or part of the above described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed apparatus/terminal device and method can be implemented in other ways. For example, the above-described apparatus/terminal device embodiments are merely illustrative, and for example, the division of the modules or units is only one type of logical function division, and there may be another division in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Each functional unit in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U.S. disk, removable hard disk, magnetic diskette, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunications signal, and software distribution medium, etc. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (9)

1. A method for managing monitored data, comprising:
initializing a disk file system, dividing a disk into 1 file system area, 1 tail reserved area and a plurality of files, wherein the file system area comprises a file header and a plurality of file indexes, each file index corresponds to an index item of one file, each file index comprises 1 file index header and a plurality of index items, and the file index header comprises: the method comprises the following steps of identifying a channel, monitoring data stream identification number, file time span and file writing starting time, wherein the channel identification number is used for distinguishing the source of monitoring data;
acquiring monitoring data and a monitoring data writing request;
acquiring a write address of the monitoring data according to the monitoring data and the monitoring data write request, wherein the acquiring comprises the following steps: judging whether the file to which the monitoring data belongs is a used file or not; if the file to which the monitoring data belongs is a used file, acquiring a file index of the used file, wherein the file index comprises a file index head and a file index item, and acquiring a write address of the monitoring data according to the file index; if the file to which the monitoring data belongs is not a used file, acquiring an empty file index head, initializing the file index head, and acquiring a write address of the monitoring data according to the file index head;
writing the monitoring data into a storage space of a file corresponding to the write address in a data block form, wherein the data volume of the data block is an integral multiple of 4K;
acquiring a query request for a data block; determining monitoring data to which the data block belongs according to the query request for the data block, acquiring a file index head of a file to which the monitoring data belongs according to the monitoring data to which the data block belongs, acquiring a file index entry of the data block corresponding to the monitoring data according to the file index head of the file to which the monitoring data belongs, acquiring a write address and a data length of the data block corresponding to the monitoring data according to the file index entry, and acquiring the data block corresponding to the monitoring data according to the write address and the data length.
2. The monitoring data management method according to claim 1, wherein the writing of the monitoring data into the storage space corresponding to the write address in a data block, the data amount of the data block being an integer multiple of 4K, includes:
determining the data volume of a data block, wherein the data volume of the data block is an integral multiple of 4K;
dividing the monitoring data into data blocks having the data amount;
and writing the monitoring data into the storage space corresponding to the write address in a data block form.
3. The monitoring data management method according to claim 1, wherein before the obtaining of the write address of the monitoring data according to the monitoring data and the monitoring data write request, the method comprises:
judging whether the monitoring data meets a writing condition or not, wherein the writing condition comprises the following steps: the time length of the monitoring data is greater than a preset time length, or/and the data volume of the monitoring data is greater than a preset data volume;
and if the monitoring data meets the writing condition, executing the writing request according to the monitoring data and the monitoring data to obtain the writing address of the monitoring data.
4. The monitoring data management method according to claim 1, after performing the step of writing the monitoring data in the form of data blocks into the storage space corresponding to the write address, comprising:
and updating the file index item and the file index head according to the time span of the monitoring data.
5. The monitoring data management method according to claim 1, wherein after writing the monitoring data in the form of data blocks into the storage space corresponding to the write address, the method includes:
acquiring a query request for file information to which monitoring data belongs, wherein the file information to which the monitoring data belongs comprises: monitoring data stream information, file starting time and file ending time;
acquiring a file index head of a file to which the monitoring data belongs according to the query request;
and acquiring the file information of the monitoring data according to the file index head of the file to which the monitoring data belongs.
6. The monitoring data management method according to claim 1, wherein after writing the monitoring data in the form of data blocks into the storage space corresponding to the write address, the method includes:
acquiring a query request for monitoring data;
acquiring a file index head of a file to which the monitoring data belongs according to the query request;
acquiring a file index item of the monitoring data according to a file index header of a file to which the monitoring data belongs;
and acquiring the monitoring data according to the file index item of the monitoring data.
7. A monitoring data management apparatus, comprising:
the first acquisition unit is used for acquiring monitoring data and a monitoring data writing request;
a second obtaining unit, configured to obtain a write address of the monitoring data according to the monitoring data and the monitoring data write request; the second obtaining unit is specifically configured to: judging whether the file to which the monitoring data belongs is a used file or not; if the file to which the monitoring data belongs is a used file, acquiring a file index of the used file, and acquiring a write address of the monitoring data according to the file index; if the file to which the monitoring data belongs is not a used file, acquiring an empty file index head, initializing the file index head, and acquiring a write address of the monitoring data according to the file index head;
the monitoring data writing unit is used for writing the monitoring data into the storage space of the file corresponding to the writing address in a data block form, and the data volume of the data block is an integral multiple of 4K;
the data block query unit is used for acquiring a query request for the data block; determining monitoring data to which the data block belongs according to the query request for the data block, acquiring a file index head of a file to which the monitoring data belongs according to the monitoring data to which the data block belongs, acquiring a file index entry of the data block corresponding to the monitoring data according to the file index head of the file to which the monitoring data belongs, acquiring a write address and a data length of the data block corresponding to the monitoring data according to the file index entry, and acquiring the data block corresponding to the monitoring data according to the write address and the data length;
the monitoring data management device is further configured to initialize a disk file system, divide the disk into 1 file system area, 1 tail reserved area, and multiple files, where the file system area includes a file header and multiple file indexes, each file index corresponds to an index entry of one file, the file index includes 1 file index header and multiple index entries, and the file index header includes: the system comprises a channel identification number, a monitoring data stream identification number, a file time span and a file writing starting time, wherein the channel identification number is used for distinguishing the source of the monitoring data.
8. Monitoring data management terminal device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor implements the steps of the method according to any of claims 1 to 6 when executing said computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a method according to any one of claims 1 to 6.
CN201910068113.8A 2019-01-24 2019-01-24 Monitoring data management method and device and terminal equipment Active CN109783321B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910068113.8A CN109783321B (en) 2019-01-24 2019-01-24 Monitoring data management method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910068113.8A CN109783321B (en) 2019-01-24 2019-01-24 Monitoring data management method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN109783321A CN109783321A (en) 2019-05-21
CN109783321B true CN109783321B (en) 2022-09-23

Family

ID=66501278

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910068113.8A Active CN109783321B (en) 2019-01-24 2019-01-24 Monitoring data management method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN109783321B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111913657B (en) * 2020-07-10 2023-06-09 长沙景嘉微电子股份有限公司 Block data read-write method, device, system and storage medium
CN112597112B (en) * 2020-12-25 2023-06-27 北京市商汤科技开发有限公司 Data processing method and device, electronic equipment and storage medium
CN112954244A (en) * 2021-01-19 2021-06-11 普联技术有限公司 Method, device and equipment for realizing storage of monitoring video and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101644996A (en) * 2009-09-25 2010-02-10 杭州华三通信技术有限公司 Storage method of index data and storage control device
CN102508784A (en) * 2011-11-02 2012-06-20 杭州海康威视数字技术股份有限公司 Data storage method of flash memory card in video monitoring equipment, and system thereof
CN105100716A (en) * 2015-07-23 2015-11-25 浙江立元通信技术股份有限公司 Safe memory cell used for network video monitoring and system thereof
CN105468642A (en) * 2014-09-09 2016-04-06 杭州海康威视数字技术股份有限公司 Data storage method and apparatus
CN105518612A (en) * 2015-07-29 2016-04-20 深圳市锐明技术股份有限公司 Write-in method and apparatus for monitoring data
CN106231252A (en) * 2016-07-29 2016-12-14 银江股份有限公司 A kind of extensive video monitoring storage method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130013605A1 (en) * 2011-07-08 2013-01-10 Stanfill Craig W Managing Storage of Data for Range-Based Searching

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101644996A (en) * 2009-09-25 2010-02-10 杭州华三通信技术有限公司 Storage method of index data and storage control device
CN102508784A (en) * 2011-11-02 2012-06-20 杭州海康威视数字技术股份有限公司 Data storage method of flash memory card in video monitoring equipment, and system thereof
CN105468642A (en) * 2014-09-09 2016-04-06 杭州海康威视数字技术股份有限公司 Data storage method and apparatus
CN105100716A (en) * 2015-07-23 2015-11-25 浙江立元通信技术股份有限公司 Safe memory cell used for network video monitoring and system thereof
CN105518612A (en) * 2015-07-29 2016-04-20 深圳市锐明技术股份有限公司 Write-in method and apparatus for monitoring data
CN106231252A (en) * 2016-07-29 2016-12-14 银江股份有限公司 A kind of extensive video monitoring storage method

Also Published As

Publication number Publication date
CN109783321A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
US11169710B2 (en) Method and apparatus for SSD storage access
CN109783321B (en) Monitoring data management method and device and terminal equipment
CN108038112B (en) File processing method, mobile terminal and computer readable storage medium
WO2017107414A1 (en) File operation method and device
CN106991179B (en) Data deleting method and device and mobile terminal
CN109804359A (en) For the system and method by write back data to storage equipment
CN105117351A (en) Method and apparatus for writing data into cache
CN108717516B (en) File labeling method, terminal and medium
US8924642B2 (en) Monitoring record management method and device
CN110851474A (en) Data query method, database middleware, data query device and storage medium
CN112612853A (en) Data processing method and device based on database cluster and electronic equipment
CN109697019B (en) Data writing method and system based on FAT file system
CN109947667B (en) Data access prediction method and device
US20140281211A1 (en) Fast mount cache
CN114996173A (en) Method and device for managing write operation of storage equipment
CN108304142A (en) A kind of data managing method and device
CN112800291B (en) Similar account determination method and device, electronic equipment and storage medium
US20110106815A1 (en) Method and Apparatus for Selectively Re-Indexing a File System
CN108985758B (en) Data processing method, data processing system and terminal equipment
CN110874723B (en) Electronic red envelope detection method, electronic red envelope detection device and mobile terminal
CN111723244A (en) Data processing method, data processing device and terminal
CN111090633A (en) Small file aggregation method, device and equipment of distributed file system
CN110007878B (en) Memory card processing method, memory card processing device and mobile terminal
CN110321340B (en) Database updating method, database updating device and mobile terminal
CN110875873B (en) Information monitoring method, information monitoring device and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant