A resource recommendation method, device, equipment, and storage medium
By building a node relationship diagram of material and advertising space elements, finding ad slots that match recommended adaptations, it solves the problem that the material and advertising space style requirements are inconsistent when advertisers place advertisements, and improves work efficiency.
Patent Information
- Application Number
- CN202110051017.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-14
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-01-14
AI Technical Summary
When serving advertisements, advertisers often encounter problems that the material does not match the style requirements of the advertising space, which leads to frequent modification of the material or rollback of the selection of the advertising space, which increases the workload.
By obtaining the element collection of materials and ad slots, mapping them into nodes, building node relationship diagrams, and finding matching ad slots to recommend adapted adaptations.
Effectively judge the adaptability between materials and advertising spaces, reduce users' blind choices, avoid material modification or resource reselecting, and improve work efficiency.
Smart Images

Figure CN113743974B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of information processing, including but not limited to a resource recommendation method, apparatus, device, and storage medium. Background Art
[0002] Currently, Internet websites generally display advertisements to increase their operating income. There are various forms of advertisement display, such as banner, floating animation, slideshow, etc. There are also various forms of advertisement materials, such as pictures, videos, and animations. Moreover, advertisement materials will be dynamically adjusted according to scheduling, customer requirements, or event arrangements.
[0003] Currently, when placing advertisements, advertisers need to first select an advertising space and then upload the advertisement materials to the advertising space. However, they often encounter problems where the advertisement materials do not meet the style requirements of the advertising space, such as incorrect picture size, too long video duration, incorrect bit rate, etc. At this time, the advertiser needs to modify the materials or roll back to select another advertising space. And after rolling back to select another advertising space, there will still be problems where the uploaded advertisement materials do not meet the style requirements of the advertising space. Therefore, it brings a large amount of cumbersome workload to the advertiser. Summary of the Invention
[0004] In view of this, embodiments of the present application provide a resource recommendation method, apparatus, device, and storage medium to solve at least one problem in the related art, which can recommend advertising spaces suitable for the materials to users and improve the work efficiency of users.
[0005] The technical solution of the embodiments of the present application is implemented as follows:
[0006] In a first aspect, embodiments of the present application provide a resource recommendation method, the method including:
[0007] Obtain the elements included in the material to obtain a first element set, and obtain the elements included in the resource to obtain a second element set;
[0008] Map each first element in the first element set to a first node, and map each second element in the second element set to a second node;
[0009] Connect edges between the first nodes and the second nodes to construct a node relationship graph;
[0010] In the node relationship graph, search for a match;
[0011] When a match is found, use the resource as the resource to be recommended and output the resource identifier of the resource to be recommended.
[0012] In a second aspect, embodiments of the present application provide a resource recommendation apparatus, the apparatus including:
[0013] An obtaining unit, configured to obtain elements included in materials to obtain a first element set, and obtain elements included in resources to obtain a second element set;
[0014] A mapping unit, configured to map each first element in the first element set to a first node, and map each second element in the second element set to a second node;
[0015] A constructing unit, configured to connect edges between the first nodes and the second nodes to construct a node relationship graph;
[0016] A matching unit, configured to search for a match in the node relationship graph;
[0017] An output unit, configured to, when a match is found, use the resource as a to-be-recommended resource and output a resource identifier of the to-be-recommended resource.
[0018] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps in the above resource recommendation method are implemented.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above resource recommendation method are implemented.
[0020] In an embodiment of the present application, a resource recommendation method is provided. Elements included in materials are obtained to obtain a first element set, and elements included in resources are obtained to obtain a second element set; each first element in the first element set is mapped to a first node, and each second element in the second element set is mapped to a second node; edges are connected between the first nodes and the second nodes to construct a node relationship graph; a match is searched for in the node relationship graph; when a match is found, the resource is used as a to-be-recommended resource, and a resource identifier of the to-be-recommended resource is output. In this way, it is possible to effectively determine whether the materials are compatible with the resources before the user uploads the materials, and recommend the compatible resources to the user as to-be-recommended resources, avoiding the user from blindly selecting resources, thereby avoiding the problems of material modification or resource re-selection caused by the incompatibility between the materials to be uploaded and the selected resources, and improving the user's work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic structural diagram of an information processing system according to an embodiment of the present application;
[0022] Figure 2 It is a schematic structural diagram of an information processing system according to an embodiment of the present application;
[0023] Figure 3 An optionally schematic flowchart of the resource recommendation method provided by an embodiment of the present application;
[0024] Figure 4 An optionally schematic structural diagram of the node relationship graph provided by an embodiment of the present application;
[0025] Figure 5 An optionally schematic flowchart of the resource recommendation method provided by an embodiment of the present application;
[0026] Figure 6 An optionally schematic flowchart of the resource recommendation method provided by an embodiment of the present application;
[0027] Figure 7 An optionally schematic structural diagram of the node relationship graph provided by an embodiment of the present application;
[0028] Figure 8 An optionally schematic flowchart of the resource recommendation method provided by an embodiment of the present application;
[0029] Figure 9 An optionally schematic structural diagram of the resource recommendation device provided by an embodiment of the present application;
[0030] Figure 10 An optionally schematic structural diagram of the electronic device provided by an embodiment of the present application. Detailed implementation manners
[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will further describe the specific technical solutions of the application in detail with reference to the accompanying drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application but are not used to limit the scope of the present application.
[0032] Before further elaborating on the embodiments of the present application for better understanding, the nouns and terms involved in the embodiments of the present application are described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0033] 1) Material: Network content composed of content such as text, pictures, videos, etc., such as advertisement materials.
[0034] 2) Resource: The page display area capable of carrying materials, such as advertisement positions.
[0035] 3) Element: A single piece of content in the content included in the material, or a single piece of content in the content that the resource can carry. Based on different types, elements can include text, pictures, videos, audio, etc.
[0036] 4) Attribute: Can characterize the requirements of the elements included in the material, including: type, size, dimensions, etc.
[0037] 5) Attribute requirements, which can characterize the capabilities of the elements that a resource can carry, including: type requirements, size requirements, magnitude requirements, etc.
[0038] 5) Node relationship graph, a graph with elements as nodes, and there is an edge connected between the first node corresponding to the element of the material and the second node corresponding to the element of the resource. Among them, when there is an edge connected between the first node and the second node, it indicates that the element corresponding to the first node is adapted to the element corresponding to the second node, that is, the element corresponding to the second node can carry the element corresponding to the first node. For example: bipartite graph.
[0039] 6) Bipartite graph, in which the two nodes associated with each edge in the graph belong to two different node sets.
[0040] 7) Matching, in a subgraph in the node relationship graph, if any two edges in the subgraph do not attach to the same node, then the subgraph is called a matching.
[0041] Embodiments of the present application can provide a resource recommendation method, device, equipment and storage medium. In practical applications, the resource recommendation method can be implemented by a text error correction device, and each functional entity in the text error correction device can be realized by the hardware resources of a computer device (such as a terminal device, a server or a server cluster), such as computing resources of a processor, etc., and communication resources (such as various communication methods used to support the implementation of optical cables, cellular networks, etc.) in a collaborative manner.
[0042] The resource recommendation method of the embodiments of the present application can be applied to Figure 1 the information processing system shown in the figure, and the resource recommendation device in the information processing system can determine whether a resource is a resource to be recommended.
[0043] In one example, as Figure 1 shown in the figure, the information processing system includes a client 10 and a server 20; among them, an input application APP capable of receiving user input operations or a browser providing an input page is installed in the client 10, and the user can receive the material input by the user through the input application APP or the input page. The server 20 serves the client 10, the server 20 includes resources, and can receive the material sent by the client 10, and determine whether a resource is a resource to be recommended for the received material, and output the resource to be recommended to the client 10. The client 10 and the server 20 interact through the network 30.
[0044] The server 20 can be implemented as a resource recommendation device for implementing the resource recommendation method. The server 20 obtains the elements included in the material to obtain a first element set, and obtains the elements included in the resource to obtain a second element set; maps each first element in the first element set to a first node, and maps each second element in the second element set to a second node; connects edges between the first nodes and the second nodes to construct a node relationship graph; searches for matches in the node relationship graph; in the case of finding a match, uses the resource as a resource to be recommended, outputs the resource identifier of the resource, and outputs the resource identifier of the resource to the client 10. In the client 10, the resource identifier of the resource to be recommended can be presented to the user through a display.
[0045] In one example, as Figure 2 shown, the information processing system only includes the client 40, and the client 40 is implemented as a resource recommendation device for implementing the resource recommendation method.
[0046] The client receives the material input by the user through the input application APP or the input page, obtains the elements included in the material to obtain a first element set, and obtains the elements included in the resource to obtain a second element set; maps each first element in the first element set to a first node, and maps each second element in the second element set to a second node; connects edges between the first nodes and the second nodes to construct a node relationship graph; searches for matches in the node relationship graph; in the case of finding a match, uses the resource as a resource to be recommended, and presents the resource identifier of the resource to be recommended to the user through a display.
[0047] Combined with the above information processing system, this embodiment proposes a resource recommendation method, which can recommend advertisement spaces adapted to the material to the user and improve the user's work efficiency.
[0048] Next, combined with Figure 1 or Figure 2 the schematic diagram of the information processing system shown, each embodiment of the resource recommendation method, device, equipment and storage medium provided by the embodiments of the present application will be described.
[0049] This embodiment provides a resource recommendation method, which is applied to a resource recommendation device. Among them, the resource recommendation device can be a computer device or a distributed network composed of computer devices. The functions implemented by this method can be realized by the processor in the computer device calling program code. Of course, the program code can be stored in the computer storage medium. It can be seen that the computer device at least includes a processor and a storage medium.
[0050] Figure 3 For the implementation process schematic diagram of a resource recommendation method of an embodiment of the present application, as Figure 3 shown, this method may include the following steps:
[0051] S301. Obtain the elements included in the material to get the first element set, and obtain the elements included in the resource to get the second element set.
[0052] The resource recommendation device receives the material input by the user and parses the elements in the material to obtain the elements included in the material. Here, the elements in the material are referred to as the first elements, and the set composed of the first elements is called the first element set. In the embodiments of the present application, one material corresponds to one first element set. Among them, the types of the first elements included in the material include one or more combinations of the following types: text, picture, audio, video, etc. In one example, the first element set corresponding to material 1 is: text 1, text 2, and video 2. In one example, the first element set corresponding to material 2 is: text 1, text 2, picture 1, picture 2, picture 3, video 1, and video 2.
[0053] The resource recommendation device obtains the elements that the resource can carry and parses them to obtain the elements included in the resource. Here, the elements in the resource are referred to as the second elements, and the set composed of the second elements is called the second element set. In the embodiments of the present application, one resource corresponds to one second element set. In one example, the second element set corresponding to resource 1 is: title 1, main picture, sub-picture, and video 1. Among them, the type of the title is text, the type of the main picture is picture, the type of the sub-picture is picture, and the type of video 1 is video. In one example, the first element set corresponding to material 2 is: text 1, text 2, picture 1, picture 2, picture 3, video 1, and video 2.
[0054] S302. Map each first element in the first element set to a first node, and map each second element in the second element set to a second node.
[0055] For example: The first element set includes: element 11, element 12, and element 13. Map element 11, element 12, and element 13 one-to-one to the first nodes: node s11, node s12, and node s13. Here, node s11, node s12, and the node form the first node set.
[0056] For example: The second element set includes: element 21, element 22, element 23, element 24, and element 25. Map element 21, element 22, element 23, element 24, and element 25 one-to-one to the second nodes: node s21, node s22, node s23, node s24, and node s25. Here, node s21, node s22, node s23, node s24, and node s25 form the second node set.
[0057] S303. Connect edges between the first nodes and the second nodes to construct a node relationship graph.
[0058] Edges are connected between the first node of the first node set and the second node of the second node set, and the formed node relationship graph is a bipartite graph. At this time, there is no edge between any two first nodes, and there is no edge between any two second nodes.
[0059] In the embodiments of the present application, edges are connected between the first node and the second node according to the relationship between the attribute of the element corresponding to the first node and the attribute requirement of the element corresponding to the second node. When the attribute of the element corresponding to the first node conforms to the attribute requirement of the element corresponding to the second node, an edge is connected between the first node and the second node; when the attribute of the element corresponding to the first node does not conform to the attribute requirement of the element corresponding to the second node, no edge is connected between the first node and the second node.
[0060] In an example, the constructed node relationship graph is as Figure 4 shown. Nodes s11, s12, and 13 form the first node set, and nodes s21, s22, s23, s24, and s25 form the second node set. The connected edges include: the edges between node s11 and nodes s21, s23, s24, and s25, the edges between node s12 and nodes s21, s22, s24, and s25, and the edges between node s13 and nodes s21, s22, s23, s24, and s25.
[0061] S304. In the node relationship graph, find a match.
[0062] After obtaining the node relationship graph, a subgraph is found in the node relationship graph based on a matching algorithm, such that any two edges in the found subgraph do not attach to the same node. Then, the subgraph is called a match.
[0063] In the embodiments of the present application, the matching algorithms used to find a match may include: Maximal Flow or Hungarian Algorithm.
[0064] In the embodiments of the present application, no limitation is imposed on the matching algorithms used to find a match.
[0065] In an example, for Figure 4The shown node relationship graph, the first element set includes: element 11, element 12, and element 13, the second element set includes: element 21, element 22, element 23, element 24, and element 25. Correspondingly, the first nodes in the first node set include: node s11, node s12, and node 13, and the second nodes in the second node set include: node s21, node s22, node s23, node s24, and node s25. The found matches include: node s11 - node s23, node S12 - node S25, node S13 - node S21.
[0066] In an example, the first element set includes: element 11, element 12, and element 13. The second element set includes: element 21, element 22, element 23, element 24, and element 25. Correspondingly, the first nodes in the first node set include: node s11, node s12, and node 13, and the second nodes in the second node set include: node s21, node s22, node s23, node s24, and node s25. The matches found based on the node relationship graph formed by the first nodes in the first node set and the second nodes in the second node set include: node s11 - node s23, node s13 - node s25.
[0067] S305. In the case of finding a match, use the said resource as the resource to be recommended, and output the resource identifier of the resource to be recommended.
[0068] When a match is found in the node relationship graph corresponding to this resource, then determine that this resource is the resource to be recommended, then obtain the resource identifier of this resource, and output the resource identifier of the resource to be recommended to present to the user, so that the user can know that the presented resource can carry this material.
[0069] In practical applications, the resource recommendation device can respectively perform the above steps S301 to S304 for a material with multiple resources respectively, and determine the recommendable resources from the multiple resources, and output the resource identifiers of the determined recommendable resources to the user. Among them, each resource corresponds to a node relationship graph. When a match is found from the node relationship graph, it is considered that the resource corresponding to the node relationship graph is the resource to be recommended, and this resource can carry the current material; when no match is found from the node relationship graph, it is considered that the resource corresponding to the node relationship graph is not the resource to be recommended, and this resource cannot carry the current material.
[0070] In an example, the material uploaded by the user is material 1, and the resources provided by the resource provider include: resource 1, resource 2, and resource 3. According to the elements of material 1 and the elements of resource 1, the node relationship Figure 1 , and a match is found in the node relationship Figure 1 : match 1; According to the elements of material 1 and the elements of resource 2, the node relationshipFigure 2 , and no match is found in the node relationship Figure 2 ; based on the elements of Material 1 and the elements of Resource 3, the node relationship Figure 3 is obtained, and a match is found in the node relationship Figure 3 : Match 2, it is considered that Resource 1 and Resource 3 can carry Material 1, and then Resource 1 and Resource 3 can be recommended to the user.
[0071] When the user knows the resources that can carry the material, that is, the resources that can adapt to the material, and there are multiple resources, the user can select the target resource for presenting the material from multiple resources according to the resource information such as the billing and location of each resource.
[0072] In practical applications, when the resources to be recommended determined by the resource recommendation device include multiple resources, the resource information such as the billing and location of each to-be-recommended resource can be obtained, the recommendation degree of each resource can be calculated according to the resource information, and while outputting the resource identifier of the to-be-recommended resource, the recommendation degree of each to-be-recommended resource can be output.
[0073] The resource recommendation method provided by the embodiments of this application obtains the elements included in the material to obtain a first element set, and obtains the elements included in the resource to obtain a second element set; maps each first element in the first element set to a first node, and maps each second element in the second element set to a second node; connects edges between the first node and the second node to construct a node relationship graph; searches for matches in the node relationship graph; in the case of finding a match, uses the resource as the to-be-recommended resource and outputs the resource identifier of the to-be-recommended resource; in this way, it is possible to effectively determine whether the material and the resource are adaptable before the user uploads the material, and recommend the adaptable resource as the to-be-recommended resource to the user, avoiding the user from blindly selecting resources, thereby avoiding the occurrence of problems such as material modification or resource re-selection caused by the inadaptability of the material to be uploaded by the selected resource, and improving the user's work efficiency.
[0074] In some embodiments, as Figure 5 shown, the implementation of S303 includes:
[0075] S3031. Obtain the attributes of the first element and the attribute requirements of the second element.
[0076] The attributes of the first element include: type and element parameters. Among them, the type includes: styles representing elements such as text, pictures, videos, etc., and the element parameters represent the size, etc. of the element. When the type is text, the element parameters include: length. When the type is picture, the element parameters include: one or more combinations of size, dimensions, and resolution. When the type is video, the element parameters include: one or more combinations of aspect ratio, size, bit rate, and duration.
[0077] The attribute requirements of the second element include: type requirements and parameter requirements. Among them, the type requirements include: the styles of elements that resources such as text, pictures, videos, etc. can carry, and the parameter requirements represent the specific requirements for the styles of the carried elements, etc. When the type requirement is text, the parameter requirements include: length. When the type requirement is picture, the parameter requirements include: one or a combination of size, dimensions, and resolution. When the type requirement is video, the parameter requirements include: one or a combination of aspect ratio, size, bit rate, and duration.
[0078] S3032. Establish a connection edge between the corresponding first node and the corresponding second node according to the attribute of the first element and the attribute requirements of the second element, and construct the node relationship graph.
[0079] After determining the attributes of each first element in the material and the attribute requirements of each second element in the resource, determine whether each first element and each second element match. Connect edges between the first node and the second node corresponding to the matching first element and second element respectively to obtain the node relationship graph. In some embodiments, the implementation of S3032 includes: traversing the attributes of each first element and the attribute requirements of each second element to determine the element pairs whose attribute requirements match the attributes; connect edges between the first node and the second node corresponding to the first element and the second element in the element pair respectively to obtain the node relationship graph.
[0080] In one example, for Figure 4The node relationship diagram shown. The first element set includes: Element 11, Element 12, and Element 13. The second element set includes: Element 21, Element 22, Element 23, Element 24, and Element 25. Correspondingly, the first nodes in the first node set include: Node s11, Node s12, and Node 13. The second nodes in the second node set include: Node s21, Node s22, Node s23, Node s24, and Node s25. The attributes of Element 11, the attributes of Element 12, and the attributes of Element 13 are respectively compared with the attribute requirements of Element 21, the attribute requirements of Element 22, the attribute requirements of Element 23, the attribute requirements of Element 24, and the attribute requirements of Element 25 to determine the element pairs where the attribute requirements match the attributes. Among them, the determined element pairs include: Element 11 and Element 21, Element 11 and Element 23, Element 11 and Element 24, Element 11 and Element 25, Element 12 and Element 21, Element 12 and Element 22, Element 12 and Element 24, Element 12 and Element 25, Element 13 and Element 21, Element 13 and Element 22, Element 13 and Element 23, Element 13 and Element 24, Element 13 and Element 25. Then the connected edges include: the edges between Node s11 and Node s21, Node s23, Node s24, and Node s25, the edges between Node s12 and Node s21, Node s22, Node s24, and Node s25, and the edges between Node s13 and Node s21, Node s22, Node s23, Node s24, and Node s25.
[0081] Here, no edges are connected between the first nodes corresponding to different first elements, and no edges are connected between the second nodes corresponding to different second elements, so that the obtained node relationship diagram is a bipartite graph.
[0082] In some embodiments, traversing the attributes of each first element and the attribute requirements of each second element to determine the element pairs where the attribute requirements match the attributes includes: taking each first element as a reference element respectively and performing the following processing: comparing the attribute of the reference element with the attribute requirements of each second element respectively; finding the second element whose attribute requirements match the attribute of the reference element as the reached element to obtain an element pair including the reference element and the reached element.
[0083] Here, when traversing the attributes of each first element and the attribute requirements of each second element, each first element can be taken as a reference element respectively to determine the element pairs corresponding to each reference element. Here, the other element in the element pair except the reference element is called the reached element.
[0084] In one example, for Figure 4The node relationship diagram shown. The first element set includes: Element 11, Element 12, and Element 13. The second element set includes: Element 21, Element 22, Element 23, Element 24, and Element 25. Correspondingly, the first nodes in the first node set include: Node s11, Node s12, and Node 13. The second nodes in the second node set include: Node s21, Node s22, Node s23, Node s24, and Node s25. First, taking Element 11 as the reference element, determine whether the attributes of Element 11 match the attribute requirements of each second element: Element 21, Element 22, Element 23, Element 24, and Element 25. After determining the element pairs corresponding to Element 11, then taking Element 12 as the reference element, determine the element pairs corresponding to Element 12, and so on, until all the first elements are used as reference elements respectively to obtain all the element pairs corresponding to the first elements.
[0085] In some embodiments, the attribute includes: type. Correspondingly, the attribute requirement includes: type requirement. At this time, the second element whose search attribute requirement matches the attribute of the first element is the reach element, including: finding at least one target second element whose type requirement is the same as the type of the target first element; among the at least one target second element, determine the reach element.
[0086] In the embodiments of the present application, when the resource recommendation device determines the element pairs corresponding to the reference element based on the reference element, first, based on the type requirement of the second element, find the second element that matches the reference element in terms of type. In one example, the first element set includes: Element 11, Element 12, and Element 13. The second element set includes: Element 21, Element 22, Element 23, Element 24, and Element 25. When determining the element pairs corresponding to Element 11, based on the type of Element 11 being text, the type requirement of Element 21 being text, the type requirement of Element 22 being text, the type requirement of Element 23 being picture, the type requirement of Element 24 being picture, and the type requirement of Element 25 being video, the determined target second elements include: Element 21 and Element 22.
[0087] After determining the target second element, among the at least one target second element, determine the reach element. Among them, the determination method for determining the reach element among the at least one target element includes one of the following:
[0088] Determination method one: Determine all the target second elements as the reach elements.
[0089] Determination method two: The target second element that can completely carry the target first element is the reach element.
[0090] When the determination method is determination method one, directly determine all the target second elements as the reach elements. In one example, as in the above example, the determined target second elements include: element 21 and element 22, then element 21 and element 22 are the reach elements.
[0091] When the determination method is determination method two, in the at least one target second element, determining the reach element includes: calculating the fitness between the target first element and each target second element according to the element parameter of the target first element and the parameter requirements of each target second element in the at least one target second element; determining the target second element whose fitness meets the set fitness range as the reach element.
[0092] Here, according to the element parameter of the reference element and the parameter requirements of each target second element, determine the fitness between the reference element and each target second element.
[0093] The calculation method of the fitness may be different according to different types.
[0094] In one example, when the type is text, the calculation formula of the fitness is as shown in formula (1):
[0095] (1-(|length-avgLength| / avgLength))*100 Formula (1)
[0096] Wherein, length is the length of the text element in the reference element, that is, the material, and avgLength represents the parameter requirement of the target second element. In practical applications, the parameter requirements of the target second element may include the minimum length and the maximum length. At this time, avgLength may be the intermediate value between the minimum length and the maximum length in the element requirements.
[0097] In one example, when the type is a picture, when the element parameter of the reference element and the parameter requirements of the target second element are exactly the same, the fitness is considered to be 100, otherwise it is 0. Here, strict requirements are imposed on the pictures in the material and the picture requirements in the resource, so that the resource can be effectively utilized while displaying the material.
[0098] In one example, when the type is a picture, when the error between the element parameter of the reference element and the parameter requirements of the target second element is less than the set error, the fitness is considered to be 100, otherwise it is 0.
[0099] In one example, when the type is a video, the calculation formula of the fitness is as shown in formula (2):
[0100] (bitRate / maxBitRate + size / maxSize + duration / maxDuration) / 3 * 100, formula (2);
[0101] Among them, bitRate is the bit rate of the reference element, i.e., the material element, maxBitRate is the maximum bit rate required by the target second element, size is the size of the reference element, i.e., the material element, maxSize is the maximum size required by the target second element, duration is the duration of the reference element, i.e., the material element, and maxDuration is the maximum duration required by the target second element.
[0102] In the embodiments of the present application, after calculating the fitness between the reference element and the target second element, it is determined whether the fitness is within the set fitness range. If the fitness is within the set fitness range, the corresponding target second element is considered as the reachable element, and the reference element and the target second element form a pair of element pairs.
[0103] The fitness range can be: greater than or equal to 20. In practical applications, the fitness range can be set according to actual needs.
[0104] In the embodiments of the present application, when the types of the first element and the second element are different, they do not match, and the corresponding first node and the corresponding second node are unreachable. When the types of the first element and the second element are the same, and the fitness between them does not meet the fitness range, they do not match, and the corresponding first node and the corresponding second node are unreachable. When the types of the first element and the second element are the same, and the fitness between them meets the fitness range, they match, and the corresponding first node and the corresponding second node are reachable and connected as an edge.
[0105] In some embodiments, before S304, it further includes:
[0106] Mark the fitness between the first node and the second node connected by the edge, and the corresponding first element and the corresponding second element, as the weight of the corresponding edge; correspondingly, the implementation of S304 includes: searching for a match in the node relationship graph according to the weight of the edge.
[0107] The resource recommendation device determines the fitness between the reference element and each target second element according to the element parameters of the reference element and the parameter requirements of each target second element. The calculation method of the fitness may be different according to different types. The calculation of the fitness can refer to the above description and will not be elaborated here.
[0108] After obtaining the fitness between the elements corresponding to the two nodes connected by each edge, mark the fitness as the weight of the edge. At this time, according to the edges between the nodes in the node relationship graph and the weights of each edge, search for a match in the node relationship graph. The matching algorithms used to search for a match based on the edges and their weights may include: the Kuhn–Munkres (KM) algorithm, the maximum flow algorithm, etc. In the embodiments of the present application, no limitation is imposed on the matching algorithm used to search for a match.
[0109] In some embodiments, after S305, as Figure 6 shown, it further includes:
[0110] S306. Determine the target edges included in the match;
[0111] S307. Establish an association relationship between the first element represented by the first node and the second element represented by the second node connected by the target edge, and output the association relationship.
[0112] After the resource recommendation device finds a match in the node relationship graph, it determines all the edges included in the match, and establishes a connection relationship between the first element and the second element corresponding to the first node and the second node connected by each edge, and outputs the connection relationship so that the user can know which materials in the materials can be displayed in a resource and the specific position where they are displayed in the resource.
[0113] Next, take the advertisement scenario where the resource is an advertising space as an example to further illustrate the resource recommendation method provided by the embodiments of the present application.
[0114] Here, first introduce the KM algorithm.
[0115] The KM algorithm can be used to solve the optimal weighted matching problem of a bipartite graph.
[0116] A bipartite graph is a special type of graph whose vertices can be divided into two independent sets U and V such that all edges connect a point in U and a point in V. That is to say, the edges starting from the vertices in U will only connect to V and will not connect to U itself. The same is true for V.
[0117] A matching refers to a subgraph M of a bipartite graph G. Any two edges in the edge set of M do not have a common vertex, so the subgraph M is a matching. That is to say, a set of edges without common vertices.
[0118] The optimal weighted matching of a bipartite graph means finding a matching on a given weighted bipartite graph such that the sum of the weights of all matching edges is the largest.
[0119] In one example, as Figure 7As shown in the figure, the weighted bipartite graph 701 includes two sets: U and V. Among them, node A and node B belong to set U, and node a and node b belong to set V. The weights of the edges between each node are as Figure 7 shown. Using the KM algorithm to find the optimal matching of the weighted bipartite graph 301, the matching result is as Figure 7 shown, including edge 702. Among them, edge 702 includes the edge between A and b and the edge between B and a, and the maximum weight is 10 + 20 = 30. Here, Figure 7 for the other matching (A - a, B - b, weight = 100 + (-101) = -1) in the weighted bipartite graph 701 shown, its weight is -1, which is less than 30.
[0120] The execution process of the KM algorithm used in the embodiments of this application includes:
[0121] Initialize the values of the feasible top labels, and perform the following operations on each vertex in set U: a), use the Hungarian algorithm to find a matching in the equal subgraph; b), if no augmenting path is found, modify the values of the feasible top labels, and repeat steps a) and b) until a complete matching of the equal subgraph is found.
[0122] In the advertising space scenario, abstract the advertising space elements and material elements into the vertices in two sets. The advertising space elements are in set U, and the material elements are in set V. The edge between the advertising space element and the material element indicates whether the material element is suitable, and the weight of the edge characterizes the degree to which the material element meets the requirements of the advertising space element. The more it meets the requirements, the higher the weight value. At the same time, there will be no edge from an advertising space element to an advertising space element or an edge from a material element to a material element. In this way, a weighted bipartite graph of advertising space - material can be constructed. On this weighted bipartite graph, the KM algorithm can be used to find a matching with the largest weight value, that is, find the most suitable material elements for each element in this advertising space.
[0123] The resource recommendation method provided by the embodiments of this application can be as Figure 8 shown, including:
[0124] S801. The user 81 submits materials to the resource recommendation device 82.
[0125] Here, when the user submits a material set to the resource recommendation device, it can be any number of text information, pictures, and videos (each text is regarded as a material element, and the same applies to pictures and videos).
[0126] S802. The resource recommendation device 82 pulls advertising spaces from the advertising space pool 83.
[0127] The resource recommendation device pulls an advertising space set from the target advertising space pool. Among them, each advertising space has a different style and is composed of one or more advertising space elements. The advertising space elements include a text field, a picture field, and a video field.
[0128] S803. The resource recommendation device 82 calculates the fitness.
[0129] The resource recommendation device 82 calculates the fitness between each element in the calculation material and each element in the ad slot.
[0130] S804. The resource recommendation device 82 constructs a weighted bipartite graph.
[0131] The resource recommendation device 82 outputs a weighted bipartite graph of material - ad slot based on the calculated fitness.
[0132] S805. The resource recommendation device 82 searches for a match.
[0133] The resource recommendation device performs a KM match on the weighted bipartite graph. If the match is successful, it means that there is a material element that fits this ad slot and it is the optimal match.
[0134] S806. The resource recommendation device 82 outputs a result set.
[0135] The resource recommendation device 82 outputs a combination of material elements - ad slot elements to the user 81 based on the match.
[0136] Here, the resource recommendation device takes the matched material element and the ad slot as a combination, adds it to the result set, and outputs the result set.
[0137] In the embodiments of the present application, the calculation rule of the weight value corresponding to the edge connecting a material element and an ad slot element, that is, the fitness between the material element and the ad slot element, may include:
[0138] 1. The weight value is normalized between 0 and 100. A very small weight (for example: -2 to the power of 20) indicates that the corresponding material element does not meet the requirements of the ad slot element, and there is no reachability (UNREACHABLE) between these two elements.
[0139] 2. There is no reachability between different types of material elements and ad slot elements.
[0140] 3. For elements of the same type, there is no reachability between elements whose attributes do not meet the requirements of the attribute requirements. The calculation method of the fitness between elements that meet the requirements is as follows:
[0141] For corresponding text - type elements: The higher the weight value of the material element whose length is closer to the average value required by the ad slot element. In an example, the calculation formula of the fitness is as shown in formula (1):
[0142] (1 - (|length - avgLength| / avgLength)) * 100 Formula (1);
[0143] Among them, length is the length of the text element in the material, and avgLength| is the median value between the minimum length and the maximum length required for the text element in the ad space.
[0144] For picture elements: The width and height of the material element strictly meet the requirements of the ad space element, and the adaptation degree is 100.
[0145] For video elements: The aspect ratio of the width and height of the material element strictly meets the requirements of the ad space element; the closer the bit rate, size, and duration of the material element are to the maximum values required by the ad space element, the higher the score. At this time, the average value of the scores of multiple different attributes is taken to obtain the final adaptation degree.
[0146] In practical applications, for picture elements, when the aspect ratio of the material element and the ad element is in line, it can be considered that the material element and the ad element match.
[0147] In an example, as shown in formula (2), for the scores of different attributes, the average value is taken to obtain the weight:
[0148] (bitRate / maxBitRate + size / maxSize + duration / maxDuration) / 3 * 100 Formula (2);
[0149] Among them, bitRate is the bit rate of the material element, maxBitRate is the maximum bit rate required by the ad space element, size is the size of the material element, maxSize is the maximum size required by the ad space element, duration is the duration of the material element, and maxDuration is the maximum duration required by the ad space element.
[0150] Based on the above rules, a weighted bipartite graph can be constructed for an ad space and a set of materials. By running the KM algorithm on the bipartite graph, the matching result can be obtained.
[0151] In an example, the elements of ad space A are shown in Table 1, and the elements of the materials uploaded by the user are shown in Table 2.
[0152] Table 1. Example of elements of ad space A
[0153]
[0154]
[0155] Table 2. Example of elements of material a
[0156]
[0157] Taking each element in advertising space A as a vertex in the first set and each element in material a as a vertex in the second set, the weighted bipartite graph formed by the vertices in the first set and the vertices in the second set is shown in Table 3, where UN represents unreachable.
[0158] Table 3. Weighted Bipartite Graph Formed by Advertising Space A and Material a
[0159]
[0160] Using the KM algorithm, the maximum weight matching of the weighted bipartite graph shown in Table 3 is:
[0161] Main title - Text 2, subtitle - Text 1, main picture - Picture 3, sub - picture - Picture 1, main video - Video 2.
[0162] Figure 9 It is a schematic implementation flowchart of a resource recommendation device according to an embodiment of the present application. As Figure 9 shown, the device 900 includes:
[0163] An acquisition unit 901, configured to acquire the elements included in the material to obtain a first element set, and acquire the elements included in the resource to obtain a second element set;
[0164] A mapping unit 902, configured to map each first element in the first element set to a first node, and map each second element in the second element set to a second node;
[0165] A construction unit 903, configured to connect edges between the first nodes and the second nodes to construct a node relationship graph;
[0166] A matching unit 904, configured to find a match in the node relationship graph;
[0167] An output unit 905, configured to, when a match is found, use the resource as a resource to be recommended and output the resource identifier of the resource to be recommended.
[0168] In some embodiments, the construction unit 903 is further configured to:
[0169] Acquire the attribute of the first element and the attribute requirement of the second element;
[0170] According to the attribute of the first element and the attribute requirement of the second element, establish a connection edge between the corresponding first node and the corresponding second node to construct the node relationship graph.
[0171] In some embodiments, the construction unit 903 is further configured to:
[0172] Traverse the attributes of each first element and the attribute requirements of each second element, and determine the element pairs whose attribute requirements match the attributes;
[0173] Connect an edge between the first node corresponding to the first element and the second node corresponding to the second element in the element pair to obtain a node relationship graph.
[0174] In some embodiments, the construction unit 903 is further configured to:
[0175] Taking each first element as a reference element, perform the following processing:
[0176] Compare the attributes of the reference element with the attribute requirements of each second element respectively;
[0177] Find the second element whose attribute requirements match the attributes of the reference element as the reachable element, and obtain an element pair including the reference element and the reachable element.
[0178] In some embodiments, the attribute includes: type, and the attribute requirement includes a type requirement; the construction unit 903 is further configured to:
[0179] Find at least one second target element whose type requirement is the same as the type of the reference element;
[0180] Determine the reachable element among the at least one second target element.
[0181] In some embodiments, the attribute further includes: element parameter, and the attribute requirement includes a parameter requirement; the construction unit 903 is further configured to:
[0182] According to the element parameter of the reference element and the parameter requirements of each second target element among the at least one second target element, calculate the fitness between the reference element and each second target element;
[0183] Determine the second target element whose fitness meets the set fitness range as the reachable element.
[0184] In some embodiments, the apparatus 900 further includes: a marking unit, configured to mark the fitness between the first node and the second node connected by the edge, and the corresponding first element and the corresponding second element, as the weight of the corresponding edge;
[0185] Correspondingly, the matching unit 904 is further configured to:
[0186] According to the weight of the edge, search for a match in the node relationship graph.
[0187] In some embodiments, the apparatus 900 further includes: an association unit, configured to:
[0188] Determine the target edges included in the matching;
[0189] Establish an association relationship between the first element represented by the first node connected to the target edge and the second element represented by the second node, and output the association relationship.
[0190] It should be noted that the resource recommendation device provided in the embodiments of the present application includes each unit included, and can be implemented by a processor in an electronic device; of course, it can also be implemented by specific logic circuits; in the process of implementation, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Micro Processor Unit), a digital signal processor (DSP, Digital Signal Processor), or a field programmable gate array (FPGA, Field-Programmable Gate Array), etc.
[0191] The description of the above device embodiments is similar to the description of the above method embodiments, and has beneficial effects similar to those of the method embodiments. For the technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0192] It should be noted that in the embodiments of the present application, if the above resource recommendation method is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the related technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read Only Memory), magnetic disks, or optical disks, etc., which can store program codes. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0193] Correspondingly, the embodiments of the present application provide an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor, and when the processor executes the program, it implements the steps in the resource recommendation method provided in the above embodiments. Among them, the electronic device can be a client or a server.
[0194] Correspondingly, an embodiment of the present application provides a storage medium, that is, a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the resource recommendation method provided in the above embodiment are implemented.
[0195] It should be noted here that the descriptions of the above storage medium and device embodiments are similar to the descriptions of the above method embodiments and have beneficial effects similar to those of the method embodiments. For the technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the descriptions of the method embodiments of the present application for understanding.
[0196] It should be noted that Figure 10 is a schematic diagram of a hardware entity of the electronic device according to an embodiment of the present application. As Figure 10 shown, the electronic device 1000 includes: a processor 1001, at least one communication bus 1002, at least one external communication interface 1004, and a memory 1005. Among them, the communication bus 1002 is configured to implement connection communication between these components. In one example, the electronic device 1000 further includes: a user interface 1003. Among them, the user interface 1003 may include a display screen, and the external communication interface 1004 may include a standard wired interface and a wireless interface.
[0197] The memory 1005 is configured to store instructions and applications executable by the processor 1001, and can also cache data to be processed or already processed by the processor 1001 and each module in the electronic device (for example, image data, audio data, voice communication data, and video communication data), and can be implemented by flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0198] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that a specific attribute, structure, or characteristic related to the embodiment is included in at least one embodiment of the present application. Therefore, the appearances of "in one embodiment" or "in some embodiments" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific attributes, structures, or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the magnitudes of the serial numbers of the above processes do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages and disadvantages of the embodiments.
[0199] It should be noted that in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising that element.
[0200] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined, or can be integrated into another system, or some attributes can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed with each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0201] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units; they can be located in one place or distributed to multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0202] In addition, each functional unit in the various embodiments of this application can be all integrated in a processing unit, or each unit can be separately a unit by itself, or two or more units can be integrated in one unit; the above-mentioned integrated units can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.
[0203] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments; and the aforementioned storage medium includes: various media such as removable storage devices, read-only memory (ROM), magnetic disks or optical discs that can store program codes.
[0204] Alternatively, if the above integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application essentially or the part that contributes to the related technology can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as removable storage devices, ROMs, magnetic disks, or optical discs that can store program codes.
[0205] As described above, the above are only the implementation manners of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A resource recommendation method, characterized in that, The method includes: Obtaining the elements included in the material to obtain a first set of elements, and obtaining the elements included in the resource to obtain a second set of elements; Mapping each first element in the first set of elements to a first node, and mapping each second element in the second set of elements to a second node; Connecting edges between the first nodes and the second nodes to construct a node relationship graph; wherein, among the connected first node and second node, the attribute of the first element corresponding to the first node conforms to the attribute requirement of the second element corresponding to the second node; Searching for a match in the node relationship graph; In the case where a match is found, taking the resource as a resource to be recommended and outputting the resource identifier of the resource to be recommended; The match includes: a subgraph in which any two edges in the node relationship graph do not attach to the same node.
2. The method according to claim 1, characterized in that, The connecting edges between the first nodes and the second nodes to construct a node relationship graph includes: Obtaining the attribute of the first element and the attribute requirement of the second element; According to the attribute of the first element and the attribute requirement of the second element, establishing a connecting edge between the corresponding first node and the corresponding second node to construct the node relationship graph.
3. The method according to claim 2, characterized in that, The according to the attribute of the first element and the attribute requirement of the second element, establishing a connecting edge between the corresponding first node and the corresponding second node to construct the node relationship graph includes: Traversing the attributes of each first element and the attribute requirements of each second element to determine element pairs whose attribute requirements match the attributes; Connecting edges between the first node and the second node corresponding to the first element and the second element in the element pair to obtain a node relationship graph.
4. The method according to claim 3, characterized in that, Traversing the attributes of each first element and the attribute requirements of each second element to determine element pairs whose attribute requirements match the attributes includes: Taking each first element as a reference element and performing the following processing: Respectively comparing the attribute of the reference element with the attribute requirements of each second element; Searching for a second element whose attribute requirement matches the attribute of the reference element as a reach element, and obtaining an element pair including the reference element and the reach element.
5. The method according to claim 4, characterized in that, The attribute includes: type, and the attribute requirement includes a type requirement; the searching for a second element whose attribute requirement matches the attribute of the reference element as a reach element includes: Searching for at least one second target element whose type requirement is the same as the type of the reference element; Determining the reach element among the at least one second target element.
6. The method according to claim 5, characterized in that, The attribute further includes: element parameter, and the attribute requirement includes a parameter requirement; the determining the reach element among the at least one second target element includes: Calculating the fitness between the reference element and each second target element according to the element parameter of the reference element and the parameter requirements of each second target element among the at least one second target element; Determining the second target element whose fitness meets the set fitness range as the reach element.
7. The method according to claim 1 or 6, characterized in that, The method further includes: Marking the fitness between the first node and the second node connected by the edge, and the corresponding first element and the corresponding second element as the weight of the corresponding edge; Correspondingly, in the node relationship graph, finding a match includes: Finding a match in the node relationship graph according to the weight of the edge.
8. The method according to claim 1, characterized in that, The method further includes: Determining the target edges included in the match; Establishing an association relationship between the first element represented by the first node and the second element represented by the second node connected by the target edge, and outputting the association relationship.
9. A resource processing device, characterized in that, The apparatus includes: An obtaining unit, configured to obtain the elements included in the material to obtain a first element set, and obtain the elements included in the resource to obtain a second element set; A mapping unit, configured to map each first element in the first element set to a first node, and map each second element in the second element set to a second node; A constructing unit, configured to connect edges between the first node and the second node to construct a node relationship graph; wherein, among the connected first node and second node, the attribute of the first element corresponding to the first node conforms to the attribute requirement of the second element corresponding to the second node; A matching unit, configured to find a match in the node relationship graph; An output unit, configured to, when a match is found, use the resource as a resource to be recommended and output the resource identifier of the resource to be recommended; The match includes: a subgraph in which any two edges in the node relationship graph do not attach to the same node.
10. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, When the processor executes the computer program, the steps in the resource recommendation method according to any one of claims 1 to 8 are implemented.
11. A storage medium, on which a computer program is stored, wherein, When the computer program is executed by the processor, the resource recommendation method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Recommendation method and device
CN108805642A
A method and apparatus for recommend electronic resources
CN109471978A