Data processing method, device, electronic device and storage medium
By fragmenting and deduplication of human and vehicle data in the video stream, the duplicate statistics in human and vehicle data statistics in the video stream are solved, and the accuracy and processing speed of data are improved.
Patent Information
- Application Number
- CN202111669621.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In the statistics of people and vehicles in the video stream, due to the continuous appearance of pedestrians and vehicles in the video stream, there are repeated statistics in the statistics of people and vehicles for multiple consecutive periods of time, resulting in data-level errors and reducing the accuracy and reliability of data mining.
By obtaining the structured characteristic data sequence of people and cars from the video stream, sharding and deduplication are performed. The specific steps include: sharding the structured characteristic data sequence based on the preset time sharding strategy, performing a first deduplication to remove duplicate data between shard data, then hashing the shard data, obtaining the shard hash data, and performing a second deduplication to remove duplicate data in the shard data.
It effectively avoids duplicate statistics of human and vehicle data, improves the accuracy of the statistics of the number of people and vehicles, and accelerates the speed of the second deduplication through hashing processing.
Smart Images

Figure CN114445737B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a data processing method, device, electronic equipment and storage medium. Background Art
[0002] With the development of digitalization, data mining and analysis need to be paid more and more attention. However, as massive data is collected and stored, there are more duplicate data, which is not conducive to data statistics. In the data dashboard, the results of data mining are often only statistical data, such as the number of a certain time period. Furthermore, in the statistics of people and vehicles in the video stream, since pedestrians and vehicles in the video stream appear continuously in a certain period of time in the video, there will be repeated statistics for the statistics of people and vehicles in multiple consecutive time periods. For example, if car A appears in time period a, and also appears in time period a-1 and time period a+1, then when counting by time period, car A will also be counted in time period a-1 and time period a+1, causing errors at the data level, resulting in low accuracy of statistical results, thereby reducing the reliability of data mining. Summary of the invention
[0003] An embodiment of the present invention provides a data processing method, which obtains structured feature data sequences of people and vehicles from a video stream, slices the structured feature data sequences of people and vehicles, performs a first deduplication on the sliced structured feature data sequences, removes repeated structured data between sliced data, and performs a second deduplication on the sliced hash data obtained after hash processing, thereby removing repeated structured data in the sliced data, thereby avoiding repeated statistics of people and vehicle data and improving the accuracy of the results of counting the number of people and vehicles; at the same time, performing a second deduplication on the sliced hash data obtained after hash processing can increase the speed of the second deduplication.
[0004] In a first aspect, an embodiment of the present invention provides a data processing method, the method comprising:
[0005] Inputting the video stream to be processed into a pre-trained object detection network to obtain a structured feature data sequence corresponding to the object to be processed contained in the video stream to be processed, wherein the object type of the object to be processed includes at least one of a motor vehicle type, a non-motor vehicle type, and a pedestrian type;
[0006] Slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy, and performing a first deduplication process on the sliced structured feature data sequence to obtain sliced data;
[0007] Performing hash processing on the shard data to obtain shard hash data of the object to be processed;
[0008] Based on the shard hash data, a second deduplication process is performed on the object to be processed to obtain a result of the quantity of the object to be processed contained in the video stream to be processed.
[0009] Optionally, the time slicing strategy includes a slicing duration. Before slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy, the method further includes:
[0010] The segment durations corresponding to the object types of the objects to be processed are determined according to the speeds corresponding to the object types of the objects to be processed.
[0011] Optionally, slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy includes:
[0012] The structured feature data sequence is segmented according to the segmentation duration corresponding to the object type of the object to be processed.
[0013] Optionally, before slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy, the method further includes:
[0014] For the same type of objects to be processed, extracting the first appearance duration of the first target in the structured feature data sequence corresponding to the same type of objects to be processed, where the first target is the first single target that appears in the structured feature data sequence corresponding to the same type of objects to be processed;
[0015] Extracting a second appearance duration of a second target from the structured feature data sequence corresponding to the object to be processed of the same type, where the appearance time of the second target is within the appearance time of the first target;
[0016] If there is a second appearance duration that is greater than the first appearance duration, determining a time slicing strategy corresponding to the structured feature data sequence of the object to be processed according to the second appearance duration;
[0017] If there is no second appearance duration greater than the first appearance duration, a time slicing strategy corresponding to the structured feature data sequence of the object to be processed is determined according to the first appearance duration.
[0018] Optionally, performing hash processing on the shard data to obtain shard hash data of the object to be processed includes:
[0019] Performing binary hash coding on each structured data in the sharded data to obtain a binary hash value of each structured data in the sharded data;
[0020] The binary hash value of each structured data in the shard data is sorted in chronological order from front to back to obtain the shard hash data of the object to be processed.
[0021] Optionally, the performing a second deduplication process on the object to be processed based on the shard hash data to obtain a result of the number of objects to be processed contained in the video stream to be processed includes:
[0022] Obtain the last N digits of the binary hash value, and convert the last N digits of the binary hash value into decimal to obtain the number of the binary hash value;
[0023] Maintain 2N counting containers, each counting container is numbered according to a decimal number;
[0024] According to the number of the binary hash value, the binary hash value is placed into a counting container with a corresponding number;
[0025] Deduplication is performed based on the first M bits of the binary value of each binary hash value in the counting container and the first M bits of the binary values of other binary hash values, to obtain the number of deduplicated binary hash values in each counting container;
[0026] The deduplicated quantities of all counting containers are added together to obtain the quantity result of the object to be processed under the corresponding time slicing strategy.
[0027] Optionally, the performing a first deduplication process on the fragmented structured feature data sequence includes:
[0028] In the current time slice n, extracting the third appearance duration of the third target from the structured feature data sequence corresponding to the object to be processed of the same type;
[0029] When the third appearance duration is less than the preset duration, judging whether there is a structured feature data sequence of the third target in the previous time slice n-1 and / or the next time slice n+1 according to the structured data corresponding to the third target;
[0030] If the structured feature data sequence of the third target exists in the previous time slice n-1 and / or the next time slice n+1, extracting the fourth appearance duration of the third target according to the structured feature data sequence of the third target;
[0031] If the fourth appearance duration is greater than the third appearance duration, deleting the structured feature data sequence of the third target from the current time slice n;
[0032] If the fourth appearance duration is shorter than the third appearance duration, the structured feature data sequence of the third target is deleted from the previous time slice n-1 and / or the next time slice n+1.
[0033] In a second aspect, an embodiment of the present invention provides a data processing device, the device comprising:
[0034] A first processing module is used to input the video stream to be processed into a pre-trained object detection network to obtain a structured feature data sequence corresponding to the object to be processed contained in the video stream to be processed, wherein the object type of the object to be processed includes at least one of a motor vehicle type, a non-motor vehicle type and a pedestrian type;
[0035] A slicing module, used for slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy, and performing a first deduplication process on the sliced structured feature data sequence to obtain slicing data;
[0036] A second processing module is used to perform hash processing on the shard data to obtain shard hash data of the object to be processed;
[0037] The third processing module is used to perform a second deduplication process on the object to be processed based on the shard hash data to obtain the quantity result of the object to be processed contained in the video stream to be processed.
[0038] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the data processing method provided in the embodiment of the present invention when executing the computer program.
[0039] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the data processing method provided in the embodiment of the invention are implemented.
[0040] In an embodiment of the present invention, a video stream to be processed is input into a pre-trained target detection network to obtain a structured feature data sequence corresponding to the object to be processed contained in the video stream to be processed, wherein the object type of the object to be processed includes at least one of a motor vehicle type, a non-motor vehicle type and a pedestrian type; the structured feature data sequence of the object to be processed is sliced based on a preset time slicing strategy, and a first deduplication processing is performed on the sliced structured feature data sequence to obtain sliced data; the sliced data is hashed to obtain sliced hash data of the object to be processed; based on the sliced hash data, a second deduplication processing is performed on the object to be processed to obtain a result of the number of objects to be processed contained in the video stream to be processed. By obtaining a structured feature data sequence of people and vehicles from a video stream, the structured feature data sequence of people and vehicles is sliced, and a first deduplication is performed on the sliced structured feature data sequence to remove repeated structured data between sliced data. The sliced hash data obtained after hash processing is subjected to a second deduplication process, thereby removing repeated structured data within the sliced data, thereby avoiding repeated statistics of people and vehicle data and improving the accuracy of the results of the statistics on the number of people and vehicles. At the same time, a second deduplication process is performed based on the sliced hash data obtained after hash processing, thereby increasing the speed of the second deduplication process. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only 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.
[0042] Figure 1 is a flow chart of a data processing method provided by an embodiment of the present invention;
[0043] Figure 2 is a structural schematic diagram of a data processing device provided by an embodiment of the present invention;
[0044] Figure 3 is a structural schematic diagram of another data processing device provided by an embodiment of the present invention;
[0045] Figure 4 It is a structural schematic diagram of another slicing module provided by the embodiment of the present invention;
[0046] Figure 5 is a structural schematic diagram of a second processing module provided by an embodiment of the present invention;
[0047] Figure 6is a structural schematic diagram of a third processing module provided by an embodiment of the present invention;
[0048] Figure 7 is a schematic diagram of the structure of another slicing module provided in an embodiment of the present invention;
[0049] Figure 8 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0051] See also Figure 1 , Figure 1 is a flow chart of a data processing method provided by an embodiment of the present invention, such as Figure 1 As shown, the data processing method includes the following steps:
[0052] 101. Input the video stream to be processed into a pre-trained object detection network to obtain a structured feature data sequence corresponding to the object to be processed contained in the video stream to be processed.
[0053] In an embodiment of the present invention, the above-mentioned video stream to be processed may be a real-time video stream collected by a collection device, such as a video stream collected in real time by airport cameras, highway cameras, shopping mall cameras, etc.; the above-mentioned video stream to be processed may also be an offline video stream, such as a stored video stream or a video stream uploaded by a user, and the object type of the above-mentioned object to be processed includes at least one of a motor vehicle type, a non-motor vehicle type and a pedestrian type.
[0054] The pre-trained target detection network can be a target detection network based on deep learning. The target detection network can be an existing target detection network. After deep learning (training), the target detection network can detect corresponding structured data. The structured data includes vehicles, vehicle attributes, pedestrians and pedestrian attributes. The vehicles include motor vehicles and non-motor vehicles. The vehicle attributes can be license plates, vehicle types, brands, colors, etc. The pedestrian attributes can be the color of the pedestrian's top, color of the bottom, objects carried, height, objects worn, etc. The structured data can be displayed in real time on a web page to facilitate the case handlers to view intuitively. It can also be stored in a database to facilitate the case handlers to trace back. On the other hand, it can be cached in the form of an MQ message queue to count the vehicles and pedestrians in the structured data.
[0055] The above-mentioned video stream to be processed is composed of continuous image frames. For example, a 50-second video stream is composed of 30 frames per second, a total of 1500 frames of image frames in time sequence. In the target detection network, each image frame will be detected. Therefore, each image frame will generate corresponding structured data. The structured data is arranged according to the time sequence of the corresponding image frames to obtain the above structured feature data sequence.
[0056] 102. Slice the structured feature data sequence of the object to be processed based on a preset time slicing strategy, and perform a first deduplication process on the sliced structured feature data sequence to obtain sliced data.
[0057] In the embodiment of the present invention, the object type of the object to be processed includes at least one of a motor vehicle type, a non-motor vehicle type and a pedestrian type. Different object types of the object to be processed have different corresponding time slicing strategies.
[0058] The above time slicing strategy may be determined according to a preset time, for example, the time slicing strategy corresponding to motor vehicles may be 10S, the time slicing strategy corresponding to non-motor vehicles may be 20S, and the time slicing strategy corresponding to pedestrians may be 30S.
[0059] In a possible embodiment, for the same type of objects to be processed, the first appearance duration of the first target can be extracted from the structured feature data sequence corresponding to the above-mentioned objects to be processed of the same type, and the above-mentioned first target is the single target that first appears in the structured feature data sequence corresponding to the above-mentioned objects to be processed of the same type; the second appearance duration of the second target is extracted from the structured feature data sequence corresponding to the above-mentioned objects to be processed of the same type, and the appearance time of the above-mentioned second target is within the appearance time of the first target; if the second appearance duration exists and is greater than the above-mentioned first appearance duration, the time slicing strategy corresponding to the structured feature data sequence of the above-mentioned objects to be processed is determined according to the above-mentioned second appearance duration; if the second appearance duration does not exist and is greater than the above-mentioned first appearance duration, the time slicing strategy corresponding to the structured feature data sequence of the above-mentioned objects to be processed is determined according to the above-mentioned first appearance duration.
[0060] Specifically, for the same type of objects to be processed, the appearance time T0 and the leaving time T1 of the first target are extracted from the structured feature data sequence corresponding to the above-mentioned objects to be processed of the same type, and the above-mentioned first target is the single target that first appears in the structured feature data sequence corresponding to the above-mentioned objects to be processed of the same type; the appearance time T3 and the leaving time T4 of the second target are extracted from the structured feature data sequence corresponding to the above-mentioned objects to be processed of the same type, and the appearance time T3 of the above-mentioned second target is between the appearance time T0 and the leaving time T1 of the first target; the first appearance duration of the above-mentioned first target is calculated according to the above-mentioned appearance time T0 and the leaving time T1; and the second appearance duration of the above-mentioned second target is calculated according to the above-mentioned appearance time T3 and the leaving time T4.
[0061] Optionally, the segment durations corresponding to different object types of the objects to be processed may be determined according to the speeds corresponding to the object types of the objects to be processed.
[0062] In a possible embodiment, a first time length can be determined according to the speed of the motor vehicles among the above-mentioned motor vehicle types, and the time slicing strategy can be determined according to the first time length to slice according to the first time length; and a second time length can be determined according to the speed of the non-motor vehicles among the above-mentioned non-motor vehicles types, and the time slicing strategy can be determined according to the second time length to slice according to the second time length; and a third time length can be determined according to the speed of the pedestrians among the above-mentioned pedestrian types, and the time slicing strategy can be determined according to the third time length to slice according to the third time length; wherein the first time length is smaller than the second time length, and the second time length is smaller than the third time length.
[0063] Specifically, a period of time in the structured feature data sequence corresponding to the motor vehicle can be intercepted, the average speed of the motor vehicle in the period of time can be calculated, and the length of time that the motor vehicle passes through the screen at the average speed of the motor vehicle can be calculated as the first time length. Similarly, a period of time in the structured feature data sequence corresponding to the non-motor vehicle can be intercepted, the average speed of the non-motor vehicle in the period of time can be calculated, and the length of time that the non-motor vehicle passes through the screen at the average speed of the non-motor vehicle can be calculated as the second time length. A period of time in the structured feature data sequence corresponding to the pedestrian can be intercepted, the average speed of the pedestrian in the period of time can be calculated, and the length of time that the pedestrian passes through the screen at the average speed of the pedestrian can be calculated as the third time length.
[0064] In an embodiment of the present invention, the time length of the shard is determined by the average speed of the object to be processed, and the target number in each shard data can be determined, so that the target number is not too large, resulting in a large amount of data in the shard data, nor is the target number too small, resulting in data dispersion in the shard data.
[0065] Optionally, the structured feature data sequence may be segmented according to the segmentation duration corresponding to the object type of the object to be processed.
[0066] In a possible embodiment, a time slicing strategy for slicing according to a first time length can be matched for the structured feature data sequence of the motor vehicle type, and the structured feature data sequence of the motor vehicle type can be sliced based on the first time length; and / or a time slicing strategy for slicing according to a second time length can be matched for the structured feature data sequence of the non-motor vehicle type, and the structured feature data sequence of the non-motor vehicle type can be sliced based on the second time length; and / or a time slicing strategy for slicing according to a first time length can be matched for the structured feature data sequence of the pedestrian type, and the structured feature data sequence of the motor vehicle type can be sliced based on the third time length. According to different types of objects to be processed, matching different time slicing strategies can improve the flexibility of slicing.
[0067] It should be noted that, in general, when statistics are required for a longer period of time including time period a, time period a-1 and time period a+1, the statistics of these three time periods cannot be directly added because of repeated statistics. It is necessary to re-statistic the human and vehicle data for the longer period, and a superior interface is also required to support the human and vehicle data statistics for the longer period. This undoubtedly increases the number of statistical calculations. In an embodiment of the present invention, the first deduplication can be performed on the structured feature data sequence after sharding. The above-mentioned first deduplication is inter-shard deduplication, which refers to deduplication of adjacent structured feature data sequences.
[0068] Optionally, in the current time slice n, the third appearance duration of the third target can be extracted from the structured feature data sequence corresponding to the above-mentioned same type of object to be processed; when the above-mentioned third appearance duration is less than the preset duration, it is judged whether the structured feature data sequence of the third target exists in the previous time slice n-1 and / or the next time slice n+1 according to the structured data corresponding to the third target; if the structured feature data sequence of the above-mentioned third target exists in the above-mentioned previous time slice n-1 and / or the next time slice n+1, the fourth appearance duration of the third target is extracted according to the structured feature data sequence of the above-mentioned third target; if the above-mentioned fourth appearance duration is greater than the above-mentioned third appearance duration, the structured feature data sequence of the above-mentioned third target is deleted from the above-mentioned current time slice n; if the above-mentioned fourth appearance duration is less than the above-mentioned third appearance duration, the structured feature data sequence of the above-mentioned third target is deleted from the above-mentioned previous time slice n-1 and / or the next time slice n+1. Each of the above-mentioned structured data corresponds to a detection box ID, and the above-mentioned detection box ID is assigned by the above-mentioned target detection network. Each detection box ID represents a target, and the third appearance duration of the third target can be extracted from the structured feature data sequence corresponding to the above-mentioned same type of object to be processed according to the above-mentioned detection box ID; it can be judged whether there is a structured feature data sequence of the third target in the previous time slice n-1 and / or the next time slice n+1 according to the above-mentioned detection box ID; and the fourth appearance duration of the third target can be extracted from the structured feature data sequence corresponding to the third target in the previous time slice n-1 and / or the next time slice n+1 according to the above-mentioned detection box ID.
[0069] Through the first deduplication, repeated targets between adjacent shard data can be removed, and repeated targets can be reasonably distributed to the shard data with the longest appearance time.
[0070] 103. Perform hash processing on the shard data to obtain shard hash data of the object to be processed.
[0071] In the embodiment of the present invention, the above hash processing is implemented by a hash function. It should be noted that, during the hash processing, the same data has the same hash value, and different data corresponds to different hash values.
[0072] Optionally, each structured data in the above shard data may be binary hash-encoded to obtain a binary hash value of each structured data in the above shard data; the binary hash values of each structured data in the above shard data are sorted in chronological order from front to back to obtain the shard hash data of the above object to be processed. The above binary hash code includes 0 and 1, a binary hash value includes 0 and 1 at different positions, and the length of the above binary hash value is L, which indicates how many 0s and 1s there are.
[0073] In the embodiment of the present invention, the structured data of the object to be processed is converted into a corresponding binary hash value through hash processing, which facilitates storage and makes calculation based on the binary hash value simpler, thereby improving the speed of the subsequent second deduplication processing.
[0074] 104. Based on the shard hash data, perform a second deduplication process on the objects to be processed to obtain a result of the number of the objects to be processed contained in the video stream to be processed.
[0075] In the embodiment of the present invention, the above-mentioned quantity result may be a quantity statistics result of the objects to be processed.
[0076] It should be noted that since most target statistics use the target detection network to perform statistics based on the detection frame ID, there are as many targets as there are detection frame IDs. However, during the detection process of the video stream, the target may be temporarily blocked, resulting in the same target being assigned two different detection frame IDs due to algorithm restart, which will also cause repeated statistics. Therefore, it is necessary to perform intra-slice deduplication on the sharded data, i.e., the second deduplication process.
[0077] Optionally, in the embodiment of the present invention, the last N digits of the binary hash value may be obtained, and the last N digits of the binary hash value may be converted into decimal to obtain the number of the binary hash value; maintaining 2 N Counting containers, each counting container is numbered according to a decimal number; the above binary hash values are placed in the corresponding numbered counting containers according to the number of the above binary hash values; the first M bits of the binary value of each binary hash value in the above counting container are deduplicated with the first M bits of the binary value of other binary hash values to obtain the deduplicated number of binary hash values in each counting container; the deduplicated numbers of all counting containers are added together to obtain the number result of the above objects to be processed under the corresponding time slicing strategy. The second deduplication is performed by binary hash values, which can save cache read and write overhead and calculation overhead while improving the accuracy of deduplication, and improve the calculation speed of the second deduplication.
[0078] In a possible embodiment, the relationship between the last N bits and the first M bits can be N+M=L or N+M=L+b, where b is an integer greater than 0. The above binary hash values are divided by the last N binary values, and all binary hash values with the same last N binary values can be assigned to the same counting container; then the first M binary values are compared, and the binary hash values with the same first M binary values are the binary hash values corresponding to the same target, and the binary hash values with different first M binary values are the binary hash values corresponding to two different targets. In this way, different binary hash values in a counting container can be counted, and the number of targets corresponding to a counting container can be determined.
[0079] In a possible embodiment, the quantity result of the object to be processed includes the target quantity result of each time slice in the corresponding type, and the target quantity result of the time slice can be directly displayed. It should be noted that after obtaining the quantity result of the object to be processed, since the first deduplication is performed between different time slices, and the second deduplication is performed within the same time slice, repeated statistics of the target quantities of each time slice are avoided. The target quantities of different time slices are added to obtain the target quantity result of the aggregated time slice. Specifically, the target quantity corresponding to the time slice can be stored as the basic statistical quantity. When aggregated time analysis is required, the corresponding time slices are aggregated and the target quantities of the corresponding time slices are added to obtain the target quantity result of the aggregated time slice for display.
[0080] In an embodiment of the present invention, a video stream to be processed is input into a pre-trained target detection network to obtain a structured feature data sequence corresponding to the object to be processed contained in the video stream to be processed, wherein the object type of the object to be processed includes at least one of a motor vehicle type, a non-motor vehicle type and a pedestrian type; the structured feature data sequence of the object to be processed is sliced based on a preset time slicing strategy, and a first deduplication processing is performed on the sliced structured feature data sequence to obtain sliced data; the sliced data is hashed to obtain sliced hash data of the object to be processed; based on the sliced hash data, a second deduplication processing is performed on the object to be processed to obtain a result of the number of objects to be processed contained in the video stream to be processed. By obtaining a structured feature data sequence of people and vehicles from a video stream, the structured feature data sequence of people and vehicles is sliced, and a first deduplication is performed on the sliced structured feature data sequence to remove repeated structured data between sliced data. The sliced hash data obtained after hash processing is subjected to a second deduplication process, thereby removing repeated structured data within the sliced data, thereby avoiding repeated statistics of people and vehicle data and improving the accuracy of the results of the statistics on the number of people and vehicles. At the same time, a second deduplication process is performed based on the sliced hash data obtained after hash processing, thereby increasing the speed of the second deduplication process.
[0081] It should be noted that the data processing method provided in the embodiment of the present invention can be applied to devices such as smart phones, computers, servers, etc. that can perform data processing.
[0082] Optional, see Figure 2 , Figure 2 is a structural diagram of a data processing device provided by an embodiment of the present invention, such as Figure 2 As shown, the device comprises:
[0083] The first processing module 201 is used to input the video stream to be processed into a pre-trained object detection network to obtain a structured feature data sequence corresponding to the object to be processed contained in the video stream to be processed, wherein the object type of the object to be processed includes at least one of a motor vehicle type, a non-motor vehicle type and a pedestrian type;
[0084] A slicing module 202 is used to slice the structured feature data sequence of the object to be processed based on a preset time slicing strategy, and perform a first deduplication process on the sliced structured feature data sequence to obtain sliced data;
[0085] The second processing module 203 is used to perform hash processing on the shard data to obtain shard hash data of the object to be processed;
[0086] The third processing module 204 is used to perform a second deduplication process on the object to be processed based on the shard hash data to obtain a result of the number of the object to be processed contained in the video stream to be processed.
[0087] Optionally, the time slicing strategy includes slicing duration, such as Figure 3 As shown, the device also includes:
[0088] The first determination module 205 is used to determine the segment duration corresponding to the object type of the object to be processed according to the speed corresponding to the object type of the object to be processed
[0089] Optionally, the slicing module 202 is further configured to slice the structured feature data sequence according to a slicing duration corresponding to an object type of the object to be processed.
[0090] Optional, such as Figure 4 As shown, the slicing module 202 further includes:
[0091] A first extraction unit 2024 is configured to extract, for the same type of objects to be processed, the first appearance duration of a first target in the structured feature data sequence corresponding to the same type of objects to be processed, where the first target is a single target that first appears in the structured feature data sequence corresponding to the same type of objects to be processed;
[0092] A second extraction unit 2025 is used to extract a second appearance duration of a second target from the structured feature data sequence corresponding to the object to be processed of the same type, where the appearance time of the second target is within the appearance time of the first target;
[0093] A first determining unit 2026 is configured to determine a time slicing strategy corresponding to the structured feature data sequence of the object to be processed according to the second appearance duration if there is a second appearance duration that is greater than the first appearance duration;
[0094] The second determining unit 2027 is configured to determine a time slicing strategy corresponding to the structured feature data sequence of the object to be processed according to the first appearance duration if there is no second appearance duration greater than the first appearance duration.
[0095] Optional, such as Figure 5 As shown, the second processing module 203 includes:
[0096] The first encoding unit 2031 is used to perform binary hash encoding on each structured data in the shard data to obtain a binary hash value of each structured data in the shard data;
[0097] The sorting unit 2032 is used to sort the binary hash value of each structured data in the shard data in a time sequence from front to back to obtain the shard hash data of the object to be processed.
[0098] Optional, such as Figure 6 As shown, the third processing module 204 includes:
[0099] An acquiring unit 2041 is used to acquire the last N digits of the binary hash value, and convert the last N digits of the binary hash value into decimal to obtain the number of the binary hash value;
[0100] The second numbered unit 2042 is used for maintaining 2 N counting containers, each counting container is numbered according to a decimal number;
[0101] The placing unit 2043 is used to place the binary hash value into a counting container with a corresponding number according to the number of the binary hash value;
[0102] A deduplication unit 2044 is used to perform deduplication based on the first M bits of the binary value of each binary hash value in the counting container and the first M bits of the binary values of other binary hash values to obtain the deduplicated number of binary hash values in each counting container;
[0103] The adding unit 2045 is used to add the deduplicated quantities of all counting containers to obtain the quantity result of the object to be processed under the corresponding time slicing strategy.
[0104] Optional, such as Figure 7 As shown, the slicing module 202 further includes:
[0105] The third extraction unit 2028 is used to extract the third appearance duration of the third target from the structured feature data sequence corresponding to the object to be processed of the same type in the current time slice n;
[0106] The judging unit 2029 is configured to judge whether there is a structured feature data sequence of the third target in the previous time slice n-1 and / or the next time slice n+1 according to the structured data corresponding to the third target when the third appearance duration is less than a preset duration;
[0107] The fourth extraction unit 20210 is configured to extract a fourth appearance duration of the third target according to the structured feature data sequence of the third target if the structured feature data sequence of the third target exists in the previous time slice n-1 and / or the next time slice n+1;
[0108] A first deleting unit 20211 is configured to delete the structured feature data sequence of the third target from the current time slice n if the fourth appearance duration is greater than the third appearance duration;
[0109] The second deleting unit 20212 is configured to delete the structured feature data sequence of the third target from the previous time slice n-1 and / or the next time slice n+1 if the fourth appearance duration is shorter than the third appearance duration.
[0110] It should be noted that the data processing device provided in the embodiment of the present invention can be applied to devices such as smart phones, computers, servers, etc. that can perform data processing.
[0111] The data processing device provided in the embodiment of the present invention can implement each process implemented by the data processing method in the above method embodiment and can achieve the same beneficial effect. To avoid repetition, it will not be described here.
[0112] See also Figure 8 , Figure 8 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 8 As shown, it includes: a memory 802, a processor 801, and a computer program of a data processing method stored in the memory 802 and executable on the processor 801, wherein:
[0113] The processor 801 is used to call the computer program stored in the memory 802 and execute the following steps:
[0114] Processor 801 executes, inputting the video stream to be processed into a pre-trained object detection network, obtaining a structured feature data sequence corresponding to the object to be processed contained in the video stream to be processed, wherein the object type of the object to be processed includes at least one of a motor vehicle type, a non-motor vehicle type, and a pedestrian type;
[0115] Slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy, and performing a first deduplication process on the sliced structured feature data sequence to obtain sliced data;
[0116] Performing hash processing on the shard data to obtain shard hash data of the object to be processed;
[0117] Based on the shard hash data, a second deduplication process is performed on the object to be processed to obtain a result of the quantity of the object to be processed contained in the video stream to be processed.
[0118] Optionally, the time slicing strategy includes a slicing duration. Before slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy, the method executed by the processor 801 further includes:
[0119] The segment durations corresponding to different object types of the objects to be processed are determined according to the speeds corresponding to the object types of the objects to be processed.
[0120] Optionally, the processor 801 executes the slicing of the structured feature data sequence of the object to be processed based on a preset time slicing strategy, including:
[0121] The structured feature data sequence is segmented according to the segmentation duration corresponding to the object type of the object to be processed.
[0122] Optionally, before slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy, the method executed by the processor 801 further includes:
[0123] For the same type of objects to be processed, extracting the first appearance duration of the first target in the structured feature data sequence corresponding to the same type of objects to be processed, where the first target is the first single target that appears in the structured feature data sequence corresponding to the same type of objects to be processed;
[0124] Extracting a second appearance duration of a second target from the structured feature data sequence corresponding to the object to be processed of the same type, where the appearance time of the second target is within the appearance time of the first target;
[0125] If there is a second appearance duration that is greater than the first appearance duration, determining a time slicing strategy corresponding to the structured feature data sequence of the object to be processed according to the second appearance duration;
[0126] If there is no second appearance duration greater than the first appearance duration, a time slicing strategy corresponding to the structured feature data sequence of the object to be processed is determined according to the first appearance duration.
[0127] Optionally, the processor 801 performs hash processing on the shard data to obtain shard hash data of the object to be processed, including:
[0128] Performing binary hash coding on each structured data in the sharded data to obtain a binary hash value of each structured data in the sharded data;
[0129] The binary hash value of each structured data in the shard data is sorted in chronological order from front to back to obtain the shard hash data of the object to be processed.
[0130] Optionally, the processor 801 performs the second deduplication processing on the object to be processed based on the shard hash data to obtain the number result of the object to be processed contained in the video stream to be processed, including:
[0131] Obtain the last N digits of the binary hash value, and convert the last N digits of the binary hash value into decimal to obtain the number of the binary hash value;
[0132] Maintain 2N counting containers, each counting container is numbered according to a decimal number;
[0133] According to the number of the binary hash value, the binary hash value is placed into a counting container with a corresponding number;
[0134] Deduplication is performed based on the first M bits of the binary value of each binary hash value in the counting container and the first M bits of the binary values of other binary hash values, to obtain the number of deduplicated binary hash values in each counting container;
[0135] The deduplicated quantities of all counting containers are added together to obtain the quantity result of the object to be processed under the corresponding time slicing strategy.
[0136] Optionally, the processor 801 performs the first deduplication processing on the fragmented structured feature data sequence, including:
[0137] In the current time slice n, extracting the third appearance duration of the third target from the structured feature data sequence corresponding to the object to be processed of the same type;
[0138] When the third appearance duration is less than the preset duration, judging whether there is a structured feature data sequence of the third target in the previous time slice n-1 and / or the next time slice n+1 according to the structured data corresponding to the third target;
[0139] If the structured feature data sequence of the third target exists in the previous time slice n-1 and / or the next time slice n+1, extracting the fourth appearance duration of the third target according to the structured feature data sequence of the third target;
[0140] If the fourth appearance duration is greater than the third appearance duration, deleting the structured feature data sequence of the third target from the current time slice n;
[0141] If the fourth appearance duration is shorter than the third appearance duration, the structured feature data sequence of the third target is deleted from the previous time slice n-1 and / or the next time slice n+1.
[0142] It should be noted that the electronic device provided in the embodiment of the present invention can be applied to devices such as smart phones, computers, servers, etc. that can perform data processing.
[0143] The electronic device provided by the embodiment of the present invention can implement each process implemented by the data processing method in the above method embodiment and can achieve the same beneficial effect. To avoid repetition, it will not be described here.
[0144] An embodiment of 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 computer program implements the various processes of the data processing method or the application-side data processing method provided by the embodiment of the present invention, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0145] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0146] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A data processing method, characterized in that: The following steps are involved: Inputting the video stream to be processed into a pre-trained object detection network to obtain a structured feature data sequence corresponding to the object to be processed contained in the video stream to be processed, wherein the object type of the object to be processed includes at least one of a motor vehicle type, a non-motor vehicle type, and a pedestrian type; Determining the slicing durations corresponding to different object types of the objects to be processed according to the speeds corresponding to the object types of the objects to be processed; Slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy, and performing a first deduplication process on the sliced structured feature data sequence to remove repeated structured data between the sliced data to obtain sliced data; Performing hash processing on the shard data to obtain shard hash data of the object to be processed; Based on the shard hash data, a second deduplication process is performed on the object to be processed to remove repeated structured data in the shard data, thereby obtaining a result of the number of objects to be processed contained in the video stream to be processed.
2. The method according to claim 1, characterized in that The step of slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy includes: The structured feature data sequence is segmented according to the segmentation duration corresponding to the object type of the object to be processed.
3. The method according to claim 1, characterized in that Before slicing the structured feature data sequence of the object to be processed based on a preset time slicing strategy, the method further includes: For the same type of objects to be processed, extracting the first appearance duration of the first target in the structured feature data sequence corresponding to the same type of objects to be processed, where the first target is the first single target that appears in the structured feature data sequence corresponding to the same type of objects to be processed; Extracting a second appearance duration of a second target from the structured feature data sequence corresponding to the object to be processed of the same type, where the appearance time of the second target is within the appearance time of the first target; If there is a second appearance duration that is greater than the first appearance duration, determining a time slicing strategy corresponding to the structured feature data sequence of the object to be processed according to the second appearance duration; If there is no second appearance duration greater than the first appearance duration, a time slicing strategy corresponding to the structured feature data sequence of the object to be processed is determined according to the first appearance duration.
4. The method according to any one of claims 1 to 3, characterized in that: The performing hash processing on the shard data to obtain shard hash data of the object to be processed includes: Performing binary hash coding on each structured data in the sharded data to obtain a binary hash value of each structured data in the sharded data; The binary hash value of each structured data in the shard data is sorted in chronological order from front to back to obtain the shard hash data of the object to be processed.
5. The method according to claim 4, characterized in that The second deduplication processing is performed on the object to be processed based on the shard hash data to obtain the number of the object to be processed contained in the video stream to be processed, including: Obtain the last N digits of the binary hash value, and convert the last N digits of the binary hash value into decimal to obtain the number of the binary hash value; Maintain 2N counting containers, each counting container is numbered according to a decimal number; According to the number of the binary hash value, the binary hash value is placed into a counting container with a corresponding number; Deduplication is performed based on the first M bits of the binary value of each binary hash value in the counting container and the first M bits of the binary values of other binary hash values, to obtain the number of deduplicated binary hash values in each counting container; The deduplicated quantities of all counting containers are added together to obtain the quantity result of the object to be processed under the corresponding time slicing strategy.
6. The method according to claim 5, characterized in that The first deduplication processing is performed on the fragmented structured feature data sequence, including: In the current time slice n, extracting the third appearance duration of the third target from the structured feature data sequence corresponding to the object to be processed of the same type; When the third appearance duration is less than the preset duration, judging whether there is a structured feature data sequence of the third target in the previous time slice n-1 and / or the next time slice n+1 according to the structured data corresponding to the third target; If the structured feature data sequence of the third target exists in the previous time slice n-1 and / or the next time slice n+1, extracting the fourth appearance duration of the third target according to the structured feature data sequence of the third target; If the fourth appearance duration is greater than the third appearance duration, deleting the structured feature data sequence of the third target from the current time slice n; If the fourth appearance duration is shorter than the third appearance duration, the structured feature data sequence of the third target is deleted from the previous time slice n-1 and / or the next time slice n+1.
7. A data processing device, characterized in that: The device comprises: A first processing module is used to input the video stream to be processed into a pre-trained object detection network to obtain a structured feature data sequence corresponding to the object to be processed contained in the video stream to be processed, wherein the object type of the object to be processed includes at least one of a motor vehicle type, a non-motor vehicle type and a pedestrian type; A first determination module, used to determine the segmentation durations corresponding to different object types of the object to be processed according to the speeds corresponding to the object types of the object to be processed; A sharding module, used to shard the structured feature data sequence of the object to be processed based on a preset time sharding strategy, and perform a first deduplication process on the sharded structured feature data sequence to remove repeated structured data between the sharded data to obtain sharded data; A second processing module is used to perform hash processing on the shard data to obtain shard hash data of the object to be processed; The third processing module is used to perform a second deduplication process on the object to be processed based on the shard hash data, remove repeated structured data in the shard data, and obtain the quantity result of the object to be processed contained in the video stream to be processed.
8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the data processing method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the data processing method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and system used for data management
CN104123309A
Video processing method and related device
WO2021175040A1