Information recommendation method and device, electronic equipment, storage medium and program product

By pre-compiling and storing the target syntax tree, and directly reusing the compiled syntax tree for information recommendation, it solves the problem of high running costs in the existing technology and realizes an efficient information recommendation process.

CN118733870APending Publication Date: 2024-10-01TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310363458.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing information recommendation technology requires real-time analysis and real-time compilation after dynamically reading the calculation formula, resulting in high operating costs.

Method used

By pre-compiling the target syntax tree and storing the association with the target fusion expression in the object pool, the compiled syntax tree is directly reused to perform fusion operations on multiple dimensional scores to avoid repeated compilation overhead.

Benefits of technology

It greatly saves computing costs, improves the efficiency of information recommendation, reduces response time, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733870A_ABST
    Figure CN118733870A_ABST
Patent Text Reader

Abstract

The invention provides an information recommendation method and device, electronic equipment, a storage medium and a program product, and relates to the technical fields of cloud computing, cloud storage, big data, intelligent transportation and the like. The method comprises the steps of determining scores of each piece of candidate information in at least two dimensions based on object features of a target object and features of at least one piece of candidate information; obtaining a target syntax tree corresponding to a target fusion expression from an object pool based on the target fusion expression of each piece of candidate information; as the object pool comprises the incidence relation between at least one expression and the syntax tree corresponding to each expression, the target syntax tree is obtained by compiling the source program code of the target fusion expression in advance. Therefore, the compiled target syntax tree can be directly reused to carry out fusion operation on the scores of the multiple dimensions, the target obtained through operation is fused to obtain row recommendation, the repeated compilation overhead in the fusion operation process is eliminated, the calculation cost can be greatly saved, and then the information recommendation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to technical fields such as cloud computing, cloud storage, big data, and smart transportation. The present application relates to an information recommendation method, device, electronic device, storage medium, and program product. Background Art

[0002] In the field of information recommendation, recommendations can be made based on the interests of the object or current hot spots, etc. In this field, formulas are usually used to numerically express the information in multiple dimensions so as to make recommendations based on the multi-dimensional situations.

[0003] In the related technology, the calculation formula corresponding to each information can be read in real time, and the corresponding formula parsing, compilation and other processes can be performed in sequence, and the compilation results can be executed to obtain the final score of each information, and the final score can be used for recommendation.

[0004] However, the above method requires real-time parsing and real-time compilation after dynamically reading the calculation formula, which consumes a large real-time interpretation overhead, resulting in a high operating cost of the above method. Summary of the invention

[0005] The present application provides an information recommendation method, device, electronic device, storage medium and program product, which can solve the problem of high operating costs in related technologies. The technical solution is as follows:

[0006] In one aspect, a method for information recommendation is provided, the method comprising:

[0007] In response to a recommendation request for a target object, determining a score of each candidate information in at least two dimensions based on an object feature of the target object and a feature of at least one candidate information;

[0008] Based on the target fusion expression of each candidate information, obtaining a target syntax tree corresponding to the target fusion expression from the object pool;

[0009] The object pool includes an association relationship between at least one expression and a syntax tree corresponding to each expression, and the syntax tree corresponding to the expression is obtained by compiling the source program code corresponding to the expression in advance;

[0010] Based on the target syntax tree and the scores of each candidate information in multiple dimensions, obtaining a target fusion score for each candidate information;

[0011] Based on the target fusion score of each candidate information, each candidate information is recommended.

[0012] In another aspect, an information recommendation device is provided, the device comprising:

[0013] A dimension score determination module, configured to determine, in response to a recommendation request for a target object, a score of each candidate information in at least two dimensions based on an object feature of the target object and a feature of at least one candidate information;

[0014] A syntax tree acquisition module, used for acquiring a target syntax tree corresponding to the target fusion expression from an object pool based on the target fusion expression of each candidate information;

[0015] The object pool includes an association relationship between at least one expression and a syntax tree corresponding to each expression, and the syntax tree corresponding to the expression is obtained by compiling the source program code corresponding to the expression in advance;

[0016] A target fusion score acquisition module, used to obtain a target fusion score of each candidate information based on the target syntax tree and the scores of each candidate information in multiple dimensions;

[0017] The recommendation module is used to recommend each candidate information based on the target fusion score of each candidate information.

[0018] In a possible implementation, the target fusion score acquisition module is used to:

[0019] For each candidate information, assign values ​​to the variables in the initial symbol table based on the scores of the dimensions corresponding to the candidate information and the variables corresponding to the scores of the dimensions, so as to obtain a target symbol table;

[0020] Based on the target syntax tree and the target symbol table, a fusion operation logic is performed on the scores of each dimension to obtain a target fusion score of the candidate information.

[0021] In one possible implementation, the recommendation request belongs to a target thread among at least two threads currently running;

[0022] The device further comprises an initial symbol table acquisition module, which is specifically used for:

[0023] Based on the target thread to which the recommendation request belongs, the initial symbol table corresponding to the target thread is obtained from the correspondence between each thread and the initial symbol table. Each thread corresponds to its own initial symbol table, and the initial symbol table includes each variable and the initial value of the variable in the fusion expression corresponding to the target thread.

[0024] In a possible implementation, the target fusion expression represents the fusion operation logic between at least two predefined variables;

[0025] The device further comprises a storage module, wherein the storage module is used for:

[0026] For each candidate information, obtaining a target fusion expression corresponding to the candidate information;

[0027] Based on the correspondence between the scores of each dimension of the candidate information and each variable in the target fusion expression, the target fusion expression corresponding to the candidate information and each variable and the score of each dimension are associated and stored, and each variable is associated with the score of one dimension.

[0028] In a possible implementation, the syntax tree acquisition module is used to:

[0029] Based on the target fusion expression, traverse the syntax tree corresponding to the target fusion expression in the object pool;

[0030] If the object pool includes a target syntax tree corresponding to the target fusion expression, obtaining the target syntax tree included in the object pool;

[0031] If the object pool does not include a syntax tree corresponding to the target fusion expression, the source program code corresponding to the target fusion expression is compiled into the target syntax tree, and the association relationship between the target fusion expression and the target syntax tree is stored in the object pool.

[0032] In a possible implementation, the device further includes a syntax tree generation module, and the syntax tree generation module is specifically used to:

[0033] Parsing the target fusion expression through a formula parser to obtain source program code corresponding to the target fusion expression;

[0034] The source program code is lexically analyzed to obtain a word sequence corresponding to the source program code, and based on the word sequence corresponding to the source program code, the grammatical relationship between each operator and each variable is analyzed to generate a target syntax tree corresponding to the target fusion expression.

[0035] In a possible implementation, the syntax tree acquisition module, when storing the association relationship between the target fusion expression and the target syntax tree in the object pool, is specifically used to:

[0036] If the total number of syntax trees corresponding to the object pool exceeds the first capacity threshold, the activity of each syntax tree in the object pool within the target time period is obtained, the syntax trees whose activity meets the target condition are deleted, and the association relationship between the target syntax tree and the target fusion expression is stored in the object pool;

[0037] If the total number of syntax trees corresponding to the object pool does not exceed the first capacity threshold, the association relationship between the target syntax tree and the target fusion expression is stored in the object pool.

[0038] In a possible implementation, the device further includes an adjustment module, wherein the adjustment module is configured to:

[0039] If the total number of syntax trees corresponding to the object pool exceeds a first capacity threshold, counting the frequency of deleting syntax trees in the object pool within a preset time period;

[0040] If the operation frequency meets the adjustment condition, sending a first prompt message;

[0041] Based on an adjustment instruction triggered by a capacity adjustment operation, the first capacity threshold is adjusted to a second capacity threshold.

[0042] In a possible implementation, the recommendation request belongs to a target thread among at least two currently running threads; the object pool also includes a current state of each syntax tree corresponding to the target thread, and the current state is used to indicate whether it is used by any request in the target thread;

[0043] The device further includes a state updating module, which is specifically used to:

[0044] Marking the current state of the target syntax tree as a use state;

[0045] The state update module, after obtaining the target fusion score of each candidate information based on the target syntax tree and the scores of each candidate information in multiple dimensions, is specifically used to:

[0046] The target marks the current state of the target syntax tree as an unused state.

[0047] On the other hand, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the above-mentioned information recommendation method.

[0048] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned information recommendation method is implemented.

[0049] On the other hand, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the above-mentioned information recommendation method is implemented.

[0050] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0051] The information recommendation method provided by the present application determines the score of each candidate information in at least two dimensions based on the object features of the target object and the features of at least one candidate information; and based on the target fusion expression of each candidate information, obtains the target syntax tree corresponding to the target fusion expression from the object pool; because the object pool includes at least one expression and the association relationship between the syntax tree corresponding to each expression, the target syntax tree is obtained by pre-compiling the source code of the target fusion expression. Therefore, the compiled target syntax tree can be directly reused to perform fusion operations on the scores of multiple dimensions to obtain the target fusion score; by using the target fusion score for recommendation, the repeated compilation overhead of the fusion operation process is eliminated, which can greatly save the computing cost and thus improve the efficiency of information recommendation. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in describing the embodiments of the present application.

[0053] Figure 1 A schematic diagram of an implementation environment for implementing an information recommendation method provided in an embodiment of the present application;

[0054] Figure 2 A flowchart of an information recommendation method provided in an embodiment of the present application;

[0055] Figure 3 A schematic diagram of a scenario of an information recommendation method provided in an embodiment of the present application;

[0056] Figure 4 A flowchart of an information recommendation method provided in an embodiment of the present application;

[0057] Figure 5 A schematic diagram of the structure of an information recommendation device provided in an embodiment of the present application;

[0058] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0060] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said", and "the" used herein may also include plural forms. The terms "include" and "comprise" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, and operations, but do not exclude the implementation as other features, information, data, steps, operations, etc. supported by the technical field.

[0061] It can be understood that in the specific implementation of the present application, any object-related data such as object characteristics, object interaction data, object browsing records, object behavior records (such as likes, comments, and forwarding) is involved. When the above embodiments of the present application are applied to specific products or technologies, it is necessary to obtain the object's permission or consent, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.

[0062] Figure 1 This is a schematic diagram of an implementation environment of an information recommendation method provided by this application. Figure 1 As shown, the implementation environment includes: a server 101 and a terminal 102. The server 101 may be a background server of an application. The server 101 and the terminal 102 may be connected and communicated directly or indirectly via wired or wireless communication.

[0063] In an embodiment of the present application, the terminal 102 may be installed with a target application having an information recommendation function, and the server 101 may be a background server of the target application. The terminal 102 may send a recommendation request to the server, and the server 101 may send the recommended information to the terminal 102 based on the recommendation request. For example, the server 101 may recommend one piece of information or a recommendation list including multiple pieces of information to the terminal 102. Among them, the server 101 may adopt the information recommendation method of the present application to fuse the scores of each candidate information in multiple dimensions to obtain the fusion score of the candidate information; and recommend information based on the fusion score of each candidate information.

[0064] The target application may be a social application, a content interaction platform, an information application, a game application, a video application, a news application, an interactive entertainment application, a browser application, a shopping application, a content sharing application, a game application, etc., which is not limited in the present embodiment. The recommended information may include, but is not limited to, any form such as videos, articles, pictures and texts, live broadcasts, special topics, column advertising links, shopping web pages, etc.

[0065] The server 101 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, and big data and artificial intelligence platforms. The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a digital broadcast receiver, a desktop computer, a vehicle-mounted terminal (such as a vehicle-mounted navigation terminal, a vehicle-mounted computer, etc.), a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected via wired or wireless communication, and may also be determined based on the actual application scenario requirements, which is not limited here.

[0066] Figure 2 The flowchart of an information recommendation method provided by an embodiment of the present application is shown in FIG. The execution subject of the method may be an electronic device, which may be a background server of a target application, or any device such as a cloud computing center device or server for providing information recommendation services. Figure 2 As shown, the method includes the following steps.

[0067] Step 201: In response to a recommendation request for a target object, the electronic device determines scores of each candidate information in at least two dimensions based on object features of the target object and features of at least one candidate information.

[0068] The candidate information may be information to be recommended. For example, the candidate information may be any form of information such as videos, articles, graphics, live broadcasts, special topics, column advertising links, shopping web pages, etc. In one example, the candidate information may also be information preliminarily screened in the target application, and the electronic device may filter out the at least one candidate information from multiple information of the target application according to the preconfigured filtering rules; for example, the electronic device may filter out the 100 most recently published articles in the content publishing platform of the target application as candidate information to be recommended; for another example, 80 articles matching the current hot spots may be filtered out from the 100 most recently published articles as candidate information; or, the top 100 most popular short videos in the past two days may be used as candidate information.

[0069] Exemplarily, the object feature may characterize the features of the target object in one or more dimensions. For example, the object feature may include but is not limited to: the object ID of the target object, the location, browsing history, click history, reading history, reading time, interest tags, frequently read categories, candidate set article categories, interactive behavior data (for example, object browsing, click, collection, sharing, like, dislike, stay time and other behavior data), etc. The features of the candidate information may include but are not limited to: the title, abstract, body, publishing author, publishing date, hot tags, media, content type, content body, whether it is a hot article, cover, etc. of the candidate information.

[0070] In one possible manner, the multiple dimensions may be preconfigured dimensions, and the scores of the multiple dimensions may be scores in the preconfigured dimensions obtained by using a preconfigured algorithm, model, or calculation method.

[0071] In one example, the scores of the multiple dimensions may include an interaction prediction score. The prediction score is obtained by predicting the interaction behavior between the target object and the candidate information using the object features and the features of the candidate information. The interaction behavior includes but is not limited to: click, read, comment, unfollow, like, collect, shop, reward, stay and browse, and other interaction behaviors. Exemplarily, the interaction prediction score may include a click-through rate prediction score, or may also include a reading time prediction score, a like rate or a collection rate prediction score, etc. For example, the electronic device may input the object features and the features of each candidate information into a trained interaction prediction model, and predict the interaction between the target object and the candidate information through the interaction prediction model to obtain the interaction prediction score; the interaction prediction model may include a trained click-through rate prediction model, a reading time prediction model, a like rate prediction model, etc.

[0072] In one example, the scores of the multiple dimensions may include information attribute value scores. The information attribute value score represents the score of the attribute value of the candidate information in at least one preconfigured attribute. For example, the at least one preconfigured attribute may include a timeliness attribute, a degree of matching with a target object, content quality, picture clarity, and the like. The electronic device may obtain information attribute value scores of each candidate information based on the characteristics of the object and the characteristics of the candidate information using prior knowledge processing. For example, feature data such as the frequently read categories of the object, the categories to which each candidate article belongs, and the time when the article was published may be pulled from a database, and the data may be processed based on expert prior knowledge to map the feature data from the target object and the candidate information to the attribute value scores corresponding to at least one preconfigured attribute. For example, a timeliness score representing the timeliness of the article, an object matching score representing the degree of matching between the article and the target object, and the like may be obtained.

[0073] In one example, the scores of the multiple dimensions may include an interaction experience score. The interaction experience score may represent the score of the target object's interaction experience with information in the current interaction environment. For example, an electronic device may obtain the interaction environment information of the target object in the target application on the client, and after processing the data based on the interaction environment through expert prior knowledge, map the interaction environment information to an interaction experience score. Among them, the interaction environment information may include, but is not limited to: information such as the network type (such as wifi or data traffic) and geographic location of the device where the target object is currently located. For example, the interaction experience in the current interaction environment may also be scored in combination with the historical interaction behavior and interaction environment information of the target object to obtain the interaction experience score. For example, if the current network type is wifi, the experience score is 85; if the current network type is data traffic, the experience score is 70.

[0074] In this application, the original scores from multiple dimensions can be calculated through a series of expressions of the fusion formula to obtain the final fusion score, and the fusion score can be used for recommendation. Since the fusion score obtained by multi-dimensional fusion can take into account the effects of multiple dimensions at the same time, the comprehensive effect of the information recommendation system is optimized.

[0075] In the present application, a pre-configured target fusion expression can be used to perform a fusion operation on the scores of each dimension to obtain a final fusion score. Exemplarily, the target fusion expression represents the fusion operation logic between at least two predefined variables; for example, the target fusion expression can be a pre-defined formula for performing a fusion operation on the scores of each candidate information in multiple dimensions, and the target fusion expression can include various variables and various operators.

[0076] In one possible way, after obtaining the scores of each dimension, the obtained scores of each dimension may be stored in association according to the corresponding relationship between the corresponding variables in the expression and each score. In one possible way, the process of storing the obtained scores of each dimension may include the following steps A1-A2:

[0077] Step A1: For each candidate information, the electronic device obtains a target fusion expression corresponding to the candidate information;

[0078] Step A2: Based on the correspondence between the scores of each dimension of the candidate information and each variable in the target fusion expression, the electronic device associates and stores the target fusion expression corresponding to the candidate information and each variable with the score of each dimension, wherein each variable is associated with the score of one dimension.

[0079] Exemplarily, one candidate information may correspond to one or more target fusion expressions, and the target fusion expressions corresponding to different candidate information may be the same or different.

[0080] In one example, each candidate information corresponding to a recommendation request may correspond to the same target fusion expression; then step A1 may include: the electronic device, based on the recommendation request corresponding to the candidate information, uses the target fusion expression corresponding to the recommendation request as the target fusion expression corresponding to the candidate information; for example, 100 candidate articles corresponding to the recommendation request may correspond to 1 target fusion expression (such as Formula 1), or these 100 candidate articles may correspond to 2 target fusion expressions (such as Formula 2 and Formula 3) or more target fusion expressions.

[0081] In another example, different target fusion formulas may be used for each candidate information corresponding to a recommendation request; then step A1 may include: the electronic device obtains the target fusion formula corresponding to each candidate information corresponding to the recommendation request; for example, among the 100 candidate articles corresponding to the recommendation request, candidate article a corresponds to formula 1, candidate article b corresponds to formula 1 and formula 2, candidate article c corresponds to formula 2 and formula 3, and candidate article d corresponds to formula 1 and formula 2.

[0082] Exemplarily, the electronic device may also determine the corresponding target fusion expression according to the type of candidate information, and step A1 may include: for each candidate information in the recommendation request, the electronic device obtains the target fusion expression corresponding to the type of each candidate information from the association relationship between the information type and the target fusion expression based on the type of each candidate information. For example, Formula 2 and Formula 3 may be used for video candidate information, Formula 1 may be used for article candidate information, Formula 2 and Formula 4 may be used for live broadcast candidate information, etc. Of course, the target fusion expression corresponding to each candidate information may also be obtained in combination with the release time of the candidate information, whether it is a hot topic, whether it has a topic tag, etc.

[0083] In this step, the electronic device can obtain the target fusion expression corresponding to each candidate information. For each candidate information, based on the relationship between the scores of each dimension of the candidate information and each variable in the target fusion expression of the candidate information, the target fusion expression, variables and dimension scores are associated and stored. Exemplarily, the electronic device can use the form of key-value pairs to associate and store the target fusion expression, variables and dimension scores.

[0084] For example, assume that the multi-dimensional scores of candidate information a1 include click-through rate score, timeliness score, and matching score; pre-define variables x, y, and z to represent the click-through rate score, timeliness score, and matching score, respectively, and assume that the target fusion formula corresponding to the variables x, y, and z is M=x+y+z; then, the variables x, y, and z and the target fusion expression M=x+y+z between the variables can be stored in key; the values ​​corresponding to the variables are stored in value, that is, the click-through rate score, timeliness score, and matching score of the candidate information a1 are 80, 90, and 85, respectively, thereby associating the formula, the variables in the formula, and the actual score.

[0085] Step 202: The electronic device obtains a target syntax tree corresponding to the target fusion expression from an object pool based on the target fusion expression of each candidate information.

[0086] Among them, the object pool includes an association relationship between at least one expression and a syntax tree corresponding to each expression, and the syntax tree corresponding to the expression is obtained by pre-compiling the source program code corresponding to the expression. The target fusion expression represents the fusion operation logic between at least two predefined variables. The target syntax tree represents the operation logic relationship between each variable in the target fusion expression. Among them, the target syntax tree can be AST (Abstract Syntax Tree), which is an abstract representation of the syntax structure of the source program code, and it expresses the syntax structure of the programming language in a tree form.

[0087] In one possible way, the object pool may include pre-compiled syntax trees corresponding to multiple expressions, and the electronic device may traverse the syntax tree corresponding to the target fusion expression in the object pool; if the corresponding syntax tree is successfully traversed, it can be directly obtained and used; if the traversal is unsuccessful, it is necessary to compile and generate the target syntax tree in real time. Accordingly, step 202 may include the following steps 2021-2023:

[0088] Step 2021: The electronic device traverses a syntax tree corresponding to the target fusion expression in the object pool based on the target fusion expression;

[0089] Step 2022: If the object pool includes a target syntax tree corresponding to the target fusion expression, the electronic device obtains the target syntax tree included in the object pool;

[0090] Step 2023: If the object pool does not include the syntax tree corresponding to the target fusion expression, the electronic device compiles the source program code corresponding to the target fusion expression into the target syntax tree, and stores the association relationship between the target fusion expression and the target syntax tree in the object pool.

[0091] Exemplarily, the object pool may include pointers to syntax trees corresponding to each expression, that is, memory addresses. The electronic device may traverse the syntax tree pointer of the target fusion expression of each candidate information from the object pool based on the target fusion expression of each candidate information, and use the traversed syntax tree pointer to read the target syntax tree from the memory. The target syntax tree can be stored in the memory in the form of a syntax tree of the source program language. Of course, if the syntax tree pointer corresponding to the target fusion expression is not traversed, it can be compiled based on the target fusion expression to generate a syntax tree corresponding to the target fusion expression.

[0092] When the target syntax tree is added to the object pool, a memory address can be allocated in the memory space corresponding to the object pool to store the target syntax tree. At this time, the target syntax tree is an instantiated syntax tree, that is, an instantiated AST object, so the target syntax tree can also be called an expression AST instance.

[0093] In one possible manner, the method of generating the target syntax tree may include the following steps B1-B2:

[0094] Step B1, the electronic device analyzes the target fusion expression through a formula analyzer to obtain a source program code corresponding to the target fusion expression;

[0095] Step B2: The electronic device performs lexical analysis on the source program code to obtain a word sequence corresponding to the source program code, and analyzes the grammatical relationship between each operator and each variable based on the word sequence corresponding to the source program code to generate a target syntax tree corresponding to the target fusion expression.

[0096] Exemplarily, the formula parser can be an Exprtk parser. Among them, Exprtk is a simple, easy-to-use, easy-to-integrate, and extremely efficient mathematical expression parsing and evaluation engine at runtime. It can be directly embedded in a C++ program and is open source with MIT License. Exprtk is based on interpreted execution, and a symbol table and a compiled expression need to be constructed before the expression is evaluated. In this step, the Exprtk parser can be used to parse the target fusion expression into a corresponding source program code, such as a program code in C language, which can represent the fusion operation logic between each variable in the target fusion expression. The electronic device can further compile the source program code; for example, the source program code can be lexically analyzed to obtain a word sequence, which can include multiple minimum lexical units in the source program code, that is, tokens; for example, the word sequence can include each variable, each operator, etc. corresponding to the target fusion expression in the source program code. Then, the word sequence is parsed to analyze the grammatical relationship between each operator and variable, and a corresponding target syntax tree is generated based on the grammatical relationship. Among them, the target syntax tree represents the syntax and structure of the source program code corresponding to the target fusion expression. By analyzing the grammatical relationship between each variable and each operator in the word sequence, the operation logic between each variable can be obtained, thereby constructing a target syntax tree that conforms to the operation logic of the target fusion expression.

[0097] In one possible implementation, if the object pool does not include a syntax tree corresponding to the target fusion expression, the electronic device can generate a target syntax tree corresponding to the target fusion expression through the above steps B1-B2. In addition, the newly generated target syntax tree can also be added to the object pool. Based on this, the syntax tree used for the fusion operation in each recommendation process can be added to the object pool, so that multiple compiled syntax trees can be accumulated in the object pool. In the subsequent recommendation process, if the same fusion expression as the historical recommendation process is used, the existing syntax tree in the object pool can be directly reused without repeated compilation, which can greatly save computing costs.

[0098] Moreover, especially in high-concurrency and cross-request scenarios, since the present application can completely eliminate the repeated compilation overhead of the fusion operation process, it can significantly save the formula calculation cost; especially when the real-time requirements for responding to user requests are high, since the repeated compilation overhead is eliminated, there is no need for real-time parsing and real-time compilation of fusion operation formulas, which greatly shortens the response time to users and improves user experience.

[0099] In a possible implementation, if the object pool does not include the syntax tree corresponding to the target fusion expression, when adding the newly generated syntax tree to the object pool, the object pool can be cleaned up in time to release the object pool space in combination with the capacity of the object pool and the number of syntax trees currently included. Exemplarily, the process of storing the association relationship between the target fusion expression and the target syntax tree in the object pool can be implemented by following the steps C1-C2:

[0100] Step C1: if the total number of syntax trees corresponding to the object pool exceeds the first capacity threshold, obtain the activity of each syntax tree in the object pool within the target time period, delete the syntax trees whose activity meets the target condition, and store the association relationship between the target syntax tree and the target fusion expression in the object pool;

[0101] Step C2: If the total number of syntax trees corresponding to the object pool does not exceed the first capacity threshold, the association relationship between the target syntax tree and the target fusion expression is stored in the object pool.

[0102] Exemplarily, the activity of a syntax tree can characterize the usage of the syntax tree in the target time period. The higher the activity of a syntax tree, the more frequently the syntax tree is used in the target time period, and the syntax tree is relatively more important. The electronic device can obtain the historical usage records of each syntax tree, and determine the activity of each syntax tree in the target time period based on the historical usage records of each syntax tree. For example, the more times it is used in the target time period, the greater the activity; or, the closer the last use time is to the current time, the greater the activity. Exemplarily, the target condition may include, but is not limited to: the activity is lower than the target activity threshold, the activity in multiple consecutive time periods is lower than the target activity threshold, etc. For example, the target time period can be configured based on needs, and this application is not limited to this. For example, the target time period can be within the last 3 days, a week, or 1 month.

[0103] Exemplarily, the electronic device can combine multiple data such as the activity of each syntax tree, historical usage records, etc., and use the LRU (Least Recently Used) strategy to screen the syntax trees to be deleted. It should be noted that if the number of syntax trees in the object pool is equal to or even exceeds the set upper threshold of the object pool, it means that the object pool capacity is insufficient. At this time, the LRU strategy is used to eliminate the longest unused instance, and the object pool space can be released in time to add the newly generated target syntax tree to the object pool. By managing the object pool in combination with the activity of each syntax tree, the limited number of expressions that may be used globally in the recommendation system is adapted, and only the syntax trees of active expressions are maintained, saving the memory usage of the expression AST instance. By optimizing the object pool management of each thread through TLS, while keeping the computing library easy to use and easy to integrate, it ensures imperceptible thread safety, significantly reducing the difficulty of program development.

[0104] Of course. If the number of instances in the object pool is less than the set upper limit threshold of the object pool, it means that the object pool has sufficient capacity. At this time, the newly generated target syntax tree can be directly added to the object pool.

[0105] In one possible approach, the capacity of the object pool can be adjusted in real time based on the operation of deleting syntax trees within a period of time. Exemplarily, the capacity adjustment process of the object pool can be implemented by following steps D1 to D3:

[0106] Step D1: if the total number of syntax trees corresponding to the object pool exceeds a first capacity threshold, counting the frequency of deleting syntax trees in the object pool within a preset period of time;

[0107] Step D2: If the operation frequency meets the adjustment condition, send a first prompt message;

[0108] Step D3: Based on the adjustment instruction triggered by the capacity adjustment operation, the first capacity threshold is adjusted to the second capacity threshold.

[0109] The first prompt message is used to prompt that the capacity threshold of the object pool does not match the actual expression usage upper limit. For example, if the actual expression usage upper limit in the last three days is 300, and the object pool capacity threshold is 100, the first capacity threshold can be increased.

[0110] It should be noted that if the existing syntax trees in the object pool are deleted multiple times within a period of time, such as the expression AST instances in the object pool need to be frequently eliminated within the last 3 hours, it means that the object pool capacity is lower than the actual required expression upper limit. In this case, an alarm can be issued to prompt the staff to adjust the object pool capacity threshold.

[0111] Step 203: The electronic device obtains a target fusion score for each candidate information based on the target syntax tree and the scores of each candidate information in multiple dimensions.

[0112] For each candidate information, the electronic device may execute the fusion operation logic corresponding to the target syntax tree based on the scores of the candidate information in multiple dimensions to obtain a target fusion score of the candidate information.

[0113] In a possible implementation, the electronic device may use the symbol table to obtain the value of each variable in the syntax tree, such as the score actually represented by each variable, so as to perform a fusion operation on each score. Exemplarily, step 203 may be implemented by following steps 2031-2302:

[0114] Step 2031: For each candidate information, the electronic device assigns values ​​to each variable in the initial symbol table based on the scores of each dimension corresponding to the candidate information and the variables corresponding to the scores of each dimension to obtain a target symbol table;

[0115] Step 2032: The electronic device executes a fusion operation logic on the scores of each dimension based on the target syntax tree and the target symbol table to obtain a target fusion score of the candidate information.

[0116] Exemplarily, the initial symbol table includes each variable and its corresponding initial value, for example, the initial value may be 0; the electronic device may use each dimension score stored in the form of key-value to assign the initial symbol table. Among them, the electronic device may assign the dimension score corresponding to each variable to the variable in the initial symbol table according to the dimension score corresponding to each variable stored in the key-value association. For example, the initial symbol table may include variables x, y, and z, and the click rate score 80, timeliness score 90, and matching score 85 corresponding to x, y, and z stored in value may be assigned to the corresponding variables in the initial symbol table. After assignment, the values ​​of variables x, y, and z in the symbol table are 80, 90, and 85 respectively; thereby obtaining the target symbol table.

[0117] Among them, if the target fusion expression includes a nested expression, the calculation result of the nested expression can be substituted into the corresponding intermediate variable, and the value of the outer expression can be calculated again to obtain the final target fusion score in turn. For example, formula 1 is "M = x + y + z", formula 2 is "N = a * M", and formula 1 is a nested formula of formula 2. The target syntax trees corresponding to formula 1 and formula 2 can be obtained in the object pool, and the calculation result of the formula, that is, the value of M, can be obtained by using the target syntax tree of formula 1. Then, the value of M is assigned to the variable M of formula 2, and the result of the formula, that is, the value of N, is calculated by using the target syntax tree of formula 2. If N is the final fusion score, the value of N is used as the target fusion score; otherwise, continue to calculate layer by layer from M to N to obtain the final target fusion score, which will not be repeated here.

[0118] In a possible implementation, the recommendation request belongs to a target thread among at least two threads currently running; each thread may correspond to its own symbol table. In an example, the electronic device may obtain the initial symbol table based on the target thread to which the recommendation request belongs, from the correspondence between each thread and the initial symbol table, to obtain the initial symbol table corresponding to the target thread. Each thread corresponds to its own initial symbol table, and the initial symbol table includes each variable in the fusion expression corresponding to the target thread and the initial value of the variable.

[0119] In this application, thread-level storage can be used to store the symbol table of each thread, and the symbol table of each thread includes the variables corresponding to each recommendation request in the thread. Among them, thread-level storage, also known as thread local storage (TLS), is a thread-level storage capability provided by the operating system. Each thread has an independent storage space to store thread variables, that is, a symbol table, which is invisible between different threads, and can ensure the security and reliability of each thread running under multi-threading, and improve the reliability of the information recommendation process.

[0120] It should be noted that the target syntax tree can be an executable program code, and the target syntax tree can include various variables and various operators. For example, for x+y, the target syntax tree may include variables x, y and operator "+", 1 variable or 1 operator may correspond to 1 node of the target syntax tree, and there are corresponding connections between the nodes in the target syntax tree. The operations between the various variables can be implemented by a data structure with corresponding computing capabilities in a pre-built library. Exemplarily, the data structure with the corresponding computing capabilities of the target syntax tree may include the actual execution code of the computing logic of the target syntax tree. Among them, the data structure with corresponding computing capabilities in the pre-built library can also be referred to as a function that implements the corresponding operation in the library. For example, for addition operations, there is a data structure corresponding to the addition operation in the pre-built library, and the data structure defines the actual execution code for implementing the addition of variables x and y, and the actual execution code may correspond to the computing logic of the target syntax tree corresponding to the expression x+y. For example, the pre-built library can be a computing engine Exprtk library.

[0121] The present application can be implemented as a code based on an embedded scripting language, and the source program code corresponding to the target fusion expression can be embedded into the existing program code for compilation, and the compilation result of the embedded scripting language is the target syntax tree. The compilation in the present application can be the process of generating a target program from a source program written in a source language using a compiler; for example, the source program code corresponding to the target fusion expression can be compiled into executable C++ code using Exprtk; the compiled Exprtk expression, that is, the compilation result, can be stored in the memory in the form of an abstract syntax tree.

[0122] In a possible implementation, the electronic device can also maintain the usage status of the syntax tree by the request in the thread in real time. Exemplarily, the recommendation request belongs to the target thread of at least two currently running threads; the object pool also includes the current status of each syntax tree corresponding to the target thread, and the current status is used to indicate whether it is used by any request in the target thread.

[0123] For example, after obtaining the target syntax tree corresponding to the target fusion expression based on each candidate information from the object pool, the following steps may be performed: the electronic device marks the current state of the target syntax tree as a use state.

[0124] Accordingly, after obtaining the target fusion score of each candidate information based on the target syntax tree and the scores of each candidate information in multiple dimensions, the following steps may be performed: the electronic device marks the current state of the target syntax tree as an unused state.

[0125] Exemplarily, each thread may correspond to its own object pool, and the electronic device may also use thread-level storage to store the object pools of each thread. By re-marking the target syntax tree as unused after use, the ownership of the target syntax tree can be returned to the TLS object pool of the current thread.

[0126] Step 204: The electronic device recommends each candidate information based on the target fusion score of each candidate information.

[0127] Exemplarily, the electronic device may arrange each candidate information in descending order based on the target fusion score of each candidate information, and recommend each candidate information based on the order of descending arrangement. For example, the target information that meets the target sorting condition among the candidate information arranged in descending order may be recommended. For example, the target sorting condition may include: the first 10 candidate information in the order of descending arrangement, then the first 10 candidate information with the highest target fusion score may be used as the target information, and a target information recommendation table is returned to the target object, and the target information recommendation table may include the 10 target information arranged in descending order.

[0128] In one possible scenario, the present application can be applied to a subscription account box in a content interaction platform (such as an article publishing platform) of a social application. Article publishers can publish articles regularly in their own publishing accounts, and the subjects can browse the articles of interest in each publishing account. The subjects can subscribe to some publishing accounts that they are interested in, and use the subscription account box function to view the articles of the publishing accounts of interest. Figure 3 As shown, Figure 3 The middle left part is the entrance to the subscription account box in the social application, and the text below the button is the summary of the article. Figure 3The middle right part is the main interface after clicking on the subscription box entrance. The user browses the article content sent to the user by the article publishing platform in the right picture, and the summary of the first article is displayed at the left picture entrance. The user experience of the article publishing platform is related to the content matching degree. The user's article click-through rate, article reading time, and article timeliness can all be important dimensions for measuring user experience. Through the information recommendation method of the present application, based on the above steps 201-203, a multi-objective fusion operation can be performed on the scores of multiple dimensions of each candidate article, so that the articles that the user finally reads are relatively excellent in these multiple dimensions, thereby maximizing the user's comprehensive experience of reading articles, achieving high-performance and easy-to-use multi-dimensional fusion capabilities, and saving computing costs, which helps to support more complex fusion formulas, increase the upper limit of the fusion exploration space, and increase user stickiness, and ultimately increase user activity.

[0129] Below Figure 4 The process shown in the figure further introduces the information recommendation process of this application. Figure 4 As shown, assuming that the business scenario is to sort a batch of candidate articles, determine the articles recommended to users and the relative order of the recommended articles. The information recommendation process of this application can mainly include the following 4 steps:

[0130] In the first step, we first obtain the target raw scores of each article in multiple dimensions from multiple sources:

[0131] (1) Model prediction score: Offline training of the deep learning model, online deployment of the model, the model learns the user's article exposure click samples, takes the object features and the article features in the article publishing platform as input, and outputs the predicted card click rate as the score. The model can also learn the user's reading samples, predict the article reading time, and output the predicted card reading time as the score.

[0132] (2) Use the database to obtain the attribute value score of the article: Pull the user's frequently read categories, candidate article categories and article publication time and other feature data from the database. After processing the data based on the expert's prior knowledge, these features are output to score the article timeliness, matching degree and other dimensions.

[0133] (3) Use context to obtain experience scores: Input the user's interaction information with the card on the client, which is carried by the request. After processing the data using expert prior knowledge, the experience score related to the interaction is output.

[0134] The original scores of each candidate article and the corresponding variables can be stored in the form of key-value pairs. After obtaining the target original scores of multiple dimensions, the multi-target fusion formula for fusion operation of the multiple target original scores is read. The formula consists of various variables and expressions. The target original scores of each dimension and various variables and expressions can be stored in the form of key-value.

[0135] Step 2: Get the compiled expression AST instance pointer from the TLS object pool of the current thread (that is, the memory address of the target syntax tree corresponding to the target fusion expression).

[0136] (1) If the expression AST instance corresponding to the target fusion expression already exists in the object pool, the formula can directly reuse the expression AST instance. After obtaining the instance, all variables in the variable symbol table are reset to 0.

[0137] (2) If the expression AST instance corresponding to the target fusion expression does not exist in the object pool, the target fusion expression is a newly appeared formula, which needs to be compiled in real time to generate the corresponding expression AST instance, initialize the variable symbol table, and set all variables to 0.

[0138] Step 3: After obtaining the expression AST instance, the business application sets the variable symbol table, and the instance automatically calculates the evaluation of the expression as the fusion score of the article.

[0139] (1) Read the target original scores of multiple dimensions in the data stored in the key-value format, and assign values ​​to the variables in the variable symbol table according to the variable names bound to them. Use to assign values ​​to the variables in the symbol table.

[0140] (2) Get the fusion score of the expression AST instance calculation. If it is a nested formula, it is used as the variable score. Otherwise, it is output as the final fusion score.

[0141] (3) In the formula nesting scenario, substitute the calculation result of (2) as the value into the intermediate variable, and calculate the outer formula again until the calculation result of the outermost formula is calculated as the final fusion score of the article.

[0142] (4) Arrange the articles from high to low based on their fusion scores to determine their relative exposure order.

[0143] Step 4: Return ownership of the expression AST instance to the TLS object pool of the current thread.

[0144] If it is the expression AST instance generated by the real-time compilation in step 2, it is added to the object pool through (1)-(2); otherwise, the state of the expression AST instance is directly changed to the unused state to return the ownership of the expression AST instance to the object pool;

[0145] (1) If the number of instances in the object pool is equal to the set object pool capacity threshold, it means that the object pool capacity is insufficient. At this time, the LRU strategy is used to eliminate the expression AST instance that has not been used for the longest time, release the object pool space, and add the newly added expression AST instance to the object pool.

[0146] (2) If the number of instances in the object pool is less than the upper limit of the capacity threshold, it means that the object pool has sufficient capacity. In this case, the newly added expression AST instance is directly added to the object pool.

[0147] (3) If the LRU elimination instance phenomenon occurs frequently, it means that the object pool capacity threshold is lower than the expression usage upper limit of the recommendation system, and an alarm is generated. The operation and maintenance personnel adjust the object pool capacity through parameters. For example, the object pool capacity threshold can be increased.

[0148] The information recommendation method provided by the present application determines the score of each candidate information in at least two dimensions based on the object features of the target object and the features of at least one candidate information; and based on the target fusion expression of each candidate information, obtains the target syntax tree corresponding to the target fusion expression from the object pool; because the object pool includes at least one expression and the association relationship between the syntax tree corresponding to each expression, the target syntax tree is obtained by pre-compiling the source code of the target fusion expression. Therefore, the compiled target syntax tree can be directly reused to perform fusion operations on the scores of multiple dimensions to obtain the target fusion score; by using the target fusion score for recommendation, the repeated compilation overhead of the fusion operation process is eliminated, which can greatly save the computing cost and thus improve the efficiency of information recommendation.

[0149] It can be understood that the information recommendation method provided in this application involves technologies such as cloud computing and cloud storage, such as using cloud computing to compile and generate the syntax tree of the fusion expression, using the syntax tree to perform fusion operations to obtain the target fusion score, and using cloud storage technology to store a large amount of candidate information.

[0150] It is understandable that cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, expanded at any time, and paid for by use.

[0151] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.

[0152] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.

[0153] It can be understood that cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.

[0154] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.

[0155] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is pre-divided into stripes. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.

[0156] Figure 5 This is a schematic diagram of the structure of an information recommendation device provided in an embodiment of the present application. Figure 5 As shown, the device comprises:

[0157] A dimension score determination module 501 is used to determine the score of each candidate information in at least two dimensions based on the object feature of the target object and the feature of at least one candidate information in response to a recommendation request of the target object;

[0158] The syntax tree acquisition module 502 is used to acquire a target syntax tree corresponding to the target fusion expression from the object pool based on the target fusion expression of each candidate information;

[0159] The object pool includes an association relationship between at least one expression and a syntax tree corresponding to each expression, and the syntax tree corresponding to the expression is obtained by compiling the source program code corresponding to the expression in advance;

[0160] A target fusion score acquisition module 503 is used to obtain a target fusion score of each candidate information based on the target syntax tree and the scores of each candidate information in multiple dimensions;

[0161] The recommendation module 504 is used to recommend each candidate information based on the target fusion score of each candidate information.

[0162] In a possible implementation, the target fusion score acquisition module is used to:

[0163] For each candidate information, based on the scores of each dimension corresponding to the candidate information and the variables corresponding to the scores of each dimension, assign values ​​to each variable in the initial symbol table to obtain a target symbol table;

[0164] Based on the target syntax tree and the target symbol table, a fusion operation logic is performed on the scores of each dimension to obtain a target fusion score of the candidate information.

[0165] In one possible implementation, the recommendation request belongs to a target thread among at least two threads currently running;

[0166] The device also includes an initial symbol table acquisition module, which is specifically used to:

[0167] Based on the target thread to which the recommendation request belongs, the initial symbol table corresponding to the target thread is obtained from the correspondence between each thread and the initial symbol table. Each thread corresponds to its own initial symbol table, and the initial symbol table includes each variable and the initial value of the variable in the fusion expression corresponding to the target thread.

[0168] In a possible implementation, the target fusion expression represents the fusion operation logic between at least two predefined variables;

[0169] The device also includes a storage module, which is used to:

[0170] For each candidate information, obtain the target fusion expression corresponding to the candidate information;

[0171] Based on the correspondence between the scores of each dimension of the candidate information and each variable in the target fusion expression, the target fusion expression corresponding to the candidate information and each variable and the score of each dimension are associated and stored, and each variable is associated with the score of one dimension.

[0172] In a possible implementation, the syntax tree acquisition module is used to:

[0173] Based on the target fusion expression, traverse the syntax tree corresponding to the target fusion expression in the object pool;

[0174] If the object pool includes a target syntax tree corresponding to the target fusion expression, obtaining the target syntax tree included in the object pool;

[0175] If the object pool does not include a syntax tree corresponding to the target fusion expression, the source program code corresponding to the target fusion expression is compiled into the target syntax tree, and the association relationship between the target fusion expression and the target syntax tree is stored in the object pool.

[0176] In a possible implementation, the device further includes a syntax tree generation module, which, when generating the target syntax tree, is specifically configured to:

[0177] The target fusion expression is parsed by a formula parser to obtain source program code corresponding to the target fusion expression;

[0178] The source program code is lexically analyzed to obtain a word sequence corresponding to the source program code, and based on the word sequence corresponding to the source program code, the grammatical relationship between each operator and each variable is analyzed to generate a target syntax tree corresponding to the target fusion expression.

[0179] In a possible implementation, the syntax tree acquisition module, when storing the association relationship between the target fusion expression and the target syntax tree in the object pool, is specifically used to:

[0180] If the total number of syntax trees corresponding to the object pool exceeds the first capacity threshold, the activity of each syntax tree in the object pool within the target time period is obtained, the syntax trees whose activity meets the target condition are deleted, and the association relationship between the target syntax tree and the target fusion expression is stored in the object pool;

[0181] If the total number of syntax trees corresponding to the object pool does not exceed the first capacity threshold, the association relationship between the target syntax tree and the target fusion expression is stored in the object pool.

[0182] In a possible implementation, the device further includes an adjustment module, the adjustment module being configured to:

[0183] If the total number of syntax trees corresponding to the object pool exceeds the first capacity threshold, counting the frequency of deleting syntax trees in the object pool within a preset time period;

[0184] If the operation frequency meets the adjustment conditions, a first prompt message is sent;

[0185] Based on an adjustment instruction triggered by the capacity adjustment operation, the first capacity threshold is adjusted to a second capacity threshold.

[0186] In a possible implementation, the recommendation request belongs to a target thread among at least two currently running threads; the object pool also includes a current state of each syntax tree corresponding to the target thread, and the current state is used to indicate whether it is used by any request in the target thread;

[0187] The device also includes a state updating module, which is specifically used to:

[0188] Mark the current state of the target syntax tree as a used state;

[0189] The state update module, after obtaining the target fusion score of each candidate information based on the target syntax tree and the scores of each candidate information in multiple dimensions, is specifically used to:

[0190] Marks the current state of the target syntax tree as unused.

[0191] The information recommendation method provided by the present application determines the score of each candidate information in at least two dimensions based on the object features of the target object and the features of at least one candidate information; and based on the target fusion expression of each candidate information, obtains the target syntax tree corresponding to the target fusion expression from the object pool; because the object pool includes at least one expression and the association relationship between the syntax tree corresponding to each expression, the target syntax tree is obtained by pre-compiling the source code of the target fusion expression. Therefore, the compiled target syntax tree can be directly reused to perform fusion operations on the scores of multiple dimensions to obtain the target fusion score; by using the target fusion score for recommendation, the repeated compilation overhead of the fusion operation process is eliminated, which can greatly save the computing cost and thus improve the efficiency of information recommendation.

[0192] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.

[0193] Figure 6 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device includes: a memory, a processor and a computer program stored in the memory, and the processor executes the above computer program to implement the steps of the information recommendation method. Compared with the related art, the following can be achieved:

[0194] The information recommendation method provided by the present application determines the score of each candidate information in at least two dimensions based on the object features of the target object and the features of at least one candidate information; and based on the target fusion expression of each candidate information, obtains the target syntax tree corresponding to the target fusion expression from the object pool; because the object pool includes at least one expression and the association relationship between the syntax tree corresponding to each expression, the target syntax tree is obtained by pre-compiling the source code of the target fusion expression. Therefore, the compiled target syntax tree can be directly reused to perform fusion operations on the scores of multiple dimensions to obtain the target fusion score; by using the target fusion score for recommendation, the repeated compilation overhead of the fusion operation process is eliminated, which can greatly save the computing cost and thus improve the efficiency of information recommendation.

[0195] In an alternative embodiment, an electronic device is provided, such as Figure 6 As shown, Figure 6 The electronic device 600 shown includes: a processor 601 and a memory 603. The processor 601 and the memory 603 are connected, such as through a bus 602. Optionally, the electronic device 600 may also include a transceiver 604, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 604 is not limited to one, and the structure of the electronic device 600 does not constitute a limitation on the embodiments of the present application.

[0196] Processor 601 may be a CPU (Central Processing Unit), a general purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 601 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0197] The bus 602 may include a path to transmit information between the above components. The bus 602 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 602 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0198] The memory 603 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium\other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.

[0199] The memory 603 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 601. The processor 601 is used to execute the computer program stored in the memory 603 to implement the steps shown in the above method embodiment.

[0200] Among them, electronic equipment includes but is not limited to: servers, terminals or cloud computing center equipment, etc.

[0201] 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 and corresponding contents of the aforementioned method embodiment can be implemented.

[0202] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.

[0203] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said", and "the" used herein may also include plural forms. The terms "include" and "comprise" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, and operations, but do not exclude the implementation as other features, information, data, steps, operations, etc. supported by the technical field.

[0204] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.

[0205] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0206] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.

Claims

1. An information recommendation method, characterized in that: The method comprises: In response to a recommendation request for a target object, determining a score of each candidate information in at least two dimensions based on an object feature of the target object and a feature of at least one candidate information; Based on the target fusion expression of each candidate information, obtaining a target syntax tree corresponding to the target fusion expression from the object pool; The object pool includes an association relationship between at least one expression and a syntax tree corresponding to each expression, and the syntax tree corresponding to the expression is obtained by compiling the source program code corresponding to the expression in advance; Based on the target syntax tree and the scores of each candidate information in multiple dimensions, obtaining a target fusion score for each candidate information; Based on the target fusion score of each candidate information, each candidate information is recommended.

2. The method according to claim 1, characterized in that The step of obtaining a target fusion score of each candidate information based on the target syntax tree and the scores of each candidate information in multiple dimensions includes: For each candidate information, assign values ​​to the variables in the initial symbol table based on the scores of the dimensions corresponding to the candidate information and the variables corresponding to the scores of the dimensions, so as to obtain a target symbol table; Based on the target syntax tree and the target symbol table, a fusion operation logic is performed on the scores of each dimension to obtain a target fusion score of the candidate information.

3. The method according to claim 2, characterized in that The recommendation request belongs to a target thread among at least two currently running threads; The method for obtaining the initial symbol table includes: Based on the target thread to which the recommendation request belongs, acquiring the initial symbol table corresponding to the target thread from the correspondence between each thread and the initial symbol table; Each thread corresponds to its own initial symbol table, and the initial symbol table includes each variable in the fusion expression corresponding to the target thread and the initial value of the variable.

4. The method according to any one of claims 1 to 3, characterized in that The target fusion expression represents the fusion operation logic between at least two predefined variables; After determining the score of each candidate information in at least two dimensions based on the object feature of the target object and the feature of at least one candidate information, the method further includes: For each candidate information, obtaining a target fusion expression corresponding to the candidate information; Based on the correspondence between the scores of each dimension of the candidate information and each variable in the target fusion expression, the target fusion expression corresponding to the candidate information and each variable and the score of each dimension are associated and stored, and each variable is associated with the score of one dimension.

5. The method according to claim 1, characterized in that The target fusion expression based on each candidate information, obtaining a target syntax tree corresponding to the target fusion expression from an object pool, includes: Based on the target fusion expression, traverse the syntax tree corresponding to the target fusion expression in the object pool; If the object pool includes a target syntax tree corresponding to the target fusion expression, obtaining the target syntax tree included in the object pool; If the object pool does not include a syntax tree corresponding to the target fusion expression, the source program code corresponding to the target fusion expression is compiled into the target syntax tree, and the association relationship between the target fusion expression and the target syntax tree is stored in the object pool.

6. The method according to claim 1 or 5, characterized in that: The method for generating the target syntax tree includes: Parsing the target fusion expression through a formula parser to obtain source program code corresponding to the target fusion expression; The source program code is lexically analyzed to obtain a word sequence corresponding to the source program code, and based on the word sequence corresponding to the source program code, the grammatical relationship between each operator and each variable is analyzed to generate a target syntax tree corresponding to the target fusion expression.

7. The method according to claim 5, characterized in that The storing the association relationship between the target fusion expression and the target syntax tree in the object pool includes: If the total number of syntax trees corresponding to the object pool exceeds the first capacity threshold, the activity of each syntax tree in the object pool within the target time period is obtained, the syntax trees whose activity meets the target condition are deleted, and the association relationship between the target syntax tree and the target fusion expression is stored in the object pool; If the total number of syntax trees corresponding to the object pool does not exceed the first capacity threshold, the association relationship between the target syntax tree and the target fusion expression is stored in the object pool.

8. The method according to claim 7, characterized in that The method further comprises: If the total number of syntax trees corresponding to the object pool exceeds a first capacity threshold, counting the frequency of deleting syntax trees in the object pool within a preset time period; If the operation frequency meets the adjustment condition, sending a first prompt message; Based on an adjustment instruction triggered by a capacity adjustment operation, the first capacity threshold is adjusted to a second capacity threshold.

9. The method according to claim 1, characterized in that: The recommended request belongs to a target thread among at least two currently running threads; the object pool also includes a current state of each syntax tree corresponding to the target thread, and the current state is used to indicate whether it is used by any request in the target thread; After obtaining the target syntax tree corresponding to the target fusion expression based on each candidate information from the object pool, the method further includes: Marking the current state of the target syntax tree as a use state; After obtaining the target fusion score of each candidate information based on the target syntax tree and the scores of each candidate information in multiple dimensions, the method further includes: Mark the current state of the target syntax tree as an unused state.

10. An information recommendation device, characterized in that: The device comprises: A dimension score determination module, configured to determine, in response to a recommendation request for a target object, a score of each candidate information in at least two dimensions based on an object feature of the target object and a feature of at least one candidate information; A syntax tree acquisition module, used for acquiring a target syntax tree corresponding to the target fusion expression from an object pool based on the target fusion expression of each candidate information; The object pool includes an association relationship between at least one expression and a syntax tree corresponding to each expression, and the syntax tree corresponding to the expression is obtained by compiling the source program code corresponding to the expression in advance; A target fusion score acquisition module, used to obtain a target fusion score of each candidate information based on the target syntax tree and the scores of each candidate information in multiple dimensions; The recommendation module is used to recommend each candidate information based on the target fusion score of each candidate information.

11. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.