A method and apparatus for information storage

By creating a bucket array divided by time period in the information storage system, only storing user browsing information without storing time information, the problems of large storage space and high cost in the prior art are solved, and efficient storage and recommendation are achieved.

CN114357302BActive Publication Date: 2025-06-27GUANGZHOU QUWAN NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111677190.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-06-27
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

When recommending user information, the prior art requires storing the information that the user has browsed and browsed at the same time, resulting in large storage space and high cost.

Method used

By creating a bucket array, each bucket array corresponds to a storage period, and it is stored in the corresponding bucket array according to the browsing time of the user's browsing information, and only the user's browsing information is stored without the time information.

Benefits of technology

Save a lot of storage space, reduce storage costs, and improve storage efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114357302B_ABST
    Figure CN114357302B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and apparatus for information storage. The method includes: determining at least one created bucket array and determining the creation time of each of the bucket arrays; each of the bucket arrays is used to store the user's browsed information within the corresponding storage period, and the storage period corresponding to any one of the bucket arrays is determined according to the creation time of the bucket array and the creation time of the first bucket array created after the creation of the bucket array; obtaining at least one user browsing information browsed by the target user and determining the browsing time of each of the user browsing information; and storing each of the user browsing information in the determined bucket array according to the browsing time of each of the user browsing information and the storage period corresponding to each of the bucket arrays. It can be seen that implementing the present invention can only store the user browsing information correspondingly, saving a large amount of storage space and reducing the storage cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information storage, and in particular, to a method and device for information storage. Background Art

[0002] In the Internet era of information explosion, it is self-evident how important it is for Internet companies to attract users' attention and browsing. Most Internet companies will recommend relevant information according to users' hobbies, and exclude the information that users have browsed in a recent period of time during the process of recommending relevant information, so as to attract users to browse.

[0003] Currently, when recommending relevant information, the information browsed by users and the browsing time will be stored in advance to query whether there is information browsed in a recent period of time among the recommended relevant information, and then exclude the information browsed in a recent period of time. This requires storing both the browsed information and the browsing time, occupying a large amount of storage space and increasing the storage cost. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and device for information storage, which can store only the corresponding user browsing information, saving a large amount of storage space and reducing the storage cost.

[0005] To solve the above technical problem, a first aspect of the present invention discloses a method for information storage, and the method includes:

[0006] Determine at least one bucket array that has been created, and determine the creation time of each bucket array; each bucket array is used to store the user-browsed information within its corresponding storage period, and the storage period corresponding to any bucket array is determined according to the creation time of this bucket array and the creation time of the first bucket array created after the creation of this bucket array;

[0007] Obtain at least one user-browsed information browsed by the target user, and determine the browsing time of each user-browsed information;

[0008] According to the browsing time of each user-browsed information and the storage period corresponding to each bucket array, store each user-browsed information correspondingly in the determined bucket array.

[0009] As an optional implementation manner, in the first aspect of the present invention, the storing each user-browsed information correspondingly in the determined bucket array according to the browsing time of each user-browsed information and the storage period corresponding to each bucket array includes:

[0010] For each of the user browsing information, according to the storage period corresponding to each of the bucket arrays, determine the target storage period in which the browsing moment of the user browsing information is located from the storage periods corresponding to all the bucket arrays, and determine the target bucket array corresponding to the target storage period as the target bucket array corresponding to the user browsing information;

[0011] For each of the user browsing information, store the user browsing information in the target bucket array corresponding to the user browsing information.

[0012] As an optional implementation manner, in the first aspect of the present invention, the method further includes:

[0013] Determine the identification information uniquely corresponding to the target browsing information to be traversed;

[0014] Traverse the target browsing information corresponding to the identification information from all the currently existing bucket arrays in the order of decreasing creation duration until the target browsing information is traversed or all the currently existing bucket arrays are traversed;

[0015] Wherein, the target browsing information is the user browsing information to be queried or the user browsing information to be deleted.

[0016] As an optional implementation manner, in the first aspect of the present invention, the storing the user browsing information in the target bucket array corresponding to the user browsing information for each of the user browsing information includes:

[0017] For each of the user browsing information, determine the identification information corresponding to the user browsing information, perform hashing on the identification information corresponding to the user browsing information through a preset hash function to obtain the hash value corresponding to the user browsing information, and determine the storage position of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information;

[0018] For each of the user browsing information, store the hash value corresponding to the user browsing information in the storage position in the target bucket array corresponding to the user browsing information.

[0019] As an optional implementation manner, in the first aspect of the present invention, the bucket array includes at least two candidate buckets, and the determining the storage position of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information for each of the user browsing information includes:

[0020] For each of the user browsing information, determine the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information through a preset hash function, and determine the storage location of the second candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information;

[0021] For each of the user browsing information, determine the storage location of the hash value corresponding to the user browsing information in the corresponding target bucket array according to the occupancy of the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information and the occupancy of the storage location of the second candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information.

[0022] As an optional implementation manner, in the first aspect of the present invention, the step of, for each of the user browsing information, determining the storage location of the hash value corresponding to the user browsing information in the corresponding target bucket array according to the occupancy of the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information and the occupancy of the storage location of the second candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information includes:

[0023] For each of the user browsing information, detect whether the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information is occupied, and when it is detected that the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information is not occupied, determine the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information as the storage location of the hash value corresponding to the user browsing information in the corresponding target bucket array;

[0024] For each of the user browsing information, when it is detected that the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information is occupied, determine the storage location of the second candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information as the storage location of the hash value corresponding to the user browsing information in the corresponding target bucket array.

[0025] As an optional implementation manner, in the first aspect of the present invention, the method further includes:

[0026] Determine the creation duration of each bucket array according to the current moment and the creation moment of each bucket array;

[0027] Compare the shortest creation duration among the creation durations of all the bucket arrays with a preset second preset duration, and when the shortest creation duration is greater than the second preset duration, create a new bucket array and store the browsing information to be inserted in the new bucket array;

[0028] For each of the bucket arrays, compare the creation duration of the bucket array with a preset third preset duration, and when the creation duration of the bucket array is greater than the third preset duration, delete the bucket array from all the bucket arrays.

[0029] A second aspect of the present invention discloses a device for information storage, the device comprising:

[0030] A determination module, configured to determine at least one created bucket array and determine the creation moment of each of the bucket arrays; each of the bucket arrays is used to store the user's browsed information within the corresponding storage period, and the storage period corresponding to any one of the bucket arrays is determined according to the creation moment of the bucket array and the creation moment of the first bucket array created after the creation of the bucket array;

[0031] An acquisition module, configured to acquire at least one user browsing information browsed by a target user and determine the browsing moment of each of the user browsing information;

[0032] A storage module, configured to store each of the user browsing information in the determined bucket array according to the browsing moment of each of the user browsing information and the storage period corresponding to each of the bucket arrays.

[0033] As an optional implementation manner, in the second aspect of the present invention, the specific manner in which the storage module stores each of the user browsing information in the determined bucket array according to the browsing moment of each of the user browsing information and the storage period corresponding to each of the bucket arrays is as follows:

[0034] For each of the user browsing information, determine the target storage period in which the browsing moment of the user browsing information is located from the storage periods corresponding to all the bucket arrays according to the storage period corresponding to each of the bucket arrays, and determine the target bucket array corresponding to the target storage period as the target bucket array corresponding to the user browsing information; for each of the user browsing information, store the user browsing information in the target bucket array corresponding to the user browsing information.

[0035] As an optional implementation manner, in the second aspect of the present invention, the determination module is further configured to determine the identification information uniquely corresponding to the target browsing information to be traversed;

[0036] The device further comprises:

[0037] A traversal module, configured to traverse the target browsing information corresponding to the identification information from all the currently existing bucket arrays in the order of the creation duration from long to short until the target browsing information is traversed or all the currently existing bucket arrays are traversed; wherein, the target browsing information is the browsing information of the user to be queried or the browsing information of the user to be deleted.

[0038] As an optional implementation manner, in the second aspect of the present invention, the specific manner of storing each user browsing information in the storage module in the target bucket array corresponding to the user browsing information is as follows:

[0039] For each user browsing information, determine the identification information corresponding to the user browsing information, perform hashing on the identification information corresponding to the user browsing information through a preset hashing function to obtain the hash value corresponding to the user browsing information, and determine the storage position of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information; for each user browsing information, store the hash value corresponding to the user browsing information at the storage position in the target bucket array corresponding to the user browsing information.

[0040] As an optional implementation manner, in the second aspect of the present invention, the bucket array includes at least two candidate buckets, and the specific manner of determining the storage position of the hash value corresponding to each user browsing information in the target bucket array corresponding to the user browsing information in the storage module is as follows:

[0041] For each user browsing information, determine the storage position of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array through a preset hashing function, and determine the storage position of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array; for each user browsing information, determine the storage position of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information according to the occupancy of the storage position of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array and the occupancy of the storage position of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array.

[0042] As an alternative implementation, in the second aspect of the present invention, for each piece of user browsing information in the storage module, the specific manner of determining the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information according to the occupancy of the storage location of the first candidate bucket in the corresponding target bucket array and the occupancy of the storage location of the second candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information is as follows:

[0043] For each piece of user browsing information, detect whether the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information is occupied. When it is detected that the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information is not occupied, determine the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information as the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information; for each piece of user browsing information, when it is detected that the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information is occupied, determine the storage location of the second candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information as the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information.

[0044] As an alternative implementation, in the second aspect of the present invention, the determination module is further configured to determine the creation duration of each bucket array according to the current time and the creation time of each bucket array;

[0045] The device further includes:

[0046] A comparison module, configured to compare the shortest creation duration among the creation durations of all the bucket arrays with a preset second preset duration, and when the shortest creation duration is greater than the second preset duration, create a new bucket array and store the browsing information to be inserted into the new bucket array; for each bucket array, compare the creation duration of the bucket array with a preset third preset duration, and when the creation duration of the bucket array is greater than the third preset duration, delete the bucket array from all the bucket arrays.

[0047] A third aspect of the present invention discloses another information storage device, the device includes:

[0048] A memory storing executable program code;

[0049] A processor coupled to the memory;

[0050] The processor calls the executable program code stored in the memory and executes some or all of the steps in the information storage method disclosed in the first aspect of the present invention.

[0051] The fourth aspect of the present invention discloses a computer storage medium storing computer instructions, which are used to execute some or all of the steps in the information storage method disclosed in the first aspect of the present invention when called.

[0052] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0053] In the embodiments of the present invention, at least one bucket array that has been created is determined, and the creation time of each bucket array is determined; each bucket array is used to store the user's browsed information within the corresponding storage period, and the storage period corresponding to any bucket array is determined according to the creation time of this bucket array and the creation time of the first bucket array created after the creation of this bucket array; at least one user browsing information browsed by the target user is obtained, and the browsing time of each user browsing information is determined; according to the browsing time of each user browsing information and the storage period corresponding to each bucket array, each user browsing information is correspondingly stored in the determined bucket array. It can be seen that implementing the present invention can only store the user browsing information correspondingly, saving a large amount of storage space and reducing the storage cost. Description of the Drawings

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0055] Figure 1 It is a schematic flowchart of a method for information storage disclosed in an embodiment of the present invention;

[0056] Figure 2 It is a schematic flowchart of another information storage method disclosed in an embodiment of the present invention;

[0057] Figure 3a It is a schematic flowchart of a process for creating a bucket array disclosed in an embodiment of the present invention;

[0058] Figure 3b It is a schematic flowchart of a process for deleting a bucket array disclosed in an embodiment of the present invention;

[0059] Figure 4 It is a schematic structural diagram of an information storage device disclosed in an embodiment of the present invention;

[0060] Figure 5 It is a schematic structural diagram of another information storage device disclosed in an embodiment of the present invention;

[0061] Figure 6 It is a schematic structural diagram of yet another information storage device disclosed in an embodiment of the present invention. Detailed implementation manners

[0062] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0063] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or terminal including a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or terminals.

[0064] Referring to "embodiment" herein means that a specific feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of the present invention. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0065] The present invention discloses a method and device for information storage, which can store only the information browsed by the user, saving a large amount of storage space and reducing the storage cost. The following will be described in detail respectively.

[0066] Embodiment 1

[0067] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a method for information storage disclosed in an embodiment of the present invention. Among them, Figure 1 the described information storage method can be applied to a terminal device or an Internet server. The embodiments of the present invention do not make a limitation. As Figure 1 shown, the information storage method may include the following operations:

[0068] Step 101, determine at least one created bucket array, and determine the creation time of each bucket array.

[0069] Among them, each bucket array can be used to store the information browsed by the user within its corresponding storage period. The information browsed by the user can be the information browsed by the user in the past period of time. The storage period corresponding to any bucket array can be determined according to the creation time of this bucket array and the creation time of the first bucket array created after the creation of this bucket array. Each bucket array can include at least two candidate buckets, and each candidate bucket can be used to store the information browsed by the user within its corresponding storage period. Each candidate bucket can be an array structure with a certain length.

[0070] In order to store the information browsed by the user in the past period of time, at least one bucket array can be created in advance, and then when it is necessary to store the information browsed by the user in the past period of time, determine at least one created bucket array and determine the creation time of each bucket array.

[0071] In practical applications, after obtaining the creation time of each bucket array, the creation time of any bucket array can be determined, and the creation time of the first bucket array created after the creation of this bucket array can be determined. Then, according to the creation time of this bucket array and the creation time of the first bucket array created after the creation of this bucket array, the storage period corresponding to this bucket array can be determined.

[0072] For example, it can be determined that the creation time of bucket array A is 12:00, and the first bucket array after the creation of bucket array A is bucket array B, and the creation time of bucket array B is determined to be 13:00. Then, according to the creation time of bucket array A and the creation time of bucket array B, the storage period corresponding to bucket array A can be determined to be the period from 12:00 to 13:00.

[0073] Step 102, obtain at least one user browsing information browsed by the target user, and determine the browsing time of each user browsing information.

[0074] Among them, the target user can be the user who needs to be recommended relevant information among all users. The user browsing information can include text information, image information, video information, etc. The browsing time of any user browsing information can be the time when the target user browses this user browsing information.

[0075] When it is detected that the target user has browsed information in the past period of time, at least one user browsing information browsed by the target user can be obtained, and the browsing time when the target user browses each user browsing information can be determined.

[0076] Step 103: According to the browsing time of each user's browsing information and the storage period corresponding to each bucket array, store each user's browsing information in the determined bucket array.

[0077] Among them, each bucket array can correspond to different storage periods respectively, and the storage period can be any period within a past period of time.

[0078] After obtaining the browsing time of each user's browsing information and the storage period corresponding to each bucket array, each user's browsing information can be stored in the determined bucket array according to the browsing time of each user's browsing information and the storage period corresponding to each bucket array.

[0079] In an optional embodiment, step 103 may include the following sub-steps:

[0080] Sub-step 11: For each user's browsing information, determine the target storage period in which the browsing time of this user's browsing information is located from the storage periods corresponding to all bucket arrays according to the storage period corresponding to each bucket array, and determine the target bucket array corresponding to the target storage period as the target bucket array corresponding to this user's browsing information.

[0081] Among them, the target storage period corresponding to any user's browsing information may include the browsing time of this user's browsing information, and the target bucket array corresponding to any user's browsing information may be the bucket array used to store this user's browsing information among all bucket arrays.

[0082] After obtaining the creation time of each bucket array and the storage period corresponding to each bucket array, for each user's browsing information, the target storage period in which the browsing time of this user's browsing information is located can be determined from the storage periods corresponding to all bucket arrays, and then the bucket array corresponding to this target storage period can be determined as the target bucket array, and the target bucket array corresponding to this target storage period can be determined as the target bucket array corresponding to this user's browsing information.

[0083] For example, the storage period corresponding to bucket array A may be the period from 12:00 to 13:00, the browsing time of user browsing information a may be 12:01, and the browsing time of user browsing information b may be 13:01. Then it can be determined that the browsing time of user browsing information a is within the storage period corresponding to bucket array A. Then it can be determined that the target storage period in which the browsing time of user browsing information a is located is the period from 12:00 to 13:00, and bucket array A is determined as the target bucket array corresponding to user browsing information a. However, the browsing time of user browsing information b is not within the storage period corresponding to bucket array A. Then it can be determined that bucket array A is not the target bucket array corresponding to user browsing information b.

[0084] Sub-step 12: For each user browsing information, store the user browsing information into the target bucket array corresponding to the user browsing information.

[0085] After determining the target bucket array corresponding to each user browsing information, for each user browsing information, the user browsing information can be stored into the target bucket array corresponding to the user browsing information.

[0086] In practical applications, since each bucket array can store the user browsing information within its corresponding storage period, the user browsing information can be stored only into the target bucket array corresponding to the user browsing information, without the need to store the user browsing information and the browsing time simultaneously, saving a large amount of storage space and reducing the storage cost.

[0087] In an optional embodiment, the method may further include the following steps:

[0088] Determine the identification information uniquely corresponding to the target browsing information to be traversed; from all the currently existing bucket arrays, traverse the target browsing information corresponding to the identification information in the order of the creation duration from long to short until the target browsing information is traversed or all the currently existing bucket arrays are traversed.

[0089] Wherein, the target browsing information may be the user browsing information to be queried or the user browsing information to be deleted, the target browsing information to be traversed may be the user browsing information selected manually, the identification information uniquely corresponding to the target browsing information may be used to represent the identity of the target browsing information, and the identification information may include the label information, title information, abstract information, serial number information, etc. of the target browsing information. The creation duration may be the creation duration of the bucket array, and the creation duration of any bucket array can be determined by the creation time of the bucket array and the current time.

[0090] After storing each user browsing information correspondingly in the determined bucket array, the target browsing information selected manually can be determined from each user browsing information, and the identification information uniquely corresponding to the target browsing information can be determined. Then, from all the currently existing bucket arrays, the target browsing information corresponding to the identification information can be traversed in the order of the creation duration from long to short in the user browsing information stored in all the currently existing bucket arrays until the target browsing information is traversed or all the currently existing bucket arrays are traversed, so as to output the target browsing information or delete the target browsing information when the target browsing information is traversed, and it is considered that the target browsing information does not exist in all the bucket arrays when all the currently existing bucket arrays are traversed and the target browsing information is not traversed.

[0091] In an alternative embodiment, the target browsing information may also be relevant information recommended to the target user. When recommending relevant information to the target user, it is possible to determine whether there is user browsing information corresponding to the relevant information recommended to the target user in all the existing bucket arrays, so as to delete the information browsed by the user in the recent period. Therefore, it is possible to traverse the target browsing information in all the existing bucket arrays to determine whether there is target browsing information in all the existing bucket arrays.

[0092] In an alternative embodiment, for each piece of user browsing information, when storing the user browsing information into the target bucket array corresponding to the user browsing information, it is possible to determine the uniquely corresponding identification information of the user browsing information, and then store the uniquely corresponding identification information of the user browsing information into the target bucket array corresponding to the user browsing information, further saving storage space. And when traversing the target browsing information in all the existing bucket arrays, it is possible to determine whether there is target browsing information in all the existing bucket arrays by querying and matching the identification information, improving the traversal efficiency.

[0093] In the embodiments of the present invention, at least one created bucket array is determined, and the creation time of each bucket array is determined; each bucket array is used to store the user-browsed information within the corresponding storage period, and the storage period corresponding to any bucket array is determined according to the creation time of the bucket array and the creation time of the first bucket array created after the creation of the bucket array; at least one piece of user browsing information browsed by the target user is obtained, and the browsing time of each piece of user browsing information is determined; according to the browsing time of each piece of user browsing information and the storage period corresponding to each bucket array, each piece of user browsing information is correspondingly stored in the determined bucket array. It can be seen that implementing the present invention can only store the user browsing information correspondingly, saving a large amount of storage space and reducing the storage cost.

[0094] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of another information storage method disclosed in the embodiments of the present invention. Among them, Figure 2 the described information storage method can be applied to a terminal device or an Internet server, which is not limited in the embodiments of the present invention. As Figure 2 shown, the information storage method may include the following operations:

[0095] Step 201, determine at least one created bucket array and determine the creation time of each bucket array.

[0096] Step 202, obtain at least one piece of user browsing information browsed by the target user and determine the browsing time of each piece of user browsing information.

[0097] Step 203: For each user browsing information, determine the target storage period in which the browsing moment of the user browsing information is located from all the storage periods corresponding to the bucket arrays according to the storage period corresponding to each bucket array, and determine the target bucket array corresponding to the target storage period as the target bucket array corresponding to the user browsing information.

[0098] Step 204: For each user browsing information, determine the identification information corresponding to the user browsing information, perform hashing on the identification information corresponding to the user browsing information through a preset hash function to obtain the hash value corresponding to the user browsing information, and determine the storage position of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information.

[0099] Among them, the hash function can be used to transform the identification information of any length into a hash value of a fixed length through a hashing algorithm, and obtain the mapping relationship between the hash value and the corresponding storage position. The hash value can be a numerical value uniquely corresponding to the identification information obtained through the hashing algorithm.

[0100] After determining the target bucket array corresponding to each user browsing information, for each user browsing information, the identification information corresponding to the user browsing information can be determined. Furthermore, the identification information corresponding to the user browsing information can be hashed through a preset hash function to obtain the hash value corresponding to the user browsing information. The storage position of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information can be determined through the mapping relationship between the hash value and the storage position of the target bucket array.

[0101] In practical applications, when creating a bucket array, a hash function can be pre-constructed, and at least one candidate bucket corresponding to the hash function can be created according to the hash function. Furthermore, a bucket array can be generated according to each candidate bucket, and the hash value output by the hash function can have a mapping relationship with the storage position of each candidate bucket in the bucket array.

[0102] For example, bucket array A can include candidate bucket 1. Candidate bucket 1 can be an array structure with a length of 8 bytes. The identification information corresponding to user browsing information a can be determined, and the identification information corresponding to user browsing information a can be hashed through a hash function to obtain a hash value of 57. Furthermore, according to the mapping relationship between the hash value and the storage position of candidate bucket 1, it is determined that the storage position of hash value 57 in candidate bucket 1 is the 5th byte of candidate bucket 1.

[0103] Step 205: For each user browsing information, store the hash value corresponding to the user browsing information at the storage position in the target bucket array corresponding to the user browsing information.

[0104] After obtaining the hash value corresponding to each user browsing information and determining the storage location of the hash value corresponding to each user browsing information, for each user browsing information, the hash value corresponding to the user browsing information can be stored in the storage location in the target bucket array corresponding to the user browsing information.

[0105] In practical applications, since the identification information is hashed through a hash function, a hash value with a smaller length can be obtained, that is, the space occupied by the hash value is smaller. And only storing the hash value in the storage location in the target bucket array corresponding to the user browsing information can further save storage space.

[0106] In a specific implementation, since the mapping relationship between the hash value and the storage location of the hash value in the bucket array can be obtained through the hash function, and then when traversing the target browsing information in all existing bucket arrays, through this mapping relationship and the hash value corresponding to the target browsing information, it can be determined whether the target browsing information exists in all existing bucket arrays, without having to traverse all bucket arrays completely, that is, only one traversal is required to determine whether the target browsing information exists in all existing bucket arrays, further improving the traversal efficiency and query efficiency.

[0107] In an optional embodiment, step 205 may include the following sub-steps:

[0108] Sub-step 21, for each user browsing information, determine the storage location of the first candidate bucket of the hash value corresponding to the user browsing information in the corresponding target bucket array through a preset hash function, and determine the storage location of the second candidate bucket of the hash value corresponding to the user browsing information in the corresponding target bucket array.

[0109] After obtaining the hash value corresponding to each user browsing information and determining the storage location of the hash value corresponding to each user browsing information, for each user browsing information, the storage location of the first candidate bucket of the hash value corresponding to the user browsing information in the corresponding target bucket array can be determined through a preset hash function, and the storage location of the second candidate bucket of the hash value corresponding to the user browsing information in the corresponding target bucket array can be determined.

[0110] In practical applications, since the candidate bucket can be an array structure with a certain length, that is, the length is limited, and then the hash values that each candidate bucket can store are also limited, multiple candidate buckets can be established to store more hash values, and the storage location of the hash value in each candidate bucket can be determined through the hash function when storing the hash value.

[0111] Sub-step 22: For each user browsing information, determine the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding thereto according to the occupancy of the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information and the occupancy of the storage location of the second candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information.

[0112] Among them, the occupancy situation may include: for each user browsing information, there is a hash value corresponding to other user browsing information stored at the storage location of the first candidate bucket in the target bucket array for the hash value corresponding to the user browsing information, and there is no hash value corresponding to other user browsing information stored at the storage location of the first candidate bucket in the target bucket array for the hash value corresponding to the user browsing information.

[0113] After determining the storage location of the first candidate bucket in the bucket array for each hash value and the storage location of the second candidate bucket in the bucket array, for each user browsing information, the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding thereto can be determined according to the occupancy of the storage location of the first candidate bucket in the target bucket array for the hash value corresponding to the user browsing information and the occupancy of the storage location of the second candidate bucket in the target bucket array for the hash value corresponding to the user browsing information.

[0114] In practical applications, since each candidate bucket has a unique storage location corresponding to each hash value respectively, for the hash value corresponding to each user browsing information, by determining the occupancy of the storage location corresponding to the hash value in each candidate bucket, and then according to the occupancy of the storage location corresponding to the hash value in each candidate bucket, the target candidate bucket for storing the hash value can be selected from each candidate bucket, and the storage location corresponding to the hash value in the target candidate bucket can be determined, which is the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding thereto.

[0115] In an alternative embodiment, for each user browsing information, it is also possible to detect whether the storage location of the first candidate bucket in the target bucket array for the hash value corresponding to the user browsing information is occupied, and when it is detected that the storage location of the first candidate bucket in the target bucket array for the hash value corresponding to the user browsing information is not occupied, determine the storage location of the first candidate bucket in the target bucket array for the hash value corresponding to the user browsing information as the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding thereto.

[0116] In practical applications, for each piece of user browsing information, when it is detected that the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array is not occupied, it can be considered that the first candidate bucket has sufficient storage space to store the hash value corresponding to the user browsing information. Furthermore, the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array can be determined as the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information.

[0117] For each piece of user browsing information, when it is detected that the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array is occupied, the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array is determined as the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information.

[0118] In practical applications, when it is detected that the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array is occupied, it can be considered that the storage space of the first candidate bucket is insufficient to store the hash value corresponding to the user browsing information. Furthermore, the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array can be determined as the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information.

[0119] In an optional embodiment, for each piece of user browsing information, when it is detected that the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array is occupied, it is also possible to determine whether the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array is occupied. When it is detected that the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array is occupied, the hash value stored in the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array is removed, so as to store the hash value corresponding to the user browsing information in the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array.

[0120] In practical applications, for each piece of user browsing information, after removing the hash value stored in the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array, since any hash value has a corresponding storage location in all candidate buckets, furthermore, after removing the hash value, a candidate bucket with sufficient storage space to store the hash value can be selected from all candidate buckets to store the removed hash value.

[0121] In an optional embodiment, for each user browsing information, when it is detected that the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information is occupied, the hash value stored in the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information may also be removed, so as to store the hash value corresponding to the user browsing information in the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information.

[0122] In practical applications, for each user browsing information, after removing the hash value stored in the storage location of the first candidate bucket in the corresponding target bucket array for the hash value corresponding to the user browsing information, since any hash value has a corresponding storage location in all candidate buckets, after removing the hash value, a candidate bucket with sufficient storage space to store the hash value can be selected from all candidate buckets to store the removed hash value.

[0123] In an optional embodiment, the method may further include the following steps:

[0124] According to the current time and the creation time of each bucket array, determine the creation duration of each bucket array; compare the shortest creation duration among the creation durations of all bucket arrays with a preset first preset duration, and when the shortest creation duration is greater than or equal to the first preset duration, create a new bucket array and store the browsing information to be inserted into the new bucket array; for each bucket array, compare the creation duration of the bucket array with a preset second preset duration, and when the creation duration of the bucket array is greater than the second preset duration, delete the bucket array from all bucket arrays.

[0125] Among them, the shortest creation duration may be the creation duration with the smallest value among the creation durations of all bucket arrays, the first preset duration and the second preset duration may be set manually, and the browsing information to be inserted may be the user browsing information whose creation time is not in the storage period corresponding to all currently existing bucket arrays.

[0126] After obtaining the creation time of each bucket array, the difference between the current time and the creation time of each bucket array can be determined. Furthermore, the difference between the current time and the creation time of each bucket array can be determined as the creation duration of each bucket array, and the creation duration with the smallest difference can be determined as the shortest creation duration. The shortest creation duration can be compared with the preset first preset duration. Furthermore, when the shortest creation duration is greater than the first preset duration, a new bucket array can be created and the browsing information to be inserted can be stored in the new bucket array.

[0127] In practical applications, when it is determined that the shortest creation duration is greater than or equal to the first preset duration, it can be indicated that the storage periods corresponding to all existing bucket arrays do not include the current moment, and thus the user browsing information obtained at the current moment cannot be stored correspondingly, that is, the browsing information to be inserted cannot be stored. When it is determined that the shortest creation duration is greater than the first preset duration, a new bucket array can be created to store the browsing information to be inserted in the new bucket array.

[0128] Please refer to Figure 3a , Figure 3a which is a schematic flowchart of creating a bucket array disclosed in an embodiment of the present invention. As Figure 3a shown, filter 2 can be the first bucket array, and the creation moment of filter 2 can be 2, filter 3 can be the second bucket array, and the creation moment of filter 3 can be 3, while the current moment can be 4, and the first preset duration can be 1. Furthermore, it can be determined that the shortest creation duration is the creation duration of filter 3, that is, the shortest creation duration is 1. Then it can be determined that the shortest creation duration is greater than or equal to the first preset duration, and a new filter 4 is created, that is, a new bucket array is created, and the creation moment of filter 4 is 4.

[0129] After determining the creation duration of each bucket array, for each bucket array, the creation duration of the bucket array can be compared with a preset second preset duration, and when the creation duration of the bucket array is greater than the second preset duration, the bucket array can be deleted from all bucket arrays.

[0130] In practical applications, according to the information recommendation strategy, it can be determined that the information browsed by the user in the recent N days is the information recently browsed by the user. Furthermore, when recommending relevant information, the information browsed by the user in the recent N days can be not recommended to the target user. It can be determined that the information browsed by the user in the recent N + 1 days is the information not browsed by the user. Furthermore, when recommending relevant information, the information browsed by the user in the recent N + 1 days can be recommended to the target user, where N can be corresponding to the information recommendation strategy or can be a value set manually, such as determining that the information browsed by the user in the recent 3 days is the information recently browsed by the user.

[0131] Then for each bucket array, when the creation duration of the bucket array is greater than the second preset duration, it can be indicated that all the user browsing information stored in the bucket array is the information not browsed by the user. When recommending relevant information, all the user browsing information stored in the bucket array can be recommended to the target user, and when recommending relevant information, it is not necessary to determine whether there is user browsing information corresponding to the relevant information recommended to the target user in the bucket array. Furthermore, the bucket array can be deleted from all bucket arrays.

[0132] Please refer to Figure 3b , Figure 3b which is a schematic flowchart of deleting a bucket array disclosed in an embodiment of the present invention. AsFigure 3b As shown, the filter 1 can be the first bucket array, and the creation time of the filter 1 can be 1. The filter 2 can be the second bucket array, and the creation time of the filter 2 can be 2. The filter 3 can be the third bucket array, and the creation time of the filter 3 can be 3. And the current time can be 4, and the first preset duration can be 2. Thus, it can be determined that the creation duration of the filter 1 is 3, the creation duration of the filter 2 is 2, and the creation duration of the filter 3 is 1. Then, it can be determined that the creation duration of the filter 1 is greater than the first preset duration, and the creation durations of the filter 2 and the filter 3 are less than the first preset duration. Thus, the filter 1 can be deleted.

[0133] It can be seen that in the embodiment of the present invention, only the hash values corresponding to the user browsing information are stored correspondingly, and the corresponding user browsing information can also be deleted according to time, having the function of eliminating information according to time.

[0134] In the embodiment of the present invention, at least one created bucket array is determined, and the creation time of each bucket array is determined. At least one user browsing information browsed by the target user is obtained, and the browsing time of each user browsing information is determined. For each user browsing information, according to the storage period corresponding to each bucket array, the target storage period in which the browsing time of the user browsing information is located is determined from the storage periods corresponding to all bucket arrays, and the target bucket array corresponding to the target storage period is determined as the target bucket array corresponding to the user browsing information. For each user browsing information, the identification information corresponding to the user browsing information is determined, and the identification information corresponding to the user browsing information is hashed through a preset hash function to obtain the hash value corresponding to the user browsing information, and the storage position of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information is determined. For each user browsing information, the hash value corresponding to the user browsing information is stored at the storage position in the target bucket array corresponding to the user browsing information. It can be seen that implementing the present invention can only store the hash values corresponding to the user browsing information correspondingly, further saving a large amount of storage space and reducing the storage cost.

[0135] Embodiment III

[0136] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of an information storage device disclosed in the embodiment of the present invention. As Figure 4 shown, the information storage device can be applied to a terminal device or an Internet server. The information storage device can include:

[0137] A determination module 401 is configured to determine at least one created bucket array and determine the creation time of each bucket array; each bucket array is used to store the user's browsed information within its corresponding storage period, and the storage period corresponding to any bucket array is determined according to the creation time of the bucket array and the creation time of the first bucket array created after the creation of the bucket array.

[0138] An acquisition module 402 is configured to acquire at least one user browsing information browsed by a target user and determine the browsing time of each user browsing information.

[0139] A storage module 403 is configured to store each user browsing information in the determined bucket array according to the browsing time of each user browsing information, the creation time of each bucket array, and the storage period corresponding to each bucket array.

[0140] As an optional implementation manner, the specific manner in which the storage module 403 stores each user browsing information in the determined bucket array according to the browsing time of each user browsing information, the creation time of each bucket array, and the storage period corresponding to each bucket array is as follows:

[0141] For each user browsing information, according to the storage period corresponding to each bucket array, determine the target storage period in which the browsing time of the user browsing information is located from the storage periods corresponding to all bucket arrays, and determine the target bucket array corresponding to the target storage period as the target bucket array corresponding to the user browsing information; for each user browsing information, store the user browsing information in the target bucket array corresponding to the user browsing information.

[0142] As an optional implementation manner, the determination module 401 is further configured to determine the identification information uniquely corresponding to the target browsing information to be traversed.

[0143] Refer to Figure 5 It is a schematic structural diagram of another network interaction room distribution device disclosed in an embodiment of the present invention. As Figure 5 shown, the device further includes:

[0144] A traversal module 404 traverses the target browsing information corresponding to the identification information in sequence from all currently existing bucket arrays in the order of the longest creation duration to the shortest until the target browsing information is traversed or all currently existing bucket arrays are traversed; wherein, the target browsing information is the user browsing information to be queried or the user browsing information to be deleted.

[0145] As an optional implementation manner, the specific manner in which the storage module 403 stores each user browsing information in the target bucket array corresponding to the user browsing information is as follows:

[0146] For each user browsing information, determine the identification information corresponding to the user browsing information, and hash the identification information corresponding to the user browsing information through a preset hash function to obtain the hash value corresponding to the user browsing information, and determine the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information; for each user browsing information, store the hash value corresponding to the user browsing information at the storage location in the target bucket array corresponding to the user browsing information.

[0147] As an optional implementation manner, the bucket array includes at least two candidate buckets. The specific manner for the storage module 403 to determine the storage location of the hash value corresponding to each user browsing information in the target bucket array corresponding to the user browsing information is as follows:

[0148] For each user browsing information, determine the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array through a preset hash function, and determine the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array; for each user browsing information, determine the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information according to the occupancy of the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array and the occupancy of the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array.

[0149] As an optional implementation manner, the specific manner for the storage module 403 to determine the storage location of the hash value corresponding to each user browsing information in the target bucket array corresponding to the user browsing information according to the occupancy of the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array and the occupancy of the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array is as follows:

[0150] For each user browsing information, detect whether the storage location of the first candidate bucket of the hash value corresponding to the user browsing information in the corresponding target bucket array is occupied, and when it is detected that the storage location of the first candidate bucket of the hash value corresponding to the user browsing information in the corresponding target bucket array is not occupied, determine the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array as the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information; for each user browsing information, when it is detected that the storage location of the first candidate bucket of the hash value corresponding to the user browsing information in the corresponding target bucket array is occupied, determine the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array as the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information.

[0151] As an optional implementation manner, the determining module 402 is further configured to determine the creation duration of each bucket array according to the current moment and the creation moment of each bucket array;

[0152] The apparatus further includes:

[0153] A comparison module 405, configured to compare the shortest creation duration among the creation durations of all bucket arrays with a preset second preset duration, and when the shortest creation duration is greater than the second preset duration, create a new bucket array and store the browsing information to be inserted into the new bucket array; for each bucket array, compare the creation duration of the bucket array with a preset third preset duration, and when the creation duration of the bucket array is greater than the third preset duration, delete the bucket array from all bucket arrays.

[0154] In an embodiment of the present invention, at least one created bucket array is determined, and the creation moment of each of the bucket arrays is determined; each of the bucket arrays is used to store the user-browsed information within the storage period corresponding to it, and the storage period corresponding to any one of the bucket arrays is determined according to the creation moment of the bucket array and the creation moment of the first bucket array created after the creation of the bucket array; at least one user browsing information browsed by a target user is obtained, and the browsing moment of each of the user browsing information is determined; according to the browsing moment of each of the user browsing information and the storage period corresponding to each of the bucket arrays, each of the user browsing information is correspondingly stored in the determined bucket array. It can be seen that implementing the present invention can only store the user browsing information correspondingly, saving a large amount of storage space and reducing the storage cost.

[0155] Embodiment 4

[0156] Please refer to Figure 6 , Figure 6It is a schematic structural diagram of another information storage device disclosed in an embodiment of the present invention. As Figure 6 shown, the information storage device may include:

[0157] A memory 501 storing executable program code;

[0158] A processor 502 coupled to the memory 501;

[0159] The processor 502 calls the executable program code stored in the memory 501 and executes the steps in the information storage method described in Embodiment 1 or Embodiment 2 of the present invention.

[0160] Embodiment 5

[0161] An embodiment of the present invention discloses a computer storage medium. The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the steps in the information storage method described in Embodiment 1 or Embodiment 2 of the present invention.

[0162] Embodiment 6

[0163] An embodiment of the present invention discloses a computer program product. The computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the steps in the information storage method described in Embodiment 1 or Embodiment 2.

[0164] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.

[0165] Through the specific descriptions of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, and the storage medium includes read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc memories, magnetic disk memories, tape memories, or any other medium that can be used to carry or store data and is computer-readable.

[0166] Finally, it should be noted that what is disclosed in an information storage method and device disclosed in the embodiments of the present invention is only the preferred embodiments of the present invention, and is only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for information storage, characterized in that, The method includes: Determine at least one created bucket array, and determine the creation time of each of the bucket arrays; each of the bucket arrays is used to store the user's viewed information within its corresponding storage period, and the storage period corresponding to any one of the bucket arrays is determined according to the creation time of this bucket array and the creation time of the first bucket array created after the creation of this bucket array; Obtain at least one user viewed information viewed by the target user, and determine the viewing time of each of the user viewed information; According to the viewing time of each of the user viewed information and the storage period corresponding to each of the bucket arrays, store each of the user viewed information in the determined bucket arrays correspondingly; The method further includes: Determine the identification information uniquely corresponding to the target viewed information to be traversed; From all the currently existing bucket arrays, traverse the target viewed information corresponding to the identification information in all the currently existing bucket arrays in the order from the longest creation duration to the shortest creation duration until the target viewed information is traversed or all the currently existing bucket arrays are traversed; Wherein, the target viewed information is the user viewed information to be queried or the user viewed information to be deleted, the target viewed information to be traversed is the user viewed information selected manually, the identification information uniquely corresponding to the target viewed information is used to represent the identity of the target viewed information, the identification information includes the label information, title information, abstract information, and serial number information of the target viewed information, the creation duration is the creation duration of the bucket array, and the creation duration of any bucket array is determined by the creation time of the bucket array and the current time.

2. The method for information storage according to claim 1, wherein The storing each of the user viewed information in the determined bucket arrays correspondingly according to the viewing time of each of the user viewed information and the storage period corresponding to each of the bucket arrays includes: For each of the user viewed information, determine the target storage period in which the viewing time of this user viewed information is located from the storage periods corresponding to all the bucket arrays according to the storage period corresponding to each of the bucket arrays, and determine the target bucket array corresponding to the target storage period as the target bucket array corresponding to this user viewed information; For each of the user viewed information, store this user viewed information in the target bucket array corresponding to this user viewed information.

3. The method for information storage according to claim 2, wherein The storing each of the user viewed information in the target bucket array corresponding to this user viewed information includes: For each of the user viewed information, determine the identification information corresponding to this user viewed information, perform hashing on the identification information corresponding to this user viewed information through a preset hash function to obtain the hash value corresponding to this user viewed information, and determine the storage position of the hash value corresponding to this user viewed information in the target bucket array corresponding to this user viewed information; For each of the user viewed information, store the hash value corresponding to this user viewed information in the storage position in the target bucket array corresponding to this user viewed information.

4. The method for information storage according to claim 3, characterized in that The bucket array includes at least two candidate buckets. For each piece of user browsing information, determining the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information includes: For each piece of user browsing information, determine the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array through a preset hash function, and determine the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array; For each piece of user browsing information, determine the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information according to the occupancy of the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array and the occupancy of the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array.

5. The method for information storage according to claim 4, wherein For each piece of user browsing information, determining the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information according to the occupancy of the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array and the occupancy of the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array includes: For each piece of user browsing information, detect whether the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array is occupied, and when it is detected that the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array is not occupied, determine the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array as the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information; For each piece of user browsing information, when it is detected that the storage location of the hash value corresponding to the user browsing information in the first candidate bucket of the corresponding target bucket array is occupied, determine the storage location of the hash value corresponding to the user browsing information in the second candidate bucket of the corresponding target bucket array as the storage location of the hash value corresponding to the user browsing information in the target bucket array corresponding to the user browsing information.

6. The method for information storage according to claim 5, wherein The method further includes: Determine the creation duration of each bucket array according to the current time and the creation time of each bucket array; Compare the shortest creation duration among the creation durations of all the bucket arrays with a preset second preset duration, and when the shortest creation duration is greater than the second preset duration, create a new bucket array and store the browsing information to be inserted into the new bucket array; For each bucket array, compare the creation duration of the bucket array with a preset third preset duration, and when the creation duration of the bucket array is greater than the third preset duration, delete the bucket array from all the bucket arrays.

7. An information storage device, characterized in that, The device includes: A determination module, configured to determine at least one created bucket array and determine the creation time of each of the bucket arrays; each of the bucket arrays is used to store user browsing information within its corresponding storage period, and the storage period corresponding to any one of the bucket arrays is determined according to the creation time of the bucket array and the creation time of the first bucket array created after the creation of the bucket array; An acquisition module, configured to acquire at least one user browsing information browsed by a target user and determine the browsing time of each of the user browsing information; A storage module, configured to store each of the user browsing information in the determined bucket array according to the browsing time of each of the user browsing information and the storage period corresponding to each of the bucket arrays; The apparatus further includes: The determination module is further configured to determine the identification information uniquely corresponding to the target browsing information to be traversed; A traversal module, configured to traverse the target browsing information corresponding to the identification information from all the currently existing bucket arrays in descending order of creation duration until the target browsing information is traversed or all the currently existing bucket arrays are traversed; Wherein, the target browsing information is the user browsing information to be queried or the user browsing information to be deleted, the target browsing information to be traversed is the user browsing information selected manually, the identification information uniquely corresponding to the target browsing information is used to represent the identity of the target browsing information, the identification information includes the label information, title information, abstract information, and serial number information of the target browsing information, the creation duration is the creation duration of the bucket array, and the creation duration of any bucket array is determined by the creation time of the bucket array and the current time.

8. An information storage device, characterized in that, The apparatus includes: A memory storing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory and executes the information storage method according to any one of claims 1-6.

9. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which are used to execute the information storage method according to any one of claims 1-6 when the computer instructions are called.

Citation Information

Patent Citations

  • Virtual bucket multiple hash tables for efficient memory in-line deduplication application

    CN107273397A

  • Information recommendation method and apparatus, and Bloom filter creation method and apparatus

    CN110781386A