Patent Description:
The loop recording function of driving recorder is different from normal video recording. The driving recorder needs to record for a long time and without intervals to avoid missing the file of important or collision events. Loop recording is used on all of the driving recorders on the market so as to record continuously. Older video files are deleted when the storage capacity is full, and then new video files are continuously written, so that the driving recorder may function properly.

Currently, the host and the lens of a split-type driving recorder are separated, usually equipped with a dual lens or multiple lenses of three or more. However, when multiple lenses are used simultaneously on the same host for loop recording, the storage space drops quickly and may become uneven as lenses are switched on and off, making it impossible to guarantee that sufficient space is available for each of the lenses to store the recorded video. When the writing of a file is finished, there is no way to check if there is sufficient space as other cameras are still writing their files, making it easier to miss seconds or lose files. For this reason, typical designs always reserve a storage space equal to the maximum size of the video file multiplied by the number of lenses. When it falls below the reserved storage space, old video files will start to be deleted to ensure that there is no space problem for each writing of files. However, this requires a large amount of storage space, and once the settings for the resolution, the frames per second (FPS), the loop recording time, and the file compression format, etc. have been changed, the original settings for the reserved storage space will not be applicable. <CIT> relates to the technical field of data storage and provides a method and system for loop recording and a tachograph.

The following disclosure serves a better understanding of the present invention. The disclosure provides a method for storing multi-lens recording file and a multi-lens recording apparatus, which may reserve storage space according to the amount of the lens.

The method for storing multi-lens recording file of the disclosure is adapted for being executed by a processor, which is described below. A total recording capacity of at least one lens for loop recording is calculated in response to at least one of multiple lenses being driven to perform the loop recording based on respective setting data of the at least one lens being driven. Each of the lenses has a lens number correspondingly. Whether the remaining capacity of the storage space is less than the total recording capacity is determined. A file cleaning action is performed on multiple recorded files stored in the storage space by the at least one lens in response to the remaining capacity being less than the total recording capacity, which is described below. At least one recorded file stored in the storage space is deleted based on the recording time and the lens number, until the remaining capacity is no less than the total recording capacity. The loop recording is performed through the at least one lens being driven and a currently recorded file is stored in response to the remaining capacity being no less than the total recording capacity.

In an embodiment of the disclosure, in response to a first lens among the lenses being driven, the file cleaning action is described below. Whether a first amount of the recorded files corresponding to the first lens stored in the storage space is greater than a default amount is determined based on the lens number of the first lens. An earliest recorded file among the recorded files corresponding to the first lens is deleted based on the recording time in response to the first amount being greater than the default amount.

In an embodiment of the disclosure, after determining whether the first amount of the recorded files corresponding to the first lens stored in the storage space is greater than the default amount, a second lens is decided among remaining lenses of the lenses in response to the first amount not being greater than the default amount, where a second amount of the recorded files corresponding to the second lens stored in the storage space is greater than the default amount. The earliest recorded file among the recorded files corresponding to the second lens is deleted based on the recording time.

In an embodiment of the disclosure, after determining whether the first amount of the recorded files corresponding to the first lens stored in the storage space is greater than the default amount, a second lens is decided among remaining lenses of the lenses in response to the first amount not being greater than the default amount, where a second amount of the recorded files corresponding to the second lens stored in the storage space is greater than the default amount. A recorded file with a largest file size among the recorded files corresponding to the second lens is deleted based on a file size.

In an embodiment of the disclosure, in response to multiple lenses among the lenses being driven, the file cleaning action is described below. For each of the lenses being driven, whether a first amount of the recorded files corresponding to each of the lenses stored in the storage space is greater than a default amount is determined based on the lens number of each of the lenses. The earliest recorded file among the recorded files corresponding to each of the lenses in response to the first amount being greater than the default amount is deleted based on the recording time.

In an embodiment, after determining whether the first amount of the recorded files corresponding to each of the lenses stored in the storage space is greater than the default amount, For lenses for which the first amount is not greater than the default amount, the earliest recorded file among the recorded files corresponding to another lens stored in the storage space is deleted based on the recording time, where a second amount of the recorded files corresponding to the another lens stored in the storage space is greater than the default amount.

In an embodiment, after determining whether the first amount of the recorded files corresponding to each of the lenses stored in the storage space is greater than the default amount, For lenses for which the first amount is not greater than the default amount, a recorded file with a largest file size among the recorded files corresponding to another lens stored in the storage space is deleted based on a file size. where a second amount of the recorded files corresponding to the another lens stored in the storage space is greater than the default amount.

In an embodiment of the disclosure, the setting data includes a resolution, frames per second, a loop recording time, and a file compression format. The process of calculating the total recording capacity of the at least one lens for the loop recording is described below. A file size is calculated correspondingly based on the resolution, the frames per second, the loop recording time, and the file compression format corresponding to each of the at least one lens being driven. The total recording capacity is obtained by summing up the file size corresponding to the lens being driven.

In an embodiment of the disclosure, the method is further elaborated as below. Multiple queues are set up respectively for the lenses, where each of the queues is configured to record file information of the recorded file stored in the storage space by each of the lenses.

In an embodiment of the disclosure, the method is further elaborated as below. Whether the setting data of the lens being driven is updated is determined. The total recording capacity for the loop recording of the lens is recalculated in response to the setting data being updated.

The multi-lens recording apparatus of the disclosure includes multiple lenses, a storage, and a processor. The storage includes a storage space. The processor is coupled to the lenses and the storage and configured to execute the method for storing multi-lens recording file.

Based on the above, the disclosure may estimate the file size of a single file recorded by each of the lenses according to setting data of the lens being driven, and reserve the required storage space to ensure that each of the lenses may record a complete file. Accordingly, the reserved storage space may be changed, and more storage space may be used for storage.

<FIG> is a block diagram of a multi-lens recording apparatus according to an embodiment of the disclosure. Referring to <FIG>, a multi-lens recording apparatus <NUM> is, for example, a driving recorder, a robot, a monitoring system, and the like. The multi-lens recording apparatus <NUM> includes a processor <NUM>, a storage <NUM>, and multiple lenses <NUM>. In this embodiment, three lenses are shown for illustration, that is, the first lens <NUM>-<NUM>, the second lens <NUM>-<NUM>, and the third lens <NUM>-<NUM>, but not limited thereto. The amount of the lens <NUM> may be <NUM>, <NUM>, or more.

The processor <NUM> is, for example, a central processing unit (CPU), a physical processing unit (PPU), a programmable microprocessor, an embedded control chip, a digital signal processor (DSP), an application specific integrated circuits (ASIC), or other similar devices.

The storage <NUM> may be implemented by, for example, any type of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory, hard disk, or other similar device or a combination of these devices.

The lens <NUM> may be implemented by using a charge coupled element (CCD) lens, a complementary metal oxide semiconductor transistor (CMOS) lens, and the like.

A storage space <NUM> is set in the storage <NUM> to store the recorded file of the lens <NUM>. The storage <NUM> also stores at least one code snippet. After the above code snippet is installed, the processor <NUM> executes the following method for storing multi-lens recording file.

<FIG> is a flow diagram of a method for storing multi-lens recording file according to an embodiment of the disclosure. Referring to <FIG>, in step S205, in response to at least one lens <NUM> being driven to perform loop recording, the processor <NUM> calculates the total recording capacity of the lens <NUM> being driven for loop recording based on setting data of each of the lenses <NUM> being driven.

In response to the multi-lens recording apparatus <NUM> being turned on, the processor <NUM> calculates the file size of a single file recorded by each of the lenses <NUM> according to the setting data of the lenses <NUM> being driven (one or more). In this way, required space may be reserved in the storage space <NUM> to ensure that each of the lenses <NUM> may record a complete file.

Setting data includes a resolution, frames per second (FPS), a loop recording time, and a file compression format. The processor <NUM> calculates the file size correspondingly based on the resolution, the frames per second, the loop recording time, and the file compression format corresponding to each of the lenses <NUM> being driven. The setting data of each of the lenses <NUM> being driven is assumed to be as follows: the file compression format is Motion JPEG (Joint Photographic Experts Group), the resolution is <NUM>×<NUM>, the frames per second is <NUM>, and the loop recording time is <NUM> minutes. As a result, the file size of a single recording file of each lens <NUM> being driven is <NUM>. If the boot-up setting is set to drive only one first lens <NUM>-<NUM>, the total recording capacity is <NUM>. If the boot-up setting is set to drive the first lens <NUM>-<NUM>, the second lens <NUM>-<NUM>, and the third lens <NUM>-<NUM> at the same time, the total recording capacity is <NUM> (<NUM>×<NUM>) MB. In other embodiments, the setting data of each of the lenses being driven may also be different, which is not limited herein.

Next, in step S210, the processor <NUM> determines whether the remaining capacity of the storage space <NUM> is less than the total recording capacity. Before starting to record through the lens <NUM>, the processor <NUM> determines whether the remaining capacity is sufficient.

If the remaining capacity is less than the total recording capacity, in step S220, the processor <NUM> performs a file cleaning action on the recorded files stored in the storage space <NUM> by each of the lenses <NUM> being driven. That is, the processor <NUM> deletes at least one recorded file stored in the storage space <NUM> based on the recording time and a lens number, and returns to step S210 until the remaining capacity of the storage space <NUM> is no less than the total recording capacity. Each of the lenses <NUM> has a lens number correspondingly, and each of the recorded files has information related to the lens number of the corresponding lens <NUM>.

In an embodiment, it may be set to: in response to the remaining capacity of the storage space <NUM> being insufficient, the recorded file corresponding to the lens <NUM> being driven is first deleted. In order to maintain a balance of the recorded files stored by each of the lenses <NUM>, it may be further set to: keeping the amount of the recorded files stored in the storage space <NUM> by the lens <NUM> being driven not less than the default amount. That is, in response to the remaining capacity of the storage space <NUM> being insufficient and the recorded files stored in the storage space <NUM> by the lens <NUM> being driven being greater than the default amount, the earliest recorded file is deleted based on the recording time. In response to the amount of the recorded files stored in the storage space <NUM> by the lens <NUM> being driven not being greater than the default amount, another lens is decided among other remaining lenses. The amount of the recorded files stored in the storage space <NUM> by the another lens is greater than the default amount. The earliest recorded file among the recorded files corresponding to the another lens is deleted. In addition, it may also be set to: deleting the recorded file with the largest file size.

For example, with the first lens <NUM>-<NUM> being driven, is it assumed that the lens number of the first lens <NUM>-<NUM> is "Video1", the default amount is X, and the amount of the recorded files stored in the storage space <NUM> with the lens number of "Video1" is Y. If Y≥X, the earliest recorded file among the recorded files with the lens number "Video1" is deleted. If Y<X, the earliest recorded file among the recorded files corresponding to another lens number and with an amount greater than X is deleted.

In response to the remaining capacity of the storage space <NUM> being no less than the total recording capacity, in step S215, the processor <NUM> performs loop recording through at least one lens <NUM> being driven and stores the currently recorded file. Afterwards, continue loop recording and return to step S210 to continuously monitor whether the remaining capacity is sufficient to store subsequent recorded files.

The processor <NUM> further determines whether the setting data of the lens <NUM> being driven is updated during the loop recording. In response to the setting data of the lens <NUM> being changed during the loop recording, the processor <NUM> has to recalculate the total recording capacity of the lens <NUM> being driven for loop recording. For example, assuming the file size of a newly recorded file of the first lens <NUM>-<NUM> calculated based on the updated setting data is 88MB and the original recorded file size is 30MB, it is necessary to delete three recorded files corresponding to the first lens <NUM>-<NUM> in the storage space <NUM> at one time, so as to ensure sufficient space for completely storing the next recorded file. If there are insufficient recorded files corresponding to the first lens <NUM>-<NUM> in the storage space <NUM> to be deleted, the recorded files corresponding to another lens are deleted instead.

In the following, examples are given for driving one lens <NUM> and driving multiple lenses <NUM> respectively.

<FIG> is a flow diagram of the method for storing multi-lens recording file with a single lens being driven according to an embodiment of the disclosure. In this embodiment, the first lens <NUM>-<NUM> is used as an example. Referring to <FIG> and <FIG>, in step S305, in response to the first lens <NUM>-<NUM> being driven to perform loop recording, the processor <NUM> calculates the total recording capacity of the first lens <NUM>-<NUM> for loop recording based on the setting data of the first lens <NUM>-<NUM>. That is, the file size of a single recording of the first lens <NUM>-<NUM> is set as the total recording capacity.

Next, in step S310, the processor <NUM> determines whether the remaining capacity of the storage space <NUM> is less than the total recording capacity.

In response to the remaining capacity of the storage space <NUM> being no less than the total recording capacity, in step S315, the processor <NUM> performs loop recording through the first lens <NUM>-<NUM> being driven and stores the currently recorded file. Afterwards, continue loop recording and return to step S210 to continuously monitor whether the remaining capacity is sufficient to store subsequent recorded files of the first lens <NUM>-<NUM>.

In response to the remaining capacity of the storage space <NUM> being less than the total recording capacity, in step S320, the processor <NUM> determines whether the first amount of the recorded files corresponding to the first lens <NUM>-<NUM> stored in the storage space <NUM> is greater than the default amount based on the lens number of the first lens <NUM>-<NUM>.

In response to the first amount being greater than the default amount, in step S325, the earliest recorded file among the recorded files corresponding to the first lens <NUM>-<NUM> is deleted by the processor <NUM> based on the recording time. Afterwards, return to step S310 until the remaining capacity of the storage space <NUM> is no less than the total recording capacity.

In addition, in response to the first amount not being greater than the default amount, in step S330, the processor <NUM> decides a second lens <NUM>-<NUM> among the other remaining lenses. The processor <NUM> finds another lens (assumed to be the second lens <NUM>-<NUM> here) with a second amount of the corresponding recorded file thereof greater than the default amount among other lenses. That is, the second amount of the recorded files corresponding to the second lens <NUM>-<NUM> stored in the storage space <NUM> is greater than the default amount.

After that, in step S335, the processor <NUM> deletes the earliest recorded file among the recorded files corresponding to the second lens <NUM>-<NUM> based on the recording time. In addition, in other embodiments, the processor <NUM> may also delete the recorded file with the largest file size among the recorded files corresponding to the second lens <NUM>-<NUM> based on the file size. Afterwards, return to step S310 until the remaining capacity of the storage space <NUM> is no less than the total recording capacity.

<FIG> is a flow diagram of the method for storing multi-lens recording file with multiple lenses being driven according to an embodiment of the disclosure. In this embodiment, the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM> are used as examples. Referring to <FIG> and <FIG>, in step S405, in response to the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM> being driven to perform loop recording, the processor <NUM> calculates the total recording capacity of the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM> for loop recording based on the setting data of the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM>. That is, the total recording capacity is set as the sum of the file sizes of the recorded files recorded individually by the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM>.

Next, in step S415, the processor <NUM> performs loop recording by the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM> and stores the currently recorded file. Afterwards, continue loop recording and return to step S410 to continuously monitor whether the remaining capacity is sufficient to store subsequent recorded files of the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM>.

In response to the remaining capacity of the storage space <NUM> being less than the total recording capacity, in step S420, the processor <NUM> performs a file cleaning action on the recorded files corresponding to the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM>, respectively, based on the lens numbers of the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM>. Step S420 includes step S421, step S423, and step S425. For the file cleaning action of step S421, step S423, and step S425, please refer to the file cleaning action of step S320 to step S335. In step S421, step S423, and step S425, the file cleaning action is performed on each of the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM>, respectively.

That is, whether the first amount of the recorded files corresponding to each of the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM> stored in the storage space <NUM> is greater than default amount is determined based on the each of the lens numbers of the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM>. In response to the first amount being greater than the default amount, the earliest recorded file among each of the recorded files corresponding to the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM> is deleted based on the recording time.

For lenses for which the first amount is not greater than the default amount, the earliest recorded file among the recorded files corresponding to another lens stored in the storage space <NUM> is deleted based on the recording time. Alternatively, a recorded file with a largest file size among the recorded files corresponding to another lens stored in the storage space <NUM> is deleted based on a file size. The second amount of the recorded files corresponding to the another lens stored in the storage space <NUM> is greater than the default amount.

In an embodiment, queues corresponding to the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM> may be set up in the storage <NUM> to respectively record the file information of the recorded files stored in the storage space <NUM> by the first lens <NUM>-<NUM> to the third lens <NUM>-<NUM>. The file information includes the file name, the lens number, the recording time, and the file size.

In an embodiment, the file name may be set to be associated with the lens number and the recording time, for example, "lens number_recording date_recording start time". For example, assuming that the lens number of the first lens <NUM>-<NUM> is "Video <NUM>" and the recording starts at <NUM>:<NUM>:<NUM> AM on June <NUM>, <NUM>, the file name of the recorded file is, for example, "Video 1_2022-<NUM>- 29_10-<NUM>-<NUM>". However, this is for illustrative purposes only and not as a limitation.

The processor <NUM> records the file name into a corresponding queue based on the lens number. For the file name "Video1_2022-<NUM>-29_10-<NUM>-<NUM>", in response to storing the corresponding recorded file in the storage space <NUM>, the processor <NUM> records the file name correspondingly to the queue of the first lens <NUM>-<NUM> according to the lens number "Video1". In addition, in response to deleting the recorded file corresponding to the file name "Video1_2022-<NUM>-29_10-<NUM>-<NUM>" from the storage space <NUM>, the processor <NUM> deletes the file name from the queue of the first lens <NUM>-<NUM>.

In response to the processor <NUM> determining that the remaining capacity of the storage space <NUM> is insufficient to store the file of the next loop recording, the processor <NUM> may first read each of the queues to determine the amount of the recorded file stored in the storage space <NUM> by each of the lenses <NUM>. The file name tells the recording time of each of the recorded files, so that the earliest recorded file is found accordingly. In addition, the file size and the file name of each of the recorded files may be further recorded in the corresponding queue, so that the recorded file with the largest file size may be found based on the records of the queue.

Claim 1:
A method for storing a recording file of a multi-lens recording apparatus, adapted for being executed by a processor (<NUM>), characterized in that the method comprises:
calculating (S205, S305, S405) a total recording capacity in response to one or multiple of a plurality of lenses being driven to perform a loop recording, wherein each of the lenses (<NUM>) has a lens number correspondingly, and calculating the total recording capacity comprises:
in response to one of the lenses being driven to perform the loop recording, calculating a file size of a file recorded by the lens being driven based on setting data of the lens being driven and setting the file size as the total recording capacity; and
in response to multiple of the lenses being driven to perform the loop recording, calculating file sizes of files recorded individually by the multiple lenses being driven based on respective setting data of the multiple lenses being driven and setting sum of the file sizes as the total recording capacity;
after obtaining the total recording capacity, determining (S210, S310, S410) whether a remaining capacity of a storage space (<NUM>) is less than the total recording capacity;
performing a file cleaning action on a plurality of recorded files stored in the storage space (<NUM>) in response to the remaining capacity being less than the total recording capacity, comprising: deleting (S220) at least one of the recorded files stored in the storage space (<NUM>) based on a recording time and a first amount of the recorded files corresponding to the lens number of each lens being driven being greater than a default amount, until the remaining capacity is no less than the total recording capacity; and
in response to the remaining capacity being no less than the total recording capacity, performing (S215, S315, S415) the loop recording through each driven lens (<NUM>), associating a file currently recorded by each driven lens with the corresponding lens number, and then storing the file currently recorded by each driven lens to the storage space.