Video storage method, medium, product and video recording device
By using at least two memories in the video recording device, each memory having a main storage space and a reserved storage space, and using a cross-storage and cyclic storage method, the problem of the video recording data being easily lost in the event of a failure is solved, and the reliability and practicality of the video recording device are improved.
Patent Information
- Application Number
- CN202411415792.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-28
AI Technical Summary
When the video recording device encounters faults and fault repairs, the video recording data is easily lost, resulting in reduced reliability and practicality.
A video recording storage method is provided, utilizing at least two memories, wherein each memory includes a main storage space and a reserved storage space. Through cross-storage and cyclic storage, ensure that the recorded data can be maintained and restored in the event of memory failure.
In the event of unexpected memory damage, ensure that recent video recording data can be read and played back, reduce the risk of data loss, and improve the reliability and practicality of the video recording device.
Smart Images

Figure CN119541565A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video storage, and in particular to a video storage method, medium, product and video recording device. Background Art
[0002] With the continuous development of science and technology, video recording devices have been widely used in many scenarios such as vehicle-mounted, security and facility monitoring. In these application scenarios, video recording devices often need to be unattended for a long time or run fully automatically. However, due to various unpredictable reasons, the memory of the video recording device often has problems. On the one hand, reversible damage such as data format errors may occur. When encountering this situation, the memory is usually reformatted to troubleshoot; on the other hand, irreversible damage such as hardware failure may occur. At this time, the problem can only be solved by replacing the memory.
[0003] However, both solutions, whether formatting for reversible damage or replacing the memory for irreversible damage, have serious drawbacks: they will lead to the loss of saved video data, especially when the video of the critical period is lost, it will have a great impact on the evidence collection of emergencies. In addition, when the memory hardware fails, the maintenance personnel need to remove the faulty memory hardware for replacement, which results in the inability to save the video data during the period from the damage of the memory to the completion of the replacement, further reducing the reliability and practicality of the video recording device. Summary of the invention
[0004] The embodiments of the present invention provide a video storage method, medium, product and video recording device, so as to improve the reliability and practicality of the video recording device by solving the problem that the video recording data is easily lost when the video recording device encounters a fault or is repaired.
[0005] In order to achieve the above object, on the one hand, a video storage method is provided, which is applied to a video recording device, wherein the video recording device includes at least two memories for storing video recording data, and the two memories respectively include their own main storage space and reserved storage space, wherein the main storage space and the reserved storage space are reserved in the form of folders, and the video storage method includes:
[0006] When both memories are operating normally, the currently acquired video data is stored in the main storage space of the first memory of the two memories in a cross-storage manner, and the video data within a predetermined time period from the current time is backed up in the reserved storage space of the second memory of the two memories;
[0007] When the main storage space of the first storage device is full, the currently collected video data is stored in the main storage space of the second storage device, and the reserved storage space of the second storage device is cleared, and the video data within the predetermined time period is stored in the reserved storage space of the first storage device;
[0008] When the memory storing the currently acquired video data of the two memories fails and the other memory does not fail, the currently acquired video data is stored in the main storage space of the memory that has not failed, and the video data within the predetermined time period is kept stored in the reserved storage space of the memory that has not failed.
[0009] Preferably, the method described above stores the currently acquired video data in the main storage space and stores the backup data within the predetermined time period in the reserved storage space in a cyclic manner.
[0010] Preferably, the method further comprises:
[0011] Automatically repair the failed storage device, and after all the storage devices are working normally, restore the cross-storage method of storing the currently collected video data in the main storage space of one storage device and storing the video data backup within a predetermined time period from the current time in the reserved storage space of another storage device.
[0012] Preferably, the method further comprises:
[0013] Automatically repair failed storage;
[0014] If the repair is unsuccessful, you will be prompted to replace the memory.
[0015] Preferably, the method of storing the video data in the main storage space or reserved storage space of the corresponding memory comprises:
[0016] Generate video data packets;
[0017] When a new video file needs to be generated, the location of the corresponding storage is updated, and a file or folder used as the main storage space and / or reserved storage space is created at the updated location.
[0018] On the other hand, a computer-readable storage medium is further provided, wherein the computer-readable storage medium is used to store a computer program, wherein the computer program includes instructions for executing the steps in any of the video recording storage methods described above.
[0019] On the other hand, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the video recording storage methods described above are implemented.
[0020] In another aspect, a video recording device for implementing any of the video recording storage methods described above is provided, the video recording device comprising:
[0021] A video collection device, used for collecting video data;
[0022] At least two memories for storing video data, the two memories respectively comprising a main storage space and a reserved storage space, wherein the main storage space and the reserved storage space are reserved in the form of folders;
[0023] A processor is provided with a first computer program module, and when the first computer program module is executed, the steps of any of the video recording storage methods described above are implemented.
[0024] Preferably, in the video recording device, the processor is further provided with:
[0025] The second computer program module is used to automatically repair the memory when a failure occurs.
[0026] The above technical solution has the following technical effects:
[0027] The technical solution of the embodiment of the present invention enables a video recording device to be connected to at least two memories, both of which include a main storage space and a reserved storage space. When both memories are working normally, the currently acquired video data is stored in the main storage space of the first memory of the two memories in a cross-storage manner, and the video data within a predetermined time period from the current time is backed up in the reserved storage space of the second memory of the two memories; when the main storage space of the first memory is full, the currently acquired video data is stored in the main storage space of the second memory, and the reserved storage space of the second memory is cleared at the same time, and the video data within the predetermined time period is stored in the reserved storage space of the first memory; when the memory storing the currently acquired video data of the two memories fails and the other memory does not fail, the currently acquired video data is stored in the main storage space of the memory that has not failed, and the video data within the predetermined time period is kept stored in the reserved storage space of the memory that has not failed;
[0028] The technical solution of the embodiment of the present invention can ensure that recent video data can still be read and played back when the memory is accidentally damaged; it can also ensure that the video data is continuous during the period when the memory is damaged and not replaced, thereby reserving more time for equipment maintenance; it improves the reliability and practicality of the video recording device by solving the problem that the video recording data is easily lost when the video recording device encounters a fault and the fault is repaired. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1It is a flowchart of a video storage method according to an embodiment of the present invention;
[0030] Figure 2 is a flow chart of a video storage method according to another embodiment of the present invention;
[0031] Figure 3 It is a schematic diagram of a process of storing video data according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] To further illustrate the various embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, which are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, a person of ordinary skill in the art should be able to understand other possible implementations and advantages of the present invention. The components in the figures are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0033] The present invention will now be further described with reference to the accompanying drawings and specific implementation methods.
[0034] Embodiment 1:
[0035] Figure 1 FIG. 1 is a flow chart of a video storage method according to an embodiment of the present invention. Figure 1 The video storage method of this example is applied to a video recording device, the video recording device includes at least two memories for storing video recording data, the two memories respectively include their own main storage space and reserved storage space, wherein the main storage space and the reserved storage space are reserved in the form of folders, and the video recording storage method includes the following steps:
[0036] When both memories are working normally, the currently collected video data is stored in the main storage space of the first memory of the two memories in a cross-storage manner, and the video data within a predetermined time period from the current time is backed up in the reserved storage space of the second memory of the two memories;
[0037] When the main storage space of the first storage is full, the currently collected video data is stored in the main storage space of the second storage, and the reserved storage space of the second storage is cleared, and the video data within a predetermined time period is stored in the reserved storage space of the first storage;
[0038] When the memory storing the currently acquired video data of the two memories fails and the other memory does not fail, the currently acquired video data is stored in the main storage space of the memory that has not failed, and the video data within a predetermined time period is kept stored in the reserved storage space of the memory that has not failed.
[0039] In a specific implementation, currently collected video data is stored in the main storage space and backup data within a predetermined time period is stored in the reserved storage space in a cyclic manner.
[0040] In a specific implementation, the method further includes:
[0041] Automatically repair the failed storage device, and after all the storage devices are working normally, restore the cross-storage method of storing the currently collected video data in the main storage space of one storage device and storing the video data backup within a predetermined time period from the current time in the reserved storage space of another storage device.
[0042] In a specific implementation, the method further includes:
[0043] Automatically repair failed storage;
[0044] If the repair is unsuccessful, you will be prompted to replace the memory.
[0045] In a specific implementation, the step of storing the video data in the main storage space or the reserved storage space of the corresponding memory includes:
[0046] Generate video data packets;
[0047] When a new video file needs to be generated, the location of the corresponding storage is updated, and a file or folder used as the main storage space and / or reserved storage space is created at the updated location.
[0048] Embodiment 2:
[0049] Figure 2 FIG. 1 is a flow chart of a video storage method according to another embodiment of the present invention. Figure 2 The video storage method of this embodiment includes the following steps:
[0050] Step 1: The video recording device is connected to a first storage device and a second storage device for storing video recording data.
[0051] In a specific implementation, the video recording device may also be connected to three memories for storing video data or four memories for storing video data. In a specific implementation, one of the multiple memories may be set as a main memory for storing currently acquired video data, and the other memories may be used as reserved memories. When the memories are working normally, the currently acquired video data is stored in the main storage space of the main memory, and the backup video data within a predetermined period of time is stored in the reserved storage space of the reserved memory. If the main memory fails, one of the reserved memories may be selected as the main memory.
[0052] Step 2: Start the video recording function. After the video recording device collects the video data, it transcodes the video data to generate a video data packet. When the video data packet needs to be written into the memory, it is determined whether a new video file needs to be generated. If necessary, the addresses of the first memory and the second memory, i.e., the main memory and the reserved memory, are found, and the respective main storage space and reserved storage space are created in the two memories in the form of folders, such as Figure 3 , is a flow chart of storing video data in this embodiment.
[0053] In a specific implementation, the reserved storage space is much smaller than the main storage space.
[0054] Step three: Set the first memory as the main memory and the second memory as the reserved memory. When the main memory and the reserved memory are working normally, the currently collected video data is stored in the main storage space of the main memory, and the video data within a predetermined time period from the current time is backed up in the reserved storage space of the reserved memory through a loop storage method.
[0055] In a specific implementation, the circular storage means that when the storage space of the memory is full, the newly collected video data will overwrite the earliest video data, and the storage space will be used cyclically.
[0056] In a specific implementation, when the first memory is the main memory, if the main storage space of the main memory is full, the second memory is set as the main memory, and the first memory is set as the reserved memory, and the currently collected video data is stored in the main storage space of the main memory, and the reserved storage space of the main memory is cleared at the same time, and the video data within a predetermined time period from the current time is backed up in the reserved storage space of the reserved memory through a circular storage method.
[0057] In a specific implementation, when the second memory is the main memory, if the main storage space of the main memory is full, the first memory is set as the main memory and the second memory is set as the reserved memory, and the currently collected video data is stored in the main storage space of the main memory, while the reserved storage space of the main memory is cleared, and the video data within a predetermined time period from the current time is backed up in the reserved storage space of the reserved memory through a circular storage method.
[0058] Step 4: When the first memory is the main memory and the second memory is the reserved memory, if the first memory fails, the first memory is automatically repaired. If the damage to the first memory is irreversible, it is determined whether the second memory fails. When the second memory works normally, the second memory is set as the main memory, and the currently collected video data is stored in the main storage space of the main memory through a circular storage method, and the video data stored in the reserved storage space of the main memory within a predetermined time period is retained.
[0059] In a specific implementation, if the damage to the first memory is reversible, the original video storage method is maintained.
[0060] In a specific implementation, when the damage to the first memory is irreversible, it is prompted that the first memory needs to be replaced.
[0061] In a specific implementation, when the second memory also fails, the second memory is automatically repaired. If the damage to the second memory is irreversible, it is prompted that the first memory and the second memory need to be replaced. If the damage to the second memory is reversible, the second memory is set as the main memory, and the currently collected video data is stored in the main storage space of the main memory through a circular storage method, and the video data stored in the reserved memory of the main storage within a predetermined time period is retained.
[0062] Step 5: When the first memory is the main memory and the second memory is the reserved memory, if the second memory fails, the second memory is automatically repaired. If the damage to the second memory is reversible, the original video storage method is maintained. If the damage to the second memory is irreversible, the first memory is set as the main memory, and a prompt is given that the second memory needs to be replaced. At the same time, the currently collected video data is stored in the main storage space of the main memory through a circular storage method.
[0063] By utilizing the technical solution of the embodiment of the present invention, the storage of the video data will not be affected during the failure and replacement of the memory of the video recording device, thereby reducing the risk of data loss. In addition, when the total storage capacity remains unchanged, the use of multiple memories will not increase the cost. At the same time, the reserved storage space takes up a smaller storage space in the memory in the form of a folder, which not only does not destroy the wear balancing mechanism of the memory, but also has a minimal impact on the storage capacity of the memory, thereby ensuring the stable operation of the memory and improving the service life of the memory.
[0064] Embodiment three:
[0065] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method in the embodiment of the present invention are implemented.
[0066] If the module / unit integrated in the computer unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory) and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0067] Embodiment four:
[0068] The present invention also provides a computer program product, comprising a computer program, characterized in that when the computer program is executed by a processor, the steps of any of the method embodiments described above are implemented.
[0069] Embodiment five:
[0070] The present invention further provides a video recording device for implementing any of the video recording storage methods described above, wherein the video recording device comprises:
[0071] A video collection device, used for collecting video data;
[0072] At least two memories for storing video data, the two memories respectively comprising a main storage space and a reserved storage space, wherein the main storage space and the reserved storage space are reserved in the form of folders;
[0073] A processor is provided with a first computer program module, and when the first computer program module is executed, the steps of any of the video recording storage methods described above are implemented.
[0074] In a specific implementation, the processor is further provided with:
[0075] The second computer program module is used to automatically repair the memory when a failure occurs.
[0076] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, it should be understood by those skilled in the art that various changes may be made to the present invention in form and details without departing from the spirit and scope of the present invention as defined by the appended claims, all of which are within the scope of protection of the present invention.
Claims
1. A video storage method, applied to a video recording device, characterized in that: The video recording device includes at least two memories for storing video data, the two memories respectively include a main storage space and a reserved storage space, wherein the main storage space and the reserved storage space are reserved in the form of folders, and the video recording storage method includes: When both memories are operating normally, the currently acquired video data is stored in the main storage space of the first memory of the two memories in a cross-storage manner, and the video data within a predetermined time period from the current time is backed up in the reserved storage space of the second memory of the two memories; When the main storage space of the first storage device is full, the currently collected video data is stored in the main storage space of the second storage device, and the reserved storage space of the second storage device is cleared, and the video data within the predetermined time period is stored in the reserved storage space of the first storage device; When the memory storing the currently acquired video data of the two memories fails and the other memory does not fail, the currently acquired video data is stored in the main storage space of the memory that has not failed, and the video data within the predetermined time period is kept stored in the reserved storage space of the memory that has not failed.
2. The video storage method according to claim 1, characterized in that: The currently collected video data is stored in the main storage space and the backup data within the predetermined time period is stored in the reserved storage space in a cyclic manner.
3. The video storage method according to claim 1, characterized in that: Also includes: Automatically repair the failed storage device, and after all the storage devices are working normally, restore the cross-storage method of storing the currently collected video data in the main storage space of one storage device and storing the video data backup within a predetermined time period from the current time in the reserved storage space of another storage device.
4. The method according to claim 1, characterized in that: Also includes: Automatically repair failed storage; If the repair is unsuccessful, you will be prompted to replace the memory.
5. The method according to claim 1, characterized in that The steps of storing the video data in the main storage space or the reserved storage space of the corresponding storage device include: Generate video data packets; When a new video file needs to be generated, the location of the corresponding storage is updated, and a file or folder used as the main storage space and / or reserved storage space is created at the updated location.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program includes instructions for executing the steps in the video recording storage method according to any one of claims 1 to 5.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the video recording storage method according to any one of claims 1 to 5 are implemented.
8. A video recording device for implementing the video recording storage method according to any one of claims 1 to 5, characterized in that: The video recording device comprises: A video collection device, used for collecting video data; At least two memories for storing video data, the two memories respectively comprising a main storage space and a reserved storage space, wherein the main storage space and the reserved storage space are reserved in the form of folders; A processor is provided with a first computer program module, and when the first computer program module is executed, the steps of the video recording storage method according to any one of claims 1 to 5 are implemented.
9. The video recording device according to claim 8, characterized in that: The processor is also provided with: The second computer program module is used to automatically repair the memory when a failure occurs.