Equipment and video file mapping method and device, equipment and storage medium
By performing static scene analysis on the target video data of the video encoding device, the target static scene image of the target device is determined, and compared with the historical static scene image, the target historical video file of the target device is redetermined, which solves the problem of loss of the corresponding relationship between the video encoding device and the video file, and realizes the effect of automatically binding the mapping relationship.
Patent Information
- Application Number
- CN202311663418.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2025-06-06
AI Technical Summary
In the prior art, after the correspondence between the video encoding device and the stored video file is lost, the correspondence between the video encoding device and the corresponding video file cannot be automatically bound.
By obtaining the target video data of the target device, performing static scene analysis, determining the target static scene image of the target device, and redetermining the target historical video file of the target device by comparing the target static scene image with the historical static scene image, realizing the mapping relationship between the device and the video file recovery.
After the corresponding relationship between the video encoding device and the stored video file is lost, the mapping relationship between the target historical video file and the target device can be automatically bound, solving the problem of corresponding relationship loss.
Smart Images

Figure CN120111166A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video surveillance technology, and in particular to a method, device, equipment and storage medium for mapping equipment and video files. Background Art
[0002] Video encoding devices such as IPC (IP Camera) are generally connected to the video management server through a network protocol to store the collected video files in the video management server. The video management server uses the IP address or international code and other feature information in the video encoding device to match the video encoding device with the video files it stores.
[0003] However, when the video encoding device is deleted or re-connected to the video management server according to business configuration requirements, the video encoding device changes its device identifier, or the video management server loses configuration information due to system disk damage or software abnormality and then each video encoding device is re-added, the correspondence between each video encoding device and the stored video files is lost, and the correspondence between each video encoding device and the corresponding video file cannot be automatically bound. Summary of the invention
[0004] The present invention provides a mapping method, device, equipment and storage medium between a device and a video file, so as to solve the defect in the prior art that after the correspondence between each video encoding device and the stored video file is lost, the correspondence between each video encoding device and the corresponding video file cannot be automatically bound.
[0005] The present invention provides a method for mapping a device to a video file, comprising:
[0006] Obtain target video data corresponding to the target device;
[0007] Based on the target video data, determining a target static scene image corresponding to the target device;
[0008] Based on at least one frame of the first historical static scene image and the target static scene image, a mapping relationship between a target historical video file and the target device is determined.
[0009] According to the device and video file mapping method provided by the present invention, determining the target static scene image corresponding to the target device based on the target video data includes:
[0010] Extracting frames of the target video data to obtain multiple frames of images to be analyzed;
[0011] Determine the repetition ratio corresponding to each pixel point based on the position information of each pixel point in the multiple frames of images to be analyzed after superposition;
[0012] Based on each of the repetition ratios, a target static scene image corresponding to the target device is determined.
[0013] According to the device and video file mapping method provided by the present invention, the target static scene image corresponding to the target device is determined based on each of the repetition ratios, including:
[0014] For each of the repetition ratios, when the repetition ratio is less than or equal to a first preset threshold, deleting the pixel points corresponding to the repetition ratio;
[0015] When the repetition ratio is greater than the first preset threshold, retaining the pixel points corresponding to the repetition ratio;
[0016] For each retained pixel point, a pixel average value of the retained pixel points in the multiple frames of images to be analyzed is determined, and based on each of the pixel average values, a target static scene image corresponding to the target device is determined.
[0017] According to the device and video file mapping method provided by the present invention, the at least one frame of the first historical static scene image is determined based on the following steps:
[0018] Determining time information of the target video data;
[0019] Based on the time information, at least one frame of the first historical static scene image closest to the time information is determined.
[0020] According to the mapping method between a device and a video file provided by the present invention, based on the time information, determining at least one frame of the first historical static scene image closest to the time information includes:
[0021] Acquire a historical video file list, wherein the historical video file list includes at least one historical video file that has no mapping relationship with the encoding device and second historical static scene images corresponding to each of the historical video files and in different video time periods;
[0022] Determine the target recording time period closest to the time information from each recording time period in the historical recording file list;
[0023] At least one frame of the second historical static scene image corresponding to the target recording time period is determined as the at least one frame of the first historical static scene image closest to the time information.
[0024] According to the device and video file mapping method provided by the present invention, the mapping relationship between the target historical video file and the target device is determined based on at least one frame of the first historical static scene image and the target static scene image, including:
[0025] respectively determining similarities between the target static scene image and each of the first historical static scene images;
[0026] Based on each of the similarities, the target historical video file is determined, and a mapping relationship between the target historical video file and the target device is determined.
[0027] According to the device and video file mapping method provided by the present invention, the target historical video file is determined based on each of the similarities, including:
[0028] If at least one similarity exceeds a second preset threshold, determining the first historical static scene image corresponding to the highest similarity as the target historical static scene image, and determining the historical video file corresponding to the target historical static scene image as the target historical video file;
[0029] When all the similarities are less than or equal to the second preset threshold, a new video file is created, and the new video file is determined as the target historical video file.
[0030] The present invention also provides a device for mapping equipment and video files, including:
[0031] An acquisition module, used to acquire target video data corresponding to a target device;
[0032] A first determination module, configured to determine a target static scene image corresponding to the target device based on the target video data;
[0033] The second determination module is used to determine the mapping relationship between the target historical video file and the target device based on at least one frame of the first historical static scene image and the target static scene image.
[0034] The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the mapping method between the device and the video file as described above is implemented.
[0035] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the mapping method between the device and the video file as described above is implemented.
[0036] The device and video file mapping method, apparatus, equipment and storage medium provided by the present invention, after the correspondence between each video encoding device and the stored video file is lost, obtain the target video data corresponding to the target device, perform static scene analysis on the target video data, obtain the target static scene image corresponding to the target device, and re-determine the target historical video file corresponding to the target device by comparing the target static scene image with each first historical static scene image, so as to realize the automatic binding of the mapping relationship between the target historical video file and the target device after the correspondence between each video encoding device and the stored video file is lost. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the present invention or 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 This is one of the flow charts of the method for mapping a device to a video file provided in an embodiment of the present invention;
[0039] Figure 2 is an example schematic diagram of determining a target static scene image provided by an embodiment of the present invention;
[0040] Figure 3 This is a second flow chart of a method for mapping a device to a video file provided in an embodiment of the present invention;
[0041] Figure 4 This is a third flow chart of a method for mapping a device to a video file provided in an embodiment of the present invention;
[0042] Figure 5 It is a structural schematic diagram of a device and a video file mapping apparatus provided by an embodiment of the present invention;
[0043] Figure 6 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] Aiming at the problem that after the correspondence between each video encoding device and the stored video file is lost in the prior art, the correspondence between each video encoding device and the corresponding video file cannot be restored, an embodiment of the present invention provides a mapping method between a device and a video file. Figure 1 FIG. 1 is one of the flow charts of the method for mapping a device to a video file provided in an embodiment of the present invention. Figure 1 As shown, the method includes:
[0046] Step 110: Acquire target video data corresponding to the target device.
[0047] Specifically, when the video encoding device deletes or re-connects to the video management server according to business configuration requirements, the video encoding device changes the device identification, or the video management server loses configuration information due to system disk damage or software abnormality and then re-adds each video encoding device, the target device accesses the video management server through a network protocol and transmits the real-time target video data collected by the target device to the video management server.
[0048] It should be noted that the above-mentioned target device can be a video encoding device with a fixed monitoring angle and monitoring range, such as an IPC (IP Camera, network camera), or a video encoding device with a variable monitoring range, such as a ball camera that can drive the lens to rotate by controlling the pan / tilt rotation, thereby driving the monitoring range to change. According to the access protocol of the video management server, the video encoding device needs to upload device parameters to the video management server when accessing the video management server, so that the video management server can understand the function of the video encoding device according to the device parameters. Through the device type in the device parameters, the historical video files that are the same as the device type of the target device and are not bound can be matched with the target video data corresponding to the target device, that is, the historical video files and the target device are classified according to the device type, and the historical video files of the same type are matched with the target device, which can narrow the matching range and improve the matching efficiency and matching accuracy. For example, if the device type is a fixed camera, that is, the monitoring range of the video encoding device is fixed, the target device can be matched with the historical video files that are of the fixed camera type and are not bound. If the device type is a ball camera, that is, the video encoding device can drive the lens to rotate by controlling the pan / tilt, thereby driving the monitoring range to change, and the target device can be matched with the historical video file of the ball camera type and not bound. At this time, a new video file can be created in the video management server, and the new video file can be matched one-to-one with the video encoding device.
[0049] Step 120: Determine a target static scene image corresponding to the target device based on the target video data.
[0050] Specifically, after the target video data corresponding to the target device is acquired, a static scene analysis is performed on the target video data to determine a target static scene image.
[0051] Further, determining the target static scene image corresponding to the target device based on the target video data includes:
[0052] Extracting frames of the target video data to obtain multiple frames of images to be analyzed;
[0053] Determine the repetition ratio corresponding to each pixel point based on the position information of each pixel point in the multiple frames of images to be analyzed after superposition;
[0054] Based on each of the repetition ratios, a target static scene image corresponding to the target device is determined.
[0055] Specifically, after acquiring the target video data, the target video data can be frame-extracted to obtain multiple frames of images to be analyzed, which may include only static scenes or static scenes and dynamic scenes. Since the monitoring range of the target device remains unchanged, multiple frames of images to be analyzed can be superimposed so that each pixel in each frame of the image to be analyzed is aligned vertically. After the multiple frames of images to be analyzed are superimposed, the position information of each pixel is determined, and each pixel in the multiple frames of the image to be analyzed is classified according to the position information, and the number of repetitions of pixels in the same category, that is, the number of repetitions of pixels in the same position information, is counted. Based on the ratio of the number of repetitions and the number of frames of the image to be analyzed, the repetition ratio of each pixel can be determined, so as to extract static scenes from each target image to be analyzed according to the repetition ratio, and obtain the target static scene image corresponding to the target device.
[0056] Optionally, when extracting frames from the target video data, the purpose of extracting frames is to remove dynamic scenes in the target video data and retain static scenes in the target video image. The target video data can be extracted at equal intervals according to a preset frame interval. The frame intervals between two adjacent frames of images to be analyzed extracted during frame extraction can also be unequal. The preset frame interval can be set based on historical experience to ensure that the position, size, etc. of the dynamic scene between two adjacent frames of images to be analyzed are relatively different.
[0057] Further, the determining the target static scene image corresponding to the target device based on each of the repetition ratios includes:
[0058] For each of the repetition ratios, when the repetition ratio is less than or equal to a first preset threshold, deleting the pixel points corresponding to the repetition ratio;
[0059] When the repetition ratio is greater than the first preset threshold, retaining the pixel points corresponding to the repetition ratio;
[0060] For each retained pixel point, a pixel average value of the retained pixel points in the multiple frames of images to be analyzed is determined, and based on each of the pixel average values, a target static scene image corresponding to the target device is determined.
[0061] Specifically, after determining the repetition ratio corresponding to each pixel point, if the repetition ratio is less than or equal to the first preset threshold, it indicates that the pixel point may belong to a dynamic scene. Since the target moves in the dynamic scene, the repetition ratio of the pixel point is low. At this time, the pixel point with a low repetition ratio can be deleted. At this time, deleting the pixel point means deleting all the pixels in the position information. If the repetition ratio is greater than the first preset threshold, it indicates that the pixel point may belong to a static scene. Since the position, size, etc. of the static scene in the monitoring range have not changed, and the monitoring range has not changed, the repetition ratio is high. At this time, the pixel point with a high repetition ratio can be retained, that is, all the pixels in the same position as the pixel point are retained. After traversing all the pixels, for all types of pixels in all the retained pixels, due to different shooting time information, the pixel values of each pixel point are different at different shooting times. At this time, for any type of retained pixels, the pixel values of each pixel point at the same position as the pixel point can be determined, and the pixel average value can be determined, and the pixel average value is used as the pixel value of the pixel point at the position to obtain a smooth target static scene image corresponding to the target device.
[0062] For example, take the case where ten frames of images to be analyzed are obtained by extracting frames of the target video data, the size of each frame of the images to be analyzed is 300*400, and the first preset threshold is 70%. After the ten frames of images to be analyzed are superimposed, the pixels in the ten frames of images to be analyzed are aligned vertically, that is, the superimposed image still includes 300*400 pixels in the vertical direction. Figure 2 is an example schematic diagram of determining a target static scene image provided by an embodiment of the present invention, such as Figure 2As shown, each of the ten frames of images to be analyzed includes a tree and a target person. By determining the position information of each pixel in the ten frames of images to be analyzed, all pixels can be divided into 300*400 categories. The position information of each category of pixels is the same, and each category includes ten pixels. Traverse each pixel by category, that is, traverse each pixel by position information. For the A-category pixels, the pixel A1 in the image 1 to be analyzed and the pixel A3 in the image 3 to be analyzed are both at the top of the tree. It can be considered that in the A-category pixels, the pixel A1 and the pixel A3 are repeated. The number of repetitions corresponding to the A-category pixels is counted. If the number of repetitions is 9 times, it can be determined that the repetition ratio corresponding to the A-category pixels is 90%. For the B-type pixels, the pixel B1 in the image 1 to be analyzed is at the head of the target task, while the pixel B3 in the image 3 to be analyzed is outside the target task. It can be considered that in the B-type pixels, the pixel B1 and the pixel B3 are not repeated. The number of repetitions corresponding to the B-type pixels is counted. If the number of repetitions is 2, it can be determined that the repetition ratio corresponding to the B-type pixels is 20%. Since 20%<70%<90%, it can be determined that the tree corresponding to the A-type pixels is a static scene, and the target person corresponding to the B-type pixels is a dynamic scene. At this time, the A-type pixels can be retained and the B-type pixels can be deleted. After traversing various types of pixels, various types of pixels related to the tree can be obtained. Taking the A-type pixels as an example, the pixel values corresponding to the ten pixels in the A-type pixels are determined, and the average pixel value corresponding to the ten pixels is determined as the pixel value of the pixel corresponding to the A-type pixel in the target static scene image. The light and dark effects caused by different shooting times are overcome, and the various types of retained pixels are traversed to obtain the smoothed Figure 2 A target static scene image is shown, in which only trees are retained.
[0063] Step 130: Determine a mapping relationship between a target historical video file and the target device based on at least one frame of the first historical static scene image and the target static scene image.
[0064] Specifically, after determining the target static scene image and the first historical static scene image of each frame, the first historical static scene image of each frame is matched with the target static scene image respectively to determine the target historical static scene image that matches the target static scene image and the target historical video file corresponding to the target historical static scene image. Then, after the corresponding relationship between the target device and the target historical video file is lost, the mapping relationship between the target historical video file and the target device is reconstructed.
[0065] Furthermore, before matching each frame of the first historical static scene image with the target static scene image, at least one frame of the first historical static scene image needs to be determined, and the at least one frame of the first historical static scene image is determined based on the following steps:
[0066] Determining time information of the target video data;
[0067] Based on the time information, at least one frame of the first historical static scene image closest to the time information is determined.
[0068] Specifically, after receiving the target video data, the video management server may further determine the time information of the target video data. The time information is generally embedded in the target video data, and the video management server may directly extract the time information from the target video data. After extracting the time information corresponding to the target video data, at least one frame of the first historical static scene image closest to the time information may be queried based on the time information, thereby narrowing the range of matching the subsequent target static scene image with each frame of the first historical static scene image, and improving the matching efficiency.
[0069] Further, based on the time information, determining at least one frame of the first historical static scene image closest to the time information includes:
[0070] Acquire a historical video file list, wherein the historical video file list includes at least one historical video file that has no mapping relationship with the encoding device and second historical static scene images corresponding to each of the historical video files and in different video time periods;
[0071] Determine the target recording time period closest to the time information from each recording time period in the historical recording file list;
[0072] At least one frame of the second historical static scene image corresponding to the target recording time period is determined as the at least one frame of the first historical static scene image closest to the time information.
[0073] Specifically, Figure 3 FIG. 2 is a flow chart of a method for mapping a device to a video file provided in an embodiment of the present invention. Figure 3 As shown, in the video management server, at least one historical video file that is not bound to the video encoding device is pre-determined, and each historical video file is evenly divided by time. For example, for a complete day of historical video files, the files are divided on a scale of 1 hour to obtain 24 historical video sub-files with a video duration of 1 hour, and static scene analysis is performed on each historical video sub-file to obtain the second historical static scene image corresponding to each historical video sub-file. According to all historical video files and the second historical static scene images of different video time periods in each historical video file, a historical video file list is constructed. The static scene analysis performed on each historical video sub-file is the same as the static scene analysis performed on the target video data, and the embodiment of the present invention is not described in detail here.
[0074] Optionally, when segmenting the historical video files, the segmentation scale can be set by itself. The smaller the segmentation scale, the more historical video sub-files and the second historical static scene images corresponding to each historical video sub-file are obtained, and the more accurate the target video period determined later according to the time information is. At the same time, if the segmentation scale is smaller, the video management server performs static scene analysis on each historical video sub-file more times, resulting in a larger amount of data corresponding to the historical video file list. The appropriate segmentation scale can be determined according to actual needs.
[0075] After extracting the time information corresponding to the target video data, determine the target video time period closest to the time information from each video time period in the historical video file list. For example, taking the time information as 09:30 and the segmentation scale as 1 hour as an example, it can be determined that the time information is within the video time period of 09:00-10:00, therefore, the video time period corresponding to 09:00-10:00 is determined as the target video time period closest to the time information, and the second historical static scene image corresponding to at least one historical video subfile in the target video time period is determined as the first historical static scene image closest to the time information.
[0076] Further, the determining the mapping relationship between the target historical video file and the target device based on the target static scene image and the at least one frame of the first historical static scene image includes:
[0077] respectively determining similarities between the target static scene image and each of the first historical static scene images;
[0078] Based on each of the similarities, the target historical video file is determined, and a mapping relationship between the target historical video file and the target device is determined.
[0079] Specifically, when matching the target static scene image with each frame of the first historical static scene image, the similarity between the target static scene image and the first historical static scene image is calculated for each frame of the first historical static scene image. According to each similarity, the target historical static scene image is determined from the first historical static scene image, and the target historical video file corresponding to the target historical static scene image is further determined, and then the target historical video file is mapped to the target device.
[0080] Optionally, the similarity may be cosine similarity, correlation coefficient or Euclidean distance, which is not limited in the embodiment of the present invention.
[0081] Further, the determining the target historical video file based on each of the similarities includes:
[0082] If at least one similarity exceeds a second preset threshold, determining the first historical static scene image corresponding to the highest similarity as the target historical static scene image, and determining the historical video file corresponding to the target historical static scene image as the target historical video file;
[0083] When all the similarities are less than or equal to the second preset threshold, a new video file is created, and the new video file is determined as the target historical video file.
[0084] Specifically, Figure 4 FIG. 3 is a flow chart of a method for mapping a device to a video file provided in an embodiment of the present invention. Figure 4 As shown, after calculating the similarity between the target static scene image and the first historical static scene image of each frame, each similarity is compared with the second preset threshold, that is, the second preset threshold is used as the criterion for judging whether the target historical static image exists. If at least one similarity among all similarities is greater than the second preset threshold, it indicates that there is a target historical static scene image with a high degree of matching with the target static scene image in the first historical static scene image of each frame. At this time, the first historical static scene image corresponding to the highest similarity can be determined as the target historical static scene image, and then the target historical video file corresponding to the target historical static scene image can be determined from the historical video file list to bind the target historical video file to the target device, that is, restore the mapping relationship between the target device and the target historical video file.
[0085] If each of the similarities among all the similarities is less than or equal to the second preset threshold, it indicates that the matching degree between the target device and each historical video file in the historical video file list is low. At this time, a new video file can be created in the video management server, and the new video file can be determined as the target historical video file, and the target device can be bound to the target historical video file to facilitate the storage of the video files subsequently collected by the target device.
[0086] Optionally, after the target historical video file is bound to the target device, the target historical video file can be deleted from the historical video file list to reduce the number of first historical static scene images subsequently determined and improve the analysis efficiency of subsequent repeated static scene analysis.
[0087] The device and video file mapping method provided by the embodiment of the present invention, after the correspondence between each video encoding device and the stored video file is lost, obtains the target video data corresponding to the target device, performs static scene analysis on the target video data, obtains the target static scene image corresponding to the target device, and re-determines the target historical video file corresponding to the target device by comparing the target static scene image with each first historical static scene image, thereby realizing automatic binding of the mapping relationship between the target historical video file and the target device after the correspondence between each video encoding device and the stored video file is lost.
[0088] The device and video file mapping apparatus provided by the present invention is described below. The device and video file mapping apparatus described below and the device and video file mapping method described above can be referred to each other.
[0089] The embodiment of the present invention also provides a device for mapping a device to a video file. Figure 5 Schematic diagram of the structure of the device and the video file mapping device provided by the embodiment of the present invention. Figure 5 As shown, the device 500 for mapping the device to the video file includes: an acquisition module 510, a first determination module 520 and a second determination module 530, wherein:
[0090] An acquisition module 510 is used to acquire target video data corresponding to a target device;
[0091] A first determination module 520, configured to determine a target static scene image corresponding to the target device based on the target video data;
[0092] The second determination module 530 is used to determine the mapping relationship between the target historical video file and the target device based on at least one frame of the first historical static scene image and the target static scene image.
[0093] The device and video file mapping device provided by the embodiment of the present invention obtains the target video data corresponding to the target device, performs static scene analysis on the target video data, obtains the target static scene image corresponding to the target device, and re-determines the target historical video file corresponding to the target device by comparing the target static scene image with each first historical static scene image, so as to realize the automatic binding of the mapping relationship between the target historical video file and the target device after the correspondence between each video encoding device and the stored video file is lost.
[0094] Optionally, the first determining module 520 is specifically configured to:
[0095] Extracting frames of the target video data to obtain multiple frames of images to be analyzed;
[0096] Determine the repetition ratio corresponding to each pixel point based on the position information of each pixel point in the multiple frames of images to be analyzed after superposition;
[0097] Based on each of the repetition ratios, a target static scene image corresponding to the target device is determined.
[0098] Optionally, the first determining module 520 is specifically configured to:
[0099] For each of the repetition ratios, when the repetition ratio is less than or equal to a first preset threshold, deleting the pixel points corresponding to the repetition ratio;
[0100] When the repetition ratio is greater than the first preset threshold, retaining the pixel points corresponding to the repetition ratio;
[0101] For each retained pixel point, a pixel average value of the retained pixel points in the multiple frames of images to be analyzed is determined, and based on each of the pixel average values, a target static scene image corresponding to the target device is determined.
[0102] Optionally, the second determining module 530 is specifically configured to:
[0103] respectively determining similarities between the target static scene image and each of the first historical static scene images;
[0104] Based on each of the similarities, the target historical video file is determined, and a mapping relationship between the target historical video file and the target device is determined.
[0105] Optionally, the second determining module 530 is specifically configured to:
[0106] If at least one similarity exceeds a second preset threshold, determining the first historical static scene image corresponding to the highest similarity as the target historical static scene image, and determining the historical video file corresponding to the target historical static scene image as the target historical video file;
[0107] When all the similarities are less than or equal to the second preset threshold, a new video file is created, and the new video file is determined as the target historical video file.
[0108] Optionally, the device and video file mapping apparatus 500 further includes a third determination module, and the third determination module is specifically used to:
[0109] Determining time information of the target video data;
[0110] Based on the time information, at least one frame of the first historical static scene image closest to the time information is determined.
[0111] Optionally, the third determination module is specifically used to:
[0112] Acquire a historical video file list, wherein the historical video file list includes at least one historical video file that has no mapping relationship with the encoding device and second historical static scene images corresponding to each of the historical video files and in different video time periods;
[0113] Determine the target recording time period closest to the time information from each recording time period in the historical recording file list;
[0114] At least one frame of the second historical static scene image corresponding to the target recording time period is determined as the at least one frame of the first historical static scene image closest to the time information.
[0115] Figure 6 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the mapping method between the device and the video file, and the method includes:
[0116] Obtain target video data corresponding to the target device;
[0117] Based on the target video data, determining a target static scene image corresponding to the target device;
[0118] Based on at least one frame of the first historical static scene image and the target static scene image, a mapping relationship between a target historical video file and the target device is determined.
[0119] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0120] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the mapping method between the device and the video file provided by the above methods, the method includes:
[0121] Obtain target video data corresponding to the target device;
[0122] Based on the target video data, determining a target static scene image corresponding to the target device;
[0123] Based on at least one frame of the first historical static scene image and the target static scene image, a mapping relationship between a target historical video file and the target device is determined.
[0124] In another aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for mapping a device and a video file provided by the above methods is implemented, and the method comprises:
[0125] Obtain target video data corresponding to the target device;
[0126] Based on the target video data, determining a target static scene image corresponding to the target device;
[0127] Based on at least one frame of the first historical static scene image and the target static scene image, a mapping relationship between a target historical video file and the target device is determined.
[0128] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A mapping method between a device and a video file, It is characterized in that include: Obtain target video data corresponding to the target device; Based on the target video data, determining a target static scene image corresponding to the target device; Based on at least one frame of the first historical static scene image and the target static scene image, a mapping relationship between a target historical video file and the target device is determined.
2. The method for mapping a device to a video file according to claim 1, It is characterized in that The step of determining a target static scene image corresponding to the target device based on the target video data includes: Extracting frames of the target video data to obtain multiple frames of images to be analyzed; Determine the repetition ratio corresponding to each pixel point based on the position information of each pixel point in the multiple frames of images to be analyzed after superposition; Based on each of the repetition ratios, a target static scene image corresponding to the target device is determined.
3. The method for mapping a device to a video file according to claim 2, It is characterized in that The step of determining the target static scene image corresponding to the target device based on each of the repetition ratios includes: For each of the repetition ratios, when the repetition ratio is less than or equal to a first preset threshold, deleting the pixel points corresponding to the repetition ratio; When the repetition ratio is greater than the first preset threshold, retaining the pixel points corresponding to the repetition ratio; For each retained pixel point, a pixel average value of the retained pixel points in the multiple frames of images to be analyzed is determined, and based on each of the pixel average values, a target static scene image corresponding to the target device is determined.
4. The method for mapping a device to a video file according to any one of claims 1 to 3, It is characterized in that The at least one first historical static scene image is determined based on the following steps: Determining time information of the target video data; Based on the time information, at least one frame of the first historical static scene image closest to the time information is determined.
5. The method for mapping a device to a video file according to claim 4, It is characterized in that The determining, based on the time information, at least one frame of the first historical static scene image closest to the time information includes: Acquire a historical video file list, wherein the historical video file list includes at least one historical video file that has no mapping relationship with the encoding device and second historical static scene images corresponding to each of the historical video files and in different video time periods; Determine the target recording time period closest to the time information from each recording time period in the historical recording file list; At least one frame of the second historical static scene image corresponding to the target recording time period is determined as the at least one frame of the first historical static scene image closest to the time information.
6. The method for mapping a device to a video file according to any one of claims 1 to 3, It is characterized in that The determining, based on at least one frame of the first historical static scene image and the target static scene image, a mapping relationship between the target historical video file and the target device includes: respectively determining similarities between the target static scene image and each of the first historical static scene images; Based on each of the similarities, the target historical video file is determined, and a mapping relationship between the target historical video file and the target device is determined.
7. The method for mapping a device to a video file according to claim 6, It is characterized in that The step of determining the target historical video file based on the similarities includes: If at least one similarity exceeds a second preset threshold, determining the first historical static scene image corresponding to the highest similarity as the target historical static scene image, and determining the historical video file corresponding to the target historical static scene image as the target historical video file; When all the similarities are less than or equal to the second preset threshold, a new video file is created, and the new video file is determined as the target historical video file.
8. A mapping device between a device and a video file, It is characterized in that include: An acquisition module, used to acquire target video data corresponding to a target device; A first determination module, configured to determine a target static scene image corresponding to the target device based on the target video data; The second determination module is used to determine the mapping relationship between the target historical video file and the target device based on at least one frame of the first historical static scene image and the target static scene image.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the mapping method between the device and the video file as described in claims 1-7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by the processor, the method for mapping the device and the video file as described in claims 1 to 7 is implemented.
Citation Information
Cited By
Network camera adding method and device and storage medium
CN121691769A