Information acquisition method, device, electronic device and storage medium
By determining the weight value according to the number of information collection times during the information collection process, and performing collection based on the weight value and the preset number of information collections, the problem of resource waste in the existing technology is solved and the utilization rate of information collection resources is improved.
Patent Information
- Application Number
- CN202210205293.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-02
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-03-02
AI Technical Summary
The existing technology wastes resources in the information collection process, resulting in low utilization of collection resources, mainly because it only collects words with high word frequency in the corpus and fails to effectively utilize other information.
By obtaining the number of collections of information collected within a preset period, determine the weight value of each information, and obtain and collect more relevant data from the information set based on the weight value and the preset number of information collections to ensure that within limited resources Properly allocate collection resources.
It realizes the ability to collect more relevant data when the collection resources are fixed, improves the utilization rate of information collection resources, and avoids waste of resources.
Smart Images

Figure CN114637601B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to an information acquisition method, device, electronic device and storage medium. Background Art
[0002] With the continuous development of the times, the Internet has become a huge information center. Many institutions, groups and even individuals have established various types of web pages on the Internet. The content is all-encompassing, and the accumulated information capacity is growing exponentially. Collecting information from the Internet is not only an important way for people to acquire knowledge, but also the main method and means for portal web pages to collect news, industry information and competitive information.
[0003] However, the growth rate of online data has far exceeded the development rate of hardware. How to reasonably use existing resources to collect more data is a project that is constantly explored. In related technologies, each piece of data in the corpus is segmented, the frequency of each word is counted, and then the word frequencies are sorted from high to low. The words with high frequency are collected multiple times, and the words with low frequency are collected in small quantities. However, the method of determining the collection words based only on the words with high frequency in the corpus is too one-sided, so the information collected by the determined collection words may not be necessary information, resulting in a waste of collection resources. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide an information acquisition method, device, electronic device and storage medium to solve the problem of waste of collection resources when collecting collection words in the related art, so as to improve the effective utilization of resources.
[0005] In a first aspect, an embodiment of the present application provides an information acquisition method, comprising:
[0006] Obtaining the number of times each first information in an information set that has been collected within a preset time period is collected, where the first information is any information in the information set;
[0007] Determining a weight value of each of the first information according to the number of collection times;
[0008] Acquire at least one second information from the information set according to a weight value of each first information and a preset number of information collections;
[0009] Determine a target collection number of each second information according to a weight value corresponding to each second information;
[0010] Information collection is performed according to each of the second information and the determined target collection times for each of the second information.
[0011] In a second aspect, an embodiment of the present application provides an information acquisition device, including:
[0012] An acquisition module, used to acquire the number of times each first information in the information set collected within a preset time period is collected;
[0013] A first determination module, used to determine a weight value of each first information according to the number of collection times;
[0014] A second determining module, configured to obtain at least one second information from the information set according to a weight value of each of the first information and a preset number of information collections;
[0015] A third determination module, configured to determine a target collection number of each second information according to a weight value corresponding to each second information;
[0016] A collection module is used to collect information according to each of the second information and the determined target collection times for each of the second information.
[0017] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0018] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0019] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0020] It can be seen that in the embodiment of the present application, by obtaining the number of collections of each first information in the information set that has been collected within a preset time period, the first information is any information in the information set, and the weight value of each first information is determined according to the number of collections, and then according to the weight value of each first information and the preset number of information collections, at least one second information is obtained from the information set, and the target number of collections of each second information is determined according to the weight value corresponding to each second information, and information collection is performed according to each second information and the determined target number of collections of each second information. Since the weight value of the first information is determined by the number of collections of the collected first information, the weight value can reflect the historical collection situation of the collected first information, so that when the second information is determined by the weight value and the preset number of information collections, it can be ensured that when the determined second information and the corresponding target number of collections are used for information collection, relevant information can be searched, and when the collection resources are fixed, that is, when the number of information collections is fixed, the collection resources can be reasonably allocated, and more relevant data can be collected within limited collection resources, thereby avoiding the waste of collection resources and improving the utilization rate of collection resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0022] Figure 1 This is a flow chart of the information acquisition method in the embodiment of the present application;
[0023] Figure 2 This is a flow chart of another information acquisition method in an embodiment of the present application;
[0024] Figure 3 This is a schematic diagram of the module composition of the information acquisition device in the embodiment of the present application;
[0025] Figure 4 Schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0027] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.
[0028] In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the previously and subsequently associated objects are in an "or" relationship.
[0029] In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0030] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0031] Specifically, in the related art, in the process of collecting network data, in order not to miss any relevant information, the collected information is used to search regularly according to the preset time interval to obtain all relevant information. In the specific implementation method, when collecting the collected words, each data in the corpus is usually segmented, the word frequency of each word is counted, and then the word frequency is sorted from high to low, and the collected words with high word frequency are collected multiple times, and the collected words with low word frequency are collected in small quantities. It should be noted that the corpus is a corpus set constructed in advance according to the corresponding application scenario; the word frequency is to segment each data in the corpus and count the number of times each word appears (one time is counted as one time in one data, multiple times are still counted as one time, and no appearance is not counted); however, the method of determining the collected words based only on the words with high word frequency in the corpus as the collected words is too one-sided, so the information collected by the determined collected words may not be necessary information, which reduces the utilization rate of the collected resources.
[0032] In response to this, the embodiment of the present application obtains the number of collection times of each first information in the information set that has been collected within a preset time period, and determines the weight value of each first information based on the number of collections, and then obtains at least one second information from the information set based on the weight value of each first information and the preset number of information collections, and determines the target number of collections of each second information based on the weight value corresponding to each second information, and collects information based on each second information and the determined target number of collections of each second information. Since the weight value is obtained from the number of collections of the collected first information, the weight value can reflect the historical collection situation of the collected first information, so that when the second information and the target number of collections of the second information are determined by the weight value, it can be ensured that when the second information and the corresponding target number of collections are used for information collection, relevant information can be searched, and it is achieved that when the collection resources are fixed, that is, the number of information collections is fixed, the collection resources can be reasonably allocated, and more data can be collected within limited collection resources, thereby avoiding the waste of collection resources and improving the effective utilization rate of collection resources.
[0033] The sensitive word detection method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0034] like Figure 1 As shown, it is a flowchart of the steps of the method for acquiring information provided by an embodiment of the present application. The execution subject of the method may be a server and / or a terminal device, wherein the server may be an independent server or a server cluster composed of multiple servers, and the server may be a server capable of performing program operation processing, such as a server for performing the information acquisition method. The method includes:
[0035] Step 101: Obtain the number of times each first information in an information set collected within a preset time period is collected.
[0036] The collected information set includes a set of collected information, and the first information is any information in the information set. That is, the first information in the collected information set is information that has been collected in a historical period. The first information may include words, sentences or text paragraphs in the collected information.
[0037] The preset time period may be a time period set by the user, for example, 72 hours or 48 hours.
[0038] In addition, specifically, the number of times each first information is collected can also be referred to as the number to be collected, which refers to the number of times or the number that the first information should be collected within a preset time period. The number of times each first information is collected in this embodiment refers to the number of times the corresponding first information is collected.
[0039] In this step, the number of times each first information is collected within a preset period of time can be obtained, so that the collection status of each collected first information can be known. Specifically, when obtaining the number of times the first information is collected, the frequency of each word in the collected information set can be analyzed to obtain the number of times the corresponding word is collected.
[0040] Step 102: Determine a weight value of each first information according to the number of collection times.
[0041] Specifically, after the number of times each piece of first information is collected is obtained, the weight value of the first information may be correspondingly determined according to the number of times each piece of first information is collected.
[0042] The weight value of each collected first information is determined according to the number of collection times, so that the determined weight value can reflect the collection situation of each collected first information, providing a data basis for reasonable allocation of collection resources.
[0043] Step 103: Acquire at least one second information from the information set according to the weight value of each first information and the preset number of information collections.
[0044] Specifically, the preset number of information collections can be determined by the collection resources. For example, assuming that the collection resources can support the collection of 20 information at most at a time, the preset number of information collections can be 20, that is, the number of information collections can be the maximum number of information collections corresponding to the collection resources, thus avoiding the set number of information collections exceeding the capacity of the collection resources, that is, avoiding the invalidity of the preset number of information collections.
[0045] Step 104: Determine the target number of collection times for each second information according to the weight value corresponding to each second information.
[0046] It should be noted that the second information is used as a keyword or search term in the process of information collection. The target collection number of the second information can also be called the collection number of the second information, that is, the number of times the second information is searched as a keyword.
[0047] In addition, it should be understood that since at least one second information is determined from the first information, after determining the weight value of the first information in the information set, the weight value of the second information is also determined, that is, the weight value of the second information is the corresponding weight value of the first information.
[0048] The target number of collections of each second information is the number of times the corresponding second information is used as a collection word when the second information is used as a keyword for collection. That is, the target number of collections of the second information is the number of times the second information is used as a collection word when information is collected using the corresponding second information as a collection word. In this embodiment, the target number of collections is determined based on the weight value of the second information. It can be understood that the greater the weight value of the second information, the greater the target number of collections.
[0049] Step 105: Collect corresponding information according to each piece of second information and the determined target number of times of collecting each piece of second information.
[0050] After determining the second information and the target number of collections for each second information, information collection is performed in a preset application according to the corresponding second information. For example, when collecting information on Weibo, the second information (as a search term) is input to collect information, and multiple collections are performed correspondingly according to the determined number of collections for each second information. Furthermore, when collecting the same second information, multiple collections (target number of collections) can be performed according to preset time intervals.
[0051] In this embodiment, by obtaining the number of collection times of each first information in the information set that has been collected within a preset period of time, and determining the weight value of each first information according to the number of collection times, then according to the weight value of each first information and the preset number of information collection, at least one second information is obtained from the information set, and the target number of collection times of each second information is determined according to the weight value corresponding to each second information, and corresponding information collection is performed according to the second information and the determined number of collection times of each second information. Since the weight value of the first information is determined by the number of collection times of the collected first information, the weight value can reflect the historical collection situation of the collected first information, so that the weight value of the first information can provide a reference for determining the second information and the target number of collection times of the second information. By determining the second information and the target number of collection times of the second information through the weight value of the first information (that is, the historical collection situation of the collected first information), the accuracy of the determined second information and the target number of collection times of the second information can be improved, and it can be ensured that when the second information and the corresponding target number of collections are used for information collection, relevant information can be searched, so that when the collection resources are fixed, that is, the number of information collections is fixed, the collection resources can be reasonably allocated, and more relevant data can be collected within limited collection resources, thereby avoiding the waste of collection resources and improving the utilization rate of collection resources.
[0052] In addition, optionally, in the related technology, according to the frequency of words in the corpus, the collected words with high frequency are collected multiple times, and the collected words with low frequency are collected in small quantities. Although some words have a high frequency, words with high frequency may not be suitable as collected words. For example, assuming that the frequency of collected word A is high, but collected word A is a sensitive word, the word will be blocked by the web page during collection, and the effectiveness of the collected words is poor.
[0053] In view of this, when obtaining the collected information set, words can be extracted from the web page data, and the extracted words can be used as the first information in the collected information set. For example, assuming that word B is extracted from the web page data, word B can be used as a collected first information. In this way, since the web page data has been presented after searching through the search engine, it means that the words in the web page data are all words that are not blocked by the search engine. At this time, the words extracted from the web page are used as the first information, which avoids using the words that the search engine will block as the first information. Compared with the collection method of collecting more words with high word frequency in the related technology, the effectiveness of the determined first information is improved.
[0054] In one implementation, when acquiring the number of times each first information in the information set that has been acquired within a preset period of time is collected, a first ratio of a first time value to a second time value may be acquired for each first information, and the first ratio may be determined as the number of times the first information is collected;
[0055] The first time value is the time value corresponding to the preset time period, and the second time value is the absolute value of the difference between the publishing time of the webpage data corresponding to the first information and the collection time of the first information.
[0056] That is, the number of times the first information is collected can be calculated by the following formula:
[0057] N = T / |(T1-T2)|;
[0058] Among them, N represents the number of times the first information is collected, T represents the time value corresponding to the preset period, for example, the preset period is two days, T1 represents the release time of the web page data corresponding to the first information, and T2 represents the collection time of the first information.
[0059] It should be noted that in most scenarios, the two time points represented by T1 and T2 are relatively close, that is, the value of T is much larger than the absolute value of the difference between T1 and T2 in most cases, that is, the calculated N is a value greater than 1; at this time, if the calculated N value is not a positive integer, it can be rounded down or rounded up, that is, the value of N rounded down or rounded up is used as the number of times the first information is collected. For example, in an application scenario for determining the number of times the first information is collected, assuming that the time value T corresponding to the preset time period is 48 hours, the publishing time T1 of the web page data corresponding to the first information is 12:30 on the Kth day, and the collection time T2 of the first information is 13:00 on the Kth day, then N = T / |(T1-T2)| = 96, that is, the number of times the first information is collected is 96 times.
[0060] Of course, in a few scenarios, the interval between the two time points represented by T1 and T2 is large, and the value of T may be smaller than the absolute value of the difference between T1 and T2, that is, the calculated N is a value less than 1; in this case, the calculated N value can be rounded down or up, that is, the number of times the first information is collected can be obtained by rounding the N value down or up; or, when the preset number of information collection is greater than the preset number, the N value can be determined to be 1, and when the preset number of information collection is less than the preset number, the N value can be determined to be 0. For this application scenario, it proves that the search term used does not search much information, and it can be judged through evaluation whether to reduce the number of searches for the search term or not to search.
[0061] Specifically, since the publishing time of the web page data is the real publishing time and represents the most authentic indicator, this embodiment calculates the collection times of the first information based on the publishing time of the web page data, so that the most authentic collection times of the first information can be calculated, thereby ensuring the accuracy of the calculated collection times, and further ensuring the accuracy of the determined weight value.
[0062] Optionally, the publishing time of the webpage data corresponding to the first information may be the earliest publishing time of the data in the webpage data corresponding to the first information. For example, assuming that 10 data are collected when collecting the first information, the publishing time of the 10 data may be obtained, and the earliest publishing time among the 10 data may be obtained by screening.
[0063] Of course, the publishing time of the webpage data corresponding to the first information may also be the average publishing time of the data in the webpage data corresponding to the first information. For example, assuming that 10 data are collected when collecting the first information, the publishing time of the 10 data can be obtained, and the average of the publishing time of the 10 data is used as the publishing time of the webpage data corresponding to the first information.
[0064] In addition, in one implementation, when determining the weight value of each first information based on the number of collection times, a second ratio between the number of collection times corresponding to each first information in the information set can be obtained; the second ratio is determined as the weight ratio between each first information in the information set, and the weight value of each first information is determined based on the weight ratio.
[0065] For example, assuming that the preset time period is 1 hour, the collected first information includes word A and word B. If it is calculated that the number of collections of word A and word B within 1 hour is 20 times, the second ratio between the number of collections corresponding to word A and word B is 1:1, so it can be determined that the weight ratio of word A and word B is 1:1, and at this time it can be determined that the weight values of word A and word B are both 0.5.
[0066] In this way, by determining the weight value of each first information based on the second ratio between the number of times each first information is collected, a positive correlation between the weight value and the number of times the first information is collected is achieved, so that the weight value can reflect the proportional relationship between the number of times each first information has been collected, so that the weight value can reflect the historical collection situation of the collected first information.
[0067] In addition, in an implementation manner, when acquiring at least one second information from the information set according to the weight value of each first information and the preset number of information collections, the following steps may be included:
[0068] In descending order of weight values, the N first information with the highest weight values are determined as the second information, wherein the greater the number of collected information is, the greater the value of N is.
[0069] For example, as an example, assume that the first information included in the information set includes information C1, information C2, information C3, information C4 and information C5, wherein the number of information C1 collected is 20, the number of information C2 collected is 1, the number of information C3 collected is 1, the number of information C4 collected is 10, and the number of information C5 collected is 8, that is, the weight value ratios of information C1, information C2, information C3, information C4 and information C5 are 50%, 2.5%, 2.5%, 25%, and 20% respectively. At this time, if the preset number of information collection is 1, the value of N can be 1, that is, the first information with the first weight value is determined as the second information; if the preset number of information collection is 10, the first three first information can be determined as the second information.
[0070] Of course, after acquiring at least one second information, the target collection times of each second information may be determined according to the weight value corresponding to each second information. The larger the weight value, the greater the target collection times.
[0071] Furthermore, in one implementation, the first information may include: a search term for searching for web page data, user information for searching for web page data, or geographic location information for searching for web page data.
[0072] Optionally, the user information may include information such as a user account or a user ID used to represent the user's identity.
[0073] Specifically, when searching data using search terms, a search page is displayed, which displays the data containing the search terms; when searching using user information, a user page is displayed, which displays the latest data of the user information; when searching using geographic location information, a regional page is displayed, which displays the latest data corresponding to the geographic location information.
[0074] In this way, the first information includes any one of the above items, thereby achieving the diversification of the attributes of the collected first information.
[0075] In addition, in an implementation, after acquiring at least one second information from the information set according to the weight value of each first information and the preset number of information collections, the following steps may also be included:
[0076] If the at least one second information includes at least one user information for searching web page data, determining the collection resource allocation ratio corresponding to each user information according to the resource allocation priority and / or the collection time respectively corresponding to the at least one user information;
[0077] According to the acquisition resource allocation ratio, acquisition resources are allocated to the search operation corresponding to each user information.
[0078] Specifically, the acquisition resources may include CPU, network bandwidth, number of available IPs, etc. Allocating the acquisition resources means allocating the above-mentioned resources such as CPU, network bandwidth, number of available IPs, etc.
[0079] In addition, the time for user information to be collected can be divided into 24 hours a day, and the 24 hours in a day can be segmented as the time for collection, and resources can be allocated to the segmented time periods. For example, 1:00 to 7:00 in a day can be a time for collection, and 7:00 to 1:00 the next day can be a time for collection.
[0080] In this embodiment, the resource allocation priority, the time to be collected, or the resource allocation priority and the time to be collected corresponding to at least one user information can be determined, and based on this, the collection resource allocation ratio corresponding to each user information is determined, so that collection resources can be allocated to each user information according to the collection resource allocation ratio, that is, the allocation of collection resources is related to the resource allocation priority and / or the time to be collected of the user information, thereby making the allocation of collection resources more reasonable and avoiding waste of collection resources.
[0081] Optionally, before determining the acquisition resource allocation ratio corresponding to each piece of user information, the resource allocation priority of each piece of user information can be determined according to the publication time of the last piece of information corresponding to the user of each piece of user information; wherein, the closer the publication time of the last piece of information is to the current time, the higher the resource allocation priority.
[0082] Specifically, the closer the release time of the last piece of information is to the current time, the more frequently the user corresponding to the user information releases information, and more collection resources should be allocated to the user corresponding to the user information, that is, the higher the resource allocation priority of the user information, the rationality of the resource allocation priority is ensured.
[0083] In addition, specifically, if the publishing time of the last message is within the first preset time period, the resource allocation priority of the user information is determined to be the first priority; if the publishing time of the last message is within the second preset time period, the resource allocation priority of the user information is determined to be the second priority; if the publishing time of the last message is within the third preset time period, the resource allocation priority of the user information is determined to be the third priority; wherein the third priority, the second priority, and the first priority increase in sequence, and the distances between the first preset time period, the second preset time period, and the third preset time period and the current time increase in sequence.
[0084] For example, as an example, assuming that the last message of user A was published within 3 days, the last message of user B was published within 3 days < message publishing time < 1 month, and the last message of user C was published within 1 month < message publishing time < 6 months, then it can be determined that the resource allocation priorities of user C, user B and user A increase in sequence.
[0085] At this time, the collection resource allocation of user A, user B and user C can be shown in the following table:
[0086]
[0087]
[0088] In this way, the rationality of the allocation of acquisition resources is ensured through the above method.
[0089] Below through Figure 2 The specific process of this application is introduced and explained. Figure 2 As shown, the method comprises the following steps:
[0090] Step 201: Obtain the number of times each first information in the information set collected within a preset time period is collected.
[0091] Specifically, the number of times each piece of first information is collected can be calculated using the following formula:
[0092] N = T / |(T1-T2)|;
[0093] Among them, N represents the number of times the first information is collected, T represents the time value corresponding to the preset period, for example, the preset period is two days, T1 represents the release time of the web page data corresponding to the first information, and T2 represents the collection time of the first information.
[0094] It should be noted that in most scenarios, the two time points represented by T1 and T2 are relatively close, that is, the value of T is greater than the absolute value of the difference between T1 and T2 in most cases, that is, the calculated N is a value greater than 1; of course, in a few scenarios, the two time points represented by T1 and T2 are relatively large, and the value of T may be smaller than the absolute value of the difference between T1 and T2, that is, the calculated N is a value less than 1; for these two scenarios, please refer to the relevant description of the above embodiments, and will not be repeated here.
[0095] Step 202: Determine a weight value of each first information according to the number of collection times.
[0096] Specifically, in this process, a second ratio between the collection times corresponding to each first information in the information set can be obtained, and the second ratio can be determined as the weight ratio between each first information in the information set, and the weight value of each first information is determined according to the weight ratio; this enables the determined weight value to reflect the number of collection times for each first information, providing a data basis for the reasonable allocation of collection resources.
[0097] Step 203: Obtain second information according to the weight value of each first information and the preset number of information collections.
[0098] Specifically, in this step, for each first information, N first information with the highest weight values can be determined as the second information in descending order of weight values, wherein the greater the number of collected information, the greater the value of N.
[0099] Step 204: determining the target number of collected pieces of each second information according to the weight value corresponding to each piece of second information, and collecting information according to each piece of second information and the determined target number of collected pieces of each piece of second information.
[0100] Specifically, in this step, the greater the weight value of the second information is, the greater the target acquisition times are.
[0101] It should be noted that, in this embodiment, the weight value may be updated periodically, and the second information may be determined according to the latest updated weight value. Of course, the determination of the weight value may refer to the above embodiment.
[0102] In addition, optionally, if the second information is at least one user information used to search for web page data, the acquisition resources may be allocated in the following manner:
[0103] First, if the user has posted information within the first preset time period, the user is placed in the high-frequency queue, if the user has posted information within the second preset time period, the user is placed in the low-frequency queue, and if the user has posted information within the third preset time period, the user is placed in the traversal queue; wherein the distances between the first preset time period, the second preset time period, and the third preset time period and the current time increase in sequence. For example, the first preset time period is within 3 days, the second preset time period is from 3 days to 1 month, and the third preset time period is from 1 month to 6 months.
[0104] Then, the collection resources are allocated through the following table:
[0105]
[0106] Specifically, in the above table, assuming that all resources in the time period are 1, the high-frequency and low-frequency queues occupy all resources for collection from 7 a.m. on the first day to 1 a.m. on the second day, with a ratio of 9:1. From 1 a.m. to 7 a.m. on the second day, there are very few active users, so the resource ratio of the high-frequency and low-frequency queues can be reduced to 0.5 in total, and the resource ratio of the traversal queue is increased to 0.5.
[0107] In this way, this embodiment obtains the number of collection times of each first information in the information set that has been collected within a preset time period, and determines the weight value of each first information based on the number of collection times, and then obtains at least one second information from the information set based on the weight value of each first information and the preset number of information collections, and determines the target collection time corresponding to the second information. Since the weight value is obtained by the number of collection times of the collected first information, the weight value can reflect the collection situation of the collected first information, so that when each second information and the target collection time are determined by the weight value, the accuracy of the determined second information and the target collection time can be guaranteed, and when the collection resources are fixed, that is, the number of information collections is fixed, the collection resources can be reasonably allocated, and more data can be collected within limited collection resources, thereby avoiding the waste of collection resources and improving the utilization rate of collection resources.
[0108] It should be noted that the information acquisition method provided in the embodiment of the present application can be executed by an information acquisition device or a control module in the information acquisition device for executing the information acquisition method. In the embodiment of the present application, the information acquisition device provided in the embodiment of the present application is described by taking the information acquisition method executed by the information acquisition device as an example.
[0109] like Figure 3 As shown, the device comprises:
[0110] An acquisition module 301 is used to acquire the number of times each first information in an information set that has been collected within a preset period of time is collected, where the first information is any information in the information set;
[0111] A first determination module 302, configured to determine a weight value of each first information according to the number of collection times;
[0112] A second determining module 303 is used to obtain at least one second information from the information set according to a weight value of each first information and a preset number of information collections;
[0113] A third determination module 304 is used to determine a target collection number of each second information according to a weight value corresponding to each second information;
[0114] The collection module 305 is used to collect information according to each of the second information and the determined target collection times of each of the second information.
[0115] In one implementation, the acquisition module 301 is used to obtain, for each first information, a first ratio of a first time value to a second time value, and determine the first ratio as the number of times the first information is collected; wherein the first time value is the time value corresponding to the preset time period, and the second time value is the absolute value of the difference between the publishing time of the web page data corresponding to the first information and the collection time of the first information.
[0116] In one implementation, the first determination module 302 is used to obtain a second ratio between the collection times corresponding to each first information in the information set; determine the second ratio as the weight ratio between each first information in the information set, and determine the weight value of each first information according to the weight ratio.
[0117] In one implementation, the second determination module 303 is used to determine N first information with the highest weight values as the second information in descending order of weight values, wherein the greater the number of collected information is, the greater the value of N is.
[0118] In one implementation, the first information includes: a search term for searching web page data, user information for searching web page data, or geographic location information for searching web page data.
[0119] In one implementation, the second determination module 303 is also used to, if the at least one second information includes at least one user information for searching web page data, determine the collection resource allocation ratio corresponding to each user information according to the resource allocation priority and / or collection time respectively corresponding to the at least one user information; and allocate collection resources to the search operation corresponding to each user information according to the collection resource allocation ratio.
[0120] In one implementation, the second determination module 303 is also used to determine the resource allocation priority of each user information according to the publishing time of the last information of the user corresponding to each user information; wherein, the closer the publishing time of the last information is to the current time, the higher the resource allocation priority.
[0121] It should be noted here that the information acquisition device provided in the above embodiment can implement all the method steps and beneficial effects of the above information acquisition method embodiment. To avoid repetition, the method steps and beneficial effects that are the same as those in the above method embodiment will not be repeated here.
[0122] Corresponding to the information acquisition method provided in the above embodiment, based on the same technical concept, the embodiment of the present application also provides an electronic device, which is used to execute the above information acquisition method. Figure 4A schematic diagram of the structure of an electronic device for implementing various embodiments of the present application. The electronic device may have relatively large differences due to different configurations or performances, and may include a processor (processor) 410, a communication interface (Communications Interface) 520, a memory (memory) 430 and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call a computer program stored in the memory 430 and executable on the processor 410 to perform the following steps:
[0123] Obtaining the number of times each first information in the information set collected within a preset time period is collected;
[0124] Determining a weight value of each of the first information according to the number of collection times;
[0125] Acquire at least one second information from the information set according to a weight value of each first information and a preset number of information collections;
[0126] Determine a target collection number of each second information according to a weight value corresponding to each second information;
[0127] Information collection is performed according to each of the second information and the determined target collection times for each of the second information.
[0128] In one implementation, obtaining the number of collection times of each first information in the information set that has been collected within a preset time period includes: for each first information, obtaining a first ratio of a first time value to a second time value, and determining the first ratio as the number of collection times of the first information; wherein the first time value is the time value corresponding to the preset time period, and the second time value is the absolute value of the difference between the publishing time of the web page data corresponding to the first information and the collection time of the first information.
[0129] In one implementation, determining the weight value of each first information based on the number of collection times includes: obtaining a second ratio between the number of collection times corresponding to each first information in the information set; determining the second ratio as the weight ratio between each first information in the information set, and determining the weight value of each first information based on the weight ratio.
[0130] In one implementation, at least one second information is obtained from the information set based on the weight value of each first information and a preset number of information collections, including: determining the N first information with the highest weight values as the second information in descending order of weight values, wherein the larger the number of information collections, the larger the value of N.
[0131] In one implementation, the first information includes: a search term for searching web page data, user information for searching web page data, or geographic location information for searching web page data.
[0132] In one implementation, after obtaining at least one second information from the information set based on the weight value of each first information and the preset number of information collections, it also includes: if the at least one second information includes at least one user information for searching web page data, then according to the resource allocation priority and / or collection time respectively corresponding to the at least one user information, determining the collection resource allocation ratio corresponding to each user information; according to the collection resource allocation ratio, allocating collection resources to the search operation corresponding to each user information.
[0133] In one implementation, before determining the collection resource allocation ratio corresponding to each user information according to the resource allocation priority and / or collection time corresponding to the at least one user information, it also includes: determining the resource allocation priority of each user information according to the release time of the last information of the user corresponding to each user information; wherein, the closer the release time of the last information is to the current time, the higher the resource allocation priority.
[0134] An embodiment of the present application also provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned information acquisition method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0135] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0136] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned sensitive word detection method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0137] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0138] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0140] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for obtaining information, characterized in that: include: Obtaining the number of times each first information in the information set that has been collected within a preset time period is collected, where the first information is any information in the information set that has been collected; Determining a weight value of each of the first information according to the number of collection times; According to the weight value of each of the first information and the preset number of information collections, at least one second information is obtained from the information set, where the second information is first information selected from the information set, and the weight value of the selected first information is greater than the weight value of the first information not selected from the information set; Determine the target number of collection of each second information according to the weight value corresponding to each second information, the weight value of the second information is the weight value of the corresponding first information, and the target number of collection is the number of times the second information is used as a collection word when the corresponding second information is used as a collection word for information collection; Information collection is performed in a preset application according to each of the second information and the determined target collection times for each of the second information.
2. The information acquisition method according to claim 1, characterized in that: The acquiring of the number of times each first information in the information set collected within the preset time period is collected includes: For each of the first information, obtaining a first ratio of the first time value to the second time value, and determining the first ratio as the number of times the first information is collected; The first time value is the time value corresponding to the preset time period, and the second time value is the absolute value of the difference between the publishing time of the webpage data corresponding to the first information and the collection time of the first information.
3. The information acquisition method according to claim 1, characterized in that: The determining, according to the number of collection times, a weight value of each of the first information includes: Obtaining a second ratio between the number of collection times corresponding to each first information in the information set; The second ratio is determined as the weight ratio between each first information in the information set, and the weight value of each first information is determined according to the weight ratio.
4. The information acquisition method according to claim 1, characterized in that: The acquiring at least one second information from the information set according to the weight value of each first information and the preset number of information collections includes: Selecting N first information as the second information according to the weight value, wherein the weight value corresponding to the second information is greater than the weight value of the first information that is not selected, wherein N is a positive integer, and the preset number of information collection is positively correlated with the value of N; The corresponding second information is acquired from the information set according to the determined second information.
5. The information acquisition method according to any one of claims 1 to 4, characterized in that: The first information includes: a search term for searching web page data, user information for searching web page data, or geographic location information for searching web page data.
6. The information acquisition method according to claim 1, characterized in that: After acquiring at least one second information from the information set according to the weight value of each first information and the preset number of information collection, the method further includes: If the second information includes user information for searching web page data, determining the acquisition resource allocation ratio corresponding to each user information according to the resource allocation priorities and / or the waiting acquisition time respectively corresponding to different users in the user information; According to the acquisition resource allocation ratio, acquisition resources are allocated to the search operation corresponding to each user information.
7. The information acquisition method according to claim 6, characterized in that: Before determining the collection resource allocation ratio corresponding to each user information according to the resource allocation priorities and / or the waiting collection time respectively corresponding to different users in the user information, the method further includes: Determine the resource allocation priority of each user information according to the release time of the last web page data in the search web page data corresponding to each user information; The closer the publishing time of the last piece of webpage data is to the current time, the higher the resource allocation priority is.
8. An information acquisition device, characterized in that: include: An acquisition module, used to acquire the number of times each first information in the information set that has been collected within a preset period of time is collected, wherein the first information is any information in the information set that has been collected; A first determination module, used to determine a weight value of each first information according to the number of collection times; A second determination module is used to obtain at least one second information from the information set according to a weight value of each first information and a preset number of information collections, wherein the second information is first information selected from the information set, and the weight value of the selected first information is greater than the weight value of the first information not selected from the information set; A third determination module is used to determine a target collection number of each second information according to a weight value corresponding to each second information, wherein the weight value of the second information is the weight value of the corresponding first information, and the target collection number of the second information is the number of times the second information is used as a collection word when information collection is performed using the corresponding second information as a collection word; A collection module is used to collect information in a preset application according to each of the second information and the determined target collection times of each of the second information.
9. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the information acquisition method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the information acquisition method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Commodity object recommendation method and device, electronic equipment and storage medium
CN112925986A
