Multimedia recommendation method, medium, apparatus, and computing device
By executing multimedia recommendation requests in parallel and utilizing a combination of callback functions and pipeline nodes, the problem of request waiting during multimedia recommendation is solved, thus improving recommendation efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
- Filing Date
- 2023-05-12
- Publication Date
- 2026-04-14
AI Technical Summary
In the multimedia recommendation process, multiple recommendation requests need to wait for the result of the current request to be returned before the next request can be executed, resulting in low efficiency.
Multiple recommendation requests can be executed in parallel by using callback functions. By combining pipeline nodes and callback functions, multiple recommendation requests can be processed in parallel.
It reduces the waiting time for recommendation requests and improves the efficiency of multimedia recommendations.
Smart Images

Figure CN116501973B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this disclosure relate to the field of multimedia technology, and more specifically, the embodiments of this disclosure relate to a multimedia recommendation method, medium, apparatus, and computing device. Background Technology
[0002] This section is intended to provide background or context for embodiments of this disclosure. The description herein is not intended to imply that it is prior art simply because it is included in this section.
[0003] Currently, with the development of multimedia technology, it is possible to determine a user's interests based on their multimedia playback history, and then intelligently recommend relevant multimedia content to the user, helping them find multimedia that they haven't played before and that matches their interests. Multimedia includes, but is not limited to, songs, videos, podcasts, and radio.
[0004] The multimedia recommendation process involves collecting users' historical playback records, generating recommendation requests based on these records, and then calling relevant multimedia from external systems based on these recommendations.
[0005] In practical applications, there are multiple recommendation requests. During the call process, the next call can only be executed after receiving the result returned by the current call. This results in excessively long waiting times for multiple recommendation requests and low efficiency of multimedia recommendations. Summary of the Invention
[0006] This disclosure provides a multimedia recommendation method, medium, apparatus, and computing device for improving the efficiency of multimedia recommendation.
[0007] In a first aspect of this disclosure, a multimedia recommendation method is provided, comprising: receiving a plurality of recommendation requests sent by a user terminal; determining a callback function, the callback function being used to initiate and execute the next recommendation request while the current recommendation request is being executed at the current pipeline node; executing the plurality of recommendation requests in parallel through the callback function to obtain a target multimedia corresponding to each recommendation request; and sending the target multimedia to the user terminal.
[0008] In one embodiment of this disclosure, the multiple recommendation requests are executed in parallel through the callback function to obtain the target multimedia corresponding to each recommendation request, including: determining multiple pipeline nodes, wherein the multiple pipeline nodes are used to obtain multiple original multimedia from an external system or process the multiple original multimedia to obtain multiple target multimedia according to the multiple recommendation requests; determining a callback function corresponding to each pipeline node; and executing the multiple recommendation requests in parallel through the callback function corresponding to each pipeline node to obtain the target multimedia corresponding to each recommendation request.
[0009] In another embodiment of this disclosure, the pipeline nodes include recall nodes and processing nodes. The processing nodes include at least one of the following nodes: a filtering node, a sorting node, and an assembly node. The process involves executing multiple recommendation requests in parallel using callback functions corresponding to each pipeline node to obtain the target multimedia corresponding to each recommendation request. This includes: determining multiple recall requests corresponding to the multiple recommendation requests, where the multiple recall requests are used to obtain the multiple original multimedia; sequentially sending the multiple recall requests to the external system using callback functions corresponding to the recall nodes; receiving the multiple original multimedia sent by the external system in response to the multiple recall requests using callback functions corresponding to the recall nodes; and calling callback functions corresponding to the processing nodes using callback functions corresponding to the recall nodes to process the multiple original multimedia to obtain the target multimedia corresponding to each recommendation request.
[0010] In another embodiment of this disclosure, the multiple recall requests are sequentially sent to the external system through the callback function corresponding to the recall node, including: sending the current recall request to the external system through the callback function corresponding to the recall node; and sending the next recall request to the external system after the current recall request has been sent, until the multiple recall requests have been sent.
[0011] In another embodiment of this disclosure, the callback function corresponding to the processing node is called through the callback function corresponding to the recall node to process the plurality of original multimedia files and obtain the target multimedia file corresponding to each recommendation request. This includes: calling the callback function corresponding to the current processing node through the callback function corresponding to the recall node to process the plurality of original multimedia files and obtain a plurality of processed multimedia files; determining whether the pipeline nodes include other processing nodes through the callback function corresponding to the current processing node; if the pipeline nodes include the other processing nodes, then the callback functions corresponding to the other processing nodes are called sequentially through the callback function corresponding to the current processing node to process the plurality of processed multimedia files and obtain the target multimedia file corresponding to each recommendation request; if the pipeline nodes do not include the other processing nodes, then the plurality of processed multimedia files are determined as the target multimedia file corresponding to each recommendation request.
[0012] In another embodiment of this disclosure, determining the plurality of recall requests corresponding to the plurality of recommendation requests includes: determining the plurality of recommendation tasks corresponding to each recommendation request; determining the recall request corresponding to each recommendation task, thereby obtaining the plurality of recall requests corresponding to the plurality of recommendation requests.
[0013] In another embodiment of this disclosure, the method further includes: determining a timeout duration corresponding to each recommendation request; generating an asynchronous computing interface based on the plurality of recommendation requests, the asynchronous computing interface being used to receive the target multimedia; obtaining a request number corresponding to each recommendation request and placing the request number into the asynchronous computing interface; starting a timer with the moment the request number is placed into the asynchronous computing interface as the starting point; if the asynchronous computing interface receives the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout duration, then sending the target multimedia to the user terminal; if the asynchronous computing interface does not receive the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout duration, then sending preset multimedia to the user terminal.
[0014] In a second aspect of this disclosure, a computer-readable storage medium is provided, comprising: computer-executable instructions stored therein, which, when executed by a processor, are used to implement the multimedia recommendation method as described in any one of the first aspects.
[0015] In a third aspect of this disclosure, a multimedia recommendation apparatus is provided, the apparatus comprising: a receiving module for receiving a plurality of recommendation requests sent by a user terminal; a determining module for determining a callback function, the callback function being used to initiate and execute the next recommendation request while the current recommendation request is being executed at the current pipeline node; an execution module for executing the plurality of recommendation requests in parallel through the callback function to obtain a target multimedia corresponding to each recommendation request; and a sending module for sending the target multimedia to the user terminal.
[0016] In one embodiment of this disclosure, the execution module is specifically configured to determine multiple pipeline nodes, which are used to obtain multiple original multimedia files from an external system based on the multiple recommendation requests, or to process the multiple original multimedia files to obtain multiple target multimedia files; the execution module is further configured to determine a callback function corresponding to each pipeline node; the execution module is further configured to execute the multiple recommendation requests in parallel through the callback function corresponding to each pipeline node to obtain the target multimedia files corresponding to each recommendation request.
[0017] In another embodiment of this disclosure, the pipeline node includes a recall node and a processing node, the processing node including at least one of the following nodes: a filtering node, a sorting node, and an assembly node; the execution module is specifically configured to determine multiple recall requests corresponding to the multiple recommendation requests, the multiple recall requests being used to obtain the multiple original multimedia files; the execution module is further configured to send the multiple recall requests sequentially to the external system through a callback function corresponding to the recall node; the execution module is further configured to receive the multiple original multimedia files sent by the external system in response to the multiple recall requests through a callback function corresponding to the recall node; the execution module is further configured to call a callback function corresponding to the processing node through a callback function corresponding to the recall node to process the multiple original multimedia files to obtain the target multimedia file corresponding to each recommendation request.
[0018] In another embodiment of this disclosure, the apparatus further includes: a calling module, configured to send a current recall request to the external system through a callback function corresponding to the recall node; the calling module is further configured to send a next recall request to the external system after the current recall request has been sent, until the sending of the plurality of recall requests has been completed.
[0019] In another embodiment of this disclosure, the apparatus further includes: a processing module, configured to call a callback function corresponding to the current processing node through a callback function corresponding to the recall node to process the plurality of original multimedia to obtain a plurality of processed multimedia; the processing module is further configured to determine whether the pipeline nodes include other processing nodes through the callback function corresponding to the current processing node; the processing module is further configured to, if the pipeline nodes include the other processing nodes, sequentially call the callback functions corresponding to the other processing nodes through the callback function corresponding to the current processing node to process the plurality of processed multimedia to obtain the target multimedia corresponding to each recommendation request; the processing module is further configured to, if the pipeline nodes do not include the other processing nodes, determine the plurality of processed multimedia as the target multimedia corresponding to each recommendation request.
[0020] In another embodiment of this disclosure, the apparatus further includes: a corresponding module, configured to determine a plurality of recommendation tasks corresponding to each recommendation request; the corresponding module is further configured to determine a recall request corresponding to each recommendation task, thereby obtaining the plurality of recall requests corresponding to the plurality of recommendation requests.
[0021] In another embodiment of this disclosure, the apparatus further includes: a timing module, configured to determine a timeout duration corresponding to each recommendation request; the timing module is further configured to generate an asynchronous computing interface based on the plurality of recommendation requests, the asynchronous computing interface being used to receive the target multimedia; the timing module is further configured to obtain a request number corresponding to each recommendation request and place the request number into the asynchronous computing interface; the timing module is further configured to start timing from the moment the request number is placed into the asynchronous computing interface, and if the asynchronous computing interface receives the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout duration, then sends the target multimedia to the user terminal; the timing module is further configured to send preset multimedia to the user terminal if the asynchronous computing interface does not receive the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout duration.
[0022] In a fourth aspect of this disclosure, a computing device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the computing device to perform a multimedia recommendation method as described in any one of the first aspects of this disclosure.
[0023] According to the embodiments of this disclosure, a callback function can be used to initiate and execute the next recommendation request before the current recommendation request has received a result, thereby enabling the parallel execution of multiple recommendation requests, reducing the waiting time of recommendation requests, and improving the efficiency of multimedia recommendation. Attached Figure Description
[0024] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which:
[0025] Figure 1 A schematic diagram illustrating an application scenario according to an embodiment of the present disclosure is provided.
[0026] Figure 2 A schematic flowchart of a multimedia recommendation method provided according to an embodiment of the present disclosure is shown.
[0027] Figure 3 A schematic flowchart of a multimedia recommendation method provided according to an embodiment of the present disclosure is shown.
[0028] Figure 4An example diagram of a return value interface provided according to an embodiment of the present disclosure is shown schematically;
[0029] Figure 5 An example diagram illustrating the determination of a recall request according to an embodiment of the present disclosure is shown schematically;
[0030] Figure 6 An example diagram of a processing node provided according to an embodiment of the present disclosure is shown schematically;
[0031] Figure 7 An example diagram of a time wheel provided according to an embodiment of the present disclosure is shown schematically;
[0032] Figure 8 A schematic diagram of the structure of a storage medium provided according to an embodiment of the present disclosure is shown.
[0033] Figure 9 A schematic diagram of the structure of a multimedia recommendation device provided according to an embodiment of the present disclosure is shown.
[0034] Figure 10 A schematic diagram of the structure of a multimedia recommendation device provided according to an embodiment of the present disclosure is shown.
[0035] Figure 11 A schematic diagram of the structure of a computing device provided according to an embodiment of the present disclosure is shown.
[0036] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0037] The principles and spirit of this disclosure will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement this disclosure, and are not intended to limit the scope of this disclosure in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.
[0038] Those skilled in the art will understand that the embodiments of this disclosure can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. The data involved in this disclosure can be data authorized by the user or fully authorized by all parties. The collection, dissemination, and use of the data comply with relevant national laws and regulations. The embodiments / examples of this disclosure can be combined with each other.
[0039] According to embodiments of this disclosure, a method, medium, apparatus, and computing device for multimedia recommendation are proposed.
[0040] Furthermore, the number of any elements in the accompanying drawings is for illustrative purposes only and not for limitation, and any naming is for distinction only and has no limiting meaning.
[0041] The principles and spirit of this disclosure will be explained in detail below with reference to several representative embodiments. Invention Overview
[0043] The inventors have discovered that in related technologies, when executing multiple recommendation requests, it is necessary to wait for the current recommendation request to return a recommendation result before executing the next recommendation request, resulting in low efficiency of multimedia recommendations.
[0044] To address the above issues, the inventors have developed a method that executes multiple recommendation requests via callback functions. This allows for the parallel execution of multiple recommendation requests, thereby reducing waiting time and improving the efficiency of multimedia recommendations.
[0045] After introducing the basic principles of this disclosure, various non-limiting embodiments of this disclosure will be described in detail below.
[0046] Application Scenarios Overview
[0047] First refer to Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario provided for an embodiment of this disclosure.
[0048] like Figure 1 As shown, the user client initiates a recommendation request to the multimedia recommendation device. This request recommends relevant multimedia based on the user's historical playback records. An external system stores the multimedia content. Based on the recommendation request, the multimedia recommendation device initiates a request to the external system and receives the recommended multimedia content returned by the external system. The multimedia recommendation device processes the recommended multimedia content and sends the processed recommended multimedia content back to the user client.
[0049] Exemplary methods
[0050] The following is combined Figure 1 Application scenarios, refer to Figure 2-7 This document describes a multimedia recommendation method provided according to exemplary embodiments of the present disclosure. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in any way. Rather, the embodiments of the present disclosure can be applied to any applicable scenario.
[0051] The implementation subject of the embodiments disclosed herein can be a multimedia recommendation device, which can be implemented in various ways. For example, the multimedia recommendation device can be program software; or, the device can be integrated, installed, or stored on a physical device, such as a chip, smart terminal, computer, server, or USB flash drive.
[0052] refer to Figure 2 , Figure 2 This is a flowchart illustrating a multimedia recommendation method provided in an embodiment of this disclosure. Figure 2 As shown, the multimedia recommendation method used on the server includes:
[0053] S201, Receive multiple recommendation requests sent by the user.
[0054] Among them, many recommendation requests are automatically generated based on the user's historical playback records, and these recommendations reflect the user's interests and hobbies.
[0055] Optionally, the process of generating multiple recommendation requests may incorporate the user's personal information, including but not limited to: age, gender, and occupation.
[0056] S202. Determine the callback function, which is used to start and execute the next recommendation request while the current recommendation request is being executed at the current pipeline node.
[0057] The multimedia recommendation process includes multiple flows, including but not limited to: external calls, filtering, sorting, and assembly. These flows are executed through a pipeline, with each flow corresponding to a pipeline node.
[0058] Optionally, multiple pipeline nodes may have an arrangement order, and the recommendation request may be executed according to the arrangement order.
[0059] For example, filtering nodes filter multimedia that is irrelevant to the user's interests or is invalid, while sorting nodes only sort the filtered multimedia. If the sorting node is first, it will filter all multimedia, including the multimedia that needs to be filtered. Filtering the multimedia that needs to be filtered by the sorting node will consume extra computing power.
[0060] It is understandable that executing recommendation requests through pipeline nodes, with each pipeline node executing its corresponding process sequentially, can improve the efficiency of multimedia recommendations.
[0061] S203. Through the callback function, the multiple recommendation requests are executed in parallel to obtain the target multimedia corresponding to each recommendation request.
[0062] Optionally, the callback function sorts multiple recommendation requests based on the initiation time of each request, and then launches multiple recommendation requests sequentially according to the sorting.
[0063] It is understandable that execution efficiency can be improved by executing multiple recommendation requests in parallel.
[0064] S204. Send the target multimedia to the user terminal.
[0065] Optionally, recommendation requests can come from multiple user terminals, and the target multimedia obtained from executing the recommendation requests is sent to the corresponding user terminals.
[0066] The multimedia recommendation method provided in this application embodiment can, through a callback function, initiate and execute the next recommendation request before the current recommendation request has received a result, thereby enabling the parallel execution of multiple recommendation requests, reducing the waiting time of recommendation requests, and improving the efficiency of multimedia recommendation.
[0067] Based on any of the above embodiments, the following, in conjunction with Figure 3 This section provides a detailed explanation of the multimedia recommendation process.
[0068] Figure 3 This is a flowchart illustrating a multimedia recommendation method provided in an embodiment of this application. Figure 3 As shown, the method includes:
[0069] S301: Receive multiple recommendation requests sent by the user client.
[0070] It should be noted that the execution process of S301 is the same as that of S201, and will not be repeated here.
[0071] S302. Determine the callback function, which is used to start and execute the next recommendation request while the current recommendation request is being executed at the current pipeline node.
[0072] It should be noted that the execution process of S302 is the same as that of S202, and will not be repeated here.
[0073] S303. Determine multiple pipeline nodes, which are used to obtain multiple original multimedia from an external system based on the multiple recommendation requests, or to process the multiple original multimedia to obtain multiple target multimedia.
[0074] For example, the functions of a pipeline node include: acquiring raw multimedia and processing it to obtain target multimedia. Raw multimedia acquired from an external system can be directly sent to the user. However, the raw multimedia may contain multimedia that does not meet the recommendation request or is invalid, and the sorting of the raw multimedia may be disordered, failing to meet the user's needs. Therefore, processing of the raw multimedia is necessary.
[0075] Optionally, each node executes its corresponding process.
[0076] S304. Determine the callback function corresponding to each of the pipeline nodes.
[0077] Each callback function has corresponding execution logic for multimedia, and each callback function includes the logic to launch the next callback function.
[0078] Based on the above implementation method, the logic of pipeline nodes can be automatically executed sequentially through callback functions.
[0079] S305. Determine multiple recall requests corresponding to the multiple recommendation requests, wherein the multiple recall requests are used to obtain the multiple original multimedia files.
[0080] Optionally, each recommendation request corresponds to one recall request, and each recall request corresponds to multiple original multimedia files.
[0081] Alternatively, a corresponding return value interface can be generated based on the recommendation request. The return value interface is used to receive the target multimedia.
[0082] Below, in conjunction with Figure 4 The return value interface is described.
[0083] Figure 4 This is a schematic diagram of the return value interface provided in an embodiment of this application. For example... Figure 4 As shown, for any recommendation request, a return value interface is generated based on the recommendation request, and the recommendation request is sent to the pipeline node. The pipeline node executes the recommendation request, obtains the target multimedia, and sends the target multimedia to the return value interface. The target multimedia in the return value interface can be sent to the user terminal or used for statistical processing.
[0084] One feasible implementation involves determining multiple recall requests corresponding to the multiple recommendation requests, including: determining multiple recommendation tasks corresponding to each recommendation request; and determining a recall request corresponding to each recommendation task to obtain the multiple recall requests corresponding to the multiple recommendation requests.
[0085] Below, in conjunction with Figure 5 Explain the process of determining the recall request.
[0086] Figure 5 This is a schematic diagram illustrating the determination of a recall request as provided in an embodiment of this application. Figure 5 As shown, a recommendation request includes multiple recommendation tasks, from which a corresponding recall request is determined. Multiple recall requests belong to a single recommendation request.
[0087] Optionally, all recall requests under a recommendation request can be executed and the target multimedia can be obtained and then sent to the user terminal in a unified manner, or each recall request can be executed and the target multimedia can be obtained and then sent to the user terminal immediately.
[0088] In this feasible implementation, each recall request has a different scenario. By determining multiple recall requests from the recommendation requests and executing them separately, the accuracy of multimedia recommendations can be improved.
[0089] S306. Send the current recall request to the external system through the callback function corresponding to the recall node.
[0090] Optionally, the recall node is the first node in the pipeline. For any recommendation request, the original multimedia is first retrieved through the callback function corresponding to the recall node. The callback function corresponding to the recall node includes the logic for initiating a call to an external system.
[0091] S307. Until the current recall request is sent, the next recall request is sent to the external system until the multiple recall requests are sent.
[0092] For example, multiple recall requests are queued at the recall node and sent to the external system in sequence. The fact that the current recall request has not received a call result from the external system does not affect the sending of the next recall request.
[0093] Based on the above implementation method, sending multiple recall requests in parallel and sequentially can improve the efficiency of recalling the original multimedia.
[0094] S308. Receive the multiple original multimedia messages sent by the external system in response to the multiple recall requests through the callback function corresponding to the recall node.
[0095] Optionally, a unique tag is added to the recall request and the original multimedia corresponding to the recall request. The recall node determines the recall request corresponding to the received original multimedia based on the unique tag.
[0096] Based on the above implementation methods, unique tags can prevent recall requests from not corresponding to the original multimedia, thereby improving the accuracy of multimedia recommendations.
[0097] S309. The callback function corresponding to the current processing node is called through the callback function corresponding to the recall node to process the multiple original multimedia files and obtain multiple processed multimedia files.
[0098] For example, the callback function of a recall node includes: retrieving the original multimedia from an external system based on the recall request, and calling the callback function of the processing node following the recall node in the pipeline. If there are multiple processing nodes, the callback function of the recall node calls the callback function of the first processing node following the recall node.
[0099] Optionally, after the calling function corresponding to the recall node receives the original multimedia, it calls the callback function corresponding to the processing node. Alternatively, the callback function corresponding to the processing node is called simultaneously with the calling function corresponding to the recall node initiating a call to an external system.
[0100] Based on the above implementation method, by calling the callback function corresponding to the processing node through the callback function corresponding to the recall node, the original multimedia can be transferred from the recall node to the processing node in a timely manner, thereby improving the efficiency of multimedia recommendation.
[0101] S310. Determine whether the pipeline node includes other processing nodes through the callback function corresponding to the current processing node.
[0102] If so, then execute S311.
[0103] If not, then execute S312.
[0104] S311. The callback functions corresponding to the other processing nodes are called sequentially through the callback function corresponding to the current processing node to process the multiple processing multimedia and obtain the target multimedia corresponding to each recommendation request.
[0105] For example, if the pipeline node includes other processing nodes, it means that the original multimedia has not been processed. In this case, the original multimedia cannot be sent to the user and needs to continue processing until it is completed.
[0106] S312. The plurality of processed multimedia are determined to be the target multimedia corresponding to each recommendation request.
[0107] For example, if there are no subsequent processing nodes, it means that all processing is complete, and the original multimedia after the last processing will be identified as the target multimedia.
[0108] Below, in conjunction with Figure 6 The processing nodes are described.
[0109] Figure 6 This is a schematic diagram of a processing node provided in an embodiment of this application. Figure 6 As shown, the recall node calls the original multimedia from the external system. The original multimedia is processed sequentially through the callback function corresponding to each processing node until there are no subsequent processing nodes, at which point the processed multimedia is sent to the return value interface.
[0110] A feasible implementation of the multimedia recommendation method further includes: determining the timeout duration corresponding to each recommendation request; generating an asynchronous computing interface based on the multiple recommendation requests, the asynchronous computing interface being used to receive the target multimedia; obtaining the request number corresponding to each recommendation request and placing the request number into the asynchronous computing interface; starting a timer from the moment the request number is placed into the asynchronous computing interface; if the asynchronous computing interface receives the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout duration, then sending the target multimedia to the user terminal; if the asynchronous computing interface does not receive the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout duration, then sending preset multimedia to the user terminal.
[0111] Optionally, timing can be performed using a time wheel algorithm, and the ending cell can be determined by the timeout duration, the starting cell in the time wheel, and the number of cells in the time wheel.
[0112] Alternatively, the preset multimedia can be fixed multimedia or historically recommended multimedia.
[0113] It's understandable that setting preset multimedia can prevent users from waiting for multimedia for a long time due to recommendation algorithm timeouts.
[0114] Below, in conjunction with Figure 7 Explanation of the time wheel.
[0115] Figure 7 This is a schematic diagram of a time wheel provided for an embodiment of this application. Figure 7 As shown, for example, if the time wheel has a total of 8 segments, and 1 segment represents 1 second, and the pointer is at segment 1, then the starting segment is determined to be segment 1, and the timeout duration is 20 seconds. The result of calculating the sum of the starting segment and the timeout duration modulo the total number of segments is (1+20)%8 = 5. An end marker is added to segment 5. The result of calculating the quotient of the sum of the starting segment and the timeout duration modulo the total number of segments is then added by 1, i.e., (1+20) / 8+1 = 3. Three lap markers are added to segment 5. When the pointer points to segment 5 for the third time, the timeout duration is reached, and the timer stops. Similarly, if the pointer is at segment 2, and the timeout duration is 10 seconds, then (2+10)%8 = 4. An end marker is added to segment 4, along with two lap markers. When the pointer points to segment 4 for the second time, the timeout duration is reached, and the timer stops.
[0116] In this feasible implementation, a time wheel can be used to time multiple recommendation requests separately, thereby improving the processing capability for batch recommendation requests.
[0117] Exemplary media
[0118] After introducing the methods of exemplary embodiments of this disclosure, the following references are made. Figure 8 The storage medium of the exemplary embodiments of this disclosure will be described.
[0119] refer to Figure 8 As shown, the storage medium 80 stores a program product for implementing the above-described method according to embodiments of the present disclosure. This program product may be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a device such as a personal computer. However, the program product of the present disclosure is not limited thereto.
[0120] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0121] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium.
[0122] Program code for performing the operations disclosed herein can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN).
[0123] Exemplary device
[0124] Having introduced the medium of exemplary embodiments of this disclosure, the following references are made to... Figure 9The multimedia recommendation apparatus of the exemplary embodiments of this disclosure is described to implement the methods in any of the above method embodiments. The implementation principle and technical effect are similar, and will not be repeated here.
[0125] refer to Figure 9 , Figure 9 This is a schematic diagram of the structure of a multimedia recommendation device provided in an embodiment of this disclosure. Figure 9 As shown, it includes:
[0126] The receiving module 91 is used to receive multiple recommendation requests sent by the user terminal.
[0127] The determining module 92 is used to determine a callback function, which is used to start and execute the next recommendation request while the current pipeline node is executing the current recommendation request.
[0128] The execution module 93 is used to execute the multiple recommendation requests in parallel through the callback function to obtain the target multimedia corresponding to each recommendation request.
[0129] The sending module 94 is used to send the target multimedia to the user terminal.
[0130] Optionally, the receiving module 91 can perform... Figure 2 S201 in the embodiment.
[0131] Optionally, module 92 can be executed. Figure 2 S202 in the embodiment.
[0132] Optionally, execution module 93 can execute Figure 2 S203 in the embodiment.
[0133] Optionally, the sending module 94 can perform... Figure 2 S204 in the embodiment.
[0134] In one possible implementation, the execution module 93 is specifically used for:
[0135] Multiple pipeline nodes are identified, which are used to obtain multiple original multimedia from an external system based on the multiple recommendation requests, or to process the multiple original multimedia to obtain multiple target multimedia.
[0136] Determine the callback function corresponding to each of the pipeline nodes;
[0137] The multiple recommendation requests are executed in parallel using the callback function corresponding to each pipeline node, thereby obtaining the target multimedia corresponding to each recommendation request.
[0138] In one possible implementation, the execution module 93 is specifically used for:
[0139] Determine multiple recall requests corresponding to the multiple recommendation requests, and the multiple recall requests are used to obtain the multiple original multimedia files;
[0140] The multiple recall requests are sent to the external system sequentially through the callback function corresponding to the recall node;
[0141] The callback function corresponding to the recall node receives the multiple original multimedia files sent by the external system in response to the multiple recall requests.
[0142] The callback function corresponding to the recall node is invoked to call the callback function corresponding to the processing node to process the multiple original multimedia files and obtain the target multimedia file corresponding to each recommendation request.
[0143] Figure 10 This is a schematic diagram of the structure of a multimedia recommendation device provided in an embodiment of this application. Figure 9 Based on the illustrated embodiments, as Figure 10 As shown, the multimedia recommendation device 100 further includes: a calling module 105, a processing module 106, a corresponding module 107, and a timing module 108, wherein:
[0144] The calling module 105 is used to: send the current recall request to the external system through the callback function corresponding to the recall node; and send the next recall request to the external system after the current recall request has been sent, until the multiple recall requests have been sent.
[0145] The processing module 106 is configured to: call the callback function corresponding to the current processing node through the callback function corresponding to the recall node to process the plurality of original multimedia to obtain a plurality of processed multimedia; determine whether the pipeline nodes include other processing nodes through the callback function corresponding to the current processing node; if the pipeline nodes include the other processing nodes, then call the callback functions corresponding to the other processing nodes sequentially through the callback function corresponding to the current processing node to process the plurality of processed multimedia to obtain the target multimedia corresponding to each recommendation request; if the pipeline nodes do not include the other processing nodes, then determine the plurality of processed multimedia as the target multimedia corresponding to each recommendation request.
[0146] The corresponding module 107 is used to: determine multiple recommendation tasks corresponding to each recommendation request; determine recall requests corresponding to each recommendation task, and obtain the multiple recall requests corresponding to the multiple recommendation requests.
[0147] The timing module 108 is configured to: determine the timeout duration corresponding to each recommendation request; generate an asynchronous computing interface based on the multiple recommendation requests, the asynchronous computing interface being used to receive the target multimedia; obtain the request number corresponding to each recommendation request and place the request number into the asynchronous computing interface; start timing from the moment the request number is placed into the asynchronous computing interface; if the asynchronous computing interface receives the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout duration, then send the target multimedia to the user terminal; if the asynchronous computing interface does not receive the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout duration, then send a preset multimedia to the user terminal.
[0148] Exemplary computing device
[0149] Having described the methods, media, and apparatus of exemplary embodiments of this disclosure, the following references... Figure 11 A computing device according to an exemplary embodiment of the present disclosure will be described.
[0150] Figure 11 The computing device 110 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0151] like Figure 11 As shown, the computing device 110 is presented in the form of a general-purpose computing device. The components of the computing device 110 may include, but are not limited to: at least one processing unit 1101, at least one storage unit 1102, and a bus 1103 connecting different system components (including the processing unit 1101 and the storage unit 1102).
[0152] Bus 1103 includes a data bus, a control bus, and an address bus.
[0153] Storage unit 1102 may include readable media in the form of volatile memory, such as random access memory (RAM) 11021 and / or cache memory 11022, and may further include readable media in the form of non-volatile memory, such as read-only memory (ROM) 11023.
[0154] Storage unit 1102 may also include a program / utility 11025 having a set (at least one) of program modules 11024, such program modules 11024 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0155] The computing device 110 can also communicate with one or more external devices 1104 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 1105. Furthermore, the computing device 110 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1106. Figure 11 As shown, network adapter 1106 communicates with other modules of computing device 110 via bus 1103. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with computing device 110, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0156] It should be noted that although several units / modules or sub-units / modules of the multimedia recommendation device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0157] Furthermore, although the operations of the methods disclosed herein are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0158] While the spirit and principles of this disclosure have been described with reference to several specific embodiments, it should be understood that this disclosure is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for convenience of expression. This disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A multimedia recommendation method, characterized in that, include: Receive multiple recommendation requests sent by the user client; Determine a callback function, which is used to initiate and execute the next recommendation request while the current recommendation request is being executed at the current pipeline node; The callback function is used to execute the multiple recommendation requests in parallel to obtain the target multimedia corresponding to each recommendation request. Send the target multimedia to the user terminal; The callback function executes the multiple recommendation requests in parallel to obtain the target multimedia corresponding to each recommendation request, including: Multiple pipeline nodes are identified, which are used to obtain multiple original multimedia from an external system based on the multiple recommendation requests, or to process the multiple original multimedia to obtain multiple target multimedia. Determine the callback function corresponding to each of the pipeline nodes; By using the callback function corresponding to each pipeline node, the multiple recommendation requests are executed in parallel to obtain the target multimedia corresponding to each recommendation request; The pipeline nodes include recall nodes and processing nodes. The processing nodes include at least one of the following: filtering nodes, sorting nodes, and assembly nodes. Through the callback function corresponding to each pipeline node, the multiple recommendation requests are executed in parallel to obtain the target multimedia corresponding to each recommendation request, including: Determine multiple recall requests corresponding to the multiple recommendation requests, and the multiple recall requests are used to obtain the multiple original multimedia files; The multiple recall requests are sent to the external system sequentially through the callback function corresponding to the recall node; The callback function corresponding to the recall node receives the multiple original multimedia files sent by the external system in response to the multiple recall requests. The callback function corresponding to the recall node is invoked to call the callback function corresponding to the processing node to process the multiple original multimedia files and obtain the target multimedia file corresponding to each recommendation request.
2. The method according to claim 1, characterized in that, The callback function corresponding to the recall node sequentially sends the multiple recall requests to the external system, including: The current recall request is sent to the external system through the callback function corresponding to the recall node; Once the current recall request has been sent, the next recall request is sent to the external system, and so on, until all the recall requests have been sent.
3. The method according to claim 2, characterized in that, The callback function corresponding to the processing node is invoked through the callback function corresponding to the recall node to process the multiple original multimedia files, thereby obtaining the target multimedia file corresponding to each recommendation request, including: The callback function corresponding to the current processing node is called through the callback function corresponding to the recall node to process the multiple original multimedia files and obtain multiple processed multimedia files. The callback function corresponding to the current processing node determines whether the pipeline node includes other processing nodes; If the pipeline node includes the other processing nodes, the callback function corresponding to the other processing nodes is called sequentially through the callback function corresponding to the current processing node to process the multiple processing multimedia and obtain the target multimedia corresponding to each recommendation request; If the pipeline nodes do not include the other processing nodes, then the plurality of processed multimedia are determined as the target multimedia corresponding to each recommendation request.
4. The method according to claim 3, characterized in that, Determining the multiple recall requests corresponding to the multiple recommendation requests includes: Identify multiple recommendation tasks corresponding to each recommendation request; Determine the recall request corresponding to each of the recommended tasks to obtain the multiple recall requests corresponding to the multiple recommended requests.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: Determine the timeout duration for each of the aforementioned recommendation requests; Based on the multiple recommendation requests, an asynchronous computing interface is generated, which is used to receive the target multimedia. Obtain the request number corresponding to each recommendation request, and put the request number into the asynchronous calculation interface; The timing starts from the moment the request number is placed in the asynchronous computing interface. If the asynchronous computing interface receives the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout period, the target multimedia is sent to the user terminal. If the asynchronous computing interface does not receive the target multimedia corresponding to the request number within the timeout period, it sends the preset multimedia to the user terminal.
6. A computer-readable storage medium comprising: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the multimedia recommendation method as described in any one of claims 1 to 5.
7. A multimedia recommendation device, the device comprising: The receiving module is used to receive multiple recommendation requests sent by the user client; The determination module is used to determine the callback function, which is used to start and execute the next recommendation request while the current recommendation request is being executed at the current pipeline node; The execution module is used to execute the multiple recommendation requests in parallel through the callback function to obtain the target multimedia corresponding to each recommendation request; The sending module is used to send the target multimedia to the user terminal; The execution module is specifically used to determine multiple pipeline nodes, which are used to obtain multiple original multimedia from an external system based on the multiple recommendation requests, or to process the multiple original multimedia to obtain multiple target multimedia. The execution module is further configured to determine the callback function corresponding to each pipeline node; The execution module is further configured to execute the multiple recommendation requests in parallel through the callback function corresponding to each pipeline node, so as to obtain the target multimedia corresponding to each recommendation request; The pipeline nodes include recall nodes and processing nodes, and the processing nodes include at least one of the following nodes: filtering nodes, sorting nodes, and assembly nodes. The execution module is specifically used to determine multiple recall requests corresponding to the multiple recommendation requests, and the multiple recall requests are used to obtain the multiple original multimedia files; The execution module is further configured to send the multiple recall requests to the external system sequentially through the callback function corresponding to the recall node; The execution module is further configured to receive the multiple original multimedia messages sent by the external system in response to the multiple recall requests through the callback function corresponding to the recall node; The execution module is further configured to call the callback function corresponding to the processing node through the callback function corresponding to the recall node, process the multiple original multimedia files, and obtain the target multimedia file corresponding to each recommendation request.
8. The apparatus according to claim 7, characterized in that, The device further includes: The calling module is used to send the current recall request to the external system through the callback function corresponding to the recall node; The calling module is further configured to send the next recall request to the external system after the current recall request has been sent, until the sending of the multiple recall requests has been completed.
9. The apparatus according to claim 8, characterized in that, The device further includes: The processing module is used to call the callback function corresponding to the current processing node through the callback function corresponding to the recall node to process the multiple original multimedia files and obtain multiple processed multimedia files. The processing module is also used to determine whether the pipeline node includes other processing nodes through the callback function corresponding to the current processing node; The processing module is further configured to, if the pipeline node includes the other processing nodes, sequentially call the callback functions corresponding to the other processing nodes through the callback function corresponding to the current processing node to process the multiple processing multimedia and obtain the target multimedia corresponding to each recommendation request; The processing module is further configured to determine the plurality of processed multimedia as the target multimedia corresponding to each recommendation request if the pipeline nodes do not include the other processing nodes.
10. The apparatus according to claim 9, characterized in that, The device further includes: The corresponding module is used to determine multiple recommendation tasks corresponding to each recommendation request; The corresponding module is further configured to determine the recall request corresponding to each of the recommendation tasks, and obtain the multiple recall requests corresponding to the multiple recommendation requests.
11. The apparatus according to any one of claims 7-10, characterized in that, The device further includes: The timing module is used to determine the timeout duration for each recommendation request; The timing module is also used to generate an asynchronous calculation interface based on the multiple recommendation requests, and the asynchronous calculation interface is used to receive the target multimedia. The timing module is also used to obtain the request number corresponding to each recommendation request and put the request number into the asynchronous calculation interface; The timing module is also used to start timing from the moment the request number is placed in the asynchronous computing interface. If the asynchronous computing interface receives the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout duration, the target multimedia is sent to the user terminal. The timing module is further configured to send a preset multimedia to the user terminal if the asynchronous computing interface does not receive the target multimedia corresponding to the request number corresponding to the timeout duration within the timeout period.
12. A computing device, comprising: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, cause the computing device to perform the multimedia recommendation method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Business request processing method and device, electronic equipment and storage medium
CN111431966A
Data reading method and device, apparatus and medium
CN112269538A