Request processing method and apparatus, computer device, and storage medium
By setting up a traffic entry API in the video server, injecting parameters uniformly, and remotely calling the traffic entry server, the problem of traffic entry code depending on the main site project was solved, enabling independent deployment and efficient iteration of the traffic entry, and improving development efficiency and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
- Filing Date
- 2022-09-26
- Publication Date
- 2026-06-12
AI Technical Summary
In existing technologies, the development and maintenance of traffic redirection entry points are embedded in the main site project, which leads to a gradual decrease in development iteration efficiency and makes it impossible to deploy and stress test independently, affecting the stability and iteration efficiency of traffic redirection entry points.
By setting up a traffic entry API in the video server, injecting parameter information uniformly, and remotely calling the traffic server, the traffic entry's dependency on the video server is eliminated. The traffic entry code is decoupled from the main site project and deployed independently in the traffic server, achieving unified management and maintenance.
It improved the development and iteration efficiency of the traffic redirection portal, reduced the scale of the main site project, enabled independent stress testing, and ensured the service stability and user experience of the traffic redirection portal.
Smart Images

Figure CN115643431B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of video technology, and in particular to a request processing method, apparatus, computer device, and storage medium. Background Technology
[0002] With the development of video technology, users can browse videos anytime, anywhere in short video and micro-video applications. Feed video streams are a typical user request scenario. Users pull the feed video stream through their terminals and display it on their terminals. Usually, the feed video stream is accompanied by a referral entry point, such as a video card or a live stream card. A video card is an interactive card displayed on the video playback page, and a live stream card is an interactive card displayed in the live stream room. The referral entry point serves to drive traffic to downstream businesses.
[0003] Currently, the daily development and maintenance of traffic redirection entry points are typically embedded within the main site project of the Feed cluster. However, as the main site project grows increasingly large, development iteration efficiency is gradually decreasing. Therefore, a solution that can improve development iteration efficiency is urgently needed. Summary of the Invention
[0004] This disclosure provides a request processing method, apparatus, computer device, and storage medium to at least improve the development and iteration efficiency of video applications. The technical solution of this disclosure is as follows:
[0005] According to one aspect of the embodiments of this disclosure, a request processing method is provided, executed by a video server, including:
[0006] The system receives a video stream retrieval request from the terminal via the Interface Application Programming Interface (API), and the video stream retrieval request is used to retrieve the video stream from the interface associated with the API.
[0007] Through the interface API, the streaming entry API is injected with parameter information associated with the video stream pull request. The parameter information is used to provide the pass-through parameters that the interface API should inject when calling the streaming entry API.
[0008] The traffic redirection server is remotely invoked through the traffic redirection entry API. The traffic redirection server is used to generate traffic redirection entries for the videos in the video stream. The traffic redirection entry is associated with the video elements contained in the videos in the video stream.
[0009] Upon receiving the traffic redirection entry returned by the traffic redirection server for the video stream, the traffic redirection entry is sent to the terminal, and the traffic redirection entry links to the interactive interface of the service associated with the video element.
[0010] In some embodiments, the parameter information associated with the video stream retrieval request injected into the guide stream entry API via the interface API includes:
[0011] The interface API is used to generate parameter information to be injected based on the video stream retrieval request;
[0012] The interface API is used to invoke the traffic entry API, and the parameter information is passed into the traffic entry API.
[0013] In some embodiments, remotely calling the traffic redirection server via the traffic redirection entry API includes:
[0014] The API receives parameter information injected by the interface API through the traffic entry API.
[0015] The parameter information injected by the interface API is assembled according to a preset format to obtain the assembled parameters;
[0016] Send a Remote Procedure Call (RPC) request carrying the assembled parameters to the traffic redirection server. The RPC request is used to request the traffic redirection server to return the traffic redirection entry point.
[0017] In some embodiments, the method further includes:
[0018] In response to the video stream pull request, determine the scaling result of the interface API's scaling switch on the video stream pull request. The scaling result is used to indicate whether the interface API remotely calls the streaming server through the streaming entry API.
[0019] If the result of the volume increase is a remote call, the operation of injecting the parameter information of the interface API into the traffic entry API is performed;
[0020] In the case where the volume increase result is a local call, the processing logic of the traffic entry point is obtained through the local call of the interface API.
[0021] In some embodiments, the method further includes:
[0022] Skip the interface API and perform stress testing on the traffic entry API to obtain the stress test evaluation result of the traffic entry API. The stress test evaluation result is used to measure the processing performance of the traffic entry API in remotely calling the traffic server.
[0023] In some embodiments, the method further includes:
[0024] In response to the update instruction for the traffic entry API, the traffic entry API is updated and the updated traffic entry API is published.
[0025] According to another aspect of the embodiments of this disclosure, a request processing method is provided, executed by a traffic redirection server, including:
[0026] Upon receiving a remote call initiated by the video server through the streaming entry API, obtain the parameter information provided by the streaming entry API, which is generated based on the video stream retrieval request;
[0027] Based on the parameter information, the interactive video elements in the video stream retrieved from the video stream retrieved by the video stream retrieval request are determined.
[0028] Generate a traffic entry point for the video element, and link the traffic entry point to the interactive interface of the service associated with the video element;
[0029] The traffic redirection entry is sent to the video server.
[0030] In some embodiments, obtaining the parameter information provided by the streaming entry API when receiving a remote call initiated by the video server through the streaming entry API includes:
[0031] Upon receiving an RPC request sent by the video server through the streaming entry API, the assembled parameters in a preset format are read from the RPC request. The assembled parameters are assembled according to the preset format based on the parameter information injected into the streaming entry API by the interface API. The interface API refers to the API by which the video server receives the video stream pull request.
[0032] The assembled parameters are parsed to obtain the parameter information injected from the interface API into the traffic entry API.
[0033] In some embodiments, determining the interactive video elements in the video stream retrieved from the video stream retrieved by the video stream retrieval request based on the parameter information includes:
[0034] In the case where the video stream contains multiple interactive video elements, a correlation parameter is determined for each of the multiple video elements and the video, the correlation parameter being used to indicate the degree of correlation between the video element and the video;
[0035] Based on the correlation parameters, the video elements to be used to generate the traffic entry point are selected from the plurality of video elements.
[0036] In some embodiments, the ingress point for generating the video element includes:
[0037] Identify at least one service associated with the video element;
[0038] Send a referral link request to the business API of each of the at least one business, the referral link request being used to request that the business indicated by the business API be provided in the interactive interface linked by the referral entry;
[0039] Upon receiving confirmation information from various business APIs regarding the referral link request, the display resources for the referral entry point and the display resources for the interactive interface are generated.
[0040] In some embodiments, sending the traffic redirection entry to the video server includes:
[0041] The video server is sent with the display resources of the traffic entry point and the access address of the interactive interface, the access address being used to provide the display resources of the interactive interface.
[0042] In some embodiments, the method further includes:
[0043] When the video server performs stress testing on the traffic redirection entry API, it processes the remote calls initiated by the traffic redirection entry API and generates a stress test evaluation result for the traffic redirection entry API. The stress test evaluation result is used to measure the processing performance of the traffic redirection entry API in remotely calling the traffic redirection server.
[0044] In some embodiments, the method further includes:
[0045] In response to the update instruction for the processing logic of the traffic entry API, the processing logic of the traffic entry API is updated and the updated processing logic is published.
[0046] Based on the updated processing logic, an update instruction for the traffic entry API is sent to the video server, and the update instruction for the traffic entry API is adapted to the update instruction of the processing logic.
[0047] According to another aspect of the embodiments of this disclosure, a request processing apparatus is provided, comprising:
[0048] The receiving unit is configured to execute a video stream retrieval request from the receiving terminal via a user interface application programming interface (API), the video stream retrieval request being used to retrieve a video stream from the interface associated with the API.
[0049] The parameter injection unit is configured to inject parameter information associated with the video stream pull request into the stream entry API through the interface API. The parameter information is used to provide the pass-through parameters that the interface API should inject when calling the stream entry API.
[0050] The remote call unit is configured to execute a remote call to the streaming server via the streaming entry API. The streaming server is used to generate streaming entries for the videos in the video stream, and the streaming entry is associated with the video elements contained in the videos in the video stream.
[0051] The delivery unit is configured to, upon receiving a traffic entry point returned by the traffic redirection server for the video stream, send the traffic redirection entry point to the terminal, wherein the traffic redirection entry point links to the interactive interface of the service associated with the video element.
[0052] In some embodiments, the parameter injection unit is configured to perform:
[0053] The interface API is used to generate parameter information to be injected based on the video stream retrieval request;
[0054] The interface API is used to invoke the traffic entry API, and the parameter information is passed into the traffic entry API.
[0055] In some embodiments, the remote invocation unit is configured to execute:
[0056] The API receives parameter information injected by the interface API through the traffic entry API.
[0057] The parameter information injected by the interface API is assembled according to a preset format to obtain the assembled parameters;
[0058] Send a Remote Procedure Call (RPC) request carrying the assembled parameters to the traffic redirection server. The RPC request is used to request the traffic redirection server to return the traffic redirection entry point.
[0059] In some embodiments, the apparatus further includes:
[0060] The volume increase result determination unit is configured to respond to the video stream pull request and determine the volume increase result of the interface API's volume increase switch for the video stream pull request. The volume increase result is used to indicate whether the interface API remotely calls the traffic redirection server through the traffic redirection entry API.
[0061] The remote call unit is also configured to perform the operation of injecting the parameter information of the interface API into the traffic entry API when the result of the volume increase is a remote call;
[0062] The local processing unit is configured to execute processing logic to obtain the traffic entry point through the interface API local call when the traffic increase result is a local call.
[0063] In some embodiments, the apparatus further includes:
[0064] The load testing unit is configured to perform a load test on the traffic redirection entry API by skipping the interface API, and obtain a load test evaluation result for the traffic redirection entry API. The load test evaluation result is used to measure the processing performance of the traffic redirection entry API in remotely calling the traffic redirection server.
[0065] In some embodiments, the apparatus further includes:
[0066] The update and release unit is configured to execute an update instruction for the traffic entry API, update the traffic entry API, and release the updated traffic entry API.
[0067] According to another aspect of the embodiments of this disclosure, a request processing apparatus is provided, comprising:
[0068] The parameter acquisition unit is configured to, upon receiving a remote call initiated by the video server through the streaming entry API, acquire parameter information provided by the streaming entry API, wherein the parameter information is generated based on the video stream retrieval request;
[0069] The video element determination unit is configured to determine, based on the parameter information, the interactive video elements contained in the video stream retrieved from the video stream retrieved by the video stream retrieval request.
[0070] The traffic entry generation unit is configured to generate a traffic entry for the video element, and the traffic entry is linked to the interactive interface of the service associated with the video element.
[0071] The distribution unit is configured to distribute the traffic entry to the video server.
[0072] In some embodiments, the parameter acquisition unit is configured to perform:
[0073] Upon receiving an RPC request sent by the video server through the streaming entry API, the assembled parameters in a preset format are read from the RPC request. The assembled parameters are assembled according to the preset format based on the parameter information injected into the streaming entry API by the interface API. The interface API refers to the API by which the video server receives the video stream pull request.
[0074] The assembled parameters are parsed to obtain the parameter information injected from the interface API into the traffic entry API.
[0075] In some embodiments, the video element determination unit is configured to perform:
[0076] In the case where the video stream contains multiple interactive video elements, a correlation parameter is determined for each of the multiple video elements and the video, the correlation parameter being used to indicate the degree of correlation between the video element and the video;
[0077] Based on the correlation parameters, the video elements to be used to generate the traffic entry point are selected from the plurality of video elements.
[0078] In some embodiments, the inlet generation unit is configured to perform:
[0079] Identify at least one service associated with the video element;
[0080] Send a referral link request to the business API of each of the at least one business, the referral link request being used to request that the business indicated by the business API be provided in the interactive interface linked by the referral entry;
[0081] Upon receiving confirmation information from various business APIs regarding the referral link request, the display resources for the referral entry point and the display resources for the interactive interface are generated.
[0082] In some embodiments, the issuing unit is configured to perform:
[0083] The video server is sent with the display resources of the traffic entry point and the access address of the interactive interface, the access address being used to provide the display resources of the interactive interface.
[0084] In some embodiments, the apparatus further includes:
[0085] The load testing unit is configured to process remote calls initiated by the traffic entry API when the video server performs a load test on the traffic entry API, and generate a load test evaluation result for the traffic entry API. The load test evaluation result is used to measure the processing performance of the traffic entry API in remotely calling the traffic server.
[0086] In some embodiments, the apparatus further includes:
[0087] The logic update unit is configured to execute an update instruction in response to the processing logic of the traffic entry API, update the processing logic of the traffic entry API, and publish the updated processing logic.
[0088] The sending unit is also configured to execute an update instruction for the traffic entry API to the video server based on the updated processing logic, wherein the update instruction for the traffic entry API is adapted to the update instruction for the processing logic.
[0089] According to another aspect of the embodiments of this disclosure, a computer device is provided, comprising:
[0090] One or more processors;
[0091] One or more memories for storing the one or more processor-executable instructions;
[0092] The one or more processors are configured to perform the request processing method in any of the possible implementations of the above-described aspects.
[0093] According to another aspect of the present disclosure, a computer-readable storage medium is provided such that, when at least one instruction in the computer-readable storage medium is executed by one or more processors of a computer device, the computer device is enabled to perform a request processing method in any possible implementation of the above aspect.
[0094] According to another aspect of the present disclosure, a computer program product is provided, including one or more instructions that can be executed by one or more processors of a computer device, enabling the computer device to perform a request processing method in any possible implementation of the above aspect.
[0095] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:
[0096] By setting up a streaming entry API in the video server, regardless of the interface from which the video stream is triggered, whenever there is a need to generate a streaming entry in the video stream, the interface API will uniformly inject parameter information into the streaming entry API. The streaming entry API will then initiate a remote call to the streaming server, calling the remote streaming server to synthesize the streaming entry for each video in the video stream. This decouples the synthesis of streaming entry from the video server and removes the code logic of the streaming entry from the main site project. This facilitates unified management and maintenance of streaming entry synthesis for video streams from various interface requests, and helps improve development iteration efficiency.
[0097] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0098] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0099] Figure 1This is a schematic diagram illustrating the implementation environment of a request processing method according to an exemplary embodiment;
[0100] Figure 2 This is a flowchart illustrating a request processing method according to an exemplary embodiment;
[0101] Figure 3 This is an interactive flowchart illustrating a request processing method according to an exemplary embodiment;
[0102] Figure 4 This is a schematic diagram illustrating the principle of a request processing method provided in an embodiment of this disclosure;
[0103] Figure 5 This is a logical structure block diagram of a request processing apparatus according to an exemplary embodiment;
[0104] Figure 6 This is a logical structure block diagram of a request processing apparatus according to an exemplary embodiment;
[0105] Figure 7 This is a schematic diagram of the structure of a server provided in an embodiment of this disclosure. Detailed Implementation
[0106] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0107] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0108] The information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this disclosure are all authorized by the user or fully authorized by the parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the video streams involved in this disclosure were all obtained with full authorization.
[0109] In some embodiments, the meaning of A and / or B includes three cases: A and B, and A and B.
[0110] The following describes the terminology used in the embodiments of this disclosure.
[0111] Feed: A feed is a content aggregator that combines several message sources actively subscribed to by a user, helping the user continuously obtain the latest content from their subscriptions. Based on this, a feed stream is a continuously updated and presented information flow to the user. When the continuously updated content in a feed stream consists of several videos, it is also called a video feed.
[0112] Traffic redirection entry point: This is an important resource position on the playback page of each video in the Feed video stream. It is usually presented in the form of interactive cards, interactive widgets, etc., and plays the role of driving traffic to multiple downstream businesses. The traffic redirection entry point is usually associated with a certain video element displayed in the video. For example, if the video involves shared bicycles, the traffic redirection entry point is provided as the download entry point for the shared bicycle APP (Application). Or, if the video involves a certain product, the traffic redirection entry point is provided as the purchase entry point for the product.
[0113] Application Programming Interface (API): An API is defined as a standard set of instructions that an application can use to exchange information and commands with a computer's operating system. A standard API provides users or software developers with a common programming environment to write applications that can run interactively on computers from different vendors.
[0114] Stress testing, or load testing for short, is a testing method to establish system stability. It is typically conducted outside the system's normal operating range to examine its functional limits and identify potential problems. Generally, API stress testing involves continuously applying "stress" to the server that remotely calls the API. By identifying a system's bottlenecks or unacceptable performance points, it aims to determine the maximum service level the system can provide. Before an API or feature goes live, stress testing is usually performed to understand its service performance and the corresponding server's traffic capacity.
[0115] Queries per second (QPS): QPS is an important metric in load testing, measuring the amount of traffic a specific query server can handle within a given time. Typically, load testing aims to test the server's maximum QPS capacity.
[0116] Remote Procedure Call (RPC): Similar to a three-tier C / S (Client / Server) system, the server provides an API to the outside world. Third-party programs use the API to call standard or custom functions inside the server, obtain the data returned by the function, process it, and then display or print it. For example, a streaming server provides a streaming entry API to the outside world, which allows the video server to remotely call the code logic in the streaming server that generates the streaming entry through the streaming entry API. The streaming server then returns the generated streaming entry to the video server.
[0117] Typically, in short video or micro-video applications, feed video streams are a typical user request scenario. Users pull the feed video stream through their terminals and display it on their terminals. Usually, the feed video stream is accompanied by a referral entry point, such as a video card or a live stream card. A video card is an interactive card displayed on the video playback page, and a live stream card is an interactive card displayed in the live stream room. The referral entry point serves to drive traffic to downstream businesses.
[0118] Currently, the daily development and maintenance of the traffic redirection entry point are typically embedded within the main site project of the Feed cluster. As the main site project grows increasingly large, development iteration efficiency is gradually decreasing. Under the current project architecture, when a user requests to pull Feed video streams from different interfaces, each interface's API is invoked. For the traffic redirection entry point function, since all interface APIs need to call the traffic redirection entry point code, any changes to the code require redeploying all interface APIs involved in calling the entry point, significantly reducing development iteration efficiency. Furthermore, due to the overall deployment architecture of the main site project, the traffic redirection entry point code cannot be deployed independently, and it's impossible to simulate the actual peak traffic of the traffic redirection entry point through load testing. For example, if 10 interface APIs are involved, simulating a peak traffic of 500,000 for the traffic redirection entry point would require simulating 50,000 traffic for each of the 10 interface APIs simultaneously, which is virtually impossible in load testing scenarios. Therefore, there is a lack of effective means to ensure the stability of the traffic redirection entry point.
[0119] In view of this, this embodiment of the disclosure provides an integrated traffic referral entry API and an integrated traffic referral server. The code of the traffic referral entry is separated from the main site project and deployed independently to the traffic referral server, which provides the integrated traffic referral entry API to the outside world. This not only reduces the size of the main site project, but also effectively improves the iteration efficiency of the traffic referral entry due to the separate deployment of the traffic referral entry code. When the code is updated, only the traffic referral entry API needs to be redeployed, instead of redeploying all interface APIs. In addition, the traffic referral server can be stress tested separately through the traffic referral entry API, which can ensure the service stability of the traffic referral entry and help improve the user experience.
[0120] The system architecture involved in the embodiments of this disclosure will be described below.
[0121] Figure 1 This is a schematic diagram illustrating an implementation environment of a request processing method according to an exemplary embodiment. See also: Figure 1 This implementation environment includes a terminal 110 and a server cluster 120. The server cluster 120 includes a video server 121, a traffic redirection server 122, and a service server 123, which are described in detail below:
[0122] Terminal 110 has an application installed and running that supports playing video streams. The video stream can be a feed video stream containing multiple videos. For example, the application includes: short video application, mini video application, audio and video application, social application, content sharing application, game application, browser application, etc.
[0123] In some embodiments, a user launches an application on terminal 110, and as the user accesses the Feed video stream in the application, calls the interface API of the trigger interface for accessing the Feed video stream, so as to send a video stream pull request to the video server 121 in the server cluster 120 through the interface API.
[0124] Terminal 110 is directly or indirectly connected to server cluster 120 via wired or wireless communication, and this embodiment of the present disclosure does not limit this.
[0125] Server cluster 120 is used to provide background services to applications running on terminal 110. Server cluster 120 includes at least one of multiple servers, cloud computing platforms, or virtualization centers. Optionally, server cluster 120 undertakes the primary computing work, and terminal 110 undertakes the secondary computing work; or, server cluster 120 undertakes the secondary computing work, and terminal 110 undertakes the primary computing work; or, server cluster 120 and terminal 110 use a distributed computing architecture for collaborative computing.
[0126] In some embodiments, server cluster 120 maintains the video sharing platform accessed by the aforementioned application. Users can upload videos they have shot or recorded on the video sharing platform through terminal 110, and can also start live streaming. In addition, users can also pull feed video streams through terminal 110 and browse videos or live streams of interest by playing the feed video stream. For example, during the playback of the feed video stream, the video pulled from the feed video stream is played on the video playback page. At the same time, the playback page also displays a referral entry related to a certain video element in the video. If the user is interested in the video element, they can perform interactive operations on the referral entry to enter the details interface of the business corresponding to the video element, and realize subsequent deep interactive behaviors such as conversion, consumption, download, following, and sharing of downstream businesses.
[0127] In some embodiments, if a user is not interested in the video on the current playback page while browsing the Feed video stream, they can switch to the previous / next video in the Feed video stream by using predefined video switching operations such as swiping up, swiping down, swiping left, and swiping right.
[0128] In an exemplary scenario, server cluster 120 includes video server 121, streaming server 122, and business server 123. A video stream retrieval request from the terminal is sent to video server 121 via an interface API. In response to this request, server 121 generates a video stream to be sent to the terminal, then injects the video stream and related parameters into the streaming entry API. It remotely calls streaming server 122 via the streaming entry API. Streaming server 122, in response to the remote call, runs the code logic to generate the streaming entry, determines the downstream business (which may be multiple) linked to the streaming entry, and sequentially accesses the business server 123 of the downstream business. This generates display resources for the streaming entry and the linked business interface for each video in the video stream. The generated streaming entry and business interface display resources are then returned to video server 121. Video server 121 then sends a feed video stream carrying the streaming entry to the terminal.
[0129] In some embodiments, the device type of terminal 110 includes at least one of the following: a smartphone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, or a desktop computer. For example, terminal 110 is a smartphone or other handheld portable electronic device. The following embodiments illustrate this by assuming that terminal 110 includes a smartphone.
[0130] Those skilled in the art will understand that the number of terminals 110 described above can be more or less. For example, there may be only one terminal 110, or there may be dozens or hundreds of terminals 110, or even more. This disclosure does not limit the number or type of terminals 110.
[0131] Figure 2 This is a flowchart illustrating a request processing method according to an exemplary embodiment, see [link to flowchart]. Figure 2 The request processing method is executed by a video server, which is an exemplary illustration of a computer device, and the method includes the following steps:
[0132] In step 201, the video server receives a video stream retrieval request from the terminal via the interface API. This video stream retrieval request is used to retrieve the video stream from the interface associated with the interface API.
[0133] In step 202, the video server injects the parameter information associated with the video stream retrieval request into the stream entry API through the interface API. This parameter information is used to provide the pass-through parameters that the interface API should inject when calling the stream entry API.
[0134] In step 203, the video server remotely calls the streaming server through the streaming entry API. The streaming server is used to generate streaming entries for the video in the video stream. The streaming entry is associated with the video elements contained in the video in the video stream.
[0135] In step 204, when the video server receives the redirection entry returned by the redirection server for the video stream, it sends the redirection entry to the terminal, and the redirection entry links to the interactive interface of the service associated with the video element.
[0136] The method provided in this disclosure, by setting a streaming entry API in the video server, ensures that regardless of the interface triggering the video stream retrieval request, when there is a need to generate a streaming entry in the video stream, parameter information is uniformly injected into the streaming entry API via the interface API. The streaming entry API then initiates a remote call to the streaming server, invoking the remote streaming server to synthesize the streaming entry for each video in the video stream. This decouples the synthesis of streaming entry from the video server, removing the code logic of the streaming entry from the main site project. This facilitates unified management and maintenance of streaming entry synthesis for video streams from various interface requests, and improves development iteration efficiency.
[0137] In some embodiments, the parameter information associated with the video stream retrieval request injected via the interface API through the wizard stream entry API includes:
[0138] The API interface generates the parameter information to be injected based on the video stream retrieval request.
[0139] The API interface is used to invoke the traffic entry API, and the parameter information is passed into the traffic entry API.
[0140] In some embodiments, remotely calling the traffic redirection server via the traffic redirection entry API includes:
[0141] Through this traffic entry API, the parameter information injected by the interface API is received;
[0142] The parameters injected by the API of this interface are assembled according to a preset format to obtain the assembled parameters.
[0143] Send a Remote Procedure Call (RPC) request carrying the assembled parameters to the referral server. This RPC request is used to request the referral server to return the referral entry point.
[0144] In some embodiments, the method further includes:
[0145] In response to the video stream pull request, determine the scaling result of the scaling switch of the interface API for the video stream pull request. The scaling result is used to indicate whether the interface API makes a remote call to the streaming server through the streaming entry API.
[0146] If the result of this volume increase is a remote call, then perform the operation of injecting the parameter information of the interface API into the traffic entry API;
[0147] If the traffic increase result is a local call, the processing logic of the traffic entry point is obtained through the local call of the interface API.
[0148] In some embodiments, the method further includes:
[0149] Skip the interface API and perform stress testing on the traffic entry API to obtain the stress test evaluation result of the traffic entry API. The stress test evaluation result is used to measure the processing performance of the traffic entry API when remotely calling the traffic server.
[0150] In some embodiments, the method further includes:
[0151] In response to the update command for the traffic entry API, update the traffic entry API and publish the updated traffic entry API.
[0152] All of the above-mentioned optional technical solutions can be combined in any way to form optional embodiments of this disclosure, and will not be described in detail here.
[0153] Figure 3 This is an interactive flowchart illustrating a request processing method according to an exemplary embodiment, such as... Figure 3 As shown, the request processing method is used in the interaction process between the terminal, the video server, and the traffic redirection server. This embodiment includes the following steps.
[0154] In step 301, the terminal accesses the video interface in the application and sends a video stream retrieval request to the video server through the interface API of the video interface.
[0155] The video stream retrieval request is used to retrieve the video stream from the interface associated with the API.
[0156] In some embodiments, a user launches an application on a terminal and accesses a video interface through the application. The video interface refers to an interface used to play video streams, such as an account homepage, video recommendation page, popular recommendation page, nearby recommendation page, live stream recommendation page, etc. This disclosure does not specifically limit the type of video interface.
[0157] When a terminal accesses a video interface, it calls the interface API associated with the video interface and sends a video stream retrieval request to the video server through the interface API. The video stream retrieval request is used to retrieve the video stream in the video interface. For example, when the video stream is a feed video stream, the video stream retrieval request is used to retrieve the feed video stream in the video interface.
[0158] In step 302, the video server receives the terminal's video stream retrieval request through the interface API.
[0159] In some embodiments, the video server receives a video stream retrieval request from the terminal through an interface API. Depending on how the terminal sends the video stream retrieval request, the video server receives the video stream retrieval request through different means. This disclosure does not specifically limit the method of sending / receiving the video stream retrieval request.
[0160] Optionally, the terminal establishes a long-lived connection with the video server. The video server pre-registers a callback function in the terminal. When the terminal accesses the video interface, the callback function notifies the video interface's API to send a video stream retrieval request to the video server, requesting the video server to distribute the feed video stream from the video interface. Correspondingly, the video server receives the video stream retrieval request based on a callback method within the long-lived connection session.
[0161] Optionally, the terminal establishes a persistent connection session with the video server. The video server pre-registers an event listener in the terminal. When the event listener detects an access event to the video interface from the terminal, it invokes the interface API of the video interface through a hook function, triggering the interface API to send a video stream retrieval request to the video server, requesting the video server to send the feed video stream from the video interface. Correspondingly, the video server receives the video stream retrieval request in the persistent connection session using the hook method.
[0162] Optionally, the terminal establishes a persistent connection with the video server. When the terminal accesses the video interface, it notifies the video server to send the feed video stream from the video interface via JavaScript reflection. Correspondingly, the video server receives the video stream retrieval request within the persistent connection session based on JavaScript reflection.
[0163] In step 303, the video server injects the parameter information associated with the video stream retrieval request into the stream entry API via the interface API.
[0164] This parameter information is used to provide the pass-through parameters that the interface API should inject when calling the traffic entry API.
[0165] In some embodiments, after the video server receives a video stream retrieval request from the terminal through the interface API, it generates parameter information to be injected based on the video stream retrieval request through the interface API, and then invokes the stream entry API through the interface API to pass the parameter information into the stream entry API.
[0166] In some embodiments, in response to the video stream retrieval request, the video server generates a video stream to be distributed to the terminal. Then, it determines the parameter information used to generate the streaming entry point for this video stream. For example, the parameter information includes the interface ID of the video interface, the video ID (identification) of each video in the video stream, the account ID of the logged-in terminal, etc. The content of the parameter information is not limited here. After obtaining the parameter information, the streaming entry API can be called using the plc.sdk tool to inject the parameter information into the streaming entry API.
[0167] In the above process, by generating parameter information to be injected based on the video stream retrieval request, and injecting the parameter information into the streaming entry API, the parameter information can be uniformly injected into the streaming entry API regardless of which terminal or interface initiates the video stream retrieval request. This allows the streaming entry API to act as an integrated interface to uniformly process requests that need to generate streaming entry points, decoupling the streaming entry code from the logic of each interface API.
[0168] In step 304, the video server assembles the parameter information injected by the interface API according to a preset format through the traffic entry API to obtain the assembled parameters.
[0169] In some embodiments, after the video server invokes the streaming entry API, the video server receives the parameter information injected by the interface API through the streaming entry API. Further, to ensure that the parameter information transmitted to the streaming server through the streaming entry API is not missed or mistransmitted, the streaming entry API assembles the parameter information injected by the interface API according to a preset format to obtain assembled parameters. This ensures that regardless of which video interface API is invoked, the parameters can be assembled according to a unified preset format, achieving correct transmission of parameter information. The preset format can be predefined by technicians on the video server, allowing it to adapt to different interface APIs. Optionally, a corresponding preset format can be adapted for each interface API, or the same preset format can be adapted for different interface APIs; this embodiment does not limit this.
[0170] In some embodiments, the preset format can be a URL (Uniform Resource Locator) format. By assembling the parameter information injected by the interface API into a URL format and predefining the meaning of each part of the URL format, it can be ensured that the traffic redirection server reads the corresponding part of the URL format when it needs the required parameter, thus achieving correct transmission of parameter information. Of course, in addition to the URL format, other formats can also be used to assemble parameter information, such as sets, arrays, data stacks, bitmaps, etc., and this disclosure does not specifically limit the specific format used.
[0171] In step 305, the video server sends an RPC request carrying the assembled parameters to the streaming server via the streaming entry API.
[0172] The RPC request is used to request the referral server to return the referral entry point.
[0173] The streaming server is used to generate streaming entry points for the videos in the video stream, and these entry points are associated with the video elements contained in the videos in the video stream.
[0174] In some embodiments, after obtaining the assembled parameters through step 304 above, the video server encapsulates the assembled parameters into an RPC request. For example, the assembled parameters are encapsulated using a pre-negotiated communication protocol between the video server and the streaming server to obtain the RPC request. The communication protocol includes Transmission Control Protocol (TCP), Internet Protocol (IP), User Datagram Protocol (UDP), etc. Then, the RPC interface in the streaming entry API is called to send the RPC request to the streaming server, thereby enabling remote invocation of the streaming server.
[0175] In steps 304-305 above, a possible implementation method is provided whereby the video server remotely calls the streaming server through the streaming entry API. That is, by modifying the parameter pass-through part of the interface API to the streaming entry API, it is adapted to the integrated streaming entry generation service, and the streaming server is remotely called through the RPC interface. This allows the code logic for generating streaming entries to be moved from the video server to the streaming server, thereby eliminating the dependency between the streaming entry code and the main site project. This means that the main site project does not need to depend on the local code of the video server. When there is a need to generate streaming entries, the logic can be remotely called to the remote streaming server through the streaming entry API. Furthermore, it can also converge all the various streaming entry generation needs of different video interfaces into the streaming entry API for processing, and manage and maintain the streaming entry-related services through the streaming entry API, improving the convenience of management and maintenance.
[0176] In step 306, the traffic redirection server reads the assembled parameters in a preset format from the RPC request.
[0177] The assembled parameters are assembled according to the preset format based on the parameter information injected into the traffic entry API by the interface API. The interface API refers to the API by which the video server receives the video stream pull request.
[0178] In some embodiments, when the streaming server receives an RPC request sent by the video server through the streaming entry API, it parses the received RPC request based on a pre-negotiated communication protocol to obtain the assembled parameters assembled according to a preset format.
[0179] It should be noted that the RPC request sent by the video server to the streaming server may be compressed or encrypted. If the RPC request received by the streaming server is compressed, the streaming server needs to decompress the parsed request. If the RPC request received by the streaming server is encrypted, the streaming server needs to decrypt the parsed request. This embodiment does not specifically limit whether the RPC request is encrypted / compressed.
[0180] In the above process, the assembled parameters are obtained from the RPC request. Since the assembled parameters are assembled in a preset format, the omission or incorrect transmission of parameter information injected by the interface API is avoided, and the parameter information is correctly transmitted from the interface API to the traffic redirection server.
[0181] In step 307, the traffic redirection server parses the assembled parameters to obtain the parameter information injected from the interface API into the traffic redirection entry API.
[0182] This parameter information is generated based on the video stream retrieval request.
[0183] In some embodiments, the traffic redirection server continues to parse the assembled parameters to obtain the parameter information originally injected by the interface API. For example, the assembled parameters are presented in the following format: Account ID + Interface ID + Video ID_1 + Video ID_2 + ... + Video ID_n (n≥1). Then, the traffic redirection server can parse each field of the assembled parameters in sequence to obtain the Account ID, Interface ID, Video ID_1 of the first video in the Feed video stream, Video ID_2 of the second video in the Feed video stream, ..., Video ID_n of the nth video in the Feed video stream.
[0184] In steps 306-307 above, a possible implementation method is provided for the streaming server to obtain the parameter information provided by the streaming entry API when it receives a remote call initiated by the video server through the streaming entry API. The streaming entry API assembles the injected parameter information according to a preset format to obtain the assembled parameters, and encapsulates the assembled parameters in an RPC request and sends it to the streaming server. The streaming server parses the RPC request to obtain the assembled parameters, and then parses the assembled parameters to obtain the original injected parameter information. This allows the interface API to promptly check for any missing parameters (such as missing fields in the preset format) during the parameter injection stage. At the same time, the streaming server can also check for missing fields during the parsing of the assembled parameters to determine whether any parameters were lost during transmission, thereby improving the correctness and stability of parameter information transmission between the video server and the streaming server.
[0185] In step 308, the streaming server, based on the parameter information, determines the interactive video elements in the video stream retrieved from the video stream retrieved by the video stream retrieval request.
[0186] In some embodiments, the streaming server can determine the video ID of each video in the video stream generated by the video server based on this parameter information. Then, it can query one or more interactive video elements contained in the corresponding video based on each video ID.
[0187] In some embodiments, the streaming server associates the video ID of each video with the element ID of an interactive video element in the video. Thus, for each video ID parsed from the parameter information, one or more element IDs associated with that video ID can be retrieved. These retrieved element IDs are used to indicate one or more interactive video elements contained in the video.
[0188] To illustrate, the streaming server stores a hash table. Each row in the hash table records the video ID of a video and a list of element IDs of the interactive video elements in that video. Whenever a video ID is parsed from the parameter information, the list of element IDs corresponding to that video ID is retrieved from the hash table, and one or more interactive video elements in the current video are determined based on one or more element IDs stored in the element ID list.
[0189] To illustrate, the streaming server constructs a Key-Value data structure for each video. In the Key-Value data structure, the video ID is used as the key and the list of element IDs is used as the value. Thus, whenever a video ID is parsed from the parameter information, the corresponding value in the Key-Value data structure is retrieved using that video ID as the key. At this point, a list of element IDs can be retrieved, and based on one or more element IDs stored in the element ID list, one or more interactive video elements contained in the current video can be determined.
[0190] It should be noted that the interactive video elements mentioned above refer to video elements that are related to the video content and have business significance. For example, video elements can be products (goods or services) promoted in the video, items that appear in the video, the filming location / background location of the video, magic expressions / filters / special effects used in the video, and game / app / website / event links / co-hosts / service accounts mentioned in the video. There are no specific limitations on video elements here.
[0191] In some embodiments, in addition to associating and storing the video ID of each video with the element ID of the interactive video element in the video, the traffic redirection server can also access the video file of the video based on the video ID of each video in order to identify one or more interactive video elements contained in each video from the video frames contained in the video file, thereby improving the accuracy of video element identification.
[0192] In some embodiments, the traffic redirection server can also access the video details information of each video based on the video ID, and detect whether the video details information contains keywords of video elements. Based on the detected keywords, one or more interactive video elements contained in each video can be determined, which can also improve the accuracy of video element recognition. The video details information includes: video title, video summary, video description, video content tags, etc.
[0193] It should be noted that not every video in the feed will necessarily contain interactive video elements. If no interactive video elements are identified for a certain video, simply skip the current video and continue to identify interactive video elements for the next video.
[0194] In some embodiments, since the Feed video stream may involve multiple videos, and each video may be a recorded video or a live video, this disclosure does not specifically limit the video type. For each video, multiple interactive video elements may be identified. In the case that any video in the Feed video stream contains multiple interactive video elements, since generating a referral entry for each video element would severely obscure the video playback page, the referral server can also filter out one video element from the multiple video elements to generate a referral entry for this time.
[0195] In some embodiments, during the process of filtering video elements, for each video in the Feed video stream, the traffic redirection server determines the correlation parameters of multiple video elements with the video. The correlation parameters are used to indicate the degree of correlation between the video element and the video. Then, based on the correlation parameters, the video elements to be generated as traffic redirection entry points are selected from the multiple video elements. For example, when the higher the correlation parameter, the higher the degree of correlation, the video element with the highest correlation parameter value is selected.
[0196] In some embodiments, when calculating the relevance parameter, video features can be extracted from the video and element features can be extracted from the video elements. Based on the feature similarity between the video features and the element features, the business weights of the services associated with the video elements are weighted. That is, the value after weighting the feature similarity with business weights is used as the relevance parameter. This makes the relevance parameter not only represent the degree of association between the video elements and the video, but also consider the importance of the services associated with the video elements, thus improving the expressive power of the relevance parameter.
[0197] In the above process, by filtering the video elements that ultimately generate traffic entry points based on relevance parameters, it is possible to synthesize traffic entry points for video elements with high relevance as much as possible, avoiding drawing traffic entry points for some less important peripheral elements on the video playback page, thereby improving the traffic generation for the business associated with the video elements.
[0198] In step 309, the streaming server generates the streaming entry for the video element and sends the streaming entry to the video server.
[0199] The referral entry point links to the interactive interface of the business associated with the video element.
[0200] In some embodiments, after filtering each video in the Feed video stream to obtain video elements, the process of synthesizing the referral entry is as follows: determining at least one service associated with the video element; then, sending a referral link request to the respective service API of the at least one service, the referral link request being used to request the service indicated by the service API to be provided in the interactive interface linked to the referral entry; then, upon receiving confirmation information returned by each service API in response to the referral link request, generating the display resources of the referral entry and the display resources of the interactive interface.
[0201] In some embodiments, the traffic redirection server stores the element ID of each video element in association with the business ID of its associated service. This association can be stored using a hash table or a key-value data structure, similar to the description in step 308 above, and will not be repeated here. Thus, after filtering each video in the Feed video stream to obtain video elements, the traffic redirection server queries one or more business IDs associated with the element ID of the filtered video element. Then, based on these queried business IDs, it invokes the business API indicated by each business ID and sends a traffic redirection link request to the business API of each business ID to request the provision of the corresponding downstream service in the interactive interface linked at the traffic redirection entry point.
[0202] In some embodiments, the referral server initiates a referral link request to the downstream business server through the RPC interface in the business API of each business ID. Then, through the RPC interface, it receives confirmation or rejection information returned by the business server. If all business APIs associated with the video element receive the returned confirmation information, it means that authorization has been obtained for all services provided by the interactive interface linked to the referral entry point. At this point, the display resources of the referral entry point and the display resources of the interactive interface are generated. Next, the generated display resources of the referral entry point and the display resources of the interactive interface are returned to the video server through the referral entry point API. The confirmation information can be an ACK (Acknowledge Character) message. The RPC interface invocation method is similar to that described in steps 305-306, and will not be repeated here.
[0203] In some embodiments, if any service API associated with the video element receives a rejection message, the service indicated by that service API cannot be provided in the interactive interface linked to the traffic entry point. Instead, display resources for the interactive interface are generated only for other authorized services. Furthermore, if all service APIs associated with the video element receive rejection messages, it means that no service can be provided in the interactive interface. In this case, an error code can be directly returned to the video server via the traffic entry point API, or a generation failure message can be returned to the video server via the traffic entry point API. Alternatively, the current video can be replaced with a new video element, and the operation of compositing the traffic entry point and the display resources of the interactive interface can be performed again. This disclosure does not specifically limit this approach.
[0204] In some embodiments, when synthesizing display resources for the interactive interface, the traffic redirection server can also filter out some URLs, illegal links, and services provided by illegal proxies recorded in the blacklist, so as to further improve the security of the interactive interface linked to by the traffic redirection entry and reduce the risk of traffic redirection. This disclosure does not specifically limit this aspect.
[0205] In step 310, the video server returns the video stream carrying the redirection entry to the terminal.
[0206] In some embodiments, for each video in the Feed video stream, after the video server receives the display resources of the referral entry points and the display resources of the interactive interface returned by the referral entry point API for each video in the Feed video stream, the video server assigns an access address to each interactive interface. This access address is used to provide the display resources of the interactive interface; that is, the access address is equivalent to the download address of the display resources of the corresponding interactive interface. Next, the display resources of each referral entry point, the access address of the interactive interface linked to the referral entry point, and the video ID of the corresponding video in the Feed video stream are associated with each other. Then, the Feed video stream carrying each referral entry point is returned to the terminal through the interface API. The sent video stream carries at least: multiple videos included in the Feed video stream, the display resources of the referral entry points associated with the video elements contained in each video, the access address of the interactive interface linked to the referral entry point of each video, and the aforementioned association relationships.
[0207] In other embodiments, the video server stores the correspondence between each traffic entry and the display resources of its corresponding interactive interface. Each traffic entry is embedded into the video frame of the corresponding video in the feed video stream sent to the terminal. When a user clicks on a traffic entry, the terminal will again retrieve the display resources of the interactive interface linked to that traffic entry from the video server. Then, the video server returns the display resources of the corresponding interactive interface to the terminal according to the locally stored correspondence. Since not every traffic entry will be clicked by the user, the sending of certain access addresses is unnecessary. By not sending access addresses, and only retrieving them from the video server when an actual access demand is generated, the communication overhead during the feed video stream sending stage can be saved.
[0208] In step 311, the terminal displays the video stream in the video interface and displays the corresponding streaming entry when playing a video in the video stream.
[0209] In some embodiments, the terminal receives the Feed video stream sent by the video server through the interface API and plays the Feed video stream in the video interface. For the video in the Feed video stream that is being played, if the sent resources contain the entry point for that video, the entry point will be displayed in the video interface according to the display resources of the entry point.
[0210] In some embodiments, the referral entry can be presented in the form of a video card / live card, or in the form of other interactive controls, or in a hidden display mode, switching the corresponding video element in the video frame to an interactive element (i.e., the referral entry is the corresponding video element in the video frame). If the user is interested in the video element, clicking on the video element will take them to the interactive interface linked by the referral entry. If the user is not interested in the video element, it will not affect the normal browsing of the current video, thus achieving an immersive playback experience. The display mode of the referral entry is determined based on the display resources of the referral entry, and this disclosure does not specifically limit the display mode of the referral entry.
[0211] In some embodiments, when the referral entry is a video card / live card, the referral entry can be displayed in the lower left corner, upper left corner, lower right corner, upper right corner, or any other position on the video interface. It can only appear in video frames where the video element associated with the referral entry appears in the video, and the remaining video frames are automatically hidden or removed from the video interface, or disappear automatically after the appearance reaches a preset duration. This can avoid disturbing the user's video viewing and improve the user's video viewing experience.
[0212] The technical solution provided in this disclosure, regardless of the interface from which the video stream retrieval request is triggered, will uniformly inject parameter information into the guide entry API via the interface API when there is a need to generate a guide entry in the video stream. The guide entry API will then initiate a remote call to the guide server to synthesize the guide entry for each video in the video stream. This decouples the synthesis of the guide entry from the video server and decouples the code logic of the guide entry from the main site project. This facilitates unified management and maintenance of the synthesized guide entry for video streams from various interface requests, and helps improve development iteration efficiency.
[0213] Furthermore, by independently separating the traffic entry code from the main site project and deploying it to the traffic entry server, the video server does not need to run the traffic entry code locally. It only needs to call the traffic entry API to remotely invoke the traffic entry code deployed on the remote traffic entry server. This allows for centralized processing of various requests triggered by different interfaces through the traffic entry API, and also enables the traffic entry to be generated on the traffic entry server from these requests, eliminating the need for the video server to perform any logic processing related to traffic entry generation. In addition, since the traffic entry code is deployed on the traffic entry server, it no longer consumes video server resources, allowing for server scaling and other targeted performance optimizations.
[0214] Furthermore, since the referral entry API can centrally handle the generation of referral entry points in the feed video streams requested by different interfaces, when the business related to the referral entry needs to launch new features / new requirements / logic optimizations, the API that needs to be redeployed has changed from all the interface APIs to a single referral entry API. This greatly reduces the number of APIs that need to be redeployed when the performance of the referral entry is updated, and also shortens the time spent redeploying the API, such as from 1 day to half an hour, thereby improving the speed of launching new requirements related to the referral entry and enabling rapid response to new business needs.
[0215] Furthermore, since all calls related to the traffic redirection entry point can be consolidated into a single traffic redirection entry API, the upper-level interface API can be bypassed, allowing for load testing of the traffic redirection entry API alone. This effectively evaluates the code performance of the traffic redirection entry point in the traffic redirection server, thereby ensuring the service stability of the traffic redirection entry point. Moreover, when bugs are found in the existing code, there is no need to shut down the video server for maintenance; only the code deployed in the traffic redirection server needs to be repaired or rolled back, without affecting the normal provision of services by the video server.
[0216] In the previous embodiment, the request processing flow after the traffic entry code was completely migrated from the video server to the traffic entry server was described in detail. In this embodiment, the optimization measures for the traffic entry code during the migration process will be described.
[0217] In some embodiments, the code for the referral entry point may involve complex processing logic, thus requiring a phased migration from the video server to the referral server. For example, a ramp-up switch can be added to each interface API. This ramp-up switch routes some requests along the new scheme to the referral entry point API for remote calls to the referral server, while the other requests use the original scheme, directly employing the original, unmigrated code to synthesize the referral entry point. This allows for macro-level control of the ramp-up ratio, such as gradually increasing the ramp-up ratio of the first part of requests from 0% to 100%, while correspondingly, gradually decreasing the ramp-up ratio of the second part of requests from 100%. When the value drops to 0%, it is equivalent to completing the migration of some code related to the traffic entry points of the current interface API. The video server can delete the code related to the traffic entry points of the current interface API locally. Macro-control is performed on each interface API through the above-mentioned volume control switch. Different volume control switches for different interface APIs can be set with different volume control ratios (i.e., the progress can be the same or different). Volume control switches can also be opened serially or in parallel (serial means that the code migration of the next interface API is started only after the code migration of one interface API is completed, while parallel means that the code migration of multiple interface APIs can be started at the same time). This embodiment of the disclosure does not specifically limit this.
[0218] In some embodiments, for any interface API configured with a boosting switch, after receiving a video stream pull request from the terminal via step 302, the video server responds to the video stream pull request by determining the boosting result of the interface API's boosting switch for the video stream pull request. This boosting result indicates whether the interface API should remotely call the streaming server through the streaming entry API. In other words, the boosting result indicates whether the interface API should route the current video stream pull request to the streaming entry API, i.e., whether the interface API should "boost" the current video stream pull request to the streaming entry API. Then, if the boosting result is a remote call, the operation of injecting the interface API's parameter information into the streaming entry API in step 303 will be executed. If the boosting result is a local call, the traditional approach will be followed, and the streaming entry's processing logic will be obtained through a local call via the interface API (since the code migration is not yet complete, the video server will still retain the streaming entry's processing logic locally).
[0219] In the above process, by adding a ramp-up switch to each interface API, the video stream pull requests on the terminal side can be split during the migration of the traffic entry code from the video server to the traffic entry server. Some requests are routed to the traffic entry API for processing according to the new scheme, while others are called locally according to the original scheme. This allows for a smooth transition during the migration process and makes the entire code migration process grayscale and rollback-friendly. For example, if a problem occurs during the code migration, it will not affect all user requests, but will only affect the requests routed to the traffic entry API by the ramp-up switch.
[0220] In other embodiments, after migrating the code of all traffic entry points reached by the interface APIs through a ramp-up switch, the first round of load testing can be performed on the traffic entry APIs and the traffic server. In other words, on the video server side, the interface APIs of different interfaces are skipped, and the traffic entry API is directly load tested. For example, a peak traffic of a certain peak period is simulated at the same time to simultaneously call the traffic entry API. The traffic entry API remotely calls the traffic server through the RPC interface. The traffic server will process the remote call initiated by the traffic entry API when the peak traffic surges. After the load test is completed, the load test evaluation result of the traffic entry API can be generated. The load test evaluation result is used to measure the processing performance of the traffic entry API remotely calling the traffic server. For example, the load test evaluation result at least involves the maximum QPS that the traffic server can withstand, or the load test evaluation result also includes the average response time, average response speed, and request packet loss rate for a single request. This disclosure does not specifically limit the selection of load test evaluation indicators.
[0221] In some embodiments, besides migrating some code related to the traffic entry points of various interface APIs in the video server to the traffic entry server, there is also a portion of the traffic entry processing code, such as filtering blacklists, filtering illegal links, filtering illegal proxies, and performing relevance parameter calculations. This processing code may not be scattered throughout the interface API code, but rather located in a separate module of the main site project. Therefore, the remaining logic other than the interface API code should also be migrated gradually in the same way, which will not be elaborated here. After the remaining logic has been migrated, a second round of load testing can be performed on the traffic entry API and the traffic entry server to obtain the load testing evaluation results, such as the maximum QPS that can be handled. Guided by the load testing evaluation results, the code logic of the traffic entry server can be optimized or the server capacity can be expanded. Then, load testing can be performed again until the load testing evaluation results reach the set launch indicators. At the same time, the traffic entry API is officially released, and the ramp-up switches of all interface APIs are turned off. After that, all user requests will be routed to the traffic entry API, and the local processing logic related to the traffic entry point in the video server can be deleted. The second round of stress testing is conducted in the same way as the first round, so it will not be repeated here.
[0222] In some embodiments, after the traffic entry API and traffic server are officially launched, the processing code in the traffic entry API or traffic server may be updated according to business needs. For example, the preset format of the traffic entry API assembly parameters may be adjusted, the code logic for generating traffic entry points in the traffic server may be adjusted, and code logic for adding new requirements or functions may be added. In this case, technical personnel can input an update instruction for the processing logic of the traffic entry API on the traffic server side. The traffic server responds to the update instruction by updating the processing logic of the traffic entry API and publishes the updated processing logic. Then, because the processing logic of the traffic entry API has been updated, it may involve adaptive adjustments to the traffic entry point. Therefore, the traffic server sends an update instruction for the traffic entry API to the video server based on the updated processing logic, wherein the update instruction for the traffic entry API is compatible with the update instruction for the processing logic. Next, the video server responds to the update instruction for the traffic entry API by updating the traffic entry API and publishes the updated traffic entry API.
[0223] As can be seen from the above process, when the business related to the traffic redirection entry needs to launch new features / new requirements / logic optimizations, the APIs that need to be redeployed have changed from all the interface APIs to a single traffic redirection entry API. This greatly reduces the number of APIs that need to be released when the traffic redirection entry's performance is updated. This also shortens the time spent redeploying APIs, such as from one day to half an hour. This greatly shortens the launch cycle of new features / new requirements and the API release cycle, thereby improving the speed of launching new requirements related to the traffic redirection entry and enabling a rapid response to new business needs.
[0224] Figure 4 This is a schematic diagram illustrating the principle of a request processing method provided in an embodiment of this disclosure, such as... Figure 4 As shown, taking a Feed video stream scenario as an example, the user sends a Feed video stream retrieval request through the client 410 on the terminal. The corresponding interface API of the Feed server 420 receives the Feed video stream retrieval request. The interface API calls the stream entry API through the plc.sdk method and injects parameter information. Then, the stream entry API remotely calls the stream server 430 through the RPC interface. The stream server 430 further communicates and interacts with the corresponding business API in the downstream business server 440 to generate a stream entry linking to the interactive interface of the business. The display resources of the stream entry and the display resources of the interactive interface are returned to the Feed server 420, so that the Feed server 420 returns the Feed video stream carrying the stream entry to the client 410.
[0225] In the above process, regardless of which interface API the client 410 initiates the Feed video stream retrieval request from, all interface APIs inject parameter information into the streaming entry API. This achieves convergence of the different interface APIs' requirements for generating the streaming entry into the streaming entry API. The streaming entry API can standardize and assemble the parameter information injected by different interface APIs, avoiding parameter transmission errors. Then, the streaming entry API remotely calls the streaming server 430. No matter which downstream service the streaming entry needs to link to, the streaming server 430 can use its internal logic to uniformly communicate and interact with the various business APIs in the downstream business server 440, achieving converged calls to various business APIs. After applying this solution, it will not affect the retrieval of the upstream client Feed stream, nor will it affect the calls to downstream services. Furthermore, some development auxiliary tools can be used to compare the parameter information received by the downstream business server 440 with the parameter information injected by the interface API in the original Feed server 420, effectively detecting whether there are parameter omissions or errors, ensuring the security and stability of the service.
[0226] Figure 5This is a logical structure block diagram of a request processing apparatus according to an exemplary embodiment, with reference to... Figure 5 The device includes: a receiving unit 501, a parameter injection unit 502, a remote calling unit 503, and a sending unit 504, which are described below:
[0227] The receiving unit 501 is configured to execute a video stream retrieval request from the receiving terminal via the interface application programming interface (API), the video stream retrieval request being used to retrieve the video stream from the interface associated with the API.
[0228] The parameter injection unit 502 is configured to inject parameter information associated with the video stream pull request into the stream entry API through the interface API. The parameter information is used to provide the pass-through parameters that the interface API should inject when calling the stream entry API.
[0229] The remote call unit 503 is configured to execute a remote call to the streaming server via the streaming entry API. The streaming server is used to generate streaming entries for the video in the video stream, and the streaming entry is associated with the video elements contained in the video in the video stream.
[0230] The sending unit 504 is configured to send the streaming entry to the terminal when it receives the streaming entry returned by the streaming server for the video stream. The streaming entry is linked to the interactive interface of the service associated with the video element.
[0231] The apparatus provided in this disclosure, by setting a streaming entry API in the video server, ensures that regardless of the interface from which the video stream is triggered, when there is a need to generate a streaming entry in the video stream, parameter information is uniformly injected into the streaming entry API via the interface API. The streaming entry API then initiates a remote call to the streaming server to synthesize the streaming entry for each video in the video stream. This decouples the synthesis of streaming entry from the video server and the code logic of the streaming entry from the main site project, facilitating unified management and maintenance of streaming entry synthesis for video streams from various interface requests, and improving development iteration efficiency.
[0232] In some embodiments, the parameter injection unit 502 is configured to perform:
[0233] The API interface generates the parameter information to be injected based on the video stream retrieval request.
[0234] The API interface is used to invoke the traffic entry API, and the parameter information is passed into the traffic entry API.
[0235] In some embodiments, the remote invocation unit 503 is configured to execute:
[0236] Through this traffic entry API, the parameter information injected by the interface API is received;
[0237] The parameters injected by the API of this interface are assembled according to a preset format to obtain the assembled parameters.
[0238] Send a Remote Procedure Call (RPC) request carrying the assembled parameters to the referral server. This RPC request is used to request the referral server to return the referral entry point.
[0239] In some embodiments, based on Figure 5 The device comprises:
[0240] The scaling result determination unit is configured to respond to the video stream pull request by determining the scaling result of the scaling switch of the interface API for the video stream pull request. The scaling result is used to indicate whether the interface API remotely calls the streaming server through the streaming entry API.
[0241] The remote call unit 503 is also configured to perform the operation of injecting the parameter information of the interface API into the traffic entry API when the result of the volume increase is a remote call;
[0242] The local processing unit is configured to execute the processing logic of obtaining the traffic entry point through the local call of the interface API when the result of the traffic increase is a local call.
[0243] In some embodiments, based on Figure 5 The device comprises:
[0244] The load testing unit is configured to perform a load test on the traffic entry API by skipping the interface API, and obtain the load test evaluation result of the traffic entry API. The load test evaluation result is used to measure the processing performance of the traffic entry API when remotely calling the traffic server.
[0245] In some embodiments, based on Figure 5 The device comprises:
[0246] The update and publish unit is configured to execute an update command for the traffic entry API, update the traffic entry API, and publish the updated traffic entry API.
[0247] Regarding the apparatus in the above embodiments, the specific manner in which each unit performs its operation has been described in detail in the embodiments relating to the request processing method, and will not be elaborated upon here.
[0248] Figure 6This is a logical structure block diagram of a request processing apparatus according to an exemplary embodiment, with reference to... Figure 6 The device includes: a parameter acquisition unit 601, a video element determination unit 602, a stream entry generation unit 603, and a distribution unit 604, which will be described below:
[0249] The parameter acquisition unit 601 is configured to acquire parameter information provided by the streaming entry API when a remote call is received from the video server through the streaming entry API. The parameter information is generated based on the video stream retrieval request.
[0250] The video element determination unit 602 is configured to determine, based on the parameter information, the interactive video elements contained in the video stream retrieved from the video stream retrieved by the video stream retrieval request.
[0251] The traffic entry generation unit 603 is configured to generate a traffic entry for the video element, which is linked to the interactive interface of the service associated with the video element.
[0252] Unit 604 is configured to send the traffic entry to the video server.
[0253] The apparatus provided in this disclosure receives remote calls from a unified configured traffic entry API in a video server and parses the provided parameter information. Based on the parsed parameter information, it determines which video elements to generate traffic entry points for. Through interaction with downstream services, it synthesizes traffic entry points that can link to the interactive interface of the service and returns these traffic entry points to the video server. This is equivalent to independently deploying the code logic for generating traffic entry points on the traffic entry server, thus decoupling the traffic entry point synthesis from the main site project. This facilitates unified management and maintenance of traffic entry points synthesized from video streams requested by various interfaces, improving development iteration efficiency.
[0254] In some embodiments, the parameter acquisition unit 601 is configured to perform:
[0255] Upon receiving an RPC request sent by the video server through the streaming entry API, the assembled parameters in a preset format are read from the RPC request. The assembled parameters are assembled according to the preset format based on the parameter information injected into the streaming entry API by the interface API. The interface API refers to the API by which the video server receives the video stream pull request.
[0256] The assembled parameters are parsed to obtain the parameter information injected from the interface API into the traffic entry API.
[0257] In some embodiments, the video element determination unit 602 is configured to perform:
[0258] In the case where the video stream contains multiple interactive video elements, a correlation parameter is determined for each of the multiple video elements and the video, which is used to indicate the degree of correlation between the video element and the video.
[0259] Based on this correlation parameter, the video elements to be generated as the traffic entry point are selected from these multiple video elements.
[0260] In some embodiments, the flow inlet generation unit 603 is configured to perform:
[0261] Identify at least one service associated with the video element;
[0262] Send a referral link request to the respective business API of the at least one business, the referral link request being used to request that the business indicated by the business API be provided in the interactive interface linked by the referral entry;
[0263] Upon receiving confirmation information from various business APIs regarding the referral link request, the display resources for the referral entry point and the display resources for the interactive interface are generated.
[0264] In some embodiments, the issuing unit 604 is configured to perform:
[0265] The video server is sent with the display resources of the traffic entry point and the access address of the interactive interface. The access address is used to provide the display resources of the interactive interface.
[0266] In some embodiments, based on Figure 6 The device comprises:
[0267] The load testing unit is configured to process remote calls initiated by the traffic entry API when the video server performs a load test on the traffic entry API, and generate a load test evaluation result for the traffic entry API. The load test evaluation result is used to measure the processing performance of the traffic entry API in remotely calling the traffic server.
[0268] In some embodiments, based on Figure 6 The device comprises:
[0269] The logic update unit is configured to execute an update instruction in response to the processing logic of the traffic entry API, update the processing logic of the traffic entry API, and publish the updated processing logic.
[0270] The issuing unit 604 is also configured to execute an update instruction for the streaming entry API to the video server based on the updated processing logic, wherein the update instruction for the streaming entry API is adapted to the update instruction for the processing logic.
[0271] Regarding the apparatus in the above embodiments, the specific manner in which each unit performs its operation has been described in detail in the embodiments relating to the request processing method, and will not be elaborated upon here.
[0272] Figure 7 This is a schematic diagram of a server structure provided in an embodiment of this disclosure. The server 700 is an exemplary illustration of a computer device. The server 700 can be provided as a video server or a streaming server, and can vary considerably due to differences in configuration or performance. It may include one or more Central Processing Units (CPUs) 701 and one or more memories 702, wherein the memory 702 stores at least one line of program code, which is loaded and executed by the processor 701 to implement the request processing methods provided in the various embodiments above. Of course, the server 700 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 700 may also include other components for implementing device functions, which will not be elaborated here.
[0273] In an exemplary embodiment, a computer-readable storage medium including at least one instruction is also provided, such as a memory including at least one instruction, which can be executed by a processor in a terminal to complete the request processing method in the above embodiments. Optionally, the computer-readable storage medium may be a non-transitory computer-readable storage medium, such as ROM (Read-Only Memory), RAM (Random-Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, and optical data storage device, etc.
[0274] In an exemplary embodiment, a computer program product is also provided, including one or more instructions that can be executed by a terminal's processor to perform the request processing methods provided in the various embodiments described above.
[0275] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0276] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A request processing method, characterized in that, Performed by the video server, including: The system receives a video stream retrieval request from the terminal via the Interface Application Programming Interface (API), and the video stream retrieval request is used to retrieve the video stream from the interface associated with the API. The interface API generates parameter information to be injected based on the video stream retrieval request; the interface API calls the streaming entry API, and the parameter information is passed to the streaming entry API. The parameter information is used to provide the pass-through parameters that the interface API should inject when calling the streaming entry API. The traffic redirection server is remotely invoked through the traffic redirection entry API. The traffic redirection server is used to generate a traffic redirection entry for the video in the video stream based on the parameter information. The traffic redirection entry is associated with the video elements contained in the video in the video stream. Upon receiving the referral entry point returned by the referral server for the video stream, a video stream carrying the referral entry point is sent to the terminal so that the terminal displays the video stream in the video interface and displays the corresponding referral entry point when playing the video in the video stream. The referral entry point is linked to the interactive interface of the service associated with the video element.
2. The request processing method according to claim 1, characterized in that, The remote call to the traffic redirection server via the traffic redirection entry API includes: The API receives parameter information injected by the interface API through the traffic entry API. The parameter information injected by the interface API is assembled according to a preset format to obtain the assembled parameters; Send a Remote Procedure Call (RPC) request carrying the assembled parameters to the traffic redirection server. The RPC request is used to request the traffic redirection server to return the traffic redirection entry point.
3. The request processing method according to claim 1, characterized in that, The method further includes: In response to the video stream pull request, determine the scaling result of the interface API's scaling switch on the video stream pull request. The scaling result is used to indicate whether the interface API remotely calls the streaming server through the streaming entry API. If the result of the volume increase is a remote call, the operation of injecting the parameter information of the interface API into the traffic entry API is performed; In the case where the volume increase result is a local call, the processing logic of the traffic entry point is obtained through the local call of the interface API.
4. The request processing method according to claim 1, characterized in that, The method further includes: Skip the interface API and perform stress testing on the traffic entry API to obtain the stress test evaluation result of the traffic entry API. The stress test evaluation result is used to measure the processing performance of the traffic entry API in remotely calling the traffic server.
5. The request processing method according to claim 1, characterized in that, The method further includes: In response to the update instruction for the traffic entry API, the traffic entry API is updated and the updated traffic entry API is published.
6. A request processing method, characterized in that, Executed by the traffic redirection server, including: Upon receiving a remote call initiated by the video server through the streaming entry API, the system obtains the parameter information provided by the streaming entry API. This parameter information is generated by the video server through the interface application interface API based on a video stream retrieval request sent by the terminal to the video server. The video stream retrieval request is used to retrieve the video stream from the interface associated with the interface API. The parameter information is injected into the streaming entry API by the video server after it invokes the streaming entry API through the interface API. This parameter information is used to provide the pass-through parameters that the interface API should inject when calling the streaming entry API. Based on the parameter information, the interactive video elements in the video stream retrieved from the video stream retrieved by the video stream retrieval request are determined. Generate a traffic entry point for the video element, and link the traffic entry point to the interactive interface of the service associated with the video element; The video server sends the streaming entry point to the video server, which then sends a video stream carrying the streaming entry point to the terminal, so that the terminal displays the video stream in the video interface and displays the corresponding streaming entry point when playing the video in the video stream.
7. The request processing method according to claim 6, characterized in that, When receiving a remote call initiated by the video server through the streaming entry API, obtaining the parameter information provided by the streaming entry API includes: Upon receiving an RPC request sent by the video server through the streaming entry API, the assembled parameters in a preset format are read from the RPC request. The assembled parameters are assembled according to the preset format based on the parameter information injected into the streaming entry API by the interface API. The interface API refers to the API by which the video server receives the video stream pull request. The assembled parameters are parsed to obtain the parameter information injected from the interface API into the traffic entry API.
8. The request processing method according to claim 6, characterized in that, The step of determining the interactive video elements in the video stream retrieved from the video stream retrieved by the video stream retrieval request based on the parameter information includes: In the case where the video stream contains multiple interactive video elements, a correlation parameter is determined for each of the multiple video elements and the video, the correlation parameter being used to indicate the degree of correlation between the video element and the video; Based on the correlation parameters, the video elements to be used to generate the traffic entry point are selected from the plurality of video elements.
9. The request processing method according to claim 6, characterized in that, The ingress points for generating the video elements include: Identify at least one service associated with the video element; Send a referral link request to the business API of each of the at least one business, the referral link request being used to request that the business indicated by the business API be provided in the interactive interface linked by the referral entry; Upon receiving confirmation information from various business APIs regarding the referral link request, the display resources for the referral entry point and the display resources for the interactive interface are generated.
10. The request processing method according to claim 9, characterized in that, The step of sending the traffic redirection entry to the video server includes: The video server is sent with the display resources of the traffic entry point and the access address of the interactive interface, the access address being used to provide the display resources of the interactive interface.
11. A request processing apparatus, characterized in that, include: The receiving unit is configured to execute a video stream retrieval request from the receiving terminal via a user interface application programming interface (API), the video stream retrieval request being used to retrieve a video stream from the interface associated with the API. The parameter injection unit is configured to generate parameter information to be injected based on the video stream retrieval request through the interface API. The interface API is used to invoke the traffic entry API, and the parameter information is passed to the traffic entry API. The parameter information is used to provide the transparent parameters that the interface API should inject when calling the traffic entry API. The remote call unit is configured to execute a remote call to the streaming server via the streaming entry API. The streaming server is used to generate a streaming entry for the video in the video stream based on the parameter information. The streaming entry is associated with the video elements contained in the video in the video stream. The delivery unit is configured to, upon receiving a traffic entry point returned by the traffic redirection server for the video stream, send a video stream carrying the traffic entry point to the terminal, so that the terminal displays the video stream in the video interface and displays the corresponding traffic entry point when playing the video in the video stream. The traffic entry point is linked to the interactive interface of the service associated with the video element.
12. A request processing apparatus, characterized in that, include: The parameter acquisition unit is configured to, upon receiving a remote call initiated by the video server through the streaming entry API, acquire parameter information provided by the streaming entry API. The parameter information is generated by the video server through the interface application interface API based on a video stream retrieval request sent by the terminal to the video server. The video stream retrieval request is used to retrieve the video stream from the interface associated with the interface API. The parameter information is injected into the streaming entry API by the video server after invoking the streaming entry API through the interface API. The parameter information is used to provide the pass-through parameters that the interface API should inject when calling the streaming entry API. The video element determination unit is configured to determine, based on the parameter information, the interactive video elements contained in the video stream retrieved from the video stream retrieved by the video stream retrieval request. The traffic entry generation unit is configured to generate a traffic entry for the video element, and the traffic entry is linked to the interactive interface of the service associated with the video element. The sending unit is configured to send the streaming entry to the video server, which is used to send a video stream carrying the streaming entry to the terminal, so that the terminal displays the video stream in the video interface and displays the corresponding streaming entry when playing the video in the video stream.
13. A computer device, characterized in that, include: One or more processors; One or more memories for storing the one or more processor-executable instructions; The one or more processors are configured to execute the instructions to implement the request processing method as described in any one of claims 1 to 5 or claims 6 to 10.
14. A computer-readable storage medium, characterized in that, When at least one instruction in the computer-readable storage medium is executed by one or more processors of a computer device, the computer device is enabled to perform the request processing method as described in any one of claims 1 to 5 or claims 6 to 10.