A method and device for generating traceable videos
By using a heterogeneous database architecture of recent and historical databases in the system that generates traceable videos, calling data from the corresponding databases according to the traceable time nodes and assembling videos, the problem of low data retrieval and query efficiency in the prior art is solved, and the efficiency of generating traceable videos is improved.
Patent Information
- Application Number
- CN202211337467.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2042-10-28
AI Technical Summary
When generating traceable videos, the prior art requires storing all user behavior data in the intranet storage area, resulting in low retrieval and query efficiency, thereby reducing the efficiency of generating traceable videos.
Using a heterogeneous database architecture of recent databases and historical databases, the recent database stores the complete data required for videos within the preset backtracking time range, and the historical database stores data outside the preset backtracking time range. According to the backtracking time node, the required data is called from the corresponding database and the video is assembled to generate a backtracking video.
By storing data from different backtracking time ranges in different databases, the efficiency of obtaining the complete data required for video is improved, and thus the efficiency of generating backtracking videos is improved.
Smart Images

Figure CN115695914B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a method and device for generating a traceable video. Background Art
[0002] With the development requirements of the client side in the Internet finance field, it is usually necessary to collect and trace the user behaviors of the client application. Specifically, a traceable video is generated based on the user behaviors, and the behavior tracing is performed based on the traceable video.
[0003] Currently, the way to generate a traceable video is to first obtain user behavior data, and then store the user behavior data in the intranet storage area. After obtaining a traceability request, the corresponding user behavior data is retrieved from the intranet storage area, and a traceback video is generated based on the user behavior data.
[0004] However, this method stores all the user behavior data in the intranet storage area, and the efficiency of retrieving and querying the required user behavior data from the intranet storage area is low, thus resulting in a low efficiency of generating a traceable video. Summary of the Invention
[0005] To solve the above technical problems, this application provides a method and device for generating a traceable video, which can improve the generation efficiency of the traceable video.
[0006] To achieve the above object, the technical solutions provided by this application are as follows:
[0007] This application provides a method for generating a traceable video, and the method includes:
[0008] Receiving a traceable video query request; the traceable video query request includes a traceback time node;
[0009] Determining a target database from a recent database and a historical database according to the traceback time node, and calling the complete data required for the video corresponding to the traceback time node from the target database; the recent database stores the complete data required for the video within a preset traceback time range, and the historical database stores the complete data required for the video outside the preset traceback time range;
[0010] Assembling the complete data required for the video corresponding to the traceback time node to generate a traceable video.
[0011] Optionally, before receiving the traceable video query request, the method further includes:
[0012] Collecting user behavior data in the target client application and page fixed data of the target client application;
[0013] Integrate the user behavior data and the page fixed data to obtain the complete data required for the video;
[0014] Store the complete data required for the video in the recent database;
[0015] Based on the called batch scheduling component, transfer the complete data required for the video outside the preset retrospective time range in the recent database to the historical database.
[0016] Optionally, collecting the user behavior data in the target client application and the page fixed data of the target client application includes:
[0017] Based on the collection plug-in in the target client application, collect the user behavior data in the target client application by means of data embedding, and collect the page fixed data of the target client application by means of web crawling.
[0018] Optionally, integrating the user behavior data and the page fixed data to obtain the complete data required for the video includes:
[0019] Eliminate the abnormal data in the user behavior data to obtain the user behavior data after eliminating the abnormal data;
[0020] Integrate the user behavior data after eliminating the abnormal data and the page fixed data according to the client version number information to obtain the complete data required for the video.
[0021] Optionally, based on the called batch scheduling component, transferring the complete data required for the video outside the preset retrospective time range in the recent database to the historical database includes:
[0022] Based on the called batch scheduling component, transfer the complete data required for the video outside the preset retrospective time range and outside the preset query frequency range in the recent database to the historical database.
[0023] Optionally, the traceable video query request further includes a query frequency; determining the target database from the recent database and the historical database according to the retrospective time node includes:
[0024] Determine the target database from the recent database and the historical database according to the retrospective time node and the query frequency.
[0025] Optionally, the recent database is a MongoDB database and the historical database is an Elasticsearch database.
[0026] This application also provides a method for generating a traceable video, and the method includes:
[0027] A receiving unit for receiving a retrievable video query request; the retrievable video query request includes a retrospective time node;
[0028] A determining unit for determining a target database from a recent database and a historical database according to the retrospective time node, and calling complete data required for the video corresponding to the retrospective time node from the target database; the recent database stores complete data required for videos within a preset retrospective time range, and the historical database stores complete data required for videos outside the preset retrospective time range;
[0029] A generating unit for assembling the complete data required for the video corresponding to the retrospective time node to generate a retrievable video.
[0030] This application also provides an electronic device, including:
[0031] One or more processors;
[0032] A storage device having one or more programs stored thereon,
[0033] When the one or more programs are executed by the one or more processors, the one or more processors implement the retrievable video generation method as described in any one of the above.
[0034] This application also provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the retrievable video generation method as described in any one of the above.
[0035] It can be seen from the above technical solutions that this application has the following beneficial effects:
[0036] The present application provides a method and apparatus for generating a retrievable video, which receives a retrievable video query request. Among them, the retrievable video query request includes a retrospective time node. The present application provides two databases, namely a recent database and a historical database. The recent database stores the complete data required for videos within a preset retrospective time range, and the historical database stores the complete data required for videos outside the preset retrospective time range. Then, the target database can be determined from the recent database and the historical database according to the retrospective time node, and the complete data required for the video corresponding to the retrospective time node can be retrieved from the target database. Furthermore, the complete data required for the video corresponding to the retrospective time node is assembled into a video to generate a retrievable video. It can be seen that in the present application, the complete data required for videos in different retrospective time ranges is stored in different databases. When obtaining the complete data required for a video, the target database is first determined according to the retrospective time node, and then the required complete data for the video is retrieved from the target database. In this way, the efficiency of obtaining the complete data required for a video can be improved, and further the efficiency of generating a retrievable video can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0038] Figure 1 Schematic diagram of an exemplary application scenario provided by an embodiment of the present application;
[0039] Figure 2 Flowchart of a method for generating a retrievable video provided by an embodiment of the present application;
[0040] Figure 3a Schematic diagram of a retrievable video generation provided by an embodiment of the present application;
[0041] Figure 3b Schematic diagram of another retrievable video generation provided by an embodiment of the present application;
[0042] Figure 4 Flowchart of another method for generating a retrievable video provided by an embodiment of the present application;
[0043] Figure 5 Schematic diagram of a data storage provided by an embodiment of the present application;
[0044] Figure 6 Schematic diagram of the structure of a retrievable video generation apparatus provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0045] To make the above objects, features, and advantages of the present application more obvious and understandable, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0046] To facilitate the understanding and explanation of the technical solutions provided by the embodiments of the present application, the background art involved in the embodiments of the present application will be introduced first.
[0047] With the development of computer technology, more and more transactions have shifted from offline to online. To protect the legitimate rights and interests of both parties to the transaction, the traceability of the online transaction process is particularly important. Generating a traceable video of the transaction behavior and using the traceable video of the transaction behavior to trace the transaction behavior can view the execution of the transaction process, restore the transaction process, and fully guarantee the legitimate rights and interests of both parties to the transaction. For example, the insurance sales behavior is one type of transaction behavior. Generating a traceable video of the insurance sales behavior can then be used to review, retrieve, download, etc. the execution of the sales content, data storage, security protection, and relevant internal control systems of the insurance sales through the traceable video of the insurance sales behavior.
[0048] Currently, the way to generate a traceable video is to first obtain user behavior data, and then store the user behavior data in the intranet storage area. After obtaining a traceability request, the corresponding user behavior data is retrieved from the intranet storage area, and a traceback video is generated based on the user behavior data.
[0049] However, this method stores all user behavior data in the intranet storage area, and the efficiency of retrieving and querying the required user behavior data from the intranet storage area is low, thus resulting in a low efficiency of generating a traceable video.
[0050] Based on this, the embodiments of the present application provide a method and device for generating a traceable video, which receive a traceable video query request. Among them, the traceable video query request includes a traceback time node. The present application provides two databases, namely a recent database and a historical database. The recent database stores the complete data required for videos within a preset traceback time range, and the historical database stores the complete data required for videos outside the preset traceback time range. Then, the target database can be determined from the recent database and the historical database according to the traceback time node, and the complete data required for the video corresponding to the traceback time node can be called from the target database. Furthermore, the complete data required for the video corresponding to the traceback time node is assembled into a video to generate a traceable video. It can be seen that in the present application, the complete data required for videos in different traceback time ranges are stored in different databases. When obtaining the complete data required for a video, first determine the target database needed according to the traceback time node, and then obtain the complete data required for the video needed from the target database. In this way, the efficiency of obtaining the complete data required for a video can be improved, and further the efficiency of generating a traceable video can be improved.
[0051] To facilitate the understanding of the method for generating a traceable video provided by the embodiments of the present application, the following is described in combination with Figure 1 the scenario example shown below. Refer to Figure 1 As shown, this figure is a schematic framework diagram of an exemplary application scenario provided by the embodiments of the present application.
[0052] As Figure 1 shown, the functions implemented by the backend of the client application are introduced first.
[0053] The collecting user is a user who uses the client application to handle transactions. If the collecting user triggers the pre-set data points in the client application when handling business in the client application, the backend of the client application will obtain the corresponding user behavior data of the collecting user in the client application and the fixed data of the client application page. The user behavior data and the fixed data of the client application page constitute the complete data required for the video. It can be understood that when there are many collecting users, intelligent DNS processing and load balancing can be used for processing to improve the transaction handling efficiency and data acquisition efficiency of the collecting users.
[0054] Clean the complete data required for the obtained video, and store the complete data required for the video after data cleaning in the MongoDB cluster through the kafka cluster. In addition, transfer the complete data required for the video with a relatively long storage time in the MongoDB cluster to the Elasticsearch cluster. Among them, the MongoDB cluster is the recent database cluster. The Elasticsearch cluster is the historical database cluster. That is, the recent database stores the complete data required for the video within the preset retrospective time range, and the historical database stores the complete data required for the video outside the preset retrospective time range. It can be understood that the preset retrospective time range is the recent time range, for example, one month before the current time, and the storage time one month ago is a relatively long storage time.
[0055] Next, introduce the functions implemented by the management end of the client application.
[0056] The system user is the user of the management end and can construct a retrospective video query request on the management end. The management end receives the retrospective video query request, and the retrospective video query request includes a retrospective time node. When there are many retrospective video query requests, the management end can use intelligent DNS processing and load balancing for processing to improve the response efficiency of the retrospective video query request. It can be understood that, as Figure 1 shown, the front-end program of the management end is deployed on the web server cluster. To further improve the response efficiency of the retrospective video query request, load balancing is also used when transferring the retrospective video query request between the web server cluster and the retrospective management module.
[0057] After the retrospective management module receives the retrospective video query request, it determines the target database from the recent database and the historical database according to the retrospective time node, and calls the complete data required for the video corresponding to the retrospective time node from the target database. It can be understood that the target database is the MongoDB cluster or the Elasticsearch cluster. When the retrospective time node is within the preset retrospective time range, the target database is the MongoDB cluster, and the complete data required for the video corresponding to the retrospective time node is called from the MongoDB cluster. When the retrospective time node is outside the preset retrospective time range, the target database is the Elasticsearch cluster, and the complete data required for the video corresponding to the retrospective time node is called from the Elasticsearch cluster.
[0058] Finally, assemble the complete data required for the video corresponding to the called retrospective time node to generate a retrospective video.
[0059] Those skilled in the art can understand, Figure 1The schematic diagram of the framework shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of this framework.
[0060] To facilitate the understanding of the present application, a method for generating a retraceable video provided by an embodiment of the present application will be described below with reference to the accompanying drawings.
[0061] See Figure 2 As shown, this figure is a flowchart of a method for generating a retraceable video provided by an embodiment of the present application. This method can be applied to a target client application. As Figure 2 shown, this method may include S201 - S203:
[0062] S201: Receive a retraceable video query request; the retraceable video query request includes a retrace time node.
[0063] The target client application receives a retraceable video query request. The retraceable video query request is used to request the generation of a retraceable video. For example, in an insurance sales scenario, the retraceable video query request is used to request the generation of a retraceable video of an insurance sales behavior.
[0064] As an optional example, the retraceable video query request includes a retrace time node. The retrace time node can be understood as the generation time of a transaction behavior, that is, the generation time when the user implements a transaction behavior on the target client application, and can also be understood as the collection time of user behavior data.
[0065] S202: Determine a target database from the recent database and the historical database according to the retrace time node, and call the complete data required for the video corresponding to the retrace time node from the target database; the recent database stores the complete data required for videos within a preset retrace time range, and the historical database stores the complete data required for videos outside the preset retrace time range.
[0066] In the embodiments of the present application, a heterogeneous database is constructed, including a recent database and a historical database. As an optional example, the recent database stores the complete data required for videos within a preset retrace time range. The amount of data of the complete data required for videos within the preset retrace time range is small but the query demand is large. The historical database stores the complete data required for videos outside the preset retrace time range. The amount of data of the complete data required for videos outside the preset retrace time range is large but the query demand is small.
[0067] For example, the preset retrace time range is one month before the current time. Then the complete data required for videos within one month before the current time is stored in the recent database. The complete data required for videos outside one month is stored in the historical database.
[0068] Among them, the complete data required for the video is the relevant data of the user's transaction behavior, which consists of the user behavior data in the target client application and the page fixed data of the target client application. The complete data required for the video is used to generate a traceable video. The user behavior data is the full-process data of the user handling the transaction. For example, the user behavior data includes the start time of the transaction, the end time of the transaction, the user operation data, the transaction content data, etc. In addition, the user behavior data may also include the user's basic information, such as the user's personal information.
[0069] The page fixed data is various types of data in each page of the target client application, including data such as the text, pictures, and controls displayed on the page. The page fixed data can represent the page style of the page in the target client application.
[0070] As an optional example, the recent database is a MongoDB database. Among them, the MongoDB database is a database based on distributed file storage, written in the C++ language. The characteristics of the MongoDB database are high performance, easy deployment, easy use, and very convenient for storing data. The MongoDB database aims to provide an extensible high-performance data storage solution for WEB applications. The MongoDB database is between a relational database and a non-relational database and can store relatively complex data types. The query language supported by the MongoDB database is very powerful, and it can implement most of the functions similar to single-table queries in a relational database, and it also supports indexing data.
[0071] As an optional example, the historical database is an Elasticsearch database. Elasticsearch is a distributed, highly scalable, and highly real-time search and data analysis engine that can easily enable a large amount of data to have the ability to be searched, analyzed, and explored. Elasticsearch also has the function of storing data.
[0072] After obtaining the traceback time node, determine the target database from the recent database and the historical database according to the traceback time node, and call the complete data required for the video corresponding to the traceback time node from the target database. It can be understood that the target database is the recent database or the historical database. If the traceback time node is within the preset traceback time range, the target database is the recent database, and the complete data required for the video corresponding to the traceback time node is called from the recent database. If the traceback time node is outside the preset traceback time range, the target database is the historical database, and the complete data required for the video corresponding to the traceback time node is called from the historical database.
[0073] As an optional example, if the target database is the recent database and the complete data required for the video corresponding to the retrospective time node cannot be successfully retrieved from the recent database, an attempt can be made to retrieve the complete data required for the video corresponding to the retrospective time node from the historical database. If the target database is the historical database and the complete data required for the video corresponding to the retrospective time node cannot be successfully retrieved from the historical database, an attempt can be made to retrieve the complete data required for the video corresponding to the retrospective time node from the recent database.
[0074] In a possible implementation manner, the embodiments of the present application provide a specific implementation for determining a target database from a recent database and a historical database according to a retrospective time node. Please refer to the following for details.
[0075] S203: Assemble the complete data required for the video corresponding to the retrospective time node to generate a retrospective video.
[0076] After obtaining the complete data required for the video corresponding to the retrospective time node, assemble the obtained complete data required for the video to generate a retrospective video. Among them, the retrospective video is a retrospective display of a certain historical behavior trajectory of the user in the form of a video, and is generally used to safeguard the legitimate rights and interests of both parties after a transaction dispute occurs between the trading parties.
[0077] As an optional example, FFmpeg can be used to assemble the complete data required for the video corresponding to the retrospective time node to render and generate a retrospective video. Among them, FFmpeg is an open-source computer program used to record, convert digital audio and video, and convert them into streams.
[0078] See Figure 3a , Figure 3a is a schematic diagram of the generation of a retrospective video provided by the embodiments of the present application. As Figure 3a shown, if the retrospective time node is within the preset retrospective time range, it is a recent retrospective. The recent database is a MongoDB database. The complete data required for the video corresponding to the retrospective time node can be obtained based on the MongoDB database, and the complete data required for the video corresponding to the retrospective time node can be assembled through FFmpeg to render and generate a retrospective video.
[0079] See Figure 3b , Figure 3b is another schematic diagram of the generation of a retrospective video provided by the embodiments of the present application. As Figure 3bAs shown in the figure, if the backtracking time node is outside the preset backtracking time range, it is a historical backtracking. The historical database is an Elasticsearch database, and the complete data required for the video corresponding to the backtracking time node can be obtained based on the Elasticsearch database, and the complete data required for the video corresponding to the backtracking time node can be assembled into a video through FFmpeg, and rendered to generate a backtrackable video.
[0080] Based on the relevant contents of S201-S203 above, it can be known that the embodiment of the present application is constructed with a heterogeneous database, and the complete data required for the video is classified and stored according to the time division, and the complete data required for the video collected within the preset retrospective time range (for example, nearly one month, which can be dynamically adjusted according to the situation) is stored in the recent database, and the complete data required for the video collected outside the preset retrospective time range is dynamically stored in the historical database. By utilizing the lightweight and high query performance of the recent database, the query efficiency of the complete data required for the real-time video is improved, and by utilizing the distributed and highly scalable characteristics of the historical database, a large amount of complete data required for the historical video is stored, ensuring the stable and long-term storage of transaction behavior related data. Based on this, when obtaining a retrospective video query request, the target database can be determined from the recent database and the historical database based on the retrospective time node in the retrospective video query request, and the complete data required for the video corresponding to the retrospective time node is called from the target database. Then, the complete data required for the video corresponding to the retrospective time node is assembled to generate a retrospective video. In this way, the efficiency of obtaining the complete data required for the video can be improved, and the efficiency of generating retrospective videos can be improved.
[0081] Before calling the recent database or historical database, you need to first obtain the complete data required for the video and store the complete data required for the video in the appropriate database. Figure 4 , Figure 4 A flowchart of another method for generating a traceable video provided in an embodiment of the present application.
[0082] like Figure 4 As shown, before S201, the method for generating a retracing video provided in the embodiment of the present application may further include S401-S404:
[0083] S401: Collecting user behavior data in the target client application and page fixed data of the target client application.
[0084] It is understandable that each user (referring to Figure 1 The target client application collects the user behavior data of each user that appears in the target client application. In addition, the target client application also needs to collect the page fixed data of the target client application.
[0085] In a possible implementation manner, an embodiment of the present application provides a specific implementation manner for collecting user behavior data in a target client application and page fixed data of the target client application, including:
[0086] Based on the collection plug-in in the target client application, collect the user behavior data in the target client application by means of data embedding, and collect the page fixed data of the target client application by means of web crawling.
[0087] It can be understood that a collection plug-in is integrated in the target client application, and the collection plug-in is integrated into the target client application in the form of a software development kit (SDK). Based on the collection plug-in and the data embedding method, collect the full-process behavior data of the user in the target client application for transactions. The collected user behavior data is distributed to the background server cluster through a load balancing method, which can improve the concurrency ability of data collection.
[0088] In addition, collect the page fixed data of the target client application by means of web crawling. Among them, the web crawler is a program or script that automatically grabs network data according to certain rules.
[0089] It can be understood that if the user behavior data and the page fixed data are jointly collected through the collection plug-in, not only the positions where the user may generate behaviors need to be embedded with data to obtain the user behavior data, but also various page information of the target client application needs to be embedded with data to obtain the page fixed data, so the types of data embedding are numerous. Moreover, each piece of user behavior data corresponds to page fixed data. When there are multiple users and they perform transaction behaviors on the target client application of the same version, the page fixed data corresponding to the user behavior data is the same data, so the page fixed data will be obtained repeatedly.
[0090] Therefore, instead of using the method of jointly collecting user behavior data and page fixed data through the collection plug-in, the embodiment of the present application combines the method of collecting user behavior data through the collection plug-in and collecting page fixed data through a web crawler to obtain the complete data required for generating a video. In this way, the requirements for the types of data embedded in the collection plug-in can be reduced, the intrusion of the collection plug-in into the original client application can be reduced, and on the basis of ensuring data integrity, since the types of collected data are reduced, the occupation of the collection server resources is also reduced, and the stability of the entire transaction behavior traceable system is improved. In addition, by means of web crawling, the page fixed data of the target client application of the same version is only obtained once, which can save resources and avoid data redundancy.
[0091] S402: Integrate the user behavior data and the page fixed data to obtain the complete data required for the video.
[0092] After obtaining the user behavior data and the page fixed data, integrate the user behavior data and the page fixed data to obtain the complete data required for the video.
[0093] In a possible implementation manner, an embodiment of the present application provides a specific implementation manner for integrating the user behavior data and the page fixed data to obtain the complete data required for the video, including:
[0094] Eliminate the abnormal data in the user behavior data to obtain the user behavior data after eliminating the abnormal data;
[0095] Integrate the user behavior data after eliminating the abnormal data and the page fixed data according to the client version number information to obtain the complete data required for the video.
[0096] It can be understood that since the user behavior data may contain abnormal data, after obtaining the user behavior data, the user behavior data will be verified, the abnormal data in the user behavior data will be eliminated, and the user behavior data after eliminating the abnormal data will be obtained.
[0097] Furthermore, integrate the user behavior data after eliminating the abnormal data and the page fixed data according to the client version number information to obtain the complete data required for the video. It can be understood that when collecting the user behavior data, the user behavior data corresponds to the version number information of the target client application. When collecting the page fixed data, the page fixed data also corresponds to the version number information of the target client application. In this way, the user behavior data after eliminating the abnormal data and the page fixed data under the same version number information can be integrated to obtain the complete data required for the video.
[0098] It can be understood that by matching and integrating the user behavior data and the page fixed data through the version number information, the matching accuracy rate of the collected user behavior data and the page fixed data can be improved.
[0099] S403: Store the complete data required for the video in the recent database.
[0100] As an optional example, first store all the newly obtained complete data required for the video in the recent database.
[0101] S404: Based on the called batch scheduling component, transfer the complete data required for the video outside the preset retrospective time range in the recent database to the historical database.
[0102] As an alternative example, periodically detect whether the backtracking time node of the complete data required for videos in the recent database meets the preset backtracking time range. When there is complete data required for videos in the recent database whose backtracking time nodes are outside the preset backtracking time range, call the batch scheduling component. Based on the called batch scheduling component, transfer the complete data required for videos outside the preset backtracking time range in the recent database to the historical database.
[0103] It can be understood that relying on time division to store the complete data required for different types of videos in different databases can utilize the characteristics of different databases to improve the storage and query efficiency of the system for a large amount of collected data.
[0104] See Figure 5 , Figure 5 for a schematic diagram of data storage provided by an embodiment of the present application. As Figure 5 shown, the collected data is user behavior data, and the crawler data is page fixed data. Then, when the recent database is a MongoDB database and the historical database is Elasticsearch, store the collected data and crawler data in the MongoDB database through the kafka cluster. Furthermore, batch schedule the complete data required for videos outside the preset backtracking time range in the MongoDB database to the historical database.
[0105] As an alternative example, an embodiment of the present application provides a specific implementation manner of transferring the complete data required for videos outside the preset backtracking time range in the recent database to the historical database based on the called batch scheduling component, including:
[0106] Based on the called batch scheduling component, transfer the complete data required for videos outside the preset backtracking time range and outside the preset query frequency range in the recent database to the historical database.
[0107] The complete data required for videos outside the preset backtracking time range means that the backtracking time node of the complete data required for the videos is outside the preset backtracking time range. The complete data required for videos outside the preset query frequency range means that the query frequency of the complete data required for the videos is outside the preset query frequency range.
[0108] It can be understood that only transfer the complete data required for videos outside the preset backtracking time range and outside the preset query frequency range in the recent database to the historical database. Among them, the query frequency of the complete data required for the videos being outside the preset query frequency range indicates that the query frequency of the complete data required for the videos is relatively low.
[0109] In addition, the complete data required for videos within the preset retrospective time range in the recent database, as well as the complete data required for videos outside the preset retrospective time range and within the preset query frequency range, are all retained in the recent database. It can be understood that although the retrospective time nodes of the complete data required for some videos are outside the preset retrospective time range, the query frequencies of the complete data required for these videos are relatively high and within the preset query frequency range, so the complete data required for these videos are still retained in the recent database. Among them, the query frequency meeting the preset query frequency range indicates a relatively high query frequency.
[0110] As an optional example, the complete data required for a preset number of groups of videos with the highest query frequencies can also be stored in the cache to quickly obtain the complete data required for these videos.
[0111] Based on the content of S401 - S404 above, the complete data required for videos is obtained by combining a crawler with a collection plugin. At the same time, a heterogeneous database is used to separately store and query the complete data required for videos according to the time type. In this way, while taking into account data storage and data query, it also enables the complete data required for videos to be retrieved far, quickly, comprehensively, and accurately.
[0112] As an optional example, the retrospective video query request further includes a query frequency. Based on this, the embodiments of the present application also provide a specific implementation manner for determining the target database from the recent database and the historical database in S202, including:
[0113] Determine the target database from the recent database and the historical database according to the retrospective time node and the query frequency.
[0114] It can be understood that determining the target database according to the retrospective time node and the query frequency can make the determined target database more accurate to improve the query efficiency.
[0115] Based on the retrospective video generation method provided by the above method embodiments, the embodiments of the present application also provide a retrospective video generation device, which will be described below with reference to the accompanying drawings.
[0116] See Figure 6 As shown in the figure, this figure is a schematic structural diagram of a retrospective video generation device provided by the embodiments of the present application. As Figure 6 shown, the retrospective video generation device includes:
[0117] A receiving unit 601, configured to receive a retrospective video query request; the retrospective video query request includes a retrospective time node;
[0118] A determination unit 602, configured to determine a target database from a recent database and a historical database according to the retrospective time node, and call complete data required for a video corresponding to the retrospective time node from the target database; the recent database stores complete data required for videos within a preset retrospective time range, and the historical database stores complete data required for videos outside the preset retrospective time range;
[0119] A generation unit 603, configured to perform video assembly on the complete data required for the video corresponding to the retrospective time node to generate a retrospectively playable video.
[0120] In a possible implementation manner, the apparatus further includes:
[0121] An acquisition unit, configured to acquire user behavior data in a target client application and page fixed data of the target client application before receiving a retrospectively playable video query request;
[0122] An integration unit, configured to integrate the user behavior data and the page fixed data to obtain complete data required for a video;
[0123] A storage unit, configured to store the complete data required for the video in the recent database;
[0124] A transfer unit, configured to transfer, based on a called batch scheduling component, complete data required for videos outside the preset retrospective time range in the recent database to the historical database.
[0125] In a possible implementation manner, the acquisition unit is specifically configured to:
[0126] Based on an acquisition plug-in in the target client application, acquire user behavior data in the target client application by means of data embedding, and acquire page fixed data of the target client application by means of web crawling.
[0127] In a possible implementation manner, the integration unit includes:
[0128] An abnormal data removal subunit, configured to remove abnormal data in the user behavior data to obtain user behavior data after removing the abnormal data;
[0129] An integration subunit, configured to integrate the user behavior data after removing the abnormal data and the page fixed data according to client version number information to obtain complete data required for a video.
[0130] In a possible implementation manner, the transfer unit is specifically configured to:
[0131] Based on the call-based batch scheduling component, transfer the complete data required for videos outside the preset backtracking time range and outside the preset query frequency range in the recent database to the historical database.
[0132] In a possible implementation manner, the retrievable video query request further includes a query frequency; the determining unit 602 is specifically configured to:
[0133] Determine a target database from the recent database and the historical database according to the backtracking time node and the query frequency.
[0134] In a possible implementation manner, the recent database is a MongoDB database and the historical database is an Elasticsearch database.
[0135] In addition, an embodiment of the present application further provides an electronic device, including:
[0136] One or more processors;
[0137] A storage device having one or more programs stored thereon,
[0138] When the one or more programs are executed by the one or more processors, the one or more processors implement the retrievable video generation method as described in any of the above embodiments.
[0139] In addition, an embodiment of the present application further provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the retrievable video generation method as described in any of the above embodiments.
[0140] From the description of the above embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in each embodiment or some parts of the embodiments of the present application.
[0141] It should be noted that the various embodiments in this specification are described in a progressive manner, and the key points of each embodiment are the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the methods disclosed in the embodiments, since they correspond to the systems disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the system part.
[0142] It should also be noted that in this text, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.
[0143] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating a traceable video, characterized in that, The method includes: Receiving a retraceable video query request; the retraceable video query request includes a retrace time node; Determining a target database from a recent database and a historical database according to the retrace time node, and calling the complete data required for the video corresponding to the retrace time node from the target database; the recent database stores the complete data required for the video within a preset retrace time range, and the historical database stores the complete data required for the video outside the preset retrace time range; Assembling the complete data required for the video corresponding to the retrace time node to generate a retraceable video; Among them, determining the target database from the recent database and the historical database according to the retrace time node includes: If the retrace time node is within the preset retrace time range, determining the recent database as the target database; If the retrace time node is outside the preset retrace time range, determining the historical database as the target database.
2. The method according to claim 1, wherein Before receiving the retraceable video query request, the method further includes: Collecting user behavior data in the target client application and page fixed data of the target client application; Integrating the user behavior data and the page fixed data to obtain the complete data required for the video; Storing the complete data required for the video in the recent database; Based on the called batch scheduling component, transferring the complete data required for the video outside the preset retrace time range in the recent database to the historical database.
3. The method according to claim 2, wherein The collecting user behavior data in the target client application and page fixed data of the target client application includes: Based on the collection plug-in in the target client application, collecting the user behavior data in the target client application by means of data embedding points, and collecting the page fixed data of the target client application by means of web crawler.
4. The method according to claim 3, wherein The integrating the user behavior data and the page fixed data to obtain the complete data required for the video includes: Removing abnormal data in the user behavior data to obtain the user behavior data after removing abnormal data; Integrating the user behavior data after removing abnormal data and the page fixed data according to the client version number information to obtain the complete data required for the video.
5. The method according to claim 2, characterized in that The transferring the complete data required for the video outside the preset retrace time range in the recent database to the historical database based on the called batch scheduling component includes: Based on the called batch scheduling component, transferring the complete data required for the video outside the preset retrace time range and outside the preset query frequency range in the recent database to the historical database.
6. The method according to claim 1 or 5, characterized in that, The retraceable video query request further includes a query frequency; the determining the target database from the recent database and the historical database according to the retrace time node includes: Determining the target database from the recent database and the historical database according to the retrace time node and the query frequency.
7. The method according to claim 1, characterized in that, The recent database is a MongoDB database and the historical database is an Elasticsearch database.
8. A backtraceable video generation device, characterized in that, The device includes: A receiving unit, configured to receive a request for querying a traceable video; the request for querying a traceable video includes a traceback time node; A determining unit, configured to determine a target database from a recent database and a historical database according to the traceback time node, and call complete data required for the video corresponding to the traceback time node from the target database; the recent database stores complete data required for videos within a preset traceback time range, and the historical database stores complete data required for videos outside the preset traceback time range; A generating unit, configured to perform video assembly on the complete data required for the video corresponding to the traceback time node to generate a traceable video; Wherein, the determining unit is specifically configured to determine the recent database as the target database if the traceback time node is within the preset traceback time range; and determine the historical database as the target database if the traceback time node is outside the preset traceback time range.
9. An electronic device, characterized in that, Comprising: One or more processors; A storage device, on which one or more programs are stored, When the one or more programs are executed by the one or more processors, the one or more processors implement the traceable video generation method according to any one of claims 1-7.
10. A computer-readable medium, characterized in that, On which a computer program is stored, wherein when the computer program is executed by a processor, the traceable video generation method according to any one of claims 1-7 is implemented.
Citation Information
Patent Citations
Database historical log backtracking method, device and system, equipment and storage medium
CN111737203A
Data processing method and device, computer equipment and storage medium
CN111949807A