Multi-platform video upload query method, device, equipment and storage medium
By adding the record line and primary key identifier of the video in the video upload request, and periodically querying the upload results based on the upload task identifier, the problem of being unable to obtain the video upload results in real time in the existing technology is solved, and the query of the video upload status and results is improved. Reliability and efficiency.
Patent Information
- Application Number
- CN202410447813.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-04-15
AI Technical Summary
In the prior art, users cannot obtain the upload results of videos in real time during video uploading, resulting in low reliability of querying video upload status and upload results.
Through the received video upload request, determine the multiple video platforms to which the video should be uploaded, add a record row of the video to the data table of each video platform, and add the primary key identifier of the record row to the data queue of the corresponding video platform. Based on the upload task identification returned by the video platform, the video upload results are periodically queried and the video upload status is updated.
It realizes obtaining the video upload result based on the upload task identifier returned by the video platform, improves the query reliability of video upload status and upload results, simplifies the operation of video upload on multiple platforms, and improves the efficiency of video upload.
Smart Images

Figure CN118540512B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a multi-platform video upload query method, device, equipment and storage medium. Background Art
[0002] With the widespread use of more and more video platforms, publishing short videos promoting games on multiple video platforms is an effective game promotion strategy. After uploading short videos to various video platforms, each video platform will review the video content and publish it on the video platform after successful review. Uploading videos to the platform is usually an asynchronous operation, that is, users can browse or perform other operations during the video upload process, which is conducive to improving the user experience.
[0003] In the prior art, when the user is browsing or performing other operations during the video upload process, the video upload result cannot be obtained in real time. Therefore, a callback function that is called when the video upload is completed can be defined, so that the platform can pass the upload result as a parameter to the callback function when the video upload is completed, and obtain the upload result from the callback function to notify the user that the upload is complete. However, the callback function is called in an asynchronous operation, which further increases the complexity of the asynchronous operation code, making the code difficult to read and maintain, and increasing the error rate of the callback query, so that the user cannot accurately know the upload status and upload results of the video, and the query reliability of the video upload status and upload results is low. Summary of the invention
[0004] The present application provides a multi-platform video upload query method, apparatus, equipment and storage medium to obtain the upload result of the video to be uploaded according to the upload task identifier returned by the video platform, and then update the upload status of the video to be uploaded, which solves the problem in the prior art that the upload result and upload result of the queried video cannot be obtained, and improves the query reliability of the video upload status and upload result.
[0005] In a first aspect, the present application provides a multi-platform video upload query method, comprising:
[0006] Based on the received video upload request, determine multiple video platforms corresponding to the first video, add a record row of the first video in a data table corresponding to each of the video platforms, add a primary key identifier of the record row to a data queue of the corresponding video platform, and the record row stores link data of the first video;
[0007] Obtaining the primary key identifier in the data queue, obtaining the link data stored in the record row in the data table of the corresponding video platform according to the primary key identifier, uploading the first video to the corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video, and returns an upload task identifier;
[0008] Based on a preset period, the upload result of the first video is queried on the corresponding video platform through the upload task identifier. If the upload result is found, the upload status of the first video is determined to be uploaded. If the upload result is not found, the upload status of the first video is determined to be uploading.
[0009] In a second aspect, the present application provides a multi-platform video upload query device, comprising:
[0010] A record row adding module is configured to determine, based on the received video upload request, a plurality of video platforms to which the first video is uploaded, and add a record row of the first video in a data table corresponding to each of the video platforms; the record row stores link data of the first video;
[0011] A primary key identifier adding module is configured to add the primary key identifier of the record row to a data queue of a corresponding video platform;
[0012] A link data acquisition module is configured to acquire the primary key identifier in the data queue, and acquire the link data stored in the record row in the data table of the corresponding video platform according to the primary key identifier;
[0013] A video uploading module, configured to upload the first video to a corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video and returns an upload task identifier;
[0014] The video upload query module is configured to query the upload result of the first video on the corresponding video platform through the upload task identifier based on a preset period, and determine that the upload status of the first video is uploaded when the upload result is queried; if the upload result is not queried, determine that the upload status of the first video is uploaded.
[0015] In a third aspect, the present application provides a multi-platform video upload query device, including:
[0016] one or more processors;
[0017] A memory stores one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the multi-platform video upload query method as described in the first aspect.
[0018] In a fourth aspect, the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the multi-platform video upload query method as described in the first aspect.
[0019] In the present application, through the received video upload request, multiple video platforms corresponding to the first video are determined, a record row of the first video is added to the data table corresponding to each video platform, and the primary key identifier of the record row is added to the data queue of the corresponding video platform, and the record row stores the link data of the first video; the primary key identifier is obtained in the data queue, and the link data stored in the record row is obtained in the data table of the corresponding video platform according to the primary key identifier, and the first video is uploaded to the corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video and returns the upload task identifier; based on the preset period, the upload result of the first video is queried on the corresponding video platform through the upload task identifier, and the upload status of the first video is determined to be the end of the upload when the upload result is queried, and the upload status of the first video is determined to be the upload in progress when the upload result is not queried. Through the above technical means, the link data of the first video can be actively obtained based on the primary key identifier cached in the data queue of each video platform, and the first video can be uploaded to each video platform according to the link data, so that the first video can be uploaded to multiple video platforms with one click, which simplifies the operation of uploading videos on multiple platforms and improves the efficiency of uploading videos. Based on the upload task identifier returned by the video platform, the upload result of the first video is queried from the corresponding video platform. Compared with the callback query, the query based on the upload task identifier has a more intuitive code structure and better readability. In addition, the logical analysis of the upload operation and result processing reduces the coupling between modules. Therefore, the error rate of querying the upload result based on the upload task identifier is low, which solves the problem of being unable to obtain the upload result and upload result of the queried video in the prior art, and improves the query reliability of the video upload status and upload result. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flow chart of a multi-platform video upload query method provided by an embodiment of the present application;
[0021] Figure 2 This is a flowchart of obtaining a first video on a cloud video-on-demand service end and uploading it to a video platform provided by an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of the execution process of the first job service provided in an embodiment of the present application;
[0023] Figure 4 This is a flowchart of querying upload results based on the upload task identifier stored in the record row provided in an embodiment of the present application;
[0024] Figure 5 is a flowchart of determining an upload result of a first video based on the upload duration of the first video provided by an embodiment of the present application;
[0025] Figure 6It is a structural diagram of a multi-platform video upload query device provided by an embodiment of the present application;
[0026] Figure 7 It is a structural diagram of a multi-platform video upload query device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] In a more common existing implementation, a callback function is defined in the browser to be called when the video upload is completed. When the browser initiates a video upload request to the video platform, the callback function is passed as a parameter to the upload function. The video platform receives the callback function and the video in the upload function. When the video upload is completed, the upload result can be passed as a parameter to the callback function. The browser obtains the upload result from the callback function to notify the user that the upload is complete. However, the callback function is called in an asynchronous operation, which further increases the complexity of the asynchronous operation code, making the code difficult to read and maintain, and increasing the error rate of the callback query, making it impossible for users to accurately know the upload status and upload results of the video, and the query reliability of the video upload status and upload results is low.
[0030] To solve the above problems, this embodiment provides a multi-platform video upload query method to obtain the upload result of the video to be uploaded according to the upload task identifier returned by the video platform, and then update the upload status of the video to be uploaded, thereby improving the query reliability of the video upload status and upload results.
[0031] The multi-platform video upload query method provided in this embodiment can be executed by a multi-platform video upload query device, which can be implemented by software and / or hardware, and can be composed of two or more physical entities, or can be composed of one physical entity. For example, the multi-platform video upload query device can be a service platform that assists in video upload, and the service platform includes a front end and a back end. The user can add the video to be uploaded and the identifiers of the corresponding multiple video platforms to be uploaded at the front end. The front end transmits the video to be uploaded and the identifiers of the multiple video platforms to the back end, and the back end uploads the video to be uploaded to each video platform in turn based on the identifier of each video platform.
[0032] The multi-platform video upload query device is installed with at least one type of operating system, wherein the operating system includes but is not limited to Android system, Linux system and Windows system. The multi-platform video upload query device can install at least one application based on the operating system, and the application can be an application that comes with the operating system, or an application downloaded from a third-party device or server. In this embodiment, the multi-platform video upload query device has at least an application that can execute the multi-platform video upload query method.
[0033] For ease of understanding, this embodiment is described by taking a service platform that assists in video uploading as an example of the subject that executes the multi-platform video upload query method.
[0034] Figure 1 A flowchart of a multi-platform video upload query method provided in an embodiment of the present application is given.
[0035] refer to Figure 1 , the multi-platform video upload query method specifically includes:
[0036] S110. Based on the received video upload request, determine the multiple video platforms corresponding to the upload of the first video, add a record row of the first video in the data table corresponding to each video platform, add the primary key identifier of the record row to the data queue of the corresponding video platform, and the record row stores the link data of the first video.
[0037] Among them, the video upload request is a request generated by the front end based on the video to be uploaded and the URLs of the corresponding multiple video platforms to be uploaded added by the user. The first video is the video to be uploaded in the video upload request. Exemplarily, the user can fill in the link data of the first video and the identifiers of the corresponding multiple video platforms to be uploaded in the front-end interface of the service platform, and the front end generates a video upload request based on the link data of the filled first video and the identifier of the video platform, and passes the video upload request to the back end of the service platform. After receiving the video upload request, the back end of the service platform obtains the link data of the first video and the identifiers of the multiple video platforms from the video upload request. After determining the multiple video platforms corresponding to the upload of the first video according to the identifiers of the multiple video platforms, add a record row of the first video to the data table corresponding to each video platform to be uploaded, and store the link data of the first video in the record row. It should be noted that when adding the record row of the first video in the data table, the primary key identifier of the record row is automatically generated, so that the storage position of the corresponding record row in the data table can be represented by the primary key identifier, so that various information of the first video of the corresponding record row can be obtained later through the primary key identifier. After adding the record row of the first video in the data table corresponding to each uploaded video platform, the primary key identifier of the record row corresponding to the first video in the data table is added to the data queue of the video platform corresponding to the data table. The data queue may be a redis queue.
[0038] This embodiment is described by taking the first video A uploaded to the first video platform and the second video platform as an example. The first video platform corresponds to the first data table and the first data queue, and the second video platform corresponds to the second data table and the second data queue. A record row A can be created in the first data table to record various information of the first video A, and a record row B can be created in the second data table to record various information of the first video A. The primary key identifier of the record row A is added to the first data queue, and the primary key identifier of the record row B is added to the second data queue.
[0039] S120. Obtain a primary key identifier in the data queue, obtain link data stored in the record row in the data table of the corresponding video platform according to the primary key identifier, upload the first video to the corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video, and returns an upload task identifier.
[0040] Exemplarily, the primary key identifier of record row A is obtained in the first data queue, and the link data of the first video A stored in record row A is obtained in the first data table according to the primary key identifier of record row A, and the first video A is uploaded to the first video platform through the link data. Similarly, the primary key identifier of record row B is obtained in the second data queue, and the link data of the first video A stored in record row B is obtained in the second data table according to the primary key identifier of record row B, and the first video A is uploaded to the second video platform through the link data.
[0041] In this embodiment, in order to prevent unauthorized access and hotlinking, the first video is cached in the cloud VOD server, and the link data of the first video is the link of the first video provided by the cloud VOD server. The cloud VOD server provides mature anti-hotlinking technology, so that only the client holding the link data of the first video can obtain and play the video on the cloud VOD server, protecting the video resources from illegal access and theft. Figure 2 This is a flow chart of obtaining a first video on a cloud video-on-demand service end and uploading it to a video platform provided by an embodiment of the present application. Figure 2 As shown, the step of obtaining the first video on the cloud on-demand server and uploading it to the video platform specifically includes S1201-S1202:
[0042] S1201. Obtain anti-hotlink data from the cloud video-on-demand server based on the link data, and splice the link data and the anti-hotlink data to obtain spliced data, where the link data is a link to the first video provided by the cloud video-on-demand server.
[0043] S1202. Download the first video on the cloud on-demand server according to the spliced data, call the upload interface of the video platform to upload the first video to the video platform, so that the video platform creates a corresponding upload task based on the first video obtained by the upload interface, and returns the upload task identifier through the upload interface.
[0044] Exemplarily, the backend of the service platform sends an anti-hotlink data acquisition request to the cloud on-demand service end based on the link data of the first video. After responding to the anti-hotlink data acquisition request, the cloud on-demand service end randomly generates the anti-hotlink data of the first video, and sends the anti-hotlink data to the backend of the service platform. The backend of the service platform splices the anti-hotlink data and the link data of the first video to obtain the spliced data, generates a video download request according to the spliced data, and sends the video download request to the cloud on-demand service end. The cloud on-demand service end verifies whether its anti-hotlink data is qualified based on the spliced data in the video download request. If the verification is qualified, the first video corresponding to the link data is sent to the backend of the service platform, and the backend of the service platform completes the download of the first video. Further, after downloading the first video, the service platform calls the upload interface provided by the video platform to upload the first video to the video platform, so that the video platform creates a corresponding upload task based on the first video, and returns the identifier of the upload task through the upload interface, so that the backend of the subsequent service platform can query the upload result and upload status of the corresponding first video based on the identifier of the upload task.
[0045] In addition, the backend of the service platform obtains the anti-hotlink data on the cloud on-demand server, and after splicing the anti-hotlink data with the link data of the first video to obtain the spliced data, the upload interface of the video platform can be called to upload the spliced data to the video platform, so that the video platform can download the first video on the cloud on-demand server based on the spliced data, create a corresponding upload task for the downloaded first video, and send the upload task identifier to the backend of the service platform through the upload interface.
[0046] In one embodiment, in order to improve the efficiency of video upload, the job service of Kubernetes corresponding to each video platform can be started, and the job service can be used to automatically download the video and upload it to the corresponding video platform according to the primary key identifier in the data queue of the corresponding video platform. Specific implementation process: The primary key identifier is obtained in the data queue of the corresponding video platform through the job service of Kubernetes, and the link data stored in the corresponding record row is queried in the data table of the corresponding video platform according to the primary key identifier, and the first video is uploaded to the video platform corresponding to the data queue according to the link data. Exemplarily, the first job service and the second job service of Kubernetes are started respectively to execute the process of uploading the first video to the first video platform and the second video platform respectively. Among them, the process of uploading the first video to the second video platform by the second job service is the same as the process of uploading the first video to the first video platform by the first job service, and other subsequent operations are also the same. In this regard, this embodiment is described by taking the processing process of the first job service as an example. In order to facilitate a more intuitive understanding of the process of uploading the first video to the first video platform by the first job service, this embodiment is taken as Figure 3 The execution process diagram of the first job service shown is used as an example for description. Figure 3 As shown, the first job service obtains the primary key identifier of record row A in the first data queue, queries the link data of the first video A stored in record row A in the first data table according to the primary key identifier of record row A, obtains the anti-hotlink data on the cloud on-demand service end according to the link data of the first video A, splices the link data and the anti-hotlink data, downloads the first video A on the cloud on-demand service end based on the spliced data, calls the upload interface of the first video platform, and uploads the first video A to the first video platform through the upload interface. The first video platform creates a corresponding first upload task based on the received first video A, and sends the first upload task identifier to the first job service.
[0047] It should be noted that the setting of the data queue can isolate the process of the backend processing video upload requests and the job service executing video upload from each other. Even when receiving high-concurrency video upload requests, the backend of the service platform can run stably, thereby improving the working reliability of the service platform.
[0048] S130. Based on a preset period, query the upload result of the first video on the corresponding video platform through the upload task identifier, and determine that the upload status of the first video is upload completed when the upload result is found; if the upload result is not found, determine that the upload status of the first video is uploading.
[0049] Exemplarily, after receiving the first upload task identifier returned by the first video platform, the backend of the service platform saves the first upload task identifier, and sends an upload result query request to the first video platform based on the first upload task identifier after a preset period. The first video platform determines the execution status of the first upload task based on the first upload task identifier in the upload result query request, obtains the corresponding execution result as the upload result of the first video and sends it to the first video platform when the execution is completed, and sends an empty instruction to the backend of the service platform when the execution is not completed. Correspondingly, when the service platform receives the upload result sent by the first video platform, it determines that the upload status of the first video is uploaded. When the empty instruction sent by the first video platform is obtained, it determines that the upload status of the first video is uploaded. The upload result query process of the backend of the service platform after receiving the second upload task identifier returned by the second video platform is similar, and will not be repeated here. Compared with the callback query, the query based on the upload task identifier has a more intuitive code structure and better readability, and the logical analysis of the upload operation and result processing reduces the coupling between modules, so the error rate of querying the upload result based on the upload task identifier is low. Moreover, by periodically querying the upload result of the first video, the upload result of the first video can be queried multiple times, thereby improving the reliability and redundancy of the query and further reducing the error rate of querying the upload result.
[0050] It should be noted that the backend of the service platform will periodically query the upload result corresponding to the first video based on the upload task identifier. However, when the backend of the service platform stores multiple upload task identifiers at the same time, it is difficult to quickly and accurately query which upload task identifier corresponds to which first video, resulting in low query reliability of video upload results. In this regard, when the upload task identifier corresponding to the first video returned by the video platform is received, the upload task identifier can be added to the record row of the data table corresponding to the video platform, and the upload status of the first video can be added as uploading in the record row. Reference Figure 3, after the first job service obtains the link data of the first video A in record row A in the first data table based on the primary key identifier in the first data queue, and then obtains the first video A according to the link data and uploads the first video A to the first video platform, the first job service can receive the first upload task identifier returned by the first video platform. The first job service stores the first upload task identifier in record row A of the first data table, so that the first upload task identifier is associated with the link data and primary key identifier corresponding to the first video A and other information is saved. Since the first upload task has just been established and the first video A is in the upload state of uploading, the first job service can add the upload state of the first video A in the upload state in record row A, so that the upload state of the first video A is associated with other information of the first video and saved, so that the upload state of the first video A on the first video platform can be confirmed later through record row A.
[0051] Furthermore, after the upload task identifier is added to the record line of the first video at the back end of the service platform, the upload task identifier can be obtained from the record line based on a preset period to query the upload result of the first video on the corresponding video platform based on the upload task identifier. Figure 4 1 is a flowchart of querying the upload result based on the upload task identifier stored in the record row provided by the embodiment of the present application. Figure 4 As shown, the step of querying the upload result based on the upload task identifier stored in the record row specifically includes S1301-S1302:
[0052] S1301. Based on a preset period, query the first video being uploaded in each record row of the data table, obtain the upload task identifier of the first video being uploaded, and query the upload result of the corresponding first video in the video platform corresponding to the data table according to the upload task identifier.
[0053] S1302. When the upload result of the first video is found, the upload result is added to the record row corresponding to the data table and the upload status in the record row is updated to upload completed; when the upload result of the first video is not found, the upload status in the record row corresponding to the data table is maintained as uploading.
[0054] refer to Figure 3When the cycle arrives, the first job service queries the upload status of the corresponding first video in each record row of the first data table to obtain the first upload task identifier of the first video whose upload status is uploading, and sends an upload result query request to the first video platform based on the obtained first upload task identifier, so that the first video platform queries the execution status of the corresponding first upload task based on the first upload task identifier in the upload result query, and sends the execution result as the upload result to the first job service when the execution status is execution completed, and sends an empty instruction to the first job service when the execution status is execution not completed. When the first job service receives the upload result sent by the first video platform, it adds the upload result to the record row corresponding to the first upload task identifier in the first data table, and updates the upload status in the record row from uploading to upload completed. For example, if the first job service finds out that the first video A is in the upload status of uploading in the first data table based on the query in the record row A, and finds out that the first video C is in the upload status of uploading in the query in the record row C, then the first upload task identifier associated with the first video A in the record row A and the first upload task identifier associated with the first video C in the record row C can be obtained, and the upload results of the first video A and the first video C can be queried on the first video platform based on the two first upload task identifiers obtained. If the first job service finds out the upload result of the corresponding first video C on the first video platform based on the first upload task identifier of the first video C, then the upload result of the corresponding first video can be added to the record row C and the upload status in the record row C can be updated from uploading to upload completed, so as to avoid subsequent query of the upload result of the first video that has been uploaded, thereby improving the subsequent upload query efficiency of other first videos. In this embodiment, the job service periodically queries the upload task identifier of the first video that has not been uploaded in the data table, so as to query the upload result on the corresponding video platform based on the upload task identifier, and updates the upload status of the first video according to the query situation, so as to query only the upload result of the first video that is in the upload in the next cycle, thereby improving the overall video upload query efficiency. Moreover, for the first video that has not been uploaded, the job service will periodically repeat the query, which greatly improves the reliability and redundancy of the video upload query.
[0055] In this embodiment, when the upload status of the first video remains in the uploading state for a long time, it may be that the video platform fails to process the upload task of the first video normally or the upload fails due to other reasons, but the video platform cannot feedback the upload result to the service platform. In this regard, this embodiment proposes that when it is detected that the upload time of the first video in the upload state reaches a preset time threshold, the upload result of the first video can be determined as an upload failure and the upload status can be updated to the upload end, thereby shortening the time to obtain the upload result and improving the user experience. Exemplary, Figure 51 is a flowchart of determining the upload result of the first video based on the upload duration of the first video provided by an embodiment of the present application. Figure 5 As shown, the step of determining the upload result of the first video based on the upload duration of the first video specifically includes S1401-S1402:
[0056] S1401. Query the start upload time of the first video being uploaded in each record row of the data table, and determine the upload duration of the first video being uploaded according to the start upload time and the current time.
[0057] Exemplarily, after receiving the first upload task identifier of the first video returned by the first video platform, the first job service adds the first upload task identifier to the record row corresponding to the first video in the first data table, and uses the moment of receiving the first upload task identifier as the start upload time of the first video, and adds the start upload time to the corresponding record row. Before periodically querying the upload result of the first video whose upload status is "uploading", the first job service can obtain the start upload time of the first video whose upload status is "uploading", and determine the time difference between the current time and the start upload time as the upload duration of the first video.
[0058] S1402. When the upload duration of the first video being uploaded exceeds a preset duration threshold, the primary key identifier of the first video being uploaded in the data table is deleted from the corresponding data queue, the upload result of the failed upload is added to the corresponding record row in the data table, and the upload status in the record row is updated to upload completion.
[0059] In this embodiment, the preset duration threshold can be understood as the maximum duration of the video platform processing the upload task. When the upload duration of the first video exceeds the preset duration threshold, it indicates that an abnormality has occurred in the video platform during the corresponding upload task, making it impossible for the first video to be published on the video platform. At this time, the upload result of the first video can be determined as an upload failure, and the upload result is added to the record row corresponding to the data table corresponding to the video platform, and the upload status in the record row is updated to the end of the upload. For example, when the first job service determines that the upload duration of the first video A on the first video platform exceeds the preset duration threshold, the upload result of the first video A can be determined as an upload failure, and the upload result is added to the record row A of the first data table, and the upload status in the record row A is updated from the upload to the end of the upload. At the same time, since the upload status of the first video A is already the end of the upload, the primary key identifier of the record row A can be deleted from the corresponding data queue to save the storage resources of the service platform. It should be noted that, before querying the upload result of the first video being uploaded, this embodiment can clean up some first videos that have actually failed to upload based on the upload duration of the first video being uploaded. There is no need to query these first videos that failed to upload on the video platform, which is beneficial to improving the efficiency of subsequent first video upload result queries.
[0060] Furthermore, after the service platform queries the upload results in each period to update the upload status of the first video in the data table, it can display the upload results and / or upload status of the first video on each video platform on the front end based on the updated data table, so that users can view the upload results and / or upload status of the first video on each video platform through the front end, thereby improving the user experience.
[0061] In this embodiment, the upload result queried by the service platform based on the upload task identifier includes upload failure and upload success. When the first video fails to upload, the video platform will determine the reason for the upload failure of the first video. The service platform can obtain the upload failure reason and display it through the front end so that the user can modify the content of the first video based on the upload failure reason. The specific implementation process is: when the upload result queried is an upload failure, obtain the upload failure reason issued by the video platform, and write the upload failure reason into the corresponding record row of the data table; display the upload result, upload status and upload failure reason of the first video according to the data table of each video platform. Exemplarily, when the first job service queries the upload result of the first video C as an upload failure, it can send a failure reason acquisition request to the video platform based on the first upload task identifier of the first video C. The first video platform obtains the upload failure reason of the first video C based on the first upload task identifier in the failure reason acquisition request, and sends the upload failure reason to the first job service. The first job service adds the upload failure reason to the record row C of the first data table. After the first job service queries the upload results of all the first videos being uploaded and updates the first data table accordingly, the upload results, upload status and / or upload failure reasons of each record row are displayed on the front end according to the first data table. At this time, the user can view the results and reasons of the failure to upload the first video C on the first video platform on the front end. In addition, the first video platform can also send down the reasons for the upload failure when sending down the upload result of the failed upload. Therefore, the first job service can directly obtain the upload result and the reasons for the upload failure, and add the upload result and the reasons for the upload failure to the same record row.
[0062] When the first video is successfully uploaded, the video platform will assign a video ID to the first video so that the first video can be uniquely represented by the video ID. The service platform can obtain the video ID and display it through the front end so that users can search for the playback status of the first video on the corresponding video platform based on the video ID. The specific implementation process is: when the upload result queried is a successful upload, obtain the video ID issued by the video platform and write the video ID into the data table; display the upload result, upload status and video ID of the first video according to the data table of each video platform. Exemplarily, when the first job service queries that the upload result of the first video C is a successful upload, it can send a video ID acquisition request to the video platform based on the first upload task ID of the first video C. The first video platform obtains the video ID published by the first video C on the first video platform based on the video ID acquisition request, and sends the video ID to the first job service. The first job service adds the video ID to the record row C in the first data table. After the first job service queries the upload results of all the first videos being uploaded and updates the first data table accordingly, the upload results, upload status and / or video identifiers of each record row are displayed on the front end according to the first data table. At this time, the user can view the successful upload result and video identifier of the first video C on the first video platform on the front end. In addition, the first video platform can also send down the video identifier together with the upload result of the successful upload, so the first job service can directly obtain the upload result and video identifier, and add the upload result and video identifier to the same record row.
[0063] This embodiment displays the upload results, upload status, reasons for upload failure and / or video identification of each first video on each video platform on the front end based on the information stored in each record row in the data table of each video platform, so that the user can fully understand the upload status of the first video on each video platform on the front end. Moreover, when the user uploads the first video to multiple video platforms, he only needs to add the link data of the first video and the identification of the corresponding uploaded video platform on the front end, which simplifies the operation of users uploading videos and querying the video upload status on multiple platforms, improves the convenience of users uploading videos and querying the video upload status, and comprehensively improves the user experience.
[0064] In summary, the multi-platform video upload query method provided by the embodiment of the present application determines the multiple video platforms corresponding to the first video upload through the received video upload request, adds the record row of the first video in the data table corresponding to each video platform, adds the primary key identifier of the record row to the data queue of the corresponding video platform, and stores the link data of the first video in the record row; obtains the primary key identifier in the data queue, obtains the link data stored in the record row in the data table of the corresponding video platform according to the primary key identifier, and uploads the first video to the corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video and returns the upload task identifier; based on the preset period, the upload result of the first video is queried on the corresponding video platform through the upload task identifier, and the upload status of the first video is determined to be the upload end when the upload result is queried, and the upload status of the first video is determined to be the upload in progress when the upload result is not queried. Through the above technical means, the link data of the first video can be actively obtained based on the primary key identifier cached in the data queue of each video platform, and the first video can be uploaded to each video platform according to the link data, so as to upload the first video to multiple video platforms with one click, simplify the operation of uploading videos on multiple platforms, and improve the upload efficiency of videos. Based on the upload task identifier returned by the video platform, the upload result of the first video is queried from the corresponding video platform. Compared with the callback query, the query based on the upload task identifier has a more intuitive code structure and better readability. In addition, the logical analysis of the upload operation and result processing reduces the coupling between modules. Therefore, the error rate of querying the upload result based on the upload task identifier is low, which solves the problem of being unable to obtain the upload result and upload result of the queried video in the prior art, and improves the query reliability of the video upload status and upload result.
[0065] Based on the above embodiments, Figure 6 This is a schematic diagram of the structure of a multi-platform video upload query device provided by an embodiment of the present application. Figure 6 The multi-platform video upload query device provided in this embodiment specifically includes: a record row adding module 21, a primary key identifier adding module 22, a link data acquisition module 23, a video upload module 24 and a video upload query module 25.
[0066] The record row adding module 21 is configured to determine the multiple video platforms corresponding to the first video upload based on the received video upload request, and add a record row of the first video in the data table corresponding to each video platform; the record row stores the link data of the first video;
[0067] A primary key identifier adding module 22 is configured to add the primary key identifier of the record row to the data queue of the corresponding video platform;
[0068] The link data acquisition module 23 is configured to acquire the primary key identifier in the data queue, and acquire the link data stored in the record row in the data table of the corresponding video platform according to the primary key identifier;
[0069] The video uploading module 24 is configured to upload the first video to the corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video and returns an upload task identifier;
[0070] The video upload query module 25 is configured to query the upload result of the first video on the corresponding video platform through the upload task identifier based on a preset period, and determine the upload status of the first video as uploaded when the upload result is found; if the upload result is not found, determine the upload status of the first video as being uploaded.
[0071] On the basis of the above embodiment, the multi-platform video upload query device also includes: a task identifier adding module, which is configured to create an upload task according to the first video on the video platform, and after returning the upload task identifier, upon receiving the upload task identifier corresponding to the first video returned by the video platform, add the upload task identifier to the record row of the data table corresponding to the video platform, and add the upload status of the first video as uploading in the record row; correspondingly, the video upload query module 25 also includes: an upload result query unit, which is configured to query the first video being uploaded in each record row of the data table based on a preset period, obtain the upload task identifier of the first video being uploaded, and query the upload result of the corresponding first video in the video platform corresponding to the data table according to the upload task identifier; an upload status updating unit, which is configured to add the upload result to the record row corresponding to the data table and update the upload status in the record row to upload completion when the upload result of the first video is queried; when the upload result of the first video is not queried, the upload status in the record row corresponding to the data table is maintained as uploading.
[0072] Based on the above embodiment, the link data acquisition module 23 includes: a link data acquisition unit, configured to obtain a primary key identifier in the data queue of the corresponding video platform through the job service of Kubernetes, and query the link data stored in the corresponding record row in the data table of the corresponding video platform according to the primary key identifier; the video upload module 24 includes: a first video upload unit, configured to upload the first video to the video platform corresponding to the data queue according to the link data.
[0073] Based on the above embodiment, the video upload module 24 includes: a link splicing unit, which is configured to obtain anti-hotlink data on the cloud on-demand server based on the link data, splice the link data and the anti-hotlink data to obtain the spliced data, and the link data is a link to the first video provided by the cloud on-demand server; a second video uploading unit, which is configured to download the first video on the cloud on-demand server according to the spliced data, call the upload interface of the video platform to upload the first video to the video platform, so that the video platform creates a corresponding upload task based on the first video obtained by the upload interface, and returns the upload task identifier through the upload interface.
[0074] On the basis of the above embodiment, the multi-platform video upload query device includes an upload result determination module, and the upload result determination module includes: an upload duration determination unit, configured to query the start upload time of the first video being uploaded in each record row of the data table, and determine the upload duration of the first video being uploaded according to the start upload time and the current time; the upload result determination unit, configured to delete the primary key identifier of the first video being uploaded in the data table from the corresponding data queue when the upload duration of the first video being uploaded exceeds a preset duration threshold, add the upload result of the failed upload to the corresponding record row of the data table and update the upload status in the record row to the end of upload.
[0075] On the basis of the above embodiment, the multi-platform video upload query device includes a first display module, and the first display module includes: a failure reason acquisition unit, which is configured to determine that the upload status of the first video is upload completion when the upload result is queried, and when the queried upload result is upload failure, obtain the upload failure reason issued by the video platform, and write the upload failure reason into the corresponding record row of the data table; the first display unit is configured to display the upload result, upload status and upload failure reason of the first video according to the data table of each video platform.
[0076] Based on the above embodiment, the multi-platform video upload query device includes a second display module, and the second display module includes: a video identification acquisition unit, which is configured to determine that the upload status of the first video is uploaded after the upload result is queried, and when the upload result is successfully uploaded, obtain the video identification issued by the video platform and write the video identification into the data table; the second display unit is configured to display the upload result, upload status and video identification of the first video according to the data table of each video platform.
[0077] As mentioned above, the multi-platform video upload query device provided by the embodiment of the present application determines the multiple video platforms corresponding to the first video upload through the received video upload request, adds the record row of the first video in the data table corresponding to each video platform, adds the primary key identifier of the record row to the data queue of the corresponding video platform, and stores the link data of the first video in the record row; obtains the primary key identifier in the data queue, obtains the link data stored in the record row in the data table of the corresponding video platform according to the primary key identifier, and uploads the first video to the corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video and returns the upload task identifier; based on the preset period, the upload result of the first video is queried on the corresponding video platform through the upload task identifier, and the upload status of the first video is determined to be the upload end when the upload result is queried, and the upload status of the first video is determined to be the upload in progress when the upload result is not queried. Through the above technical means, the link data of the first video can be actively obtained based on the primary key identifier cached in the data queue of each video platform, and the first video can be uploaded to each video platform according to the link data, so as to upload the first video to multiple video platforms with one click, simplify the operation of uploading videos on multiple platforms, and improve the upload efficiency of videos. Based on the upload task identifier returned by the video platform, the upload result of the first video is queried from the corresponding video platform. Compared with the callback query, the query based on the upload task identifier has a more intuitive code structure and better readability. In addition, the logical analysis of the upload operation and result processing reduces the coupling between modules. Therefore, the error rate of querying the upload result based on the upload task identifier is low, which solves the problem of being unable to obtain the upload result and upload result of the queried video in the prior art, and improves the query reliability of the video upload status and upload result.
[0078] The multi-platform video upload query device provided in the embodiment of the present application can be used to execute the multi-platform video upload query method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0079] Figure 7 This is a schematic diagram of the structure of a multi-platform video upload query device provided by an embodiment of the present application, referring to Figure 7 The multi-platform video upload query device includes: a processor 31, a memory 32, a communication device 33, an input device 34 and an output device 35. The number of processors 31 in the multi-platform video upload query device can be one or more, and the number of memories 32 in the multi-platform video upload query device can be one or more. The processor 31, memory 32, communication device 33, input device 34 and output device 35 of the multi-platform video upload query device can be connected through a bus or other methods.
[0080] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the multi-platform video upload query method of any embodiment of the present application (for example, the record line adding module 21, the primary key identifier adding module 22, the link data acquisition module 23, the video upload module 24 and the video upload query module 25 in the multi-platform video upload query device). The memory 32 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0081] The communication device 33 is used for data transmission.
[0082] The processor 31 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 32, that is, realizes the above-mentioned multi-platform video upload query method.
[0083] The input device 34 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 35 may include a display device such as a display screen.
[0084] The multi-platform video upload query device provided above can be used to execute the multi-platform video upload query method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0085] The embodiment of the present application also provides a storage medium containing computer executable instructions, which are used to execute a multi-platform video upload query method when executed by a computer processor. The multi-platform video upload query method includes: based on the received video upload request, determining multiple video platforms corresponding to the upload of the first video, adding a record row of the first video in the data table corresponding to each video platform, adding the primary key identifier of the record row to the data queue of the corresponding video platform, and storing the link data of the first video in the record row; obtaining the primary key identifier in the data queue, obtaining the link data stored in the record row in the data table of the corresponding video platform according to the primary key identifier, uploading the first video to the corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video and returns the upload task identifier; querying the upload result of the first video on the corresponding video platform through the upload task identifier based on a preset period, determining that the upload status of the first video is upload completed when the upload result is queried, and determining that the upload status of the first video is uploading in progress when the upload result is not queried.
[0086] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0087] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application is not limited to the multi-platform video upload query method as described above, and can also execute related operations in the multi-platform video upload query method provided in any embodiment of the present application.
[0088] The multi-platform video upload query device, storage medium and multi-platform video upload query equipment provided in the above embodiments can execute the multi-platform video upload query method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the multi-platform video upload query method provided in any embodiment of the present application.
[0089] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the protection scope of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A multi-platform video upload query method, characterized in that: include: Based on the received video upload request, determine multiple video platforms corresponding to the first video, add a record row of the first video in a data table corresponding to each of the video platforms, add a primary key identifier of the record row to a data queue of the corresponding video platform, and the record row stores link data of the first video; Obtaining the primary key identifier in the data queue, obtaining the link data stored in the record row in the data table of the corresponding video platform according to the primary key identifier, uploading the first video to the corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video, and returns an upload task identifier; In the case of receiving the upload task identifier corresponding to the first video returned by the video platform, adding the upload task identifier to the record row of the data table corresponding to the video platform, and adding the upload status of the first video as uploading in the record row; Based on a preset period, querying the upload result of the first video on the corresponding video platform through the upload task identifier, and determining that the upload status of the first video is upload completed when the upload result is queried, and determining that the upload status of the first video is uploading when the upload result is not queried; The method includes: querying the first video being uploaded in each record row of the data table based on a preset period, obtaining the upload task identifier of the first video being uploaded, and querying the upload result of the corresponding first video in the video platform corresponding to the data table according to the upload task identifier; when the upload result of the first video is queried, adding the upload result to the record row corresponding to the data table and updating the upload status in the record row to upload completion; when the upload result of the first video is not queried, maintaining the upload status in the record row corresponding to the data table as uploading.
2. The multi-platform video upload query method according to claim 1, characterized in that: The obtaining of the primary key identifier in the data queue, searching for link data stored in the record row in a data table of a corresponding video platform according to the primary key identifier, and uploading the first video to the corresponding video platform according to the link data includes: The primary key identifier is obtained in the data queue of the corresponding video platform through the Kubernetes job service, and the link data stored in the corresponding record row is queried in the data table of the corresponding video platform according to the primary key identifier, and the first video is uploaded to the video platform corresponding to the data queue according to the link data.
3. The multi-platform video upload query method according to claim 1 or 2, characterized in that: The uploading the first video to a corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video and returns an upload task identifier, includes: Acquire anti-hotlink data on the cloud video-on-demand service end based on the link data, and splice the link data and the anti-hotlink data to obtain spliced data, wherein the link data is a link to the first video provided by the cloud video-on-demand service end; The first video is downloaded from the cloud on-demand server according to the spliced data, and the upload interface of the video platform is called to upload the first video to the video platform, so that the video platform creates a corresponding upload task based on the first video obtained by the upload interface, and returns the upload task identifier through the upload interface.
4. The multi-platform video upload query method according to claim 1, characterized in that: The method further comprises: Inquiring the start upload time of the first video being uploaded in each record row of the data table, and determining the upload duration of the first video being uploaded according to the start upload time and the current time; When the upload duration of the first video being uploaded exceeds a preset duration threshold, the primary key identifier of the first video being uploaded in the data table is deleted from the corresponding data queue, the failed upload result is added to the corresponding record row of the data table, and the upload status in the record row is updated to upload completion.
5. The multi-platform video upload query method according to claim 1, characterized in that: After determining that the upload status of the first video is completed when the upload result is queried, the method further includes: When the upload result queried is that the upload fails, the upload failure reason issued by the video platform is obtained, and the upload failure reason is written into the record row corresponding to the data table; The upload result, upload status and upload failure reason of the first video are displayed according to the data table of each video platform.
6. The multi-platform video upload query method according to claim 1, characterized in that: After determining that the upload status of the first video is completed when the upload result is queried, the method further includes: When the upload result is successfully uploaded, obtaining the video ID issued by the video platform, and writing the video ID into the data table; The upload result, upload status and video ID of the first video are displayed according to the data tables of each video platform.
7. A multi-platform video upload query device, characterized in that: include: A record row adding module is configured to determine, based on the received video upload request, a plurality of video platforms corresponding to the first video being uploaded, and add a record row of the first video in a data table corresponding to each of the video platforms; the record row stores link data of the first video; A primary key identifier adding module is configured to add the primary key identifier of the record row to a data queue of a corresponding video platform; A link data acquisition module is configured to acquire the primary key identifier in the data queue, and acquire the link data stored in the record row in the data table of the corresponding video platform according to the primary key identifier; A video uploading module, configured to upload the first video to a corresponding video platform according to the link data, so that the video platform creates an upload task according to the first video and returns an upload task identifier; The task identifier adding module is configured to create an upload task according to the first video on the video platform, and after returning the upload task identifier, upon receiving the upload task identifier corresponding to the first video returned by the video platform, add the upload task identifier to a record row of the data table corresponding to the video platform, and add the upload status of the first video as being uploaded in the record row; The video upload query module is configured to query the upload result of the first video on the corresponding video platform through the upload task identifier based on a preset period, and determine the upload status of the first video as uploaded when the upload result is queried, and determine the upload status of the first video as being uploaded when the upload result is not queried; wherein, the video upload query module also includes: an upload result query unit, configured to query the first video being uploaded in each record row of the data table based on a preset period, obtain the upload task identifier of the first video being uploaded, and query the upload result of the corresponding first video on the video platform corresponding to the data table according to the upload task identifier; an upload status update unit, configured to add the upload result to the corresponding record row of the data table and update the upload status in the record row to uploaded when the upload result of the first video is queried; when the upload result of the first video is not queried, keep the upload status in the corresponding record row of the data table as being uploaded.
8. A multi-platform video upload query device, characterized in that: include: one or more processors; A memory stores one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the multi-platform video upload query method as described in any one of claims 1-6.
9. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions, when executed by a computer processor, are used to execute the multi-platform video upload query method as described in any one of claims 1-6.
Citation Information
Patent Citations
Data query method and device and server
CN109977135A
Method for quickly decomposing vehicle identification code through big data cloud platform
CN110390236A