Disclosure of Invention
In view of the above, the present application provides a method, an apparatus, and a computer-readable storage medium for collecting home user behavior data based on a smart television, which solve or at least partially solve the above existing problems.
In order to solve the technical problems, the technical scheme provided by the invention is a family user behavior data acquisition method based on an intelligent television, which comprises the following steps:
judging whether user behavior data of the smart television are received or not, if so, generating a current user behavior log, and entering the next step, and if not, not acting;
acquiring online equipment data of a home network where the smart television is located, generating a current online equipment log, and preprocessing the current online equipment log;
and generating and storing the family user behavior log data according to the current user behavior log and the preprocessed current online device log.
Preferably, the method for acquiring online device data of a home network in which the smart television is located and generating a current online device log includes:
reading an arp table of network equipment of a home network where the smart television is located, and generating a current online equipment log; the current online equipment log comprises log time, an intelligent television mac, online equipment mac and online equipment ip;
filtering the current online device log which is not required to be saved.
Preferably, the method for filtering the current online device log which is not required to be saved comprises the following steps:
acquiring a device mac set of the log to be filtered, and filtering the current online device log of which the online device mac in the current online device log is the same as the device mac in the device mac set of the log to be filtered;
filtering the online equipment mac in the current online equipment log to obtain the current online equipment log of the intelligent television mac;
current online device logs with an online device ip suffix of.1 and.255 in the current online device log are filtered.
Preferably, the method for preprocessing the current online device log comprises the following steps:
determining the equipment type corresponding to the online equipment mac in the current online equipment log, and updating the current online equipment log to include log time, the intelligent television mac, the online equipment mac and the equipment type;
and screening out the current online equipment log to be analyzed according to a preset log screening condition, traversing the current online equipment log to be analyzed, and updating a current online equipment mac list.
Preferably, the method for determining the device type corresponding to the online device mac in the current online device log includes:
acquiring a device type list corresponding to a device mac;
inquiring and obtaining the equipment type corresponding to the online equipment mac in the current online equipment log in the equipment type list corresponding to the equipment mac;
if the device type list corresponding to the device mac cannot be queried, querying the device type corresponding to the online device mac through other online modes, and updating the online device mac and the queried corresponding device type into the device type list corresponding to the device mac.
Preferably, the method for generating the current user behavior log comprises the following steps:
receiving user behavior data of the intelligent television and generating a current user behavior log; the current user behavior log comprises log time, the intelligent television mac and user behavior data.
Preferably, the method for generating and storing the home user behavior log data according to the current user behavior log and the preprocessed current online device log comprises:
acquiring a current user behavior log and a current online equipment mac list, generating and storing home user behavior log data; the family user behavior log data comprises log time, a smart television mac, user behavior data and a current online equipment mac list.
Preferably, the collecting method further comprises:
and judging whether the stored family user behavior log data reach a preset uploading condition, if so, uploading the stored family user behavior log data, and if not, performing the action.
The invention also provides a family user behavior data acquisition device based on the smart television, which comprises:
the user behavior data processing module is used for judging whether user behavior data of the intelligent television are received or not, if so, generating a current user behavior log and entering the online equipment data processing module, and if not, not acting;
the online equipment data processing module is used for acquiring online equipment data of a home network where the intelligent television is located, generating a current online equipment log and preprocessing the current online equipment log;
and the family log data generation module is used for generating and storing family user behavior log data according to the current user behavior log and the preprocessed current online device log.
Preferably, the online device data processing module includes:
the online equipment data acquisition unit is used for reading an ARP table of network equipment of a home network where the intelligent television is located and generating a current online equipment log; the current online equipment log comprises log time, an intelligent television mac, online equipment mac and online equipment ip;
and the online equipment data filtering unit is used for filtering the current online equipment log which does not need to be stored.
Preferably, the online device data filtering unit includes:
the first log filtering component is used for acquiring a to-be-filtered log equipment mac set and filtering a current online equipment log of which the online equipment mac in the current online equipment log is the same as the equipment mac in the to-be-filtered log equipment mac set;
the second log filtering component is used for filtering the current online equipment mac of the intelligent television mac from the current online equipment logs;
and the third log filtering component is used for filtering the current online device logs with the online device ip suffixes of 1 and 255 in the current online device log.
Preferably, the online device data processing module further comprises:
the online equipment type identification unit is used for determining the equipment type corresponding to the online equipment mac in the current online equipment log and updating the current online equipment log to include log time, the intelligent television mac, the online equipment mac and the equipment type;
and the online equipment log screening unit is used for screening the current online equipment log to be analyzed according to the preset log screening conditions, traversing the current online equipment log to be analyzed and updating the current online equipment mac list.
Preferably, the online device type identifying unit includes:
the equipment type acquisition component is used for acquiring an equipment type list corresponding to the equipment mac;
the equipment type query component is used for querying and obtaining the equipment type corresponding to the online equipment mac in the current online equipment log in the equipment type list corresponding to the equipment mac;
and the equipment type updating component is used for querying the equipment type corresponding to the online equipment mac in other online modes when the equipment type corresponding to the equipment mac cannot be queried in the equipment type list corresponding to the equipment mac, and updating the online equipment mac and the queried corresponding equipment type into the equipment type list corresponding to the equipment mac.
Preferably, the user behavior data processing module includes:
the user behavior data processing unit is used for receiving user behavior data of the intelligent television and generating a current user behavior log; the current user behavior log comprises log time, the intelligent television mac and user behavior data.
Preferably, the family log data generating module includes:
the family log data generation unit is used for acquiring a current user behavior log and a current online equipment mac list, generating and storing family user behavior log data; the family user behavior log data comprises log time, a smart television mac, user behavior data and a current online equipment mac list.
Preferably, the collecting device further comprises:
and the family log data uploading module is used for judging whether the stored family user behavior log data reach a preset uploading condition, if so, uploading the stored family user behavior log data, and if not, performing the action.
The invention also provides a family user behavior data acquisition device based on the smart television, which comprises:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the steps of the intelligent television-based home user behavior data acquisition method.
A computer-readable storage medium, which stores a computer program, which, when executed by a processor, implements the steps of the smart tv-based home user behavior data collection method described above.
Compared with the prior art, the beneficial effects of the method are detailed as follows: according to the method for acquiring the family user behavior data based on the smart television, the online equipment data of the family network where the smart television is located is acquired while the user behavior data of the smart television is acquired, and the acquired data is processed to generate the family user behavior log data to be used by the cloud server. The generated family user behavior log data can be used for building family figures of users and recommending personalized programs for different family users, so that the user experience is improved, and the personalized recommendation requirements of the users on the smart television are further met.
Detailed Description
In order to make the technical solutions of the present invention better understood by those skilled in the art, the present invention will be further described in detail with reference to the accompanying drawings and specific embodiments.
As shown in fig. 1, an embodiment of the present invention provides a method for acquiring home user behavior data based on a smart television, including:
s1: judging whether user behavior data of the intelligent television are received, if so, entering S21 and entering S22, and if not, not acting;
s21: generating a current user behavior log;
s22: acquiring online equipment data of a home network where the smart television is located, generating a current online equipment log, and entering S23;
s23: preprocessing a current online device log;
s3: and generating and storing the family user behavior log data according to the current user behavior log and the preprocessed current online device log.
It should be noted that, in step S22, the method for obtaining the online device data of the home network where the smart television is located and generating the current online device log includes:
s221: reading an ARP table of network equipment of a home network where the intelligent television is located, and generating a current online equipment log; the current online equipment log comprises log time, an intelligent television mac, online equipment mac and online equipment ip;
s222: filtering the current online device log which is not required to be saved.
Specifically, the method for filtering the current online device log that does not need to be saved in step S222 includes:
s2221: acquiring a device mac set of the log to be filtered, and filtering the current online device log of which the online device mac in the current online device log is the same as the device mac in the device mac set of the log to be filtered;
s2222: filtering the online equipment mac in the current online equipment log to obtain the current online equipment log of the intelligent television mac;
s2223: current online device logs with an online device ip suffix of.1 and.255 in the current online device log are filtered.
The method for acquiring the mac set of the log device to be filtered in step S2221 may include: (1) acquiring the mac of the intelligent television, and monitoring the networking broadcast of the intelligent television; (2) and acquiring an export _ device _ temp of a to-be-filtered log device mac set of a certain smart television through an API (application programming interface) provided by the smart television mac to a cloud server device _ server. (3) If the excerpt _ device _ temp is not successfully acquired, the existing excerpt _ device of the smart television is used, and if the acquisition is successful, the original excerpt _ device is replaced by the value of the excerpt _ device _ temp. The network device may be a router, a switch, or other network devices.
Specifically, when the user does not operate the smart television, the smart television may also obtain current arp information through a local arp table every certain time (for example, 3 minutes), and generate a current online device log, where the current online device log is < log time, television mac, device ip >.
And after filtering out the current online device log corresponding to the device mac to be filtered, if the current online device log device _ log to be uploaded still exists, performing the next step, otherwise, waiting for the next data collection. The next step consists in filtering the smart tv's own mac and the current online device logs with ip suffix xxx.1 (gateway) and xxx.255 (broadcast).
It should be noted that, the method for preprocessing the current online device log in step S23 includes:
s231: determining the equipment type corresponding to the online equipment mac in the current online equipment log, and updating the current online equipment log to include log time, the intelligent television mac, the online equipment mac and the equipment type;
s232: and screening out the current online equipment log to be analyzed according to a preset log screening condition, traversing the current online equipment log to be analyzed, and updating a current online equipment mac list.
Specifically, the method for determining the device type corresponding to the online device mac in the current online device log in step S231 includes:
s2311: acquiring a device type list corresponding to a device mac;
s2312: inquiring and obtaining the equipment type corresponding to the online equipment mac in the current online equipment log in the equipment type list corresponding to the equipment mac;
s2313: if the device type list corresponding to the device mac cannot be queried, querying the device type corresponding to the online device mac through other online modes, and updating the online device mac and the queried corresponding device type into the device type list corresponding to the device mac.
In the method for obtaining the device type list corresponding to the device mac in step S2311, the cloud server may be connected, and the device _ server of the cloud server is used to store the smart television, the device mac in the home network environment where the smart television is located, and the corresponding device type, where the storage format is < television mac, device type >, and the device type list corresponding to the device mac may also be obtained by reading the device type list corresponding to the device mac stored locally.
In step S2313, the device type corresponding to the online device mac is queried in other online manners, which may be implemented by the third party api. After the query is finished, the online equipment mac and the queried corresponding equipment type need to be updated to an equipment type list corresponding to the equipment mac, and the online equipment mac and the queried corresponding equipment type can be updated through local update or uploaded to a cloud server for updating.
Specifically, the method for preprocessing the current online device log in step S23 may further include:
s233: the current online device log of anomalous or missing fields is filtered out. The current online device log is pre-processed to generate log _ clear.
Specifically, in step S232, the method for screening out the current online device log to be analyzed according to the preset log screening condition may filter out the log _ phone whose device type in the current online device is the mobile phone, and the storage format is < log time, television mac, device type, online duration >. Wherein the online time duration is the acquisition interval time.
Specifically, the method for traversing the current online device log to be analyzed and updating the mac list of the current online device in step S232 includes: (1) sequentially traversing the log set of each equipment mac, (2) accumulating the online time of the mac with 30 minutes as a period, (3) if a certain period exceeds 30 minutes, comparing whether the previous 30 minutes or the next 30 minutes exceeds 30 minutes, and if not, adding the redundant part to the relative period.
It should be noted that, the method for generating the current user behavior log in step S21 includes:
receiving user behavior data of the intelligent television and generating a current user behavior log; the current user behavior log comprises log time, the intelligent television mac and user behavior data.
It should be noted that, in step S3, the method for generating and storing the home user behavior log data according to the current user behavior log and the preprocessed current online device log includes:
acquiring a current user behavior log and a current online equipment mac list, generating and storing home user behavior log data; the family user behavior log data comprises log time, a smart television mac, user behavior data and a current online equipment mac list.
The current online device mac list may be an online device mac list whose device type is a mobile phone. The user behavior data includes: movie clicking, playing (including duration), collection, etc.
As shown in fig. 2, a second embodiment of the present invention further provides a method for acquiring home user behavior data based on a smart television, where on the basis of the first embodiment, the acquisition method further includes:
s4: judging whether the stored family user behavior log data reach a preset uploading condition, if so, entering S5, and if not, not acting;
s5: and uploading the stored family user behavior log data.
Specifically, the condition for uploading the behavior log of the home user to the cloud server may be: (1) monitoring whether the size of the file exceeds 1M or not, and if so, uploading the file; (2) log files were uploaded periodically (every 1 minute).
The method for receiving and cleaning the log by the cloud server comprises the following steps: (1) the method comprises the steps that (1) a log server receives logs, (2) data are cleaned, wherein the data comprise data missing or data with an abnormal format, and (3) if the same film has a playing event, a corresponding click event is removed.
As shown in fig. 3, a third embodiment of the present invention provides a home user behavior data acquisition device based on a smart television, including:
the user behavior data processing module is used for judging whether user behavior data of the intelligent television are received or not, if so, generating a current user behavior log and entering the online equipment data processing module, and if not, not acting;
the online equipment data processing module is used for acquiring online equipment data of a home network where the intelligent television is located, generating a current online equipment log and preprocessing the current online equipment log;
and the family log data generation module is used for generating and storing family user behavior log data according to the current user behavior log and the preprocessed current online device log.
It should be noted that the online device data processing module includes:
the online equipment data acquisition unit is used for reading an ARP table of network equipment of a home network where the intelligent television is located and generating a current online equipment log; the current online equipment log comprises log time, an intelligent television mac, online equipment mac and online equipment ip;
and the online equipment data filtering unit is used for filtering the current online equipment log which does not need to be stored.
Wherein, online equipment data filter unit includes:
the first log filtering component is used for acquiring a to-be-filtered log equipment mac set and filtering a current online equipment log of which the online equipment mac in the current online equipment log is the same as the equipment mac in the to-be-filtered log equipment mac set;
the second log filtering component is used for filtering the current online equipment mac of the intelligent television mac from the current online equipment logs;
and the third log filtering component is used for filtering the current online device logs with the online device ip suffixes of 1 and 255 in the current online device log.
Specifically, the online device data processing module further includes:
the online equipment type identification unit is used for determining the equipment type corresponding to the online equipment mac in the current online equipment log and updating the current online equipment log to include log time, the intelligent television mac, the online equipment mac and the equipment type;
and the online equipment log screening unit is used for screening the current online equipment log to be analyzed according to the preset log screening conditions, traversing the current online equipment log to be analyzed and updating the current online equipment mac list.
Wherein, the online device type identification unit includes:
the equipment type acquisition component is used for acquiring an equipment type list corresponding to the equipment mac;
the equipment type query component is used for querying and obtaining the equipment type corresponding to the online equipment mac in the current online equipment log in the equipment type list corresponding to the equipment mac;
and the equipment type updating component is used for querying the equipment type corresponding to the online equipment mac in other online modes when the equipment type corresponding to the equipment mac cannot be queried in the equipment type list corresponding to the equipment mac, and updating the online equipment mac and the queried corresponding equipment type into the equipment type list corresponding to the equipment mac.
It should be noted that the user behavior data processing module includes:
the user behavior data processing unit is used for receiving user behavior data of the intelligent television and generating a current user behavior log; the current user behavior log comprises log time, the intelligent television mac and user behavior data.
It should be noted that the family log data generation module includes:
the family log data generation unit is used for acquiring a current user behavior log and a current online equipment mac list, generating and storing family user behavior log data; the family user behavior log data comprises log time, a smart television mac, user behavior data and a current online equipment mac list.
As shown in fig. 4, a fourth embodiment of the present invention further provides a device for acquiring home user behavior data based on a smart television, where on the basis of the third embodiment, the acquiring device further includes:
and the family log data uploading module is used for judging whether the stored family user behavior log data reach a preset uploading condition, if so, uploading the stored family user behavior log data, and if not, performing the action.
For the description of the features in the embodiments corresponding to fig. 3 and fig. 4, reference may be made to the related description of the embodiments corresponding to fig. 1 and fig. 2, which is not repeated here.
An embodiment of the present invention further provides a device for collecting data of home user behavior based on a smart television, including:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the steps of the intelligent television-based home user behavior data acquisition method.
The sixth embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the method for acquiring the behavior data of the home user based on the smart television are implemented.
The invention principle of the invention is as follows: ordinary families all use a router to current smart machine all can be networked. The method comprises the steps that device information in the current network is obtained by reading a local arp table, the device information is combined with the obtained operation information of a user on the smart television and then the processed operation information is reported to a big data center (cloud server) in a timing/quantitative mode, the big data center analyzes and mines the using behaviors of other devices in the home network of the user, the running conditions of the number of smart devices (mobile phones, computers, pads, sound boxes and the like) in the network, the member number of the home users in different periods, the members using the devices and the running conditions of the home smart devices to construct a home user portrait.
The method, the device and the computer-readable storage medium for acquiring the family user behavior data based on the smart television provided by the embodiment of the invention are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.