Resource recommendation method and device, equipment and storage medium
By estimating the user access time, generating pre-recommended tasks and adjusting the number of tasks according to real-time load, the problem of resource recall difficulties in recommendation system response speed and high load is solved, and more efficient resource recommendation and system stability are achieved.
Patent Information
- Application Number
- CN202411875565.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-18
AI Technical Summary
Existing recommendation systems have challenges in efficiency and response speed. Users need to wait a long time to obtain recommended resources, and may not be able to provide effective resource recalls under high load conditions, affecting the user experience.
Generate pre-recommended tasks by estimating access time based on the user's historical access data, and dynamically adjust the number of tasks based on the real-time load data of the resource recommendation service, and execute pre-recommended tasks in advance to improve response efficiency.
It significantly improves the response efficiency of users' actual access requests and improves the performance and stability of resource recommendation services under high load conditions.
Smart Images

Figure CN119807527A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of artificial intelligence technology, deep learning, natural language processing and other technical fields, and can be applied to intelligent search scenarios. Specifically, it relates to a resource recommendation method, device, equipment and storage medium. Background Art
[0002] In today's digital age, personalized recommendation systems have become a core means to improve user experience and enhance user stickiness. However, the field of recommendation systems faces the dual challenges of efficiency and response speed. Users often have to wait for a while to obtain recommended resources, and when processing complex links, they may even encounter the dilemma of being unable to provide recall resources. These problems have a serious negative impact on user experience. Summary of the invention
[0003] The present disclosure provides a resource recommendation method, apparatus, device and storage medium.
[0004] According to one aspect of the present disclosure, a resource recommendation method is provided, comprising:
[0005] Determine an estimated access time for the first user according to the historical access data of the first user, generate a pre-recommended task according to the estimated access time, and write the association between the pre-recommended task and the estimated access time into a distributed memory database;
[0006] According to the real-time load data of the resource recommendation service, calling the resource recommendation service to execute the pre-recommendation task to obtain the pre-recommended resource, and storing the association relationship between the first user and the pre-recommended resource;
[0007] Based on the association relationship between the first user and the pre-recommended resource, a resource recommendation is performed.
[0008] According to one aspect of the present disclosure, a resource recommendation device is provided, comprising:
[0009] A pre-recommendation task module, used to determine an estimated access time for the first user according to the historical access data of the first user, generate a pre-recommendation task according to the estimated access time, and write the association between the pre-recommendation task and the estimated access time into a distributed memory database;
[0010] A pre-recommended resource module, configured to call the resource recommendation service to execute the pre-recommendation task to obtain the pre-recommended resource according to the real-time load data of the resource recommendation service, and store the association relationship between the first user and the pre-recommended resource;
[0011] The resource recommendation module is used to make resource recommendations based on the association relationship between the first user and the pre-recommended resources.
[0012] According to another aspect of the present disclosure, there is provided an electronic device, the electronic device comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method provided by any embodiment of the present disclosure.
[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method provided by any embodiment of the present disclosure.
[0017] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method provided according to any embodiment of the present disclosure is implemented.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a flow chart of a resource recommendation method provided according to an embodiment of the present disclosure;
[0020] Figure 2 is a flowchart of another resource recommendation method provided according to an embodiment of the present disclosure;
[0021] Figure 3a is a flowchart of another resource recommendation method provided according to an embodiment of the present disclosure;
[0022] Figure 3b is an example diagram of a resource recommendation method provided according to an embodiment of the present disclosure;
[0023] Figure 4 is a structural diagram of a resource recommendation device provided according to an embodiment of the present disclosure;
[0024] Figure 5 It is a block diagram of an electronic device used to implement the resource recommendation method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] Figure 1 1 is a flow chart of a resource recommendation method provided according to an embodiment of the present disclosure. The method is applicable to the case where resources to be recommended are preloaded for users. The method can be executed by a resource recommendation device, which can be implemented in software and / or hardware and can be integrated into an electronic device. Figure 1 As shown, the resource recommendation method of this embodiment may include:
[0026] S101, determining an estimated access time for a first user according to historical access data of the first user, generating a pre-recommended task according to the estimated access time, and writing an association between the pre-recommended task and the estimated access time into a distributed memory database;
[0027] S102, calling the resource recommendation service to execute the pre-recommendation task to obtain pre-recommended resources according to the real-time load data of the resource recommendation service, and storing the association relationship between the first user and the pre-recommended resources;
[0028] S103: Recommend resources based on the association relationship between the first user and the pre-recommended resources.
[0029] In the disclosed embodiment, the historical access data of each user can be obtained from the log system of the specified search engine or the specified application, and the estimated access time of each user can be obtained by predicting the access time based on the historical access data of each user. Exemplarily, multiple time periods can be divided, and the historical access frequency of each user in each time period can be determined based on the historical access time of each user, and the time period with the highest historical access frequency can be used as the estimated access time of the user; or, the resources that the user is interested in can be determined based on the historical search terms of each user in the historical access process, and the estimated access time can be determined based on the time corresponding to the resources of interest. For example, if it is determined that a user is interested in the live broadcast of a certain sports event based on the historical search terms of a certain user, the live broadcast time of the sports event can be used as the estimated access time.
[0030] The first user may refer to a user who is about to access a specified search engine or a specified application within a certain length of time in the future, such as within the next 6 hours. For each first user, a pre-recommendation task can be generated for the first user based on the estimated access time, and the association between the pre-recommendation task and the estimated access time can be written into a distributed memory database such as a Redis (Remote Dictionary Serve) database, which is used to start resource calculation before the first user actually accesses, thereby improving the response efficiency to the actual access request of the first user. However, the recall calculation of pre-recommended resources for each first user in advance may increase the computational complexity of the resource recommendation service; moreover, the resource recommendation service not only needs to process each pre-recommendation task in advance, but more importantly, it needs to process the actual access requests of online users. In particular, in the case of unbalanced load, it is easy to cause performance problems in the resource recommendation service under high load, such as slow response, crash, etc., thereby affecting the stability and reliability of the resource recommendation service.
[0031] In the disclosed embodiment, the CPU usage rate, memory occupancy and other indicators of the resource recommendation service can be monitored in real time to obtain the real-time load data of the resource recommendation service, and the number of pre-recommendation tasks read from the distributed memory database can be adjusted according to the real-time load data, and the resource recommendation service can be called to execute the pre-recommendation tasks read to obtain pre-recommendation resources, such as encoding the first user's behavior preferences, points of interest, etc. to obtain the first user's features, encoding the features of each existing resource in the resource library to obtain the features of each existing resource, determining the semantic similarity between each first user feature and each existing resource feature, and selecting multiple existing resources with relatively high semantic similarity as the pre-recommendation resources for the first user. It should be noted that the disclosed embodiment does not specifically limit the resource recommendation service. For example, in the text-image scenario, a generative large model can be used to generate a new image for the first user according to the first user's behavior preferences, points of interest, and text descriptions input by the first user, as the pre-recommendation resources for the first user.
[0032] In addition, the association between the first user and the pre-recommended resources can be recorded. When the first user actually accesses the resource, the pre-recommended resources for the first user can be determined directly based on the association between the first user and the pre-recommended resources, and the corresponding pre-recommended resources can be fed back to the first user. By real-time monitoring of indicators such as CPU usage and memory usage of the resource recommendation service, and dynamically adjusting the number of pre-recommended tasks read from the distributed memory database according to real-time load data, that is, implementing a "peak shaving and valley filling" strategy, the stability and efficiency of the service can be significantly improved, and the performance of the resource recommendation service when dealing with different loads can also be improved.
[0033] The technical solution provided by the embodiment of the present disclosure generates a pre-recommendation task for the first user according to the historical access data of the first user before the first user actually visits, and dynamically adjusts the number of pre-recommendation tasks to be read according to the real-time load data of the resource recommendation service, and calls the resource recommendation service to execute the read pre-recommendation tasks to obtain the pre-recommendation resources. When the first user actually visits, the pre-recommendation resources calculated in advance can be directly fed back, which not only improves the response efficiency to the actual access request of the first user, but also improves the performance of the resource recommendation service when dealing with different loads.
[0034] Figure 2 is a flowchart of another resource recommendation method provided according to an embodiment of the present disclosure. Figure 2 Based on the above embodiment, the resource recommendation method of this embodiment may include:
[0035] S201, determining an estimated access time for the first user according to the historical access data of the first user, generating a pre-recommended task according to the estimated access time, and writing an association between the pre-recommended task and the estimated access time into a distributed memory database;
[0036] S202, determining a first quantity according to real-time load data of the resource recommendation service;
[0037] S203, reading the first number of pre-recommended tasks from the distributed memory database; continuing to execute S204 or jumping to execute S205;
[0038] S204, in response to determining that the read pre-recommended task has not expired according to the estimated access time of the pre-recommended task, and the real-time load data meets the pre-recommendation requirement, calling the resource recommendation service to execute the read pre-recommended task to obtain the pre-recommended resource; jumping to S206;
[0039] S205, in response to determining that the read pre-recommended task has not expired according to the estimated access time of the pre-recommended task, and the real-time load data does not meet the pre-recommendation requirement, storing each read pre-recommended task in a message queue; and continuing to execute S206;
[0040] S206: Recommend resources based on the association relationship between the first user and the pre-recommended resources.
[0041] In the disclosed embodiment, the estimated access time of each first user can be obtained by predicting the visit time based on the historical access data of each first user, a pre-recommended task can be generated based on the estimated access time, and the correlation between the pre-recommended task and the estimated access time can be written into the distributed memory database. It is also possible to monitor the CPU usage, memory occupancy and other indicators of the resource recommendation service in real time to obtain the real-time load data of the resource recommendation service, and calculate the first quantity based on the real-time load data. Exemplarily, when the t-th first quantity has been calculated, the first coefficient can be calculated based on the real-time load data, and the calculated t-th first quantity can be scaled using the first coefficient to obtain the t+1-th first quantity, that is, to update the first quantity. The first coefficient is negatively correlated with the real-time load data.
[0042] Exemplarily, a first number of pre-recommended tasks are read from a distributed memory database, that is, each pre-recommended task read is deleted from the distributed memory database. For each pre-recommended task read, determine whether the pre-recommended task is overdue according to the estimated access time and current time of the pre-recommended task; if overdue, discard the pre-recommended task; if not overdue, determine whether the real-time load data of the resource recommendation service meets the pre-recommended requirements, for example, determine whether the real-time load data is less than a preset load threshold value such as 80%. If the pre-recommended requirements are met, call the resource recommendation service to execute the read pre-recommended task to obtain the corresponding pre-recommended resource, and record the association relationship between the first user and the corresponding pre-recommended resource in the cache. If the pre-recommended requirements are not met, the read pre-recommended task is stored in the message queue and not processed temporarily, that is, the message queue is used as a buffer for the pre-recommended task, and the task can be temporarily stored when the system load is high to avoid task loss. It should be noted that if the pre-recommended requirements are not met, the first quantity can be scaled in gradients according to the corresponding real-time load data.
[0043] By generating a pre-recommended task for each first user based on the historical access data of each first user, the association between the pre-recommended task and the estimated access time is written into the distributed memory database; and, according to the real-time load data, the first quantity is determined, and the first quantity of pre-recommended tasks is read from the distributed memory database; by judging whether the pre-recommended task is overdue and whether the real-time load data meets the requirements, the resource recommendation task is intelligently scheduled to effectively avoid the processing of expired tasks. When the load allows, the resource recommendation service is called in time to determine and cache the association between the first user and the pre-recommended resource; when the load is too high, the pre-recommended task is stored in the message queue, which can improve the stability of the system and achieve a balance between the efficiency and accuracy of resource recommendation and the system load.
[0044] In an optional implementation, the determining the first quantity according to the real-time load data of the resource recommendation service includes: in response to determining that the real-time load data is less than a preset first load threshold and greater than a preset second load threshold, determining the first quantity according to the real-time load data of the resource recommendation service. Exemplarily, in response to determining that the real-time load data is less than a preset first load threshold and greater than a preset second load threshold, for example, less than 80% and greater than 40%, determining the first quantity according to the real-time load data of the resource recommendation service.
[0045] In an optional embodiment, calling the resource recommendation service to execute the pre-recommended task to obtain the pre-recommended resource based on the real-time load data of the resource recommendation service also includes: determining a second quantity based on the real-time load data; reading the second quantity of pre-recommended tasks from the message queue; in response to determining that the read pre-recommended task has not expired based on the estimated access time of the pre-recommended task and that the real-time load data meets the pre-recommendation requirement, calling the resource recommendation service to execute the pre-recommended task read from the message queue to obtain the pre-recommended resource; in response to determining that the read pre-recommended task has not expired based on the estimated access time of the pre-recommended task and that the real-time load data does not meet the pre-recommendation requirement, discarding each pre-recommended task read from the message queue.
[0046] In the disclosed embodiment, not only the first quantity but also the second quantity is determined according to the real-time load data. The second quantity of pre-recommended tasks is read from the message queue, that is, each pre-recommended task read is deleted from the message queue. For each pre-recommended task read from the message queue, it is determined whether the pre-recommended task is overdue according to the estimated access time and the current time of the pre-recommended task; if it is overdue, the pre-recommended task is discarded; if it is not overdue, it is determined whether the real-time load data of the resource recommendation service meets the pre-recommendation requirements. If the pre-recommendation requirements are met, the resource recommendation service is called to execute the read pre-recommended task to obtain the corresponding pre-recommended resource, and the association relationship between the first user and the corresponding pre-recommended resource can be recorded in the cache. If the pre-recommendation requirements are not met, the pre-recommended task read from the message queue is discarded. By also determining the second quantity according to the real-time load data and reading the second quantity of pre-recommended tasks from the message queue; by judging whether the pre-recommended task is overdue and whether the real-time load data meets the requirements, the resource recommendation task is intelligently scheduled to effectively avoid the processing of expired tasks. When the load permits, the resource recommendation service is called in time to determine and cache the association between the first user and the pre-recommended resources; when the load is too high, the corresponding pre-recommendation task is discarded, further improving the efficiency of resource recommendation while taking into account load balancing.
[0047] In an optional embodiment, determining a first quantity and a second quantity based on the real-time load data includes: in response to determining that the real-time load data is less than a preset second load threshold, determining the first quantity based on the real-time load data; in response to determining that the first quantity reaches a preset first quantity threshold, determining remaining load data based on load data required to be consumed by a pre-recommended task of the first quantity threshold; and determining the second quantity based on the remaining load data.
[0048] In an embodiment of the present disclosure, if the real-time load data is less than a preset second load threshold, such as 40%, a first quantity is determined based on the real-time load data; if the first quantity reaches a preset first quantity threshold, such as 100 items, the load data required for the pre-recommended tasks of the first quantity threshold is determined, and the available remaining load data is determined based on the load data required to be consumed, and the second quantity is determined in combination with the available remaining load data, thereby reading the pre-recommended tasks of the first quantity threshold from the distributed memory database, and reading the second number of pre-recommended tasks from the message queue, that is, giving priority to reading the pre-recommended tasks from the distributed memory database, and using the message queue as a buffer for the pre-recommended tasks, which can fully utilize the high-speed access and processing capabilities of the distributed memory database, and further improve resource processing efficiency.
[0049] The technical solution provided by the embodiment of the present disclosure generates a pre-recommended task for each first user according to the historical access data of each first user, and writes the correlation between the pre-recommended task and the estimated access time into a distributed memory database; and determines the first quantity and the second quantity according to the real-time load data, reads the first quantity of pre-recommended tasks from the distributed memory database, and reads the second quantity of pre-recommended tasks from the message queue, that is, the pre-recommended tasks are read preferentially from the distributed memory database, and the message queue is used as a buffer for the pre-recommended tasks, which can not only efficiently utilize the high-speed processing capability of the distributed memory database, but also flexibly respond to load changes, thereby improving the efficiency of resource recommendation.
[0050] Figure 3a is a flowchart of another resource recommendation method provided according to an embodiment of the present disclosure. Figure 3a Based on the above embodiment, the resource recommendation method of this embodiment may include:
[0051] S301, obtaining the historical access time, historical search terms and historical resources of the first user in the historical search process;
[0052] S302, determining the search mode of the first user in different time periods according to each of the historical access times and the type of time period to which each of the historical access times belongs;
[0053] S303, determining the first user's field of interest according to the historical search terms and the historical resources;
[0054] S304: Input the historical access time, the search pattern, and the field of interest into a pre-trained estimated access model to obtain the output estimated access time, generate a pre-recommended task based on the estimated access time, and write the association between the pre-recommended task and the estimated access time into a distributed memory database;
[0055] S305, calling the resource recommendation service to execute the pre-recommendation task to obtain pre-recommended resources according to the real-time load data of the resource recommendation service, and storing the association relationship between the first user and the pre-recommended resources;
[0056] S306: Recommend resources based on the association relationship between the first user and the pre-recommended resources.
[0057] In the embodiment of the present disclosure, for any first user, the historical access data of the first user can be obtained from the log system of the designated search engine or the designated application, and the historical access data includes the historical access time, the historical search terms carried in the historical access request, and the historical resources actually accessed. According to the historical access time of the first user, the access frequency of the first user in different time periods, such as weekdays, weekends, holidays, morning peaks, and evening peaks, is determined to identify the search mode of the first user in different time periods. The search mode can be an active mode or a dormant mode, etc.
[0058] In addition, keywords in historical search terms can be extracted to determine the frequency, semantics or theme of keywords; the subject identification can also be performed on the historical resources visited by the first user, such as web pages, articles, videos, etc., to extract the main content or theme of each historical resource. The field of interest of the first user is determined by combining the frequency, semantics or theme of keywords, and the main content or theme of each historical resource. The first user's historical access time, search mode in different time periods, and field of interest are input into a pre-trained estimated access model to obtain the estimated access time of the first user, that is, the next access time of the first user. By comprehensively analyzing the historical access data of the first user in the search engine or application, including historical access time, historical search terms and historical resource content, the user's active time period and field of interest can be accurately identified, and then the pre-trained estimated access model is used to determine the estimated access time for the first user, which improves the accuracy of obtaining the estimated access time and provides strong support for personalized resource recommendations.
[0059] In an optional embodiment, the above method also includes: obtaining the actual access time of the first user; determining the time difference between the actual access time of the first user and the estimated access time of the first user, and performing feedback update on the estimated access model based on the time difference; wherein the time difference is used to positively reward the estimated access model when it is less than or equal to a preset time difference threshold; and negatively punish the estimated access model when the time difference is greater than the time difference threshold.
[0060] In the embodiments of the present disclosure, a reinforcement learning algorithm can also be used to update the prediction model according to the estimated access time and the actual access time output by the estimated access model, so as to continuously improve the accuracy of the model prediction through iterative learning. Exemplarily, the estimated access model is used as an agent to determine the estimated access time for each first user; obtain the actual access time of the first user; determine the time difference between the actual access time and the estimated access time, and based on the reward function, feedback update the estimated access model according to the time difference. Exemplarily, if the time difference is less than or equal to the preset time difference threshold, the estimated access model is positively rewarded; if the time difference is greater than the time difference threshold, the estimated access model is negatively punished. Based on reinforcement learning, the estimated access model is positively or negatively fed back according to the time difference between the estimated access time and the actual access time, and the model is continuously optimized, thereby more accurately predicting user access behavior.
[0061] In addition, multiple time periods may be divided, for example, in a day, into hours, and the estimated access time and the actual access time of each first user may be counted to obtain the following statistical results:
[0062] Estimated visits(T) Estimated no visit (F) Actual visit (T) TT TF Actually not visited (F) FT FF
[0063] Among them, the accuracy of the estimated access model = TT / (TT+FT); recall = TT / (TT+TF). In other words, the ratio between the number of estimated successful time points and the total number of estimated access times is taken as the accuracy, and the ratio between the number of estimated successful time points and the total number of actual accesses is taken as the recall. The above accuracy and recall rates enable dynamic evaluation of the estimated access model, and can also be combined with the accuracy and recall rates to trigger retraining and optimization of the estimated access model.
[0064] The technical solution provided by the embodiment of the present disclosure can accurately identify the user's active time periods and areas of interest by comprehensively analyzing the first user's historical access data in the search engine or application, including historical access time, historical search terms and historical resource content, and then use the pre-trained estimated access model to determine the estimated access time for the first user, thereby improving the accuracy of the estimated access time and providing strong support for personalized resource recommendations; and, based on reinforcement learning, positive or negative feedback is given to the estimated access model according to the time difference between the estimated access time and the actual access time, and the model is continuously optimized, thereby further improving the accuracy of obtaining the estimated access time.
[0065] In an optional embodiment, the resource recommendation based on the association relationship between the first user and the pre-recommended resource includes: in response to receiving an actual access request from a second user, determining whether there is a pre-recommended resource associated with the second user based on the association relationship between the first user and the pre-recommended resource; in response to determining that there is a pre-recommended resource associated with the second user, feeding back the associated pre-recommended resource to the second user; in response to determining that there is no pre-recommended resource associated with the second user, generating a real-time recommendation task, and obtaining a real-time recommended resource by calling the resource recommendation service to execute the real-time recommendation task, and feeding back the real-time recommended resource to the second user.
[0066] The second user is any user who actually accesses the site. In response to the actual access request of the second user, based on the association relationship between the first user and the pre-recommended resources, it is determined whether there are pre-recommended resources associated with the second user, that is, whether the second user belongs to each first user; if so, the associated pre-recommended resources are directly fed back to the second user without calling the resource recommendation service for calculation, thereby improving the efficiency of responding to the actual access request. If not, a real-time recommendation task is generated for the second user, and the resource recommendation service is called to execute the real-time recommendation task to obtain the real-time recommended resources, and the real-time recommended resources are fed back to the second user, that is, the actual access request is responded to in a timely manner and avoided from being missed, which can significantly improve the coverage of the actual access request.
[0067] refer to Figure 3bThe resource recommendation method can be specifically as follows: collect user data to obtain historical access data of each first user; input the historical access data of each first user into a pre-trained estimated access model to obtain the estimated access time of each first user, generate a pre-recommended task according to the estimated access time, and write each pre-recommended task into a distributed memory database for initiating recall resource calculation before the first user actually accesses; monitor the real-time load data of the resource recommendation service; determine the first quantity according to the real-time load data, or determine the first quantity and the second quantity according to the real-time load data; obtain the first quantity of pre-recommended tasks from the distributed memory database, or obtain the first quantity of pre-recommended tasks from the distributed memory database and obtain the second quantity of pre-recommended tasks from the message queue, that is, adopt the peak shaving and valley filling strategy to schedule each pre-recommended task according to the real-time load data.
[0068] Furthermore, when the real-time load data meets the pre-recommendation requirements, the resource recommendation service is called to calculate the read pre-recommendation tasks to obtain pre-recommendation resources, and in response to the actual access request of the first user, the pre-recommendation resources are fed back to the first user to provide personalized resource recommendations for the first user. Based on the feedback mechanism, a reinforcement learning algorithm can also be used to update the estimated access model in combination with the estimated access time and actual access time of the first user; or, the accuracy and recall rate of the estimated access model can also be determined based on the estimated access time and actual access time of the first user. When the accuracy and recall rate meet the set retraining conditions, the training set of the estimated access model is updated and the estimated access model is retrained.
[0069] Figure 4 1 is a schematic diagram of a resource recommendation device according to an embodiment of the present disclosure. The device is suitable for preloading resources to be recommended for users. The device can be implemented in software and / or hardware and can be integrated into electronic devices. Figure 4 As shown, the resource recommendation device 400 of this embodiment may include:
[0070] A pre-recommendation task module 410 is used to determine an estimated access time for the first user according to the historical access data of the first user, generate a pre-recommendation task according to the estimated access time, and write the association between the pre-recommendation task and the estimated access time into a distributed memory database;
[0071] The pre-recommended resource module 420 is used to call the resource recommendation service to execute the pre-recommendation task to obtain the pre-recommended resource according to the real-time load data of the resource recommendation service, and store the association relationship between the first user and the pre-recommended resource;
[0072] The resource recommendation module 430 is configured to make resource recommendations based on the association relationship between the first user and the pre-recommended resources.
[0073] In an optional implementation, the pre-recommendation resource module 420 includes a first pre-recommendation submodule, and the first pre-recommendation submodule includes:
[0074] A first quantity unit, configured to determine a first quantity according to real-time load data of the resource recommendation service;
[0075] A first task reading unit, configured to read the first number of pre-recommended tasks from the distributed memory database;
[0076] A first resource unit, configured to, in response to determining, based on the estimated access time of the pre-recommended task, that the read pre-recommended task has not expired and the real-time load data meets the pre-recommendation requirement, call the resource recommendation service to execute the read pre-recommended task to obtain the pre-recommended resource;
[0077] The queue storage unit is used to store each pre-recommended task read into a message queue in response to determining that the pre-recommended task read has not expired according to the estimated access time of the pre-recommended task and the real-time load data does not meet the pre-recommendation requirement.
[0078] In an optional implementation, the pre-recommendation resource module 420 includes a second pre-recommendation submodule, and the second pre-recommendation submodule includes:
[0079] a second quantity unit, configured to further determine a second quantity according to the real-time load data;
[0080] A second task reading unit, configured to read the second number of pre-recommended tasks from the message queue;
[0081] A second resource unit is configured to, in response to determining that the read pre-recommended task has not expired according to the estimated access time of the pre-recommended task and that the real-time load data meets the pre-recommendation requirement, call the resource recommendation service to execute the pre-recommended task read from the message queue to obtain the pre-recommended resource;
[0082] The task discarding unit is used to discard each pre-recommended task read from the message queue in response to determining that the read pre-recommended task has not expired according to the estimated access time of the pre-recommended task and the real-time load data does not meet the pre-recommendation requirement.
[0083] In an optional implementation manner, the first quantity unit is specifically used for:
[0084] In response to determining that the real-time load data is less than a preset first load threshold and greater than a preset second load threshold, the first number is determined according to the real-time load data.
[0085] In an optional implementation manner, the first quantity unit is specifically configured to determine the first quantity according to the real-time load data in response to determining that the real-time load data is less than a preset second load threshold;
[0086] The second quantity unit is specifically used to determine the remaining load data according to the load data required to be consumed by the pre-recommended task of the first quantity threshold in response to determining that the first quantity reaches a preset first quantity threshold; and determine the second quantity according to the remaining load data.
[0087] In an optional implementation, the pre-recommendation task module 410 includes:
[0088] A history acquisition submodule, used to acquire the historical access time, historical search terms and historical resources of the first user during the historical search process;
[0089] A search mode submodule, used to determine the search mode of the first user in different time periods according to each of the historical access times and the type of time period to which each of the historical access times belongs;
[0090] An interest submodule, configured to determine the first user's area of interest based on the historical search terms and the historical resources;
[0091] The pre-recommendation task submodule is used to input the historical access time, the search mode and the field of interest into a pre-trained estimated access model to obtain the output estimated access time.
[0092] In an optional implementation, the resource recommendation device 400 further includes a model updating module; the model updating module includes:
[0093] An actual access submodule, used to obtain the actual access time of the first user;
[0094] A model updating submodule, used to determine the time difference between the actual access time and the estimated access time, and to perform feedback update on the estimated access model according to the time difference;
[0095] Among them, the time difference is used to positively reward the estimated access model when the time difference is less than or equal to a preset time difference threshold; and negatively punish the estimated access model when the time difference is greater than the time difference threshold.
[0096] In an optional implementation, the resource recommendation module 430 is specifically used to:
[0097] In response to receiving an actual access request from a second user, determining whether there is a pre-recommended resource associated with the second user based on an association relationship between the first user and the pre-recommended resource;
[0098] In response to determining that there is a pre-recommended resource associated with the second user, feeding back the associated pre-recommended resource to the second user;
[0099] In response to determining that there is no pre-recommended resource associated with the second user, a real-time recommendation task is generated, and the real-time recommended resource is obtained by calling the resource recommendation service to execute the real-time recommendation task, and the real-time recommended resource is fed back to the second user.
[0100] The resource recommendation device provided in the embodiment of the present invention can execute the resource recommendation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0101] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0102] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0103] Figure 5 It is a block diagram of an electronic device used to implement the resource recommendation method of the embodiment of the present disclosure. Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0104] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0105] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0106] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as the resource recommendation method. For example, in some embodiments, the resource recommendation method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the resource recommendation method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the resource recommendation method in any other appropriate manner (e.g., by means of firmware).
[0107] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0108] like Figure 5As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0109] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0110] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as the resource recommendation method. For example, in some embodiments, the resource recommendation method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the resource recommendation method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the resource recommendation method in any other appropriate manner (e.g., by means of firmware).
[0111] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0112] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0113] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0114] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, audio input, or tactile input).
[0115] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web player through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0116] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0117] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, audio recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.
[0118] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.
[0119] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0120] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A resource recommendation method, comprising: Determine an estimated access time for the first user according to the historical access data of the first user, generate a pre-recommended task according to the estimated access time, and write the association between the pre-recommended task and the estimated access time into a distributed memory database; According to the real-time load data of the resource recommendation service, calling the resource recommendation service to execute the pre-recommendation task to obtain the pre-recommended resource, and storing the association relationship between the first user and the pre-recommended resource; Based on the association relationship between the first user and the pre-recommended resource, a resource recommendation is performed.
2. The method according to claim 1, wherein: The step of calling the resource recommendation service to execute the pre-recommendation task and obtain the pre-recommendation resource according to the real-time load data of the resource recommendation service includes: determining a first quantity based on real-time load data of the resource recommendation service; Reading the first number of the pre-recommended tasks from the distributed memory database; In response to determining, according to the estimated access time of the pre-recommended task, that the read pre-recommended task has not expired and the real-time load data meets the pre-recommendation requirement, calling the resource recommendation service to execute the read pre-recommended task to obtain the pre-recommended resource; In response to determining that the read pre-recommended tasks have not expired according to the estimated access time of the pre-recommended tasks, and the real-time load data does not meet the pre-recommendation requirement, each read pre-recommended task is stored in a message queue.
3. The method according to claim 2, wherein: The step of calling the resource recommendation service to execute the pre-recommendation task and obtain the pre-recommendation resource according to the real-time load data of the resource recommendation service further includes: determining a second quantity based on the real-time load data; Reading the second number of the pre-recommended tasks from the message queue; In response to determining that the read pre-recommended task has not expired according to the estimated access time of the pre-recommended task, and the real-time load data meets the pre-recommendation requirement, calling the resource recommendation service to execute the pre-recommended task read from the message queue to obtain the pre-recommended resource; In response to determining that the read pre-recommended tasks have not expired according to the estimated access time of the pre-recommended tasks, and the real-time load data does not meet the pre-recommendation requirement, each pre-recommended task read from the message queue is discarded.
4. The method according to claim 2, wherein: The determining the first quantity according to the real-time load data of the resource recommendation service includes: In response to determining that the real-time load data is less than a preset first load threshold and greater than a preset second load threshold, the first number is determined according to the real-time load data.
5. The method according to claim 3, wherein: Determining the first quantity and the second quantity according to the real-time load data includes: In response to determining that the real-time load data is less than a preset second load threshold, determining the first quantity according to the real-time load data; In response to determining that the first quantity reaches a preset first quantity threshold, determining remaining load data according to load data required to be consumed by pre-recommended tasks of the first quantity threshold; The second number is determined based on the remaining load data.
6. The method according to claim 1, wherein: The step of determining the estimated access time of the first user according to the historical access data of the first user includes: Acquire the historical access time, historical search terms and historical resources of the first user during the historical search process; Determining the search mode of the first user in different time periods according to each of the historical access times and the type of time period to which each of the historical access times belongs; determining the first user's area of interest based on the historical search terms and the historical resources; The historical access time, the search pattern and the field of interest are input into a pre-trained estimated access model to obtain the output estimated access time.
7. The method according to claim 6, further comprising: Obtaining the actual access time of the first user; Determine the time difference between the actual access time and the estimated access time, and perform feedback update on the estimated access model according to the time difference; Among them, the time difference is used to positively reward the estimated access model when the time difference is less than or equal to a preset time difference threshold; and negatively punish the estimated access model when the time difference is greater than the time difference threshold.
8. The method according to claim 1, wherein: The recommending resources based on the association relationship between the first user and the pre-recommended resources includes: In response to receiving an actual access request from a second user, determining whether there is a pre-recommended resource associated with the second user based on an association relationship between the first user and the pre-recommended resource; In response to determining that there is a pre-recommended resource associated with the second user, feeding back the associated pre-recommended resource to the second user; In response to determining that there is no pre-recommended resource associated with the second user, a real-time recommendation task is generated, and the real-time recommended resource is obtained by calling the resource recommendation service to execute the real-time recommendation task, and the real-time recommended resource is fed back to the second user.
9. A resource recommendation device, comprising: A pre-recommendation task module, used to determine an estimated access time for the first user according to the historical access data of the first user, generate a pre-recommendation task according to the estimated access time, and write the association between the pre-recommendation task and the estimated access time into a distributed memory database; A pre-recommended resource module, configured to call the resource recommendation service to execute the pre-recommendation task to obtain the pre-recommended resource according to the real-time load data of the resource recommendation service, and store the association relationship between the first user and the pre-recommended resource; The resource recommendation module is used to make resource recommendations based on the association relationship between the first user and the pre-recommended resources.
10. The device according to claim 9, wherein: The pre-recommendation resource module includes a first pre-recommendation submodule, and the first pre-recommendation submodule includes: A first quantity unit, configured to determine a first quantity according to real-time load data of the resource recommendation service; A first task reading unit, configured to read the first number of pre-recommended tasks from the distributed memory database; A first resource unit, configured to, in response to determining, based on the estimated access time of the pre-recommended task, that the read pre-recommended task has not expired and the real-time load data meets the pre-recommendation requirement, call the resource recommendation service to execute the read pre-recommended task to obtain the pre-recommended resource; The queue storage unit is used to store each pre-recommended task read into a message queue in response to determining that the pre-recommended task read has not expired according to the estimated access time of the pre-recommended task and the real-time load data does not meet the pre-recommendation requirement.
11. The device according to claim 10, wherein: The pre-recommendation resource module includes a second pre-recommendation submodule, and the second pre-recommendation submodule includes: a second quantity unit, configured to determine a second quantity according to the real-time load data; A second task reading unit, configured to read the second number of pre-recommended tasks from the message queue; A second resource unit is configured to, in response to determining that the read pre-recommended task has not expired according to the estimated access time of the pre-recommended task and that the real-time load data meets the pre-recommendation requirement, call the resource recommendation service to execute the pre-recommended task read from the message queue to obtain the pre-recommended resource; The task discarding unit is used to discard each pre-recommended task read from the message queue in response to determining that the read pre-recommended task has not expired according to the estimated access time of the pre-recommended task and the real-time load data does not meet the pre-recommendation requirement.
12. The device according to claim 10, wherein: The first quantity unit is specifically used for: In response to determining that the real-time load data is less than a preset first load threshold and greater than a preset second load threshold, the first number is determined according to the real-time load data.
13. The device according to claim 11, wherein: The first quantity unit is specifically configured to determine the first quantity according to the real-time load data in response to determining that the real-time load data is less than a preset second load threshold; The second quantity unit is specifically used to determine the remaining load data according to the load data required to be consumed by the pre-recommended task of the first quantity threshold in response to determining that the first quantity reaches a preset first quantity threshold; and determine the second quantity according to the remaining load data.
14. The device according to claim 9, wherein: The pre-recommendation task module includes: A history acquisition submodule, used to acquire the historical access time, historical search terms and historical resources of the first user during the historical search process; A search mode submodule, used to determine the search mode of the first user in different time periods according to each of the historical access times and the type of time period to which each of the historical access times belongs; An interest submodule, configured to determine the first user's area of interest based on the historical search terms and the historical resources; The pre-recommendation task submodule is used to input the historical access time, the search mode and the field of interest into a pre-trained estimated access model to obtain the output estimated access time.
15. The device according to claim 14, further comprising a model updating module; The model updating module comprises: An actual access submodule, used to obtain the actual access time of the first user; A model updating submodule, used to determine the time difference between the actual access time and the estimated access time, and to perform feedback update on the estimated access model according to the time difference; Among them, the time difference is used to positively reward the estimated access model when the time difference is less than or equal to a preset time difference threshold; and negatively punish the estimated access model when the time difference is greater than the time difference threshold.
16. The device according to claim 9, wherein: The resource recommendation module is specifically used for: In response to receiving an actual access request from a second user, determining whether there is a pre-recommended resource associated with the second user based on an association relationship between the first user and the pre-recommended resource; In response to determining that there is a pre-recommended resource associated with the second user, feeding back the associated pre-recommended resource to the second user; In response to determining that there is no pre-recommended resource associated with the second user, a real-time recommendation task is generated, and the real-time recommended resource is obtained by calling the resource recommendation service to execute the real-time recommendation task, and the real-time recommended resource is fed back to the second user.
17. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
18. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-8.
19. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Resource recommendation method and device, electronic equipment and storage medium
CN116450901A
Method, device and storage medium for knowledge recommendation
WO2023272530A1