Methods and mechanisms for uploading video files and resuming interrupted streams, and related storage media and devices.

VN126458APending Publication Date: 2026-07-01E SURFING VISION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
VN · VN
Patent Type
Applications
Current Assignee / Owner
E SURFING VISION TECHNOLOGY CO LTD
Filing Date
2024-10-25
Publication Date
2026-07-01

AI Technical Summary

Technical Problem

In the prior art, when uploading video files, the shard upload method increases the docking cost and error probability on the monitoring device side, and network instability may lead to data loss.

Method used

When the upload link of the monitoring device is interrupted, the video file saved in memory is uploaded to the corresponding storage pool, and the file index information is generated and written to the file index library to realize the interrupt streaming of video files and the video file saving at the abnormal time.

Benefits of technology

It simplifies the upload process of monitoring equipment, improves the upload success rate, and finds and re-enters abnormal video files through the file index library to maximize the saving of video files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202506326_0
    Figure VN1202506326_0
Patent Text Reader

Abstract

The invention proposes a method and apparatus for uploading video files and recovering interrupted streams, and related storage media and devices. When it is detected that the monitoring device is uploading a video file to a pre-assigned upload address, the uploaded video file can first be stored in memory, and when it is detected that the upload link is interrupted before the upload process is complete, the video file partially stored in memory is uploaded to the storage area corresponding to the upload address. In this way, only one TCP link needs to be established when a video file is uploaded, and the video file on the monitoring device side is uploaded to the cloud end by a single upload, thereby simplifying the upload process of the monitoring device.Furthermore, according to the invention, based on the correspondence between the monitoring device and the upload address and the correspondence between partial video files and storage area, file index information between the monitoring device and the partial video file is generated, and the file index information is written to the file index library, so that not only is the device's upload process simplified, but the upload success rate is also increased.
Need to check novelty before this filing date? Find Prior Art

Description

Video file upload interruption recovery method, device, storage medium and related equipment Technical Field

[0001] The present application relates to the field of software development technology, and in particular to a method, device, storage medium and related equipment for recovering interrupted video file uploads. Background Art

[0002] With the continuous advancement of technology and the popularization of bandwidth, video surveillance is increasingly penetrating various fields such as education, government, entertainment, healthcare, hospitality, sports, and security. This requires that all video files of surveillance equipment, especially those generated during network and power outages, can be completely saved to the cloud.

[0003] Currently, the target video file to be uploaded is typically split according to certain rules, resulting in several fragments. Each fragment is then uploaded independently. Once all fragments have been successfully uploaded, they are finally merged into a single file. This upload is considered successful. This fragmented upload method is highly interactive, requiring the file to be split and then uploaded individually for each fragment. This increases integration costs and the probability of errors on the monitoring device side. Furthermore, network instability can cause the upload of a fragment to be lost. Minimizing data loss requires smaller fragments, but smaller fragments also result in more fragments and more uploads, further increasing integration costs and the probability of errors.

[0004] Summary of the Invention

[0005] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect that uploading video files by using the segmented uploading method in the prior art increases the docking cost and error probability of the monitoring device side.

[0006] The present application provides a method for recovering interrupted video file uploads, the method comprising:

[0007] When it is detected that the monitoring device is uploading a video file to a pre-issued upload address, the uploaded video file is saved in the memory, and when the upload link is detected to be interrupted before the end of the upload process, the part of the video file saved in the memory is uploaded to the storage pool corresponding to the upload address;

[0008] According to the correspondence between the monitoring device and the upload address, and the correspondence between the partial video files and the storage pool, file index information between the monitoring device and the partial video files is generated, and the file index information is written into the file index library.

[0009] Optionally, before detecting that the monitoring device uploads the video file to the pre-issued upload address, the method further includes:

[0010] In response to an upload address acquisition request sent by a monitoring device, a specified number of upload addresses are issued to the monitoring device, so that the monitoring device selects a non-expired upload address from the issued upload addresses to upload the video file;

[0011] Each upload address corresponds to a storage pool.

[0012] Optionally, in response to the upload address acquisition request sent by the monitoring device, sending a specified number of upload addresses to the monitoring device includes:

[0013] Receive an upload address acquisition request sent by a monitoring device, wherein the upload address acquisition request includes the device IP, device ID, and the number of upload addresses;

[0014] Parsing the province code corresponding to the device IP, allocating a specified number of storage pools based on the province code and the number of upload addresses, and generating an upload address corresponding to each storage pool, wherein the upload address includes at least an upload expiration time;

[0015] Each upload address is sent to the monitoring device, and the corresponding relationship between the device ID and each upload address is recorded.

[0016] Optionally, generating file index information between the monitoring device and the portion of the video files according to the correspondence between the monitoring device and the upload address, and the correspondence between the portion of the video files and the storage pool, includes:

[0017] Determining a correspondence between the monitoring device and the portion of the video files based on a correspondence between the monitoring device and the upload address, and a correspondence between the portion of the video files and the storage pool;

[0018] Acquiring device and file information based on the corresponding relationship between the monitoring device and the portion of the video file;

[0019] File index information between the monitoring device and the portion of the video file is generated according to the device and file information.

[0020] Optionally, acquiring device and file information according to the correspondence between the monitoring device and the portion of the video files includes:

[0021] Determining file information of the partial video file, the file information including at least a storage pool ID, a file size, a start time, an end time, and a status code of the storage pool where the partial video file is located;

[0022] According to the corresponding relationship between the monitoring device and the part of the video file, the device and file information corresponding to the monitoring device and the file information are obtained.

[0023] Optionally, determining the file information of the portion of video files includes:

[0024] Determine the storage pool ID of the storage pool where the portion of video files is located;

[0025] Determining the file size and status code of the portion of the video file;

[0026] Determining a reception time of the portion of the video file, and using the reception time as a start time of the portion of the video file;

[0027] Determine the end time of the portion of video files according to the start time of the portion of video files and the video duration;

[0028] The storage pool ID, the file size, the status code, the start time, and the end time are used as the file information of the partial video file.

[0029] Optionally, the method further includes:

[0030] Receiving a file index creation request submitted by the monitoring device;

[0031] When it is detected that the file index information corresponding to the file index creation request is not stored in the file index library, creating the file index information corresponding to the file index creation request and writing it into the file index library;

[0032] When it is detected that the file index information corresponding to the file index creation request is stored in the file index library, a file index creation instruction is returned to the monitoring device.

[0033] This application also provides a video file upload interruption recovery device, including:

[0034] The video file storage module is used to save the uploaded video file to the memory when it is detected that the monitoring device is uploading a video file to the pre-issued upload address, and to upload the part of the video file saved in the memory to the storage pool corresponding to the upload address when it is detected that the upload link is interrupted before the end of the upload process;

[0035] The file index creation module is used to generate file index information between the monitoring device and the partial video files based on the correspondence between the monitoring device and the upload address, and the correspondence between the partial video files and the storage pool, and write the file index information into the file index library.

[0036] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the video file upload interruption recovery method as described in any of the above embodiments.

[0037] The present application also provides a computer device, comprising: one or more processors, and a memory;

[0038] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the video file upload interruption recovery method as described in any one of the above embodiments are performed.

[0039] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0040] The video file upload interruption recovery method, device, storage medium and related equipment provided by the present application can first save the uploaded video file to the memory when it is detected that the monitoring device is uploading a video file to a pre-issued upload address, and when the upload link is detected to be interrupted before the end of the upload process, upload the part of the video file saved in the memory to the storage pool corresponding to the upload address; in this way, only one TCP link needs to be established when uploading the video file, and the video file on the monitoring device side is uploaded to the cloud through a one-time upload, thereby simplifying the upload process of the monitoring device. In addition, the present application first saves the uploaded video file in the memory, and then when the upload link is interrupted, the part of the video file uploaded to the memory is written to the disk, and based on the correspondence between the monitoring device and the upload address, and the correspondence between the part of the video file and the storage pool, the file index information between the monitoring device and the part of the video file is generated, and the file index information is written to the file index library. In this way, not only can the video file at the abnormal time end be saved successfully, but the abnormal video file can also be found and re-recorded through the file index library. This process not only simplifies the device upload process but also improves the upload success rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] FIG1 is a flow chart of a method for recovering a video file after interruption of upload provided by an embodiment of the present application;

[0043] FIG2 is a system architecture diagram of a video file upload interruption recovery process according to an embodiment of the present application;

[0044] FIG3 is a structural diagram of a video file upload interruption recovery device provided in an embodiment of the present application;

[0045] FIG4 is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0047] Currently, the target video file to be uploaded is typically split according to certain rules, resulting in several fragments. Each fragment is then uploaded independently. Once all fragments have been successfully uploaded, they are finally merged into a single file. This upload is considered successful. This fragmented upload method is highly interactive, requiring the file to be split and then uploaded individually for each fragment. This increases integration costs and the probability of errors on the monitoring device side. Furthermore, network instability can cause the upload of a fragment to be lost. Minimizing data loss requires smaller fragments, but smaller fragments also result in more fragments and more uploads, further increasing integration costs and the probability of errors.

[0048] Based on this, this application proposes the following technical solutions, please refer to the following for details:

[0049] In one embodiment, as shown in FIG1 , FIG1 is a flow chart of a method for recovering a video file after interruption of upload provided by an embodiment of the present application. The present application provides a method for recovering a video file after interruption of upload, which may include:

[0050] S110: When it is detected that the monitoring device uploads a video file to the pre-issued upload address, the uploaded video file is saved in the memory, and when the upload link is interrupted before the end of the upload process, the part of the video file saved in the memory is uploaded to the storage pool corresponding to the upload address.

[0051] In this step, the monitoring device can pre-send an upload address request to the cloud. The cloud can then issue the corresponding upload address based on the upload address request sent by the monitoring device. Once the monitoring device obtains the upload address, it can then send the video file to the obtained upload address when uploading the video file, thereby uploading the video file to the cloud for storage. Furthermore, when uploading the video file, the monitoring device and the cloud only need to establish a single TCP connection, and the video file on the monitoring device side is uploaded to the cloud in a one-time upload, thus simplifying the upload process for the monitoring device.

[0052] Furthermore, when the present application detects that the monitoring device is uploading a video file to a pre-issued upload address, in order to prevent the video file from being lost due to an interruption in the upload link, the present application may not directly upload the video file to the corresponding upload address for storage, but may first save the uploaded video file in the memory. Since the video file saved in the memory will not be lost due to the interruption of the upload link, even if the upload link is detected to be interrupted before the video file upload process is completed, the present application can still upload the video file saved in the memory to the storage pool corresponding to the upload address for storage, thereby maximizing the preservation of the uploaded video file.

[0053] It is understood that the aforementioned upload link interruption refers to an upload link interruption caused by reasons such as network disconnection, power outage, network jitter, etc. of the monitoring device. At this time, the monitoring device is unable to continue uploading the video file, or the uploaded video file has certain defects due to network jitter, etc. In order to prevent the uploaded video file from not being saved due to the upload link interruption, the present application proposes to save the uploaded video file to the memory when it is detected that the monitoring device is uploading a video file to a pre-issued upload address, so as to utilize the real-time storage function of the memory to save the uploaded video file.

[0054] S120: Generate file index information between the monitoring device and the upload address according to the corresponding relationship between the monitoring device and the upload address, and the corresponding relationship between the partial video files and the storage pool, and write the file index information into the file index library.

[0055] In this step, the uploaded video file is saved to the memory through S110, and when the upload link is detected to be interrupted before the end of the upload process, the part of the video file saved in the memory is uploaded to the storage pool corresponding to the upload address. This application can also generate file index information between the monitoring device and the part of the video file based on the correspondence between the monitoring device and the upload address when uploading the video file, and the correspondence between the part of the video file and the storage pool when saving the part of the video file, and write the file index information into the file index library, so that the user can log in to the file index library and view the video file at the abnormal time end of the monitoring device according to the ID of the monitoring device or the file name of the part of the video file.

[0056] Specifically, after uploading a portion of the video file to the storage pool corresponding to the upload address, the present application can also establish file index information for the portion of the video file and write the file index information into the file index library so that the user can search for the portion of the video file in the file index library. Furthermore, in order to facilitate the user to search for the portion of the video file in the file index library, the present application can generate a correspondence between the monitoring device and the portion of the video file based on the correspondence between the monitoring device and the upload address, and the correspondence between the portion of the video file and the storage pool, and then construct file index information between the monitoring device and the portion of the video file. In this way, after writing the file index information into the file index library, the user can view the video file at the abnormal time end of the monitoring device by either the ID of the monitoring device or the file name of the portion of the video file.

[0057] Furthermore, since some of the video files saved in this application may be video files that are about to be uploaded, video files that have just been uploaded, or video files that are partially uploaded, when generating file index information, this application can also generate the file size, start time, end time, etc. of this part of the video file. In this way, when the user retrieves this part of the video file through the file index library, he can determine whether to re-record the file based on the file index information of this part of the video file. In addition, this application writes the file index information of the part of the video file and the monitoring device into the file index library by analyzing the upload address and part of the video file. At this time, the monitoring device can continue to upload video files. Therefore, the video interruption recovery process of this application does not affect the normal upload process of the monitoring device.

[0058] In the above embodiment, when it is detected that the monitoring device is uploading a video file to a pre-issued upload address, the uploaded video file can be saved in the memory first, and when the upload link is detected to be interrupted before the end of the upload process, the part of the video file saved in the memory is uploaded to the storage pool corresponding to the upload address; in this way, only one TCP link needs to be established when uploading the video file, and the video file on the monitoring device side is uploaded to the cloud through a one-time upload, thereby simplifying the upload process of the monitoring device. In addition, the present application first saves the uploaded video file in the memory, and then when the upload link is interrupted, the part of the video file uploaded to the memory is written to the disk, and based on the correspondence between the monitoring device and the upload address, and the correspondence between the part of the video file and the storage pool, the file index information between the monitoring device and the part of the video file is generated, and the file index information is written into the file index library. In this way, not only can the video file at the abnormal time end be saved successfully, but also the abnormal video file can be found and re-recorded through the file index library. This process not only simplifies the device upload process but also improves the upload success rate.

[0059] In one embodiment, before detecting that the monitoring device uploads the video file to the pre-issued upload address in S110, the following steps may also be performed:

[0060] S101: In response to an upload address acquisition request sent by a monitoring device, a specified number of upload addresses are issued to the monitoring device, so that the monitoring device selects a non-expired upload address from the issued upload addresses to upload a video file; wherein each upload address corresponds to a storage pool.

[0061] In this embodiment, before uploading a video file to a pre-issued upload address, the monitoring device can send an upload address acquisition request to the cloud. The cloud can respond to the upload address acquisition request and issue a specified number of upload addresses to the monitoring device, so that the monitoring device can select an unexpired upload address from the issued upload addresses to upload the video file.

[0062] In the present application, the monitoring device of the present application can send upload address acquisition requests to the cloud multiple times, so that the cloud can determine the number of upload addresses to be issued based on the number of upload address acquisition requests, and then issue a specified number of upload addresses to the monitoring device. After receiving the specified number of upload addresses, the monitoring device can save them in a local queue. When it is necessary to upload a video file, it takes an upload address from the local queue and determines whether the upload address is expired. If it is not expired, the monitoring device will use the upload address to upload the file. If it is expired, it will be discarded. When there are too few upload addresses cached in the local queue, or there are no upload addresses, the monitoring device can continue to send upload address acquisition requests to the cloud to update the local queue. In this way, when uploading video files, the monitoring device only needs to obtain the upload address in the local queue, and does not need to obtain the upload address from the cloud every time a video file is uploaded, thereby saving video upload time and simplifying the video upload process.

[0063] In addition, when the cloud in this application generates an upload address corresponding to an upload address acquisition request, it can first determine the storage pool corresponding to the upload address acquisition request. Generally, one upload address acquisition request corresponds to one storage pool, and then generate the corresponding upload address based on the storage pool. In this way, each upload address corresponds to a storage pool, so that part of the video file can be saved in the corresponding storage pool based on the upload address.

[0064] In one embodiment, in response to the upload address acquisition request sent by the monitoring device in S101, sending a specified number of upload addresses to the monitoring device may include:

[0065] S1011: Receive an upload address acquisition request sent by a monitoring device, where the upload address acquisition request includes a device IP, a device ID, and the number of upload addresses;

[0066] Parsing the province code corresponding to the device IP, allocating a specified number of storage pools based on the province code and the number of upload addresses, and generating an upload address corresponding to each storage pool, wherein the upload address includes at least an upload expiration time;

[0067] Each upload address is sent to the monitoring device, and the corresponding relationship between the device ID and each upload address is recorded.

[0068] In this embodiment, when the cloud sends a specified number of upload addresses to the monitoring device based on the upload address acquisition request sent by the monitoring device, it can first parse the upload address acquisition request sent by the monitoring device to obtain the device IP, device ID and number of upload addresses contained in the upload address acquisition request, and then parse the device IP to determine the province code corresponding to the device IP. Then, this application can allocate a specified number of storage pools according to the province code and the number of upload addresses, and generate an upload address corresponding to each storage pool, and the upload address includes at least an upload expiration time. In this way, the monitoring device can determine whether the upload address is expired based on the upload expiration time of the obtained upload address.

[0069] Then, the application can send the generated upload addresses to the monitoring device so that the monitoring device can save them to the local queue. The application can also record the correspondence between the device ID and each upload address, so that the corresponding file index information can be generated based on the correspondence between the device ID and each upload address.

[0070] Schematically, as shown in Tables 1 and 2 below, Table 1 is a storage pool information table, and Table 2 is the relationship between the device and the upload address. In this application, different storage pools correspond to different storage pool IDs, storage pool domain names, storage pool AKs, storage pool SKs, and storage pool buckets. After obtaining the province code corresponding to the device IP, a specified number of storage pools can be allocated according to the province code and the number of upload addresses. Then, a pre-signed upload address is generated according to the object storage S3 protocol, and the correspondence between the device ID and each upload address is recorded to form the table shown in Table 2. Table 2 records the device ID, storage pool ID, storage pool objectId, and upload expiration time. In this way, the corresponding file index information can be generated through the information recorded in Table 2.

[0071] Table 1 Storage pool information table

[0072] Table 2 Relationship between devices and upload addresses

[0073] In one embodiment, generating file index information between the monitoring device and the portion of the video files based on the correspondence between the monitoring device and the upload address, and the correspondence between the portion of the video files and the storage pool in S120 may include:

[0074] S121: Determine a correspondence between the monitoring device and the portion of the video files according to the correspondence between the monitoring device and the upload address, and the correspondence between the portion of the video files and the storage pool.

[0075] S122: Acquire device and file information according to the corresponding relationship between the monitoring device and the partial video files.

[0076] S123: Generate file index information between the monitoring device and the partial video file according to the device and file information.

[0077] In this embodiment, when generating file index information between the monitoring device and some video files, the correspondence between the monitoring device and some video files can be determined based on the correspondence between the monitoring device and the upload address, and the correspondence between some video files and the storage pool, and then the device and file information can be obtained based on the correspondence, and finally the file index information between the monitoring device and some video files can be generated based on the device and file information.

[0078] It is understandable that, since the file address of the present application corresponds to the storage pool one-to-one, once the present application determines the correspondence between the monitoring device and the upload address, and the correspondence between the partial video files and the storage pool, the correspondence between the monitoring device and the partial video files can be determined. In this way, the device information of the monitoring device and the file information of the partial video files in the correspondence can be obtained and summarized as device and file information. Then, the present application can construct file index information based on the device and file information. Schematically, as shown in Table 3, Table 3 is a device video index table in the file index library of the present application. The device video index table stores multiple file index information. Each file index information includes at least a device ID, a file name, a storage pool ID, a storage pool objectid, and information on whether to re-record. In this way, the user can determine the storage pool ID and storage pool objectid of the video file to be searched by the device ID or file name in the device video index table, and then view the relevant video files based on the storage pool ID and storage pool objectid. The user can also view whether the relevant video file has been re-recorded based on the information in the "whether to re-record" column.

[0079] Table 3 Device video index table

[0080] In one embodiment, obtaining device and file information according to the correspondence between the monitoring device and the portion of the video file in S122 may include:

[0081] S1221: Determine file information of the partial video file, where the file information at least includes a storage pool ID of the storage pool where the partial video file is located, a file size, a start time, an end time, and a status code.

[0082] S1222: According to the correspondence between the monitoring device and the portion of the video file, obtain the device and file information corresponding to the monitoring device and the file information.

[0083] In this embodiment, after this application determines the correspondence between the monitoring device and the upload address, as well as the correspondence between some video files and the storage pool, it can determine the correspondence between the monitoring device and some video files. In this way, the device information of the monitoring device in the correspondence and the file information of some video files can be obtained and summarized as device and file information.

[0084] Specifically, the present application can first determine the file information of part of the video file, which includes but is not limited to the storage pool ID, file size, start time, end time and status code of the storage pool where the part of the video file is located. The status code can be used to distinguish it from the complete video file, and can also be used to extract the device and file information of the interrupted recording and write it into the device video index table.

[0085] After determining the file information of some video files, this application can obtain the device ID of the monitoring device and the file name of some video files based on the correspondence between the monitoring device and some video files, and then combine it with the file information of some video files to generate corresponding device and file information.

[0086] In one embodiment, determining the file information of the portion of the video file in S1221 may include:

[0087] S12211: Determine the storage pool ID of the storage pool where the partial video files are located.

[0088] S12212: Determine the file size and status code of the partial video file.

[0089] S12213: Determine the receiving time of the partial video file, and use the receiving time as the starting time of the partial video file.

[0090] S12214: Determine the end time of the portion of the video file according to the start time and video duration of the portion of the video file.

[0091] S12215: Use the storage pool ID, the file size, the status code, the start time, and the end time as the file information of the partial video file.

[0092] In this embodiment, when determining the file information of a partial video file, the present application can determine the storage pool ID, file size, status code, start time, end time, etc. of the storage pool where the partial video file is located, and then use the determined relevant information as the file information of the partial video file.

[0093] The file duration of some video files can be obtained using the ffmpeg tool. The start time of some video files can be obtained using the time when the server receives the data packet. The end time = start time + file duration. In this way, the file information of some video files can be obtained. As shown in Table 4, Table 4 shows the storage pool re-recording file information. Table 4 shows the file information related to some video files, including but not limited to the storage pool objectId, storage pool ID, start time, end time, and re-recording status code.

[0094] Table 4 Storage pool supplementary file information

[0095] In one embodiment, the method may further include:

[0096] S130: Receive a file index creation request submitted by the monitoring device.

[0097] S131: When it is detected that the file index information corresponding to the file index creation request is not stored in the file index library, the file index information corresponding to the file index creation request is created and written into the file index library.

[0098] S132: When it is detected that the file index information corresponding to the file index creation request is stored in the file index library, a file index creation instruction is returned to the monitoring device.

[0099] In this embodiment, the cloud can periodically and proactively obtain the file information of some video files and the device information of the monitoring devices corresponding to these video files to form device and file information. It then creates file index information based on this device and file information and writes it to the file index library. The monitoring device can also submit a file index creation request to the cloud, and the cloud can then create the corresponding file index information based on the cloud index creation request and write it to the file index library.

[0100] Furthermore, since the cloud will actively create file index information at regular intervals, when the cloud receives a file index creation request submitted by a monitoring device, it can detect whether the file index information corresponding to the file index creation request is stored in the file index library. If not detected, the file index information corresponding to the file index creation request is created and written into the file index library. If detected, the file index creation instruction is returned to the monitoring device. In this way, the monitoring device does not need to continue submitting file index creation requests to the cloud, and the cloud does not need to create the file index information again.

[0101] In addition, when the present application receives a file index creation request sent by a monitoring device and does not detect that the file index creation request is stored in the file index library, if there are multiple partial video files corresponding to the monitoring device, corresponding file index information can be created for each partial video file respectively, thereby improving the efficiency of file index creation.

[0102] The following application will illustrate the video file upload interruption recovery process of the present application through a specific example. As shown in Figure 2, Figure 2 is a system architecture diagram of the video file upload interruption recovery process provided by the embodiment of the present application; the cloud server of the present application may include an upload address module, an upload module, a data analysis module and a file index creation module; wherein, the upload address module is responsible for issuing a pre-signed one-time upload address to the monitoring device and recording the relationship between the monitoring device and the upload address; the upload module is responsible for accepting the video file uploaded by the monitoring device, and storing the video file in S3 storage if the upload is successful, and extracting the fragmented file uploaded to the memory, analyzing the video file, archiving it to S3 storage if the upload fails (the upload link is interrupted), and outputting the file information of the interruption re-recording; the data analysis module is responsible for analyzing the video that failed to be uploaded in the upload module and writing it into the file index library, mainly including analyzing the device and upload address information of the upload address module, the re-recording file information of the upload module, and outputting the re-recording device and re-recording file information, and then calling the file index creation module to generate the file index information; the file index creation module is responsible for creating the file index information of the monitoring device, and supports the monitoring device to submit a file index creation request, and also supports the platform to submit an index file creation request.

[0103] For example, the application may first configure an available upload module and insert storage pool information, such as storage pool ID, storage pool AK, storage pool SK, storage pool domain name, storage pool bucket, etc., into the storage pool information table.

[0104] Secondly, the monitoring device carries information such as device ID, device IP, and number of upload addresses to the upload address module to obtain a specified number of upload addresses. The upload address module diverts the data to the most appropriate storage pool based on the relevant information, and uses the diverted storage pool information to generate the upload address, upload signature and other information, and writes the correspondence between the device and the upload address.

[0105] Next, the monitoring device selects one of the acquired upload addresses and checks whether it has expired. If it hasn't, it uses it. If it does, it retrieves a new upload address. It then uploads the recorded 5-minute video file to the corresponding address in one go. Upon receiving the file, the upload module caches it in memory. If the network cable is unplugged three minutes into the recording, the upload module detects the interruption in the upload link, exports the three minutes of video from memory to the local hard drive, analyzes the video information, writes the three minutes of video to object storage, and writes the information to the storage pool's supplementary file information table.

[0106] Finally, the data analysis module regularly analyzes the device upload address relationship and storage pool supplementary file information to find the device that needs to be re-recorded and the corresponding file information, and then uses the corresponding information to create the file index module to create an index. This not only ensures that video files are not lost to the greatest extent, but users can also view the video files at the abnormal time of the device through the file index library.

[0107] The following describes a video file upload interruption recovery device provided in an embodiment of the present application. The video file upload interruption recovery device described below and the video file upload interruption recovery method described above can refer to each other.

[0108] In one embodiment, as shown in FIG3 , FIG3 is a structural diagram of a video file upload interruption recovery device provided by an embodiment of the present application; the present application also provides a video file upload interruption recovery device, including a video file storage module 210 and a file index creation module 220, specifically including the following:

[0109] The video file storage module 210 is used to save the uploaded video file into the memory when it is detected that the monitoring device is uploading a video file to a pre-issued upload address, and to upload part of the video file stored in the memory to the storage pool corresponding to the upload address when it is detected that the upload link is interrupted before the end of the upload process.

[0110] The file index creation module 220 is used to generate file index information between the monitoring device and the partial video file based on the correspondence between the monitoring device and the upload address, and the correspondence between the partial video file and the storage pool, and write the file index information into the file index library.

[0111] In the above embodiment, when it is detected that the monitoring device is uploading a video file to a pre-issued upload address, the uploaded video file can be saved in the memory first, and when the upload link is detected to be interrupted before the end of the upload process, the part of the video file saved in the memory is uploaded to the storage pool corresponding to the upload address; in this way, only one TCP link needs to be established when uploading the video file, and the video file on the monitoring device side is uploaded to the cloud through a one-time upload, thereby simplifying the upload process of the monitoring device. In addition, the present application first saves the uploaded video file in the memory, and then when the upload link is interrupted, the part of the video file uploaded to the memory is written to the disk, and based on the correspondence between the monitoring device and the upload address, and the correspondence between the part of the video file and the storage pool, the file index information between the monitoring device and the part of the video file is generated, and the file index information is written into the file index library. In this way, not only can the video file at the abnormal time end be saved successfully, but also the abnormal video file can be found and re-recorded through the file index library. This process not only simplifies the device upload process but also improves the upload success rate.

[0112] In one embodiment, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the video file upload interruption recovery method as described in any of the above embodiments.

[0113] In one embodiment, the present application further provides a computer device, including: one or more processors, and a memory.

[0114] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the video file upload interruption recovery method as described in any one of the above embodiments are performed.

[0115] Schematically, as shown in FIG4 , FIG4 is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application, and the computer device 300 can be provided as a server. Referring to FIG4 , the computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301 for storing instructions that can be executed by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each of which corresponds to a set of instructions. In addition, the processing component 302 is configured to execute instructions to execute the video file upload interruption recovery method of any of the above embodiments.

[0116] The computer device 300 may further include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate based on an operating system stored in the memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or the like.

[0117] Those skilled in the art will understand that the structure shown in FIG4 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0118] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0119] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.

[0120] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A video file upload interruption recovery method, characterized in that: The method comprises: When it is detected that the monitoring device uploads a video file to a pre-issued upload address, the uploaded video file is saved in the memory, and when the upload link is detected to be interrupted before the end of the upload process, part of the video file saved in the memory is uploaded to the storage pool corresponding to the upload address; According to the correspondence between the monitoring device and the upload address, and the correspondence between the partial video files and the storage pool, file index information between the monitoring device and the partial video files is generated, and the file index information is written into a file index library.

2. The video file upload interruption recovery method according to claim 1, characterized in that: Before detecting that the monitoring device uploads the video file to the pre-issued upload address, the method further includes: In response to an upload address acquisition request sent by a monitoring device, a specified number of upload addresses are sent to the monitoring device, so that the monitoring device selects a non-expired upload address from the sent upload addresses to upload the video file; Each upload address corresponds to a storage pool.

3. The video file upload interruption recovery method according to claim 2, characterized in that: The step of sending a specified number of upload addresses to the monitoring device in response to the upload address acquisition request sent by the monitoring device includes: Receive an upload address acquisition request sent by a monitoring device, wherein the upload address acquisition request includes a device IP, a device ID, and the number of upload addresses; Parsing the province code corresponding to the device IP, allocating a specified number of storage pools according to the province code and the number of upload addresses, and generating an upload address corresponding to each storage pool, wherein the upload address at least includes an upload expiration time; Each upload address is sent to the monitoring device, and the corresponding relationship between the device ID and each upload address is recorded.

4. The video file upload interruption recovery method according to claim 1, characterized in that: Generating file index information between the monitoring device and the portion of the video files according to the corresponding relationship between the monitoring device and the upload address, and the corresponding relationship between the portion of the video files and the storage pool, includes: Determine the corresponding relationship between the monitoring device and the part of the video files according to the corresponding relationship between the monitoring device and the upload address, and the corresponding relationship between the part of the video files and the storage pool; According to the corresponding relationship between the monitoring device and the part of the video file, obtaining device and file information; File index information between the monitoring device and the partial video file is generated according to the device and file information.

5. The video file upload interruption recovery method according to claim 4 is characterized in that: The obtaining of device and file information according to the correspondence between the monitoring device and the part of the video files includes: Determine file information of the partial video file, the file information at least including a storage pool ID, a file size, a start time, an end time, and a status code of the storage pool where the partial video file is located; According to the corresponding relationship between the monitoring device and the part of the video file, the device and file information corresponding to the monitoring device and the file information are obtained.

6. The video file upload interruption recovery method according to claim 5, characterized in that: The determining of the file information of the part of the video files includes: Determine the storage pool ID of the storage pool where the partial video files are located; Determining the file size and status code of the portion of the video files; Determine the receiving time of the part of the video files, and use the receiving time as the starting time of the part of the video files; Determine the end time of the portion of video files according to the start time of the portion of video files and the video duration; The storage pool ID, the file size, the status code, the start time, and the end time are used as the file information of the partial video file.

7. The video file upload interruption recovery method according to claim 1, characterized in that: The method further comprises: Receiving a file index creation request submitted by the monitoring device; When it is detected that the file index information corresponding to the file index creation request is not stored in the file index library, the file index information corresponding to the file index creation request is created and written into the file index library; When it is detected that the file index information corresponding to the file index creation request is stored in the file index library, a file index creation instruction is returned to the monitoring device.

8. A video file upload interruption recovery device, characterized in that: include: The video file storage module is used to save the uploaded video file to the memory when it is detected that the monitoring device uploads the video file to the pre-issued upload address, and to upload part of the video file stored in the memory to the storage pool corresponding to the upload address when it is detected that the upload link is interrupted before the end of the upload process; The file index creation module is used to generate file index information between the monitoring device and the partial video files according to the correspondence between the monitoring device and the upload address, and the correspondence between the partial video files and the storage pool, and write the file index information into the file index library.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the video file upload interruption recovery method as described in any one of claims 1 to 7.

10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the video file upload interruption recovery method as described in any one of claims 1 to 7 are performed.