Data processing method and device, electronic equipment and medium
By obtaining and utilizing the data segment interval information and data segment types in the index information of the candidate data segment, and combining the corresponding data segments, the problem of low return of search results caused by the large number of candidate data segments and the distribution is scattered, and more efficient search result return and client display effects are achieved.
Patent Information
- Application Number
- CN202311713220.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-13
- Publication Date
- 2025-06-13
AI Technical Summary
During the data retrieval process, there are many candidate data segments and scattered distribution, resulting in lag, failure or slow transmission rate when the search results are returned, affecting the display effect of the client.
By obtaining data segment interval information from the index information of candidate data segments, combining the data segment type, the merging method is determined to reduce the number of data segments and the amount of index information data, thereby realizing the integration of search results.
It effectively reduces the number of data segments in the search results, reduces the amount of data in the index information, improves the efficiency of search results return, avoids the problem of search result return caused by the large and scattered candidate data segments, and facilitates the display of the client.
Smart Images

Figure CN120144807A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to a data processing method, apparatus, electronic device, and medium. Background Art
[0002] Data collection is generally carried out frame by frame over time. The collected data may be continuous in time or may be data segments with intervals. In addition, when storing the collected data, the data is generally divided into data segments and stored in storage units. For example, a video recorder stores video segments collected by multiple image collectors.
[0003] When retrieving stored data segments, there may be many data segments that meet the retrieval conditions, and their distribution in time is relatively scattered. At this time, when returning the retrieval results to the client, problems such as lag, failure, and slow transmission rate may occur due to the large number of data segments and index information. And the scattered data segments will affect the display effect on the client. Summary of the Invention
[0004] Embodiments of this application provide a data processing method, apparatus, electronic device, and medium to improve the efficiency of returning retrieval results and the display effect on the client.
[0005] According to one aspect of this application, a data processing method is provided. The method includes:
[0006] Retrieving candidate data segments whose data collection time is within the retrieval time period;
[0007] Obtaining data segment interval information from the index information of the candidate data segments; wherein, the data segment interval information reflects the time interval between adjacent candidate data segments;
[0008] Determining a merging method for the candidate data segments according to the data segment interval information and the data segment type of the candidate data segments.
[0009] According to one aspect of this application, a data processing apparatus is provided. The apparatus includes:
[0010] A retrieval module, configured to retrieve candidate data segments whose data collection time is within the retrieval time period;
[0011] An obtaining module, configured to obtain data segment interval information from the index information of the candidate data segments; wherein, the data segment interval information reflects the time interval between adjacent candidate data segments;
[0012] A merging method determination module, configured to determine a merging method for the candidate data segments according to the data segment interval information and the data segment type of the candidate data segments.
[0013] According to another aspect of the present application, there is provided an electronic device, which includes:
[0014] at least one processor; and
[0015] a memory data - processing connected to the at least one processor; wherein,
[0016] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data - processing method of any embodiment of the present application.
[0017] According to another aspect of the present application, there is provided a computer - readable storage medium storing computer instructions for causing a processor to implement the data - processing method of any embodiment of the present application when executed.
[0018] The technical solution of the embodiment of the present application retrieves candidate data segments whose data acquisition time is within the retrieval time period; obtains data segment interval information from the index information of the candidate data segments; wherein, the data segment interval information reflects the time interval between adjacent candidate data segments; and determines the merging method for the candidate data segments according to the data segment interval information and the data segment type of the candidate data segments. The above - mentioned solution can merge the candidate data segments according to the data segment interval information and the data segment type in the index information when there are many retrieved candidate data segments and they are scattered, reducing the number of data segments in the retrieval result, thereby reducing the amount of index information data, realizing the integration of the retrieval result, avoiding problems such as lag and failure when returning the retrieval result due to a large number of scattered candidate data segments, and facilitating the client to draw and display the retrieval result.
[0019] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0021] Figure 1 is a flowchart of a data - processing method provided in Embodiment 1 of the present application;
[0022] Figure 2It is a flowchart of a data processing method provided in the second embodiment of the present application;
[0023] Figure 3 It is a flowchart of a data processing method provided in the third embodiment of the present application;
[0024] Figure 4 It is a schematic structural diagram of a data processing device provided in the fourth embodiment of the present application;
[0025] Figure 5 It is a schematic structural diagram of an electronic device provided in the fifth embodiment of the present application. Detailed implementation manners
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0027] It should be noted that the terms "first", "second", "third", "fourth", "actual", "preset", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0028] Embodiment 1
[0029] Figure 1 It is a flowchart of a data processing method provided in the first embodiment of the present application. The embodiments of the present application are applicable to the situation of integrating and processing multiple data segments. This method can be executed by a data processing device, which can be implemented in the form of hardware and / or software, and the data processing device can be configured in an electronic device. As Figure 1 shown, this method includes:
[0030] S110. Retrieve candidate data segments whose data acquisition time is within the retrieval time period.
[0031] Among them, the data acquisition time is the time when the data acquisition segment is acquired, which can be recorded and provided by the data acquisition device. For example, when an image collector acquires an image, the time when the image is acquired can be recorded simultaneously as the acquisition time of the image. The retrieval time period is the time period passed in by the client, which can be set by the user and used as the query basis for the data segment. In the embodiment of the present application, the execution subject can be a data processing device, and the data processing device can receive the data acquired by the data acquisition device and store it. When the data is an image or a video, the data acquisition device is an image collector, and the data processing device can be a video recorder.
[0032] Exemplarily, the user can set the retrieval time period through the client, and the retrieval time period is passed into the data processing device through the terminal where the client is located as a retrieval condition. The data processing device retrieves the candidate data segments whose data acquisition time is within the retrieval time period as the retrieval result.
[0033] S120. Obtain data segment interval information from the index information of the candidate data segments; wherein, the data segment interval information reflects the time interval between adjacent candidate data segments.
[0034] Among them, the data segment interval information is determined according to the time interval between adjacent candidate data segments to reflect the time interval. The time interval can be the time between the end time of the previous candidate data segment and the start time of the next candidate data segment among two candidate data segments. The data acquisition time of the previous candidate data segment is earlier than that of the next candidate data segment.
[0035] In the embodiment of the present application, when storing the acquired data segments of the data acquisition device, the data segment interval information can be determined in advance according to the time interval between adjacent acquired data segments, and the data segment interval information can be added to the index information of the acquired data segment, which can be added to the index information of the previous acquired data segment or the index information of the next acquired data segment. After retrieving the candidate data segments according to the retrieval time period, the number of candidate data segments may be large, and failures or lags may occur during the process of returning the retrieval results to the client. The data segment interval information can be obtained from the index information of the candidate data segments to integrate the large number of candidate data segments according to the data segment interval information, thereby improving the return efficiency and success rate. Specifically, when generating the index information, according to a pre-specified protocol, it can be determined what information is placed in which data bit. For example, the data segment interval information is placed in the fourth data bit, and when retrieving, the information in the fourth data bit of the index information is directly obtained to get the data segment interval information.
[0036] S130. Determine the merging method for the candidate data segments according to the data segment interval information and the data segment type of the candidate data segments.
[0037] Among them, the data segment type can be defined according to the application scenario when the candidate data segment is collected, and can be recorded in the index information of the candidate data segment. In the scenario of image collection, the data segment is a video segment. The types of video segments can be divided into regular videos and special videos. Regular videos are video segments obtained from a continuously recorded video process, and special videos are videos recorded only when a certain specific situation occurs, such as alarm videos, face tracking videos, etc. Alarm videos are videos for a period of time before and after an alarm is triggered when there is an alarm event. If there is no alarm event, there is no video segment for this time period. Face tracking videos are videos recorded when a face appears in the monitoring screen and end when the face disappears from the monitoring screen.
[0038] In the embodiments of the present application, it is possible to determine whether adjacent candidate data segments are close in the time dimension according to the data segment interval information. If they are close, it is possible to consider merging adjacent candidate data segments into one data segment to integrate the candidate data segments, which is convenient for the return and transmission of retrieval results. In addition, the data segment types of candidate data segments may be different, and it is necessary to consider whether the overall reflection of the data segment type is affected after merging. Therefore, it is necessary to combine the data segment interval time and the data segment types of candidate data segments to determine the merging method of candidate data segments. For example, when the data segment interval time meets the merging requirements, adjacent candidate data segments with the same data segment type are preferentially merged. It can also be that, when the data segment types of adjacent candidate data segments are inconsistent, even if the data segment interval time meets the merging requirements, the adjacent candidate data segments are not merged. It can also be that when the data segment interval time meets the merging requirements and the data segment types of adjacent candidate data segments are inconsistent, the merging method of the selected data segments is determined according to the number and / or duration of candidate data segments of different data segment types among all candidate data segments whose data segment interval time meets the merging requirements, so that the candidate data segments can be integrated and the data segment type of the merged data segment can be reflected.
[0039] In the embodiments of the present application, determining whether the data segment interval information of candidate data segments meets the merging requirements can be to compare the data segment interval information with fixed interval information set in advance, or to compare it with preset interval information carried when the client queries. The preset interval information is determined according to the time stamp scale of the client data display and the display window resolution.
[0040] In the technical solution of the embodiment of the present application, candidate data segments whose data collection time is within the retrieval time period are retrieved; data segment interval information is obtained from the index information of the candidate data segments; wherein, the data segment interval information reflects the time interval between adjacent candidate data segments; according to the data segment interval information and the data segment type of the candidate data segments, a merging method for the candidate data segments is determined. The above solution can merge candidate data segments according to the data segment interval information and data segment type in the index information when there are many retrieved candidate data segments and they are scattered, reducing the number of data segments in the retrieval result, thereby reducing the amount of index information data, realizing the integration of the retrieval result, avoiding problems such as lag and failure when returning the retrieval result due to many and scattered candidate data segments, and facilitating the client to draw and display the retrieval result.
[0041] Embodiment 2
[0042] Figure 2 The flowchart of a data processing method provided by the second embodiment of the present application. The second embodiment of the present application is optimized based on the above embodiment. For the solutions not described in detail in the second embodiment of the present application, refer to the above embodiment. As Figure 2 shown, the method of the second embodiment of the present application specifically includes the following steps:
[0043] S210. Retrieve candidate data segments whose data collection time is within the retrieval time period.
[0044] S220. Obtain data segment interval information from the index information of the candidate data segments; wherein, the data segment interval information reflects the time interval between adjacent candidate data segments.
[0045] S230. If there is data segment interval information less than the preset interval information, then use the adjacent candidate data segments represented by the data segment interval information as adjacent target data segments.
[0046] Among them, the preset interval information is determined according to the time required for the client to display data units. For example, in the case of the client displaying a video segment, image frames need to be displayed in the display window of the client. The display process is to refresh and display pixel by pixel. One pixel is a data unit. The preset interval time can be determined according to the time required for the client to display one pixel. For example, it can be set as the time required to display a preset number of pixels. The time required for the client to display one pixel can reflect the time required for the client to refresh the picture in the display window. Comparing the data segment interval information with the preset interval information can reflect whether the next candidate data segment is immediately displayed after the previous candidate data segment in adjacent candidate data segments ends. If not, it is necessary to evaluate how many pixels of the last frame of the previous candidate data segment need to be refreshed by the client before the next candidate data segment can be continued to be displayed, and then evaluate whether adjacent candidate data segments need to be merged. If the data segment interval information is less than the preset interval information, it means that during the display interruption of adjacent candidate data segments, the client needs to refresh fewer pixels to wait for the display of the next candidate data segment. At this time, the interval between adjacent candidate data segments can be ignored, and adjacent candidate data segments can be merged to achieve continuous display. The preset number can be determined according to the actual situation, such as 10, 20, 30, etc. Specifically, when the client queries data segments, it can determine the user's setting of the data display timeline and determine the time corresponding to the minimum scale of the timeline. Divide the time corresponding to the minimum scale by the resolution of the data display window to obtain the time required to display one pixel, and then determine the preset interval information. The client carries the retrieval time period and the preset interval information to perform data retrieval from the data processing device. When the user adjusts the timeline, such as stretching or shortening it, the minimum scale will change, and the preset interval information will change accordingly. The client then carries the retrieval time period and the changed preset interval information to perform data retrieval from the data processing device.
[0047] Exemplarily, compare the data segment interval information with the preset interval information. If the data segment interval information is less than the preset interval information, it means that in the time dimension, the two candidate data segments meet the requirements for merging. For example, the data segment interval information is 2 seconds, and the preset interval information is 5 seconds. The data segment interval information is less than the preset interval information, indicating that the time interval between the adjacent candidate data segments corresponding to the data segment interval information is relatively small, and it meets the requirements for merging from the time level. The adjacent candidate data segments are used as adjacent target data segments for subsequent judgment.
[0048] S240. Determine the merging method of the adjacent target data segments according to the data segment types of the adjacent target data segments.
[0049] Exemplarily, in the case where the adjacent target data segments meet the requirements for merging in the time dimension, it is also necessary to determine the merging method of the adjacent target data segments according to the data segment types of the adjacent target data segments.
[0050] In the embodiment of the present application, according to the data segment types of adjacent target data segments, the merging method of adjacent target data segments is determined, including:
[0051] If the data segment types of adjacent target data segments are the same, the adjacent target data segments are merged to obtain a new candidate data segment, and the data segment type of the adjacent target data segments is used as the data segment type of the new candidate data segment;
[0052] If the data segment types of adjacent target data segments are different, the quantity ratio and duration ratio of the first type of target data segments and the second type of target data segments are counted;
[0053] According to the quantity ratio and the duration ratio, the merging method of adjacent target data segments is determined.
[0054] In the embodiment of the present application, when the data segment is a video segment, the first type may be normal video, and the second type may be alarm video. The number of adjacent target data segments may be at least two. For example, if the data segment interval information between the first candidate data segment and the second candidate data segment is less than the preset interval information, and the data segment interval information between the second candidate data segment and the third candidate data segment is less than the preset interval information, then the first candidate data segment, the second candidate data segment, and the third candidate data segment are adjacent target data segments. If the data segment interval information between the first candidate data segment and the second candidate data segment is less than the preset interval information, and the data segment interval information between the second candidate data segment and the third candidate data segment is greater than the preset interval information, and the data segment interval information between the third candidate data segment and the fourth candidate data segment is less than the preset interval information, then the first candidate data segment and the second candidate data segment are adjacent target data segments, and the third candidate data segment and the fourth candidate data segment are adjacent target data segments, and the subsequent merging processes are respectively executed.
[0055] Exemplarily, if the data segment types of adjacent target data segments are the same, after merging the adjacent target data segments into one data segment, it can still be marked as the original data segment type, and the data segment type may not change. The adjacent target data segments can be directly merged to obtain a new candidate data segment, and the data type of the adjacent target data segments is used as the data segment type of the new candidate data segment and marked in the index information of the new candidate data segment. If the data segment types of adjacent target data segments are different, then count the number and duration of the target data segments belonging to the first type and the number and duration of the target data segments belonging to the second type among all adjacent target data segments, and determine the quantity ratio between the number of target data segments belonging to the first type and the number of target data segments belonging to the second type, and determine the duration ratio between the duration of the target data segments belonging to the first type and the duration of the target data segments belonging to the second type. Determine the distribution of the first type of target data segments and the second type of target data segments in terms of quantity and in terms of time according to the quantity ratio and the duration ratio, and further determine the merging method of the adjacent target data segments.
[0056] In the embodiments of the present application, determining the merging method of adjacent target data segments according to the quantity ratio and the duration ratio includes:
[0057] If the quantity ratio is greater than a first preset ratio and the duration ratio is greater than a second preset ratio, then merge the adjacent target data segments to obtain a new candidate data segment, and use the first type as the data segment type of the new candidate data segment;
[0058] If the quantity ratio is less than a third preset ratio and the duration ratio is less than a fourth preset ratio, then merge the adjacent target data segments to obtain a new candidate data segment, and use the second type as the data segment type of the new candidate data segment;
[0059] Otherwise, determine the overall ratio between the quantity ratio and the duration ratio;
[0060] If the overall ratio is greater than a fifth preset ratio, then merge the adjacent target data segments to obtain a new candidate data segment, and use the second type as the data segment type of the new candidate data segment;
[0061] If the overall ratio is less than a sixth preset ratio, then merge the adjacent target data segments to obtain a new candidate data segment, and use the first type as the data segment type of the new candidate data segment;
[0062] If the overall ratio is less than or equal to the fifth preset ratio and greater than or equal to the sixth preset ratio, then do not merge the adjacent target data segments.
[0063] Among them, the first preset ratio, the second preset ratio, the third preset ratio, the fourth preset ratio, the fifth preset ratio, and the sixth preset ratio can be determined according to the actual situation. Among them, the first preset ratio is greater than the third preset ratio, the second preset ratio is greater than the fourth preset ratio, and the fifth preset ratio is greater than the sixth preset ratio. For example, the first preset ratio is 5, the third preset ratio is 1 / 5, the second preset ratio is 4, the fourth preset ratio is 1 / 4, the fifth preset ratio is 6, and the sixth preset ratio is 1 / 6. The overall ratio is the quantity ratio divided by the duration ratio. Exemplarily, if the quantity ratio is greater than the first preset ratio and the duration ratio is greater than the second preset ratio, it indicates that the number of target data segments of the first type is large and the time is long, which is relatively representative among all adjacent target data segments. Therefore, the adjacent target data segments are merged as a new candidate data segment, and the first type is used as the data segment type of the new candidate data segment and added to the index information of the new candidate data segment. If the quantity ratio is less than the third preset ratio and the duration ratio is less than the fourth preset ratio, it indicates that the number of target data segments of the second type is large and the time is long, which is relatively representative among all adjacent target data segments. Therefore, the adjacent target data segments are merged as a new candidate data segment, and the second type is used as the data segment type of the new candidate data segment and added to the index information of the new candidate data segment. If the quantity ratio and the duration ratio do not meet the above conditions, the overall ratio between the quantity ratio and the duration ratio is determined. If the overall ratio is greater than the fifth preset ratio, it indicates that the target data segments of the first type have the characteristics of a large number and a short time compared with the target data segments of the second type, and are more scattered. The target data segments of the second type are more representative. The adjacent target data segments are merged as a new candidate data segment, and the second type is used as the data segment type of the new candidate data segment and added to the index information of the new candidate data segment. If the overall ratio is less than the sixth preset ratio, it indicates that the target data segments of the second type have the characteristics of a large number and a short time compared with the target data segments of the first type, and are more scattered. The target data segments of the first type are more representative. Then the adjacent target data segments are merged as a new candidate data segment, and the first type is used as the data segment type of the new candidate data segment and added to the index information of the new candidate data segment. If the overall ratio is less than or equal to the fifth preset ratio and greater than or equal to the sixth preset ratio, it indicates that the number of target data segments of the first type and the second type does not differ much, and the duration does not differ much, with similar quantity and duration characteristics, and it is difficult to determine the more representative data segment type. Therefore, the adjacent target data segments are not merged to retain the data segment type characteristics of the target data segments.
[0064] In the embodiment of the present application, the method further includes:
[0065] After merging adjacent target data segments to obtain new candidate data segments, count the number of target data segments included in the new candidate data segments;
[0066] Record the number of target data segments included in the new candidate data segments in the index information of the new candidate data segments.
[0067] In the embodiments of the present application, after merging adjacent target data segments, the number of target data segments included in the new candidate data segments can be counted, and the number of target data segments included in the new candidate data segments is recorded in the index information of the new candidate data segments to clarify how many target data segments the new candidate data segments are merged from.
[0068] Exemplarily, candidate data segment 1: 13586:20231001080000-20231001080500:Alarm:30s:1, candidate data segment 2: 13587:20231001080502-20231001090002:Alarm:2s:1. Among them, 13586 and 13587 represent identifiers, 20231001080000-20231001080500 and 20231001081522-20231001090002 represent data acquisition times, Alarm represents that the data segment type is alarm video, 30s and 2s represent time interval information, and 1 represents the number of data segments included. If the time interval information between candidate data segment 2 and candidate data segment 1 is less than the preset interval information, the two candidate data segments are used as target data segments. If the data segment types of target data segment 1 and target data segment 2 are the same, then target data segment 1 and target data segment 2 are merged to obtain a new candidate data segment: 13586:20231001080000-20231001090002:Alarm:30s:2. 13586 represents the identifier of the new candidate data segment, 20231001080000-20231001090002 represents the data acquisition time, Alarm represents that the data segment type is alarm video, 30s represents that the data segment interval information is 30 seconds, and 2 represents that the new candidate data segment is merged from two target data segments. Before merging, the two candidate data segments correspond to two index information. After merging into one new candidate data segment, it only corresponds to one index information, reducing the data volume of the index information and improving the retrieval result return efficiency.
[0069] In the embodiments of the present application, the query and merge processes can be carried out simultaneously. If a new candidate data segment is generated, or a new candidate data segment is retrieved, the above-mentioned embodiment solution is executed again for merging.
[0070] The embodiment of the present application provides a data processing method. If there is data segment interval information less than the preset interval information, the adjacent candidate data segments represented by the data segment interval information are used as adjacent target data segments; according to the data segment types of the adjacent target data segments, the merging method of the adjacent target data segments is determined, which can effectively integrate the candidate data segments by combining the time interval and the data segment type, reduce the data volume of the index information, improve the retrieval result return efficiency, avoid the problem of carding failure when returning the retrieval result due to a large number of scattered candidate data segments, and facilitate the client to draw and display the retrieval result.
[0071] Embodiment III
[0072] Figure 3 It is a flowchart of a data processing method provided by Embodiment III of the present application. The embodiment of the present application is optimized based on the above embodiment. For the solutions not described in detail in the embodiment of the present application, refer to the above embodiment. As Figure 3 shown, the method of the embodiment of the present application specifically includes the following steps:
[0073] S310. Determine the time interval between the end time of the previous acquisition data segment and the start time of the next acquisition data segment in the adjacent acquisition data segments.
[0074] In the embodiment of the present application, if the data processing device acquires the acquisition data segments transmitted by the data acquisition device, the time interval between the adjacent acquisition data segments can be determined as the time interval between the end time of the previous acquisition data segment and the start time of the next acquisition data segment.
[0075] S320. Determine the data segment interval information according to the time interval, and add the data segment interval information to the index information of the data segment to be stored; wherein, the data segment to be stored is the previous acquisition data segment or the next acquisition data segment.
[0076] Exemplarily, the time interval is the time interval between adjacent acquired data segments. The data segment time interval reflects the time interval between adjacent acquired data segments and can be added to the index information of any one of the adjacent acquired data segments. Specifically, when the data processing device obtains an acquired data segment, it can calculate the time interval between the start time of the acquired data segment and the end time of the previous acquired data segment, determine the data segment interval information according to the time interval, and add the data segment interval information to the index information of the acquired data segment. It is also possible to cache the acquired data segment when it is obtained. When the subsequent acquired data segment is obtained, calculate the time interval between the end time of the cached acquired data segment and the start time of the subsequent acquired data segment, determine the data segment interval information according to the time interval, add the time period interval information to the index information of the cached acquired data segment, and persistently store the cached acquired data segment and the corresponding index information.
[0077] In the embodiments of the present application, determining the data segment interval information according to the time interval includes:
[0078] Determining the preset time range in which the time interval is located;
[0079] According to the association relationship between the preset time range and the preset data segment interval information, determining the data segment interval information corresponding to the time interval; or,
[0080] Determining the time interval as the data segment interval information.
[0081] In an implementable solution, in order to facilitate subsequent comparison of the data segment interval information with the preset interval information, the time interval can be mapped to another value as the data segment interval information. The association relationship between the preset time range and the preset data segment interval information can be determined in advance. For example, [a, b) is associated with 1 second, [b, c) is associated with 5 seconds, and [c, d) is associated with 30 seconds. Determine which preset time range the time interval is located in, and determine the corresponding data segment interval information according to the association relationship. For example, if the time interval is within [b, c), the data segment interval information is 5 seconds. The mapping relationship depends on the scale of the user's merging evaluation. If it is desired to perform merging when the data segment interval information is large, the preset data segment interval information for the same preset time range is set to a larger value. If merging is only performed when the data segment interval information is small, the preset data segment interval information for the same preset time range is set to a smaller value.
[0082] In another implementable solution, the time interval can also be directly determined as the data segment interval information.
[0083] S330. Store the data segment to be stored and the index information.
[0084] S340. Retrieve candidate data segments whose data acquisition time is within the retrieval time period.
[0085] S350. Obtain data segment interval information from the index information of the candidate data segments; wherein, the data segment interval information reflects the time interval between adjacent candidate data segments.
[0086] S360. Determine the merging method for the candidate data segments according to the data segment interval information and the data segment type of the candidate data segments.
[0087] The embodiment of the present application provides a data processing method, which determines the time interval between the end time of the previous acquisition data segment and the start time of the next acquisition data segment among adjacent acquisition data segments; determines the data segment interval information according to the time interval, and adds the data segment interval information to the index information of the data segment to be stored; wherein, the data segment to be stored is the previous acquisition data segment or the next acquisition data segment; stores the data segment to be stored and the index information. Through the above storage method, the data segment interval information can be introduced into the index information, so as to facilitate the integration of candidate data segments according to the data segment interval information and the data segment type during the retrieval process.
[0088] Embodiment Four
[0089] Figure 4 It is a schematic structural diagram of a data processing device provided in Embodiment Four of the present application. This device can execute the data processing method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing the method. As Figure 4 shown, the device includes:
[0090] A retrieval module 410, configured to retrieve candidate data segments whose data acquisition time is within the retrieval time period;
[0091] An acquisition module 420, configured to obtain data segment interval information from the index information of the candidate data segments; wherein, the data segment interval information reflects the time interval between adjacent candidate data segments;
[0092] A merging method determination module 430, configured to determine the merging method for the candidate data segments according to the data segment interval information and the data segment type of the candidate data segments.
[0093] In the embodiment of the present application, the merging method determination module 430 is specifically configured to:
[0094] If there is data segment interval information less than the preset interval information, use the adjacent candidate data segments represented by the data segment interval information as adjacent target data segments;
[0095] Determine the merging method of adjacent target data segments according to the data segment types of the adjacent target data segments;
[0096] Wherein, the preset interval information is determined according to the time required for the client to display data units.
[0097] In the embodiment of the present application, the merging method determination module 430 is specifically configured to:
[0098] If the data segment types of adjacent target data segments are the same, then merge the adjacent target data segments to obtain a new candidate data segment, and use the data segment type of the adjacent target data segments as the data segment type of the new candidate data segment;
[0099] If the data segment types of adjacent target data segments are different, then count the quantity ratio and duration ratio of the first type of target data segments and the second type of target data segments;
[0100] Determine the merging method of adjacent target data segments according to the quantity ratio and the duration ratio.
[0101] In the embodiment of the present application, the merging method determination module 430 is specifically configured to:
[0102] If the quantity ratio is greater than a first preset ratio and the duration ratio is greater than a second preset ratio, then merge the adjacent target data segments to obtain a new candidate data segment, and use the first type as the data segment type of the new candidate data segment;
[0103] If the quantity ratio is less than a third preset ratio and the duration ratio is less than a fourth preset ratio, then merge the adjacent target data segments to obtain a new candidate data segment, and use the second type as the data segment type of the new candidate data segment;
[0104] Otherwise, determine the overall ratio between the quantity ratio and the duration ratio;
[0105] If the overall ratio is greater than a fifth preset ratio, then merge the adjacent target data segments to obtain a new candidate data segment, and use the second type as the data segment type of the new candidate data segment;
[0106] If the overall ratio is less than a sixth preset ratio, then merge the adjacent target data segments to obtain a new candidate data segment, and use the first type as the data segment type of the new candidate data segment;
[0107] If the overall ratio is less than or equal to the fifth preset ratio and greater than or equal to the sixth preset ratio, then do not merge the adjacent target data segments.
[0108] In the embodiment of the present application, the device further includes:
[0109] A time interval determination module, configured to determine a time interval between the end time of the previous acquisition data segment and the start time of the subsequent acquisition data segment in adjacent acquisition data segments;
[0110] An addition module, configured to determine data segment interval information according to the time interval, and add the data segment interval information to the index information of the data segment to be stored; wherein, the data segment to be stored is the previous acquisition data segment or the subsequent acquisition data segment;
[0111] A storage module, configured to store the data segment to be stored and the index information.
[0112] In an embodiment of the present application, the addition module is specifically configured to:
[0113] Determine a preset time range in which the time interval is located;
[0114] According to the association relationship between the preset time range and the preset data segment interval information, determine the data segment interval information corresponding to the time interval; or,
[0115] Determine the time interval as the data segment interval information.
[0116] In an embodiment of the present application, the device method further includes:
[0117] A quantity statistics module, configured to, after merging adjacent target data segments to obtain a new candidate data segment, count the number of target data segments included in the new candidate data segment;
[0118] A recording module, configured to record the number of target data segments included in the new candidate data segment in the index information of the new candidate data segment.
[0119] A data processing device provided by an embodiment of the present application can execute a data processing method provided by any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method.
[0120] Embodiment Five
[0121] Figure 5The structural schematic diagram of an electronic device 10 that can be used to implement the embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described herein and / or claimed.
[0122] As Figure 5 shown, the electronic device 10 includes at least one processor 11, and a memory that is data - processing connected to the at least one processor 11, such as a read - only memory (ROM) 12, a random - access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by the at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read - only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random - access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0123] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a data - processing unit 19, such as a network card, a modem, a wireless data - processing transceiver, etc. The data - processing unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0124] The processor 11 can be various general - purpose and / or special - purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial - intelligence (AI) computing chips, various processors running machine - learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the data - processing method.
[0125] In some embodiments, the data processing method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the data processing unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the data processing method by any other suitable means (e.g., by means of firmware).
[0126] The various embodiments of the systems and techniques described above in this document may be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0127] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs may be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on the remote machine or server.
[0128] In the context of this application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0129] To provide for interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic, speech, or tactile input).
[0130] The systems and techniques described herein can be implemented in a computing system that includes backend components (such as, for example, a data server), or a computing system that includes middleware components (such as, for example, an application server), or a computing system that includes frontend components (such as, for example, a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data processing (such as, for example, a data processing network). Examples of the data processing network include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0131] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a data processing network. The relationship between the client and the server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0132] It should be understood that various forms of processes shown above can be used, steps can be reordered, added or deleted. For example, the steps described in this application can be executed in parallel, sequentially or in different orders, as long as the information expected by the technical solution of this application can be achieved, and no limitation is made herein.
[0133] The above specific embodiments do not constitute a limitation on the protection scope of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of this application shall be included within the protection scope of this application.
Claims
1. A data processing method, characterized in that, the method includes: retrieving candidate data segments whose data acquisition time is within the retrieval time period; obtaining data segment interval information from the index information of the candidate data segments; wherein, the data segment interval information reflects the time interval between adjacent candidate data segments; determining the merging method for the candidate data segments according to the data segment interval information and the data segment type of the candidate data segments.
2. The method according to claim 1, characterized in that, determining the merging method for the candidate data segments according to the data segment interval information and the data segment type of the candidate data segments, includes: if there is data segment interval information less than the preset interval information, then taking the adjacent candidate data segments represented by the data segment interval information as adjacent target data segments; determining the merging method for the adjacent target data segments according to the data segment type of the adjacent target data segments; wherein, the preset interval information is determined according to the time required for the client to display data units.
3. The method according to claim 2, characterized in that, determining the merging method for the adjacent target data segments according to the data segment type of the adjacent target data segments, includes: if the data segment types of the adjacent target data segments are the same, then merging the adjacent target data segments to obtain a new candidate data segment, and taking the data segment type of the adjacent target data segments as the data segment type of the new candidate data segment; if the data segment types of the adjacent target data segments are different, then counting the quantity ratio and duration ratio of the first type of target data segments and the second type of target data segments; determining the merging method for the adjacent target data segments according to the quantity ratio and the duration ratio.
4. The method according to claim 3, characterized in that, determining the merging method for the adjacent target data segments according to the quantity ratio and the duration ratio, includes: if the quantity ratio is greater than the first preset ratio and the duration ratio is greater than the second preset ratio, then merging the adjacent target data segments to obtain a new candidate data segment, and taking the first type as the data segment type of the new candidate data segment; if the quantity ratio is less than the third preset ratio and the duration ratio is less than the fourth preset ratio, then merging the adjacent target data segments to obtain a new candidate data segment, and taking the second type as the data segment type of the new candidate data segment; otherwise, determining the overall ratio between the quantity ratio and the duration ratio; if the overall ratio is greater than the fifth preset ratio, then merging the adjacent target data segments to obtain a new candidate data segment, and taking the second type as the data segment type of the new candidate data segment; if the overall ratio is less than the sixth preset ratio, then merging the adjacent target data segments to obtain a new candidate data segment, and taking the first type as the data segment type of the new candidate data segment; if the overall ratio is less than or equal to the fifth preset ratio and greater than or equal to the sixth preset ratio, then not merging the adjacent target data segments.
5. The method according to claim 1, characterized in that, the method further includes: Determine the time interval between the end time of the previous acquisition data segment and the start time of the subsequent acquisition data segment in adjacent acquisition data segments; Determine data segment interval information according to the time interval, and add the data segment interval information to the index information of the data segment to be stored; wherein, the data segment to be stored is the previous acquisition data segment or the subsequent acquisition data segment; Store the data segment to be stored and the index information.
6. The method according to claim 5, wherein, Determining data segment interval information according to the time interval includes: Determine the preset time range in which the time interval is located; Determine the data segment interval information corresponding to the time interval according to the association relationship between the preset time range and the preset data segment interval information; or, Determine the time interval as the data segment interval information.
7. The method according to claim 2, wherein, The method further includes: After merging adjacent target data segments to obtain a new candidate data segment, count the number of target data segments included in the new candidate data segment; Record the number of target data segments included in the new candidate data segment in the index information of the new candidate data segment.
8. A data processing device, wherein, The device includes: A retrieval module for retrieving candidate data segments whose data acquisition time is within the retrieval time period; An acquisition module for acquiring data segment interval information from the index information of the candidate data segment; wherein, the data segment interval information reflects the time interval between adjacent candidate data segments; A merging method determination module for determining the merging method of the candidate data segments according to the data segment interval information and the data segment type of the candidate data segments.
9. An electronic device, wherein, The electronic device includes: At least one processor; and A memory data - processing connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor can execute the data processing method according to any one of claims 1 - 7.
10. A computer - readable storage medium, wherein, The computer - readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the data processing method according to any one of claims 1 - 7 is implemented.