Word cloud generation method, device, electronic device and storage medium

By calculating the search history and time difference of the target user during the observation period, determining the weight of the search keyword, and generating a word cloud, the problem of insufficient accuracy of word clouds in the existing technology is solved, and the effect of reflecting the user's recent attention is achieved.

CN113868373BActive Publication Date: 2025-09-19CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111074473.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-14
Publication Date
2025-09-19
Estimated Expiration
2041-09-14

AI Technical Summary

Technical Problem

In the prior art, word cloud generation methods cannot accurately reflect the user's attention frequency, resulting in insufficient accuracy of the generated word cloud.

Method used

By obtaining the search records of the target users during the observation period, calculating the time difference between the search keywords and the end time of the observation period, determining the weight of the search keywords based on the time difference, and generating a word cloud.

Benefits of technology

The accuracy of the word cloud is improved so that the generated word cloud can reflect the user's recent attention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113868373B_ABST
    Figure CN113868373B_ABST
Patent Text Reader

Abstract

The present application provides a word cloud generation method, device, electronic device, and storage medium, relating to the field of Internet technology, and for improving the accuracy of word clouds. The method comprises: obtaining search records of a target user during an observation period, including search keywords and search times corresponding to the search keywords; for each search record, calculating the time difference between the observation end time of the observation period and the search time corresponding to the search keyword in the search record, and obtaining the weight of the search keyword based on the time difference corresponding to the same search keyword; wherein the weight of the search keyword is inversely proportional to the time difference; and obtaining the word cloud corresponding to the target user based on the weight of the target user's search keyword.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a word cloud generation method, device, electronic device and storage medium. Background Art

[0002] With the widespread use of social media, word clouds have become a key feature of major social media platforms, with more and more social media platforms using word clouds to display vocabulary. A word cloud visually highlights frequently appearing keywords in a text. This can be achieved by forming a cloud of keywords or rendering keywords, thereby filtering out large amounts of text information. Word cloud displays allow viewers to intuitively understand the key points of a particular type of information.

[0003] Currently, the commonly used method in the industry is to determine the corresponding weight of keyword words based on the frequency of attention of the words (words with high attention frequency have high weight), and then generate a word cloud according to the weight. The words with high weight in the word cloud have high visual prominence, and the words with low weight have low visual prominence.

[0004] However, currently the number of times a word appears is used as the frequency of attention of the word. However, the number of times a word appears may not accurately reflect the frequency of attention of the word due to certain user operations (such as repeated queries or other operations by a single user), thereby reducing the accuracy of the word cloud obtained based on the frequency of attention of the word. Summary of the Invention

[0005] The present application provides a word cloud generation method, device, electronic device and storage medium, which can make the generated word cloud reflect the user's recent attention and improve the accuracy of the word cloud.

[0006] In a first aspect, the present application provides a word cloud generation method, comprising: obtaining the search records of a target user during an observation period, the search records including search keywords and the search time corresponding to the search keywords; for each search record, calculating the time difference between the observation end time of the observation period and the search time corresponding to the search keyword in the search record, and obtaining the weight of the search keyword based on the time difference corresponding to the same search keyword; wherein the weight of the search keyword is inversely proportional to the time difference; and obtaining the word cloud corresponding to the target user based on the weight of the search keyword of the target user.

[0007] In other words, by obtaining the target user's search history during the observation period, the weight of the user's search keyword is determined based on the time difference between the user's search time and the end of the observation period. Then, a word cloud is generated based on the keyword weight. In this way, by assigning a higher weight to the search keywords with the most recent search time, the resulting word cloud can reflect the user's recent attention.

[0008] A possible design, the weight W of the search keyword a a Satisfies the following relationship:

[0009]

[0010] Where T1 is the search time included in the cth search record corresponding to search keyword a, c is in the range [1, m], m is the number of search records corresponding to search keyword a for the uth target user, m is a positive integer, T2 is the end time of the observation period, and T is the duration of the observation period; N is the total number of target users, p is 0 or 1, p = 1 indicates that search keyword a was used by the uth target user, u is in the range [1, N], and p = 0 indicates that search keyword a was not used by the uth target user. In this way, the weight value of the search keyword can be accurately calculated, thereby ensuring the accuracy of the generated word cloud.

[0011] One possible design involves obtaining the target user's search history during the observation period, including: obtaining the target user's initial search history, which includes the search keyword and the search time corresponding to the search keyword; filtering the target user's initial search history. If there are more than m initial search records corresponding to the same search keyword, then obtaining m search records with the same search keyword with the later search time. This prevents a single user from significantly influencing the keyword weight, which could lead to a certain bias in the generated word cloud reflecting the target user.

[0012] One possible design is to ensure that the time difference between consecutive searches for the same keyword by the same user in the target user's initial search history is greater than a preset value. This can prevent repeated invalid searches for the same keyword due to repeated user queries or network fluctuations, which would result in a higher weight for the search keyword and affect the accuracy of the word cloud.

[0013] In one possible design, the search keywords in the search records of the target user during the observation period are obtained, including: obtaining the uniform resource locator (URL) of the target user during the observation period; obtaining the search key sentences of the target user during the observation period based on the URL of the target user during the observation period; and extracting the search key sentences of the target user during the observation period to obtain the search keywords of the target user during the observation period.

[0014] In one possible design, target users include users who are located in the target area during the observation period and whose home location is the target area, and / or users who are located in the target area and whose visit location is the target area. The target area includes multiple cells, and these multiple cells are included in the pre-observation cells. This allows for selective selection of target users, increasing the diversity of the generated word cloud.

[0015] In a second aspect, the present application provides a word cloud generation device, which includes: a first acquisition unit, a calculation unit, and a second acquisition unit.

[0016] The first acquisition unit is configured to acquire a search record of a target user during an observation period, where the search record includes a search keyword and a search time corresponding to the search keyword.

[0017] A calculation unit is used to calculate the time difference between the observation deadline of the observation period and the search time corresponding to the search keyword in the search record, and obtain the weight of the search keyword according to the time difference corresponding to the same search keyword; wherein the weight of the search keyword is inversely proportional to the time difference.

[0018] The second acquisition unit is configured to acquire a word cloud corresponding to the target user according to the weight of the target user's search keyword.

[0019] In other words, by obtaining the target user's search history during the observation period, the weight of the user's search keyword is determined based on the time difference between the user's search time and the end of the observation period. Then, a word cloud is generated based on the keyword weight. In this way, by assigning a higher weight to the search keyword with the most recent search time, the resulting word cloud can reflect the user's recent attention.

[0020] It should be noted that the word cloud generation device provided in the second aspect is used to implement the word cloud generation method described in the above-mentioned first aspect or any one of its possible designs, and its specific implementation can refer to the specific implementation of the word cloud generation method described in the above-mentioned first aspect or any one of its possible designs.

[0021] In a third aspect, the present application provides an electronic device comprising: one or more processors, and a memory; the memory is coupled to the one or more processors; the memory is used to store computer program code, the computer program code comprising instructions, and when the one or more processors execute the instructions, the electronic device executes any one of the methods provided by the first aspect or any possible design thereof.

[0022] In a fourth aspect, the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on a computer, the computer executes any one of the methods provided by the first aspect or any possible design thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A flowchart of a word cloud generation method provided in an embodiment of the present application;

[0024] Figure 2A schematic diagram of a process for obtaining search keywords of a target user during an observation period provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of the structure of a word cloud generation device provided in an embodiment of the present application;

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

[0027] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions in the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0028] In addition, the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0029] The word cloud generation method and apparatus of the present invention can be set in various electronic devices that process text content, including but not limited to wearable devices, head-mounted devices, medical and health platforms, personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, personal digital assistants (PDAs), media players, etc.), multi-processor systems, consumer electronic devices, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like.

[0030] The embodiments of the present application will be described below in conjunction with the corresponding drawings.

[0031] like Figure 1 As shown, the embodiment of the present application provides a word cloud generation method which may include the following steps:

[0032] S101. The word cloud generating device obtains the search records of the target user during the observation period.

[0033] The observation period can be a preset time period, and the duration and end time of the observation period can be set as needed without restriction. For example, if a sports meet is held in a certain place for three days from July 1st to July 3rd, the observation period can be from June 30th, the day before the sports meet, to July 1st to July 3rd, the three days after the sports meet, for a total of four days of observation period, with the start time of the observation period being June 30th and the end time being July 3rd.

[0034] Optionally, the target user may be a user located in the target area during the observation period, the target area including multiple cells, and the multiple cells being included in the pre-observation cells. The target user may include a user located in the target area during the observation period and having the target area as their home location, and / or a user located in the target area and having the target area as their visiting location. That is, the target user may be a local population in the target area, and / or a non-local population in the target area. For example, the target area may be City A, and the target user may be a user located in City A during the observation period.

[0035] One possible implementation method is to determine which users are target users based on the cell ID of the user's service location and the location of the user's mobile phone number. For example, users in the target area can be filtered out based on the cell ID of the user's service location. Then, users in the target area can be filtered out based on the location of the user's mobile phone number, to select users whose location is in the target area and / or whose visiting location is in the target area.

[0036] The cell-ID determines the user's location by identifying the cell in the network that transmitted the call and translating the cell's location information into latitude and longitude. If the area indicated by the cell-ID where user A's call originated is the target area, user A is selected as the target user.

[0037] For example, when obtaining the search records of non-local residents in City A, we first obtain the information of all users whose cell-id of the business is in the area of ​​City A. The user information includes: the user's mobile phone number and the user's search records. Then, we determine the user's place of origin based on the user's mobile phone number, and then obtain the search records of non-local users in the area of ​​City A (that is, if the user's place of origin is not City A, the user will be regarded as a non-local user in the area of ​​City A).

[0038] The search record includes the search keyword and the search time corresponding to the search keyword. A target user may correspond to one or more search records.

[0039] The search keyword may refer to a keyword entered by a user when using a search engine that best summarizes the information the user is looking for. For example, the search keyword may be a search keyword such as "computer," "cooking," or "real estate."

[0040] In this application, the search keywords can be obtained in the following manner: first, the URL of the target user during the observation period is obtained; then, based on the URL of the target user during the observation period, the search key sentence of the target user during the observation period is obtained; finally, the search key sentence of the target user during the observation period is extracted to obtain the search keyword of the target user during the observation period.

[0041] It should be noted that the specific implementation method of obtaining the search keywords of the target users during the observation period can be found in Figure 2 As described in S201-S203, no further details will be given here.

[0042] For example, the search history of the target user may be shown in Table 1 below.

[0043] Table 1

[0044]

[0045]

[0046] It should be noted that Table 1 is merely an example to illustrate the search keywords included in the search records and the search times corresponding to the search keywords, and does not specifically limit the form and content of the corresponding relationship.

[0047] In addition, it should be noted that this application does not limit the ordering of the search keywords included in the search records and the search times corresponding to the search keywords.

[0048] Optionally, in actual applications, due to objective reasons of the user (for example, network lag or terminal device lag), the user may submit multiple identical search requests in a short period of time, resulting in the search keyword weight in the search request being too high, causing the generated word cloud to be unable to accurately reflect the frequency of keyword attention. In order to avoid the occurrence of this problem, the initial search records of the target user are screened, and the same search keywords of the same user are sorted in chronological order, and search records with a time interval less than a preset value and a later search time are removed, that is, invalid searches are removed, so that the time difference between adjacent search times corresponding to the same search keyword of the same user is greater than the preset value, that is, it is ensured that the time difference between adjacent search times corresponding to the same search keyword of the same user in the search record in S101 is greater than the preset value.

[0049] The preset value can be set as needed without limitation, for example, it can be set to 1 minute.

[0050] In this way, by removing the user's search records with a time interval of the same search keyword that is less than a preset value (for example, the preset value is 1 minute) and later, it is possible to avoid the user submitting multiple identical search requests in a short period of time due to objective reasons (for example, network or terminal device lag), avoid the search keyword weight in the search request being too high, and improve the accuracy of the generated word cloud.

[0051] For example, the initial search records of user C are shown in Table 2 below. Assuming that the preset value corresponding to the time interval is set to 1 minute, it can be seen from Table 2 that user C searched for the same search keyword "cooking" at 2020 / 9 / 2 / 13:12:36, 2020 / 9 / 2 / 13:12:45, and 2020 / 9 / 2 / 13:12:54. The search intervals for these three identical search keywords of user C are less than the preset value (1 minute). Therefore, the search keyword "cooking" included in user C's search record needs to be removed. Similarly, the search intervals for user C's search keyword "computer" are less than the preset value (1 minute). Therefore, the search keyword "computer" included in user C's search record needs to be removed.

[0052] Table 2

[0053] Target users Search keywords Search time (year / month / day / hour / minute / second) User C Cooking 2020 / 9 / 2 / 13:12:36 User C Cooking 2020 / 9 / 2 / 13:12:45 User C Cooking 2020 / 9 / 2 / 13:12:54 User C computer 2020 / 9 / 2 / 13:13:02 User C computer 2020 / 9 / 2 / 13:13:22 … … …

[0054] For example, after removing the search records of user C with the same search keyword whose time interval is less than a preset value (1 minute) and which are later, the results may be as shown in Table 3 below.

[0055] Table 3

[0056] Target users Search keywords Search time (year / month / day / hour / minute / second) User C Cooking 2020 / 9 / 2 / 13:12:36 User C computer 2020 / 9 / 2 / 13:13:02 … … …

[0057] It should be noted that Tables 2 and 3 are merely examples for illustrating the removal of search records with a time interval less than a preset value and later than the same search keyword of the same user, and do not constitute a specific limitation on the content.

[0058] S102. For each search record, the word cloud generating device calculates the time difference between the observation deadline of the observation period and the search time corresponding to the search keyword in the search record, and obtains the weight of the search keyword according to the time difference corresponding to the same search keyword.

[0059] It's important to note that the weight of a search keyword reflects the user's recent interest in the keyword. This means that the keyword not only reflects the user's interest in the keyword during the observation period, but also emphasizes the user's recent interest in the keyword during the observation period. A higher weight indicates a higher user interest in the keyword, while a lower weight indicates a lower user interest in the keyword.

[0060] In the embodiment of the present application, the weight of a search keyword is affected by the following two factors:

[0061] First, the number of times users search for the search keyword.

[0062] The weight of a search keyword is directly proportional to the number of times a user searches for that keyword. Without considering the search time of the keyword, the more times a user searches for the keyword during the observation period, the greater the weight of the keyword, and vice versa.

[0063] It should be noted that, in order to prevent a single user from having too great an influence on the weight of a keyword when calculating the weight of a search keyword, only m search records of a user for the search keyword during the observation period are considered, where m is a preset positive integer.

[0064] For example, if we want to calculate the weight of the search keyword "cooking," and m is set to 3, user A has four searches for "cooking" during the observation period, user B has two searches for "cooking," and user C has five searches. The total number of searches for this keyword by the user is 3 + 2 + 3 = 8. For a user who has searched more than three times, only the three searches with the latest search time are counted. For a user who has searched less than or equal to three times, all searches are counted.

[0065] Secondly, the time difference between the observation deadline of the observation period and the search time corresponding to the search keyword in the user's search history. Among them, the weight of the search keyword is inversely proportional to the time difference.

[0066] When the number of searches for the search keyword by the user is the same, if the search time of the user for the search keyword is closer to the end of the observation period, the weight of the search keyword is greater, otherwise, the weight of the search keyword is smaller.

[0067] For example, the observation period ends at 18:00 tonight, user A searches for the keyword "cooking" at 17:00 tonight, and user B searches for the keyword "cooking" at 16:00 tonight. At this time, user A's weight for the keyword "cooking" is less than user B's weight for the keyword "cooking".

[0068] Specifically, the weight W of the search keyword a a The following relationship is satisfied:

[0069]

[0070] Among them, T1 is the search time included in the cth search record corresponding to the search keyword a, the value of c is [1, m], m is the number of search records corresponding to the search keyword a of the uth target user, the value of m is a positive integer, T2 is the end time of the observation period, and T is the duration of the observation period; N is the total number of target users, the value of p is 0 or 1, p=1 indicates that the search keyword a is used by the uth target user, the value of u is [1, N], and p=0 indicates that the search keyword a is not used by the uth target user.

[0071] For example, suppose the user's search record for the keyword "cooking" is as shown in Table 1 above.

[0072] If the observation period ends at 2020 / 11 / 14 / 00:00:00, and the observation period is 5 days (i.e. 120 hours), the weight of the keyword "cooking" is

[0073] S103. The word cloud generating device obtains a word cloud corresponding to the target user according to the weight of the target user's search keyword.

[0074] Among them, "word cloud" is to visually highlight the "keywords" that appear frequently in online texts by forming a "keyword cloud layer" or "keyword rendering" (for example, highlighting methods such as font color or font size).

[0075] In this embodiment, different visual prominence is given to search keywords with different weights. If the weight of the search keyword is larger, the search keyword is visually highlighted more highly on the word cloud diagram (for example, the search keyword is given a more prominent font color, or a larger font, etc.); if the weight of the search keyword is smaller, the search keyword is visually highlighted less highly on the word cloud diagram (for example, the search keyword is given a smaller font, or an ordinary font color).

[0076] One possible implementation method is to obtain the word cloud corresponding to the target user according to the weight of the target user's search keyword through a computer programming language (python).

[0077] Specifically, the weight of the target user's search keywords can be used to generate a word cloud corresponding to the target user through the Python data visualization (wordcloud) module. This application will not go into details.

[0078] The solution provided by this application obtains the target user's search history during the observation period, then determines the weight of the user's search for the keyword based on the time difference between the user's search time and the observation period end time. Furthermore, a word cloud is generated based on the keyword weights. In this way, by assigning a higher weight to the search keywords with the most recent search time, the resulting word cloud can reflect the user's recent attention.

[0079] like Figure 2 As shown, the embodiment of the present application provides a method for obtaining search keywords of a target user during an observation period, the method comprising the following steps:

[0080] S201. Obtain the URL of the target user during the observation period.

[0081] Among them, URL is a method of indicating the location of information on the World Wide Web service program of the Internet.

[0082] Exemplarily, the URL may be in the form of: %baidu.com%wd=%&%.

[0083] Specifically, obtaining the URL of the target user during the observation period can be achieved through the following steps 1 to 4.

[0084] Step 1: Collect and obtain the user's access data from the core network device port. The access data includes: user mobile phone number, service occurrence time, URL, and cell-id where the service occurs.

[0085] Step 2: Filter out first access data based on the service occurrence time in the access data. The first access data is the access data whose service occurrence time in the access data is within the observation period.

[0086] Step 3: Screen the users in the first access data to obtain access data of target users during the observation period.

[0087] Optionally, the target user may be a user located in the target area during the observation period.

[0088] In a possible implementation, the target user can be determined by the cell-ID of the location where the user's business occurs and the location of the user's mobile phone number.

[0089] Optionally, the target user may be a user who is located in the target area during the observation period and whose home location is the target area, and / or a user who is located in the target area during the observation period and whose visiting location is the target area.

[0090] One possible implementation method is to determine the target user by the cell-ID of the location where the user's business occurs and the location of the user's mobile phone number.

[0091] It should be noted that the specific method for determining the target user can be found in the description of step S101, and this application will not go into details here.

[0092] Step 4: Obtain the URL of the target user during the observation period based on the target user's access data during the observation period.

[0093] S202: Obtain the target user's search keyword phrases during the observation period according to the target user's URL during the observation period.

[0094] The search keyword phrase refers to the search keyword entered by the user during the search. For example, the search keyword phrase may be "how to cook", "how many districts are there in City A", "how many prefecture-level cities are there in Province B", etc.

[0095] Optionally, S202 may be specifically implemented by following steps 5 to 6.

[0096] Step 5: Obtain the target user's URLs on mainstream search engines during the observation period. Mainstream search engines may include Baidu, Sogou, and 360.

[0097] One possible implementation method is to obtain the URL of the target user in the mainstream search engine during the observation period based on the URL symbol of the mainstream search engine contained in the URL.

[0098] For example, when a user searches through the Baidu search engine, the URL obtained may be %baidu.com%wd=%&%. When a user searches through the Sogou search engine, the URL obtained may be %sougou.com%query=%&%. When a user searches through the 360 ​​search engine, the URL obtained may be %so.com%q=%&%.

[0099] Step 6: Extract the target user's search keywords based on the target user's URL in mainstream search engines during the observation period.

[0100] One possible implementation method is to extract the content after the third % sign in the URL of the target user in the mainstream search engine during the observation period through the regular expression method to obtain the user's search keyword statement.

[0101] Among them, regular expression is a logical formula for string operation, which uses some pre-defined specific characters and the combination of these specific characters to form a "regular string". This "regular string" is used to express a filtering logic for the string.

[0102] Optionally, if the search keyword is encrypted by the front-end, the search keyword can be decoded using a decoding tool.

[0103] For example, the search keyword can be obtained by decoding using Python's URL decoding (urllib.parse.unquote).

[0104] Specifically, for the decoding process of the search keyword, reference may be made to the prior art, and this application will not elaborate on this.

[0105] S203: Extract the target user's search keywords during the observation period to obtain the target user's search keywords during the observation period.

[0106] The search keywords of the target users during the observation period can be obtained by segmenting the search key sentences of the target users during the observation period and removing stop words to obtain the search keywords.

[0107] For example, if the search keyword is "how to cook", after word segmentation and removing stop words, the search keyword obtained may be "cooking". If the search keyword is "when is the registration time for the C City Marathon", after word segmentation and removing stop words, the search keywords obtained may be "City", "Marathon", "registration time".

[0108] It should be noted that when segmenting a search keyword, the specific number of segmentation characters can be preset as needed, wherein the number of segmentation characters represents the maximum number of characters of the keyword segmented from the sentence.

[0109] For example, if the search keyword is "When is the registration time for the C City Marathon?", and the preset word segmentation character count is 5 characters, the resulting search keywords may be "C City Marathon" and "Registration Time." If the preset word segmentation character count is 4 characters, the resulting search keywords may be "C City" and "Marathon" and "Registration Time."

[0110] The above mainly introduces the solution provided by the present application from the perspective of the word cloud generation device. It can be understood that in order to realize the above functions, the device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the algorithm steps of each example described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0111] The present application can divide the functional modules of the device according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in this application is schematic and is only a logical functional division. In actual implementation, there may be other division methods.

[0112] Figure 3 A schematic diagram showing the composition of a word cloud generation device provided in an embodiment of the present application is shown. Figure 3 As shown, the word cloud generating device 30 includes: a first acquiring unit 301 , a calculating unit 302 and a second acquiring unit 303 .

[0113] The first acquisition unit 301 is used to acquire the search history of the target user during the observation period, and the search history includes the search keywords and the search time corresponding to the search keywords. For example, the first acquisition unit 301 can be used to execute Figure 1 S101 shown in FIG.

[0114] The calculation unit 302 is used to calculate the time difference between the observation end time of the observation period and the search time corresponding to the search keyword in the search record, and obtain the weight of the search keyword according to the time difference corresponding to the same search keyword; wherein the weight of the search keyword is inversely proportional to the time difference. For example, the calculation unit 302 can be used to perform Figure 1 S102 shown in FIG.

[0115] The second acquisition unit 303 is used to acquire the word cloud corresponding to the target user according to the weight of the target user's search keyword. For example, the second acquisition unit 303 can be used to perform Figure 1 S103 shown in FIG.

[0116] Optionally, search for the weight W of keyword a a The following relationship is satisfied:

[0117]

[0118] Among them, T1 is the search time included in the cth search record corresponding to the search keyword a, the value of c is [1, m], m is the number of search records corresponding to the search keyword a of the uth target user, the value of m is a positive integer, T2 is the end time of the observation period, and T is the duration of the observation period; N is the total number of target users, the value of P is 0 or 1, p=1 indicates that the search keyword a is used by the uth target user, the value of u is [1, N], and p=0 indicates that the search keyword a is not used by the uth target user.

[0119] Optionally, the first acquisition unit 301 is specifically used to: obtain the initial search record of the target user, wherein the initial search record includes the search keyword and the search time corresponding to the search keyword; filter the initial search record of the target user, if the number of initial search records corresponding to the same search keyword is greater than m, then obtain m search records with the same search keyword and the search time later.

[0120] Optionally, in the initial search record of the target user, the time difference between adjacent search times corresponding to the same search keyword of the same user is greater than a preset value.

[0121] Optionally, the first acquisition unit 301 is further specifically configured to: acquire the target user's uniform resource locator URL; acquire the target user's search keyword according to the target user's URL; and extract the search keyword to acquire the target user's search keyword. Figure 2 S201-S203 shown in FIG.

[0122] in, Figure 3 The units in can also be called modules, for example, the computing units can be called computing modules. Figure 3 In the illustrated embodiment, the names of the various units may not be the names shown in the figure. For example, the computing unit may also be called a processing unit.

[0123] The present application also provides a schematic diagram of an electronic device, such as Figure 4As shown, the electronic device 40 includes a processor 401. Optionally, the device 40 further includes a memory 402 and a transceiver 403 connected to the processor 401. The processor 401, the memory 402 and the transceiver 403 are connected via a bus 404.

[0124] Processor 401 may be a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor may also be any other device having a processing function, such as a circuit, a device, or a software module. Processor 401 may also include multiple CPUs, and processor 401 may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, or processing cores for processing data (such as computer program instructions).

[0125] The memory 402 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer, and the present embodiment of the application does not impose any restrictions on this. The memory 402 may exist independently or be integrated with the processor 401. Among them, the memory 402 may contain computer program code. The processor 401 is used to execute the computer program code stored in the memory 402, thereby implementing the method provided in the embodiment of the present application.

[0126] The transceiver 403 can be used to communicate with other devices or communication networks such as Ethernet, RAN, wireless local area networks (WLAN), etc.

[0127] The bus 404 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 404 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0128] Figure 3 If the various units in the embodiment are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The storage medium for storing computer software products includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0129] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer-executable instructions. When the computer-executable instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer-executable instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer-executable instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0130] An embodiment of the present application further provides a computer-readable storage medium, comprising computer-executable instructions, which, when executed on a computer, enable the computer to execute any of the above methods.

[0131] An embodiment of the present application further provides a computer program product comprising computer-executable instructions, which, when executed on a computer, enables the computer to execute any of the above methods.

[0132] An embodiment of the present application also provides a chip, including: a processor and an interface, the processor is coupled to a memory through the interface, and when the processor executes a computer program or computer execution instruction in the memory, any one of the methods provided in the above embodiments is executed.

[0133] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer-executable instructions. When the computer-executable instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer-executable instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer-executable instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0134] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0135] Although the present application has been described with reference to specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely illustrative of the present application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, the present application is intended to include such modifications and variations as fall within the scope of the claims of the present application and their equivalents.

Claims

1. A word cloud generation method, characterized in that: The method comprises: Obtaining search records of a target user during an observation period, the search records including search keywords and search times corresponding to the search keywords; wherein the time difference between adjacent search times corresponding to the same search keyword by the same user in the search records of the target user is greater than a preset value; For each search record, calculate the time difference between the observation end time of the observation period and the search time corresponding to the search keyword in the search record, and obtain the weight of the search keyword based on the time difference corresponding to the same search keyword; Obtaining a word cloud corresponding to the target user according to the weight of the target user's search keyword; Among them, the weight W of the search keyword a a The following relationship is satisfied: Among them, T1 is the search time included in the cth search record corresponding to the search keyword a, the value of c is [1, m], m is the number of search records corresponding to the search keyword a of the uth target user, the value of m is a positive integer, T2 is the end time of the observation period, and T is the duration of the observation period; N is the total number of target users, the value of p is 0 or 1, p=1 indicates that the search keyword a is used by the uth target user, the value of u is [1, N], and p=0 indicates that the search keyword a is not used by the uth target user.

2. The method according to claim 1, characterized in that The acquisition of the target user's search history during the observation period includes: Obtaining the target user's initial search record, wherein the initial search record includes a search keyword and a search time corresponding to the search keyword; The initial search records of the target user are screened. If there are more than m initial search records corresponding to the same search keyword, then m search records with a later search time for the same search keyword are obtained.

3. The method according to claim 1, characterized in that The step of obtaining search keywords from the target user's search history during the observation period includes: Obtaining the uniform resource locator URL of the target user during the observation period; Obtaining a search keyword statement of the target user during the observation period according to the URL of the target user during the observation period; The target user's search key sentences during the observation period are extracted to obtain the target user's search keywords during the observation period.

4. The method according to claim 1, wherein The target users include users who are located in the target area during the observation period and whose home location is the target area, and / or users who are located in the target area and whose visiting location is the target area; wherein the target area includes multiple cells, and the multiple cells are included in the pre-observation cells.

5. A word cloud generating device, characterized in that: The device comprises: a first acquiring unit configured to acquire search records of a target user during an observation period, the search records including search keywords and search times corresponding to the search keywords, wherein a time difference between adjacent search times corresponding to the same search keyword of the same user in the search records of the target user is greater than a preset value; a calculation unit, configured to calculate a time difference between an observation deadline of the observation period and a search time corresponding to a search keyword in the search record, and obtain a weight of the search keyword according to the time difference corresponding to the same search keyword; A second acquiring unit is configured to acquire a word cloud corresponding to the target user according to the weight of the search keyword of the target user; The weight W of the search keyword a a The following relationship is satisfied: Among them, T1 is the search time included in the cth search record corresponding to the search keyword a, the value of c is [1, m], m is the number of search records corresponding to the search keyword a of the uth target user, the value of m is a positive integer, T2 is the end time of the observation period, and T is the duration of the observation period; N is the total number of target users, the value of p is 0 or 1, p=1 indicates that the search keyword a is used by the uth target user, the value of u is [1, N], and p=0 indicates that the search keyword a is not used by the uth target user.

6. The device according to claim 5, characterized in that The first acquiring unit is specifically configured to: Obtaining the target user's initial search record, wherein the initial search record includes a search keyword and a search time corresponding to the search keyword; The initial search records of the target user are screened. If there are more than m initial search records corresponding to the same search keyword, then m search records with a later search time for the same search keyword are obtained.

7. The device according to claim 5, characterized in that The first acquiring unit is further specifically configured to: Obtain the uniform resource locator URL of the target user; Obtaining a search keyword statement of the target user according to the URL of the target user; The search key phrases are extracted to obtain the search keywords of the target user.

8. The device according to claim 5, characterized in that The target users include users who are located in the target area during the observation period and whose home location is the target area, and / or users who are located in the target area and whose visiting location is the target area; wherein the target area includes multiple cells, and the multiple cells are included in the pre-observation cells.

9. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors; the memory is used to store computer program code, the computer program code includes instructions, and when the one or more processors execute the instructions, the electronic device executes the method according to any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes computer instructions, and when the computer instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Text library keyword refining method based on historical time characteristics

    CN111046141A

  • Public opinion analysis method and device

    CN112214673A