Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The course recommendation method provided in this embodiment can be applied to the application environment shown in fig. 1, in which the client communicates with the server via a network. Clients include, but are not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of a plurality of servers.
In an embodiment, as shown in fig. 2, a course recommending method is provided, which is described by taking the application of the method to the server side in fig. 1 as an example, and includes the following steps:
s10, generating course popularity data according to the course interaction data of the user;
s20, constructing a user-course heat matrix based on the course heat data;
s30, calculating a resource quota matrix according to the user-course heat matrix and the course interaction data;
s40, calculating a recommendation prediction matrix according to the user-course heat matrix and the resource quota matrix;
and S50, calculating a recommendation result according to the recommendation prediction matrix.
In this embodiment, the course interaction data of the user may refer to interaction information generated when the user utilizes the network learning resource, including but not limited to a learning duration of a certain course, comment data on the certain course, whether to collect the certain course, and whether to score the certain course. The source of course interaction data can be extensive, can come from a video teaching website, can come from a learning application, and can come from a live platform. In some cases, personal data of the user may be collected as course interaction data as actually needed, and the related personal data includes but is not limited to gender, age, occupation, and location information.
The course popularity data is used to characterize a particular user's preference for a particular course. The course interaction data can be processed by a preset mathematical method to reduce the complexity of the course interaction data. The preset mathematical method may be a discretization process. And then processing the course interaction data with reduced complexity according to a preset paradigm rule to generate course popularity data. In the preset paradigm rule, several user attributes (attributes closely related to personal data) and weights of course attributes are specified.
In all course interaction data, if the number of users is m and the number of courses is n, then m × n course popularity data can be generated, and an m × n matrix is formed, that is, the user-course popularity matrix. User-course heat matrix is represented by the letter R, then:
in the user-course popularity matrix, each row represents the popularity data of one user in each course, and each column represents the popularity data of different users in the same course.
The resource quota matrix is used for reflecting the recommendation relationship among the courses. The resource quota matrix can be generated according to actual needs based on the user-course heat matrix and by combining course interaction data. After the resource quota matrix is calculated, a recommendation prediction matrix may be generated based on the incidence of the resource quota matrix and the user-course heat matrix. The generated recommendation prediction matrix is an m x n matrix, each row represents the recommendation data of one user on each course, and each column represents the recommendation data of different users on the same course.
Whether the given course is a recommended course for the given user may be determined according to the size of the recommended data. The courses which are recommended to be high and have not been selected can be selected as recommended courses of the specified user. The recommendation result comprises a plurality of users and recommended courses corresponding to the users. One user may correspond to one or more recommended courses. In some special cases, the number of recommended courses for the user may be zero (e.g., the recommended data for the user at each course is below a specified value).
Optionally, as shown in fig. 3, step S10 includes:
s101, acquiring the course interaction data;
s102, processing the course interaction data according to a preset discretization method to generate discretization interaction data;
s103, processing the discretization interaction data according to a preset paradigm rule to generate the course popularity data.
In this embodiment, the course interaction data may be acquired from different sources, and then the course interaction data is processed by using a preset discretization method to generate discretization interaction data. For example, user U has learned a course C and can set the following rules:
1. if the learning time spent on C by U exceeds 10 minutes, the attribute t of the learning time is 1, otherwise, the attribute t of the learning time is 0;
2. if the U collects the C, the collection attribute C is assigned to be 1, otherwise, the collection attribute C is assigned to be 0;
3. if the U comments C, the comment attribute p is assigned to 1.5, and if not, the comment attribute p is 0;
4. if the score of U on C exceeds 50, the score attribute s is assigned to 1, otherwise, the score is 0.
Similarly, similar discretization processing can be adopted for other types of course interaction data.
The discretization interactive data is processed by a preset paradigm rule to obtain course popularity data. The course popularity data may reflect the user's preference for courses.
Optionally, the preset paradigm rule includes:
u is a user, C is a course, r is a course heat, t is a learning duration attribute of the course, C is a collection attribute of the course, p is a comment attribute of the course, s is a grading attribute of the course, α, β, gamma, delta and k are constant factors, and k is Max (α t + β C + gamma p + delta s).
In one embodiment, α ═ 3, β ═ 1, γ ═ 2, δ ═ 1, t, c, and s all take on the range of [0,1, and s]And p has a value range of [0,1.5 ]]Thus, k is 8. Thus, r can be ensuredUCIs taken to be [0,1 ]]. The preset paradigm rule can be adjusted according to actual requirements to obtain the optimized paradigm rule. These adjustments include, but are not limited to, adding parameters, deleting parameters, replacing parameters, modifying values of parameters, altering constant factors.
Optionally, the user-course heat matrix is an m × n matrix, m is the number of users, and n is the number of courses.
In this embodiment, if the number of users is m and the number of courses is n, then m × n pieces of course popularity data may be generated, and an m × n matrix is formed from the pieces of course popularity data, that is, the user-course popularity matrix. In the user-course popularity matrix, each row represents the popularity data of one user in each course, and each column represents the popularity data of different users in the same course.
Optionally, the resource quota matrix is an n × n matrix, and an element w of the n × n matrixijCalculated by the following formula:
wherein the element wijResource quota, k, assigned to course i for course jjNumber of comments for course j, klThe number of courses selected for user l, m the number of users, rilFor user l to course i's course popularity, rjlThe class hotness of the user l for the class j.
In this embodiment, it is assumed that a resource quota allocated to a course i exists for a course j. Where i and j may be equal. Element w in the resource quota matrixijCan be found from the above formula. Since the value of i is 1, 2, and 3 … … n, and the value of j is 1, 2, and 3 … … n, nxn resource quotas can be calculated, and an nxn order resource quota matrix is formed.
Optionally, the recommended prediction matrix is a product of the user-course heat matrix and the resource quota matrix.
In this embodiment, if the user-course heat matrix is represented by R, the resource quota matrix is represented by W, and the recommended prediction matrix is represented by Q, then:
Q=R×W。
wherein, R is an m multiplied by n matrix, W is an n multiplied by n matrix, and Q is an m multiplied by n matrix. Q has m rows, corresponding to m users, and each row has n elements, corresponding to the recommendation data of n courses.
Alternatively, as shown in fig. 4, step S50 includes:
s501, selecting a specified number of preferred recommended data from the recommended data belonging to the specified user in the recommended prediction matrix according to a preset processing rule;
and S502, determining the courses corresponding to the preferred recommended data as recommended courses.
In this embodiment, the recommendation data of a given user on a certain course is unique. The recommended data with a higher numerical value can be selected according to the sorting of the recommended data, and then the course corresponding to the selected recommended data is determined as the recommended course. Here, recommended courses refer to courses that the user has not learned (i.e., unselected courses). The preset processing rule is used for selecting the courses which are high in recommendation data and are not selected as the recommended courses of the specified user. Here, the specified number may be one or more. Thus, the recommended course most suitable for the user to learn can be determined.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment, a course recommending apparatus is provided, and the course recommending apparatus corresponds to the course recommending method in the above embodiment one to one. As shown in fig. 5, the course recommending apparatus includes a heatdata calculating module 10, a heatmatrix constructing module 20, aconfiguration matrix module 30, aprediction matrix module 40 and arecommendation result module 50. The functional modules are explained in detail as follows:
the hotdata calculating module 10 is used for generating course hot data according to the course interaction data of the user;
a popularitymatrix construction module 20 for constructing a user-course popularity matrix based on the course popularity data;
aconfiguration matrix module 30, configured to calculate a resource quota matrix according to the user-course heat matrix and the course interaction data;
aprediction matrix module 40, configured to calculate a recommended prediction matrix according to the user-course heat matrix and the resource quota matrix;
and arecommendation result module 50, configured to calculate a recommendation result according to the recommendation prediction matrix.
Optionally, the heatdata calculation module 10 includes:
the acquisition unit is used for acquiring the course interaction data;
the discrete unit is used for processing the course interaction data according to a preset discretization method to generate discretization interaction data;
and the paradigm processing unit is used for processing the discretization interactive data according to a preset paradigm rule and generating the course popularity data.
Optionally, the preset paradigm rule includes:
u is a user, C is a course, r is a course heat, t is a learning duration attribute of the course, C is a collection attribute of the course, p is a comment attribute of the course, s is a grading attribute of the course, α, β, gamma, delta and k are constant factors, and k is Max (α t + β C + gamma p + delta s).
Optionally, the user-course heat matrix is an m × n matrix, m is the number of users, and n is the number of courses.
Optionally, the resource quota matrix is an n × n matrix, and an element w of the n × n matrixijCalculated by the following formula:
wherein the element wijResource quota, k, assigned to course i for course jjNumber of comments for course j, klThe number of courses selected for user l, m the number of users, rilFor user l to course i's course popularity, rjlThe class hotness of the user l for the class j.
Optionally, the recommended prediction matrix is a product of the user-course heat matrix and the resource quota matrix.
Optionally, therecommendation module 50 includes:
the selecting unit is used for selecting a specified number of preferred recommended data from the recommended data belonging to the specified user in the recommended prediction matrix according to a preset processing rule;
and the course determining unit is used for determining the courses corresponding to the preferred recommended data as recommended courses.
For the specific definition of the course recommending apparatus, reference may be made to the above definition of the course recommending method, which is not described herein again. The modules of the course recommending apparatus can be implemented in whole or in part by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer readable instructions, and a database. The internal memory provides an environment for the operating system and execution of computer-readable instructions in the non-volatile storage medium. The database of the computer device is used for storing data related to the course recommendation method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer readable instructions, when executed by a processor, implement a course recommendation method. The readable storage media provided by the present embodiment include nonvolatile readable storage media and volatile readable storage media.
In one embodiment, a computer device is provided, comprising a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, the processor when executing the computer readable instructions implementing the steps of:
generating course popularity data according to the course interaction data of the user;
constructing a user-course heat matrix based on the course heat data;
calculating a resource quota matrix according to the user-course heat matrix and the course interaction data;
calculating a recommended prediction matrix according to the user-course heat matrix and the resource quota matrix;
and calculating a recommendation result according to the recommendation prediction matrix.
In one embodiment, one or more readable storage media storing computer-readable instructions are provided, the readable storage media provided by the embodiments including non-volatile readable storage media and volatile readable storage media. The readable storage medium has stored thereon computer readable instructions which, when executed by the processor, perform the steps of:
generating course popularity data according to the course interaction data of the user;
constructing a user-course heat matrix based on the course heat data;
calculating a resource quota matrix according to the user-course heat matrix and the course interaction data;
calculating a recommended prediction matrix according to the user-course heat matrix and the resource quota matrix;
and calculating a recommendation result according to the recommendation prediction matrix.
It will be understood by those of ordinary skill in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a non-volatile computer readable storage medium, and when executed, can include processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.