WO2021203319A1 - 数据查询方法、装置及服务器 - Google Patents

数据查询方法、装置及服务器 Download PDF

Info

Publication number
WO2021203319A1
WO2021203319A1 PCT/CN2020/083809 CN2020083809W WO2021203319A1 WO 2021203319 A1 WO2021203319 A1 WO 2021203319A1 CN 2020083809 W CN2020083809 W CN 2020083809W WO 2021203319 A1 WO2021203319 A1 WO 2021203319A1
Authority
WO
WIPO (PCT)
Prior art keywords
portrait
user
target
dimensional information
order
Prior art date
Application number
PCT/CN2020/083809
Other languages
English (en)
French (fr)
Inventor
贾欣
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to CN202080094719.XA priority Critical patent/CN115023697A/zh
Priority to PCT/CN2020/083809 priority patent/WO2021203319A1/zh
Publication of WO2021203319A1 publication Critical patent/WO2021203319A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation

Definitions

  • This application relates to the field of Internet technology, and more specifically, to a data query method, device, and server.
  • Internet products have been widely used.
  • Internet products usually provide users with accurate push servers based on user profile data.
  • the existing storage method of user portrait data has a huge amount of data and is difficult to maintain.
  • this application proposes a data query method, device and electronic equipment to improve the above-mentioned problems.
  • the embodiment of the application provides a data query method, which is applied to a server, and the server stores user portrait data.
  • Each user portrait data includes a user ID, a portrait label corresponding to the first-order dimension, and two of the portrait label.
  • the second-order dimension information and the portrait value of the portrait label in the second-order dimension in the first-order dimension includes: obtaining query conditions, the query conditions including target portrait labels, target second-order dimensional information, and target portrait labels The target range of the portrait value; query the first user ID according to the target portrait label and target range, and query the second user ID according to the target portrait label and target second-order dimensional information; compare the queried first user ID and the second user ID Whether the same user ID exists, and if so, the same user ID is determined as the target user ID that meets the query conditions.
  • the embodiment of the application provides a data query device, which is applied to a server, and the server stores user portrait data.
  • Each user portrait data includes a user ID, a portrait label corresponding to the first-order dimension, and two of the portrait label.
  • the first-order dimension information and the portrait value of the second-order dimension of the portrait label in the first-order dimension the device includes: an obtaining module and a query module.
  • the obtaining module is used to obtain query conditions, the query conditions include target portrait label, target second-order dimensional information, and target range of the portrait value of the target portrait label; the query module is used to query the first user ID according to the target portrait label and target range , And query the second user ID according to the target portrait label and the target second-order dimensional information; compare whether the queried first user ID and the second user ID have the same user ID, and if so, determine the same user ID It is the target user ID that meets the query conditions.
  • an embodiment of the present application provides a server, including: one or more processors; a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to Executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.
  • an embodiment of the present application provides a computer-readable storage medium having program code stored thereon, and the program code can be invoked by a processor to execute the above-mentioned method.
  • each piece of user portrait data stored by the server includes a user ID, a portrait label corresponding to the first-order dimension, the second-order dimensional information of the portrait label, and the second-order portrait label in the first-order dimension.
  • the server obtains the query conditions.
  • the query conditions include the target portrait label, target second-order dimensional information, and the target range of the target portrait label's portrait value; query the first user ID according to the target portrait label and target range, and according to the target portrait label and target second-order
  • the dimension information queries the second user ID; compares whether the same user ID exists in the first user ID and the second user ID that are queried, and if there is, the same user ID is determined as a target user ID that meets the query conditions. In this way, the number of pieces of user portrait data that needs to be stored can be reduced when the user portrait query function is implemented, thereby reducing the difficulty of maintaining the user portrait data.
  • Fig. 1 shows a schematic diagram of an application environment suitable for embodiments of the present application.
  • Fig. 2 shows a flowchart of a data query method according to an embodiment of the present application.
  • Fig. 3 shows a flowchart of a data query method according to another embodiment of the present application.
  • FIG. 4 shows a flowchart of establishing a first inverted index in the embodiment shown in FIG. 3.
  • FIG. 5 shows a schematic diagram of the structure of the first inverted index and the second inverted index in the embodiment shown in FIG. 3.
  • FIG. 6 shows a flowchart of establishing a second inverted index in the embodiment shown in FIG. 3.
  • Fig. 7 shows a flowchart of a data query method according to another embodiment of the present application.
  • FIG. 8 shows a schematic diagram of a sub-step of step S740 shown in FIG. 7.
  • FIG. 9 shows a schematic diagram of another sub-step of step S740 shown in FIG. 7.
  • FIG. 10 shows another flowchart of the data query method of the embodiment shown in FIG. 7.
  • Fig. 11 shows a block diagram of a data query device provided by an embodiment of the present application.
  • FIG. 12 is a block diagram of a server for executing the data query method according to the embodiment of the present application according to an embodiment of the present application.
  • FIG. 13 is a storage unit for storing or carrying program code for implementing the data query method according to the embodiment of the present application according to an embodiment of the present application.
  • the storage format of user portrait data is: ⁇ User ID, TagKey, Value>.
  • the user ID is information used to indicate the identity of the user, for example, it may be a user account, a user ID, and so on.
  • TagKey also known as tag key, is used to indicate the specific meaning of portrait data. It can be a monitoring indicator of a specific dimension, such as the payment amount of the game dimension, and the activity of the game dimension. Value is the value corresponding to TagKey. In the case where TagKey is a monitoring indicator of a specific dimension, Value can be the specific monitoring value of the monitoring indicator.
  • the data that needs to be stored at least includes: User ID, game_fee, Value>, ⁇ User ID, game_type_fee, Value>, ⁇ User ID, gameId_fee, Value>.
  • game_fee, game_type_fee, and gameId_fee are all TagKeys
  • game_fee represents the payment amount of the game dimension, that is, all the fees paid by the user on the game
  • game_type_fee represents the payment amount of a specific game type, which represents the amount paid by the user on the game of that specific game type Fee
  • gameId_fee represents the payment amount of a specific game, that is, the fee paid by the user on the specific game.
  • FIG. 1 is a schematic diagram of an application environment provided by an embodiment of this application.
  • the server 100 may be communicatively connected with the server 200 and the electronic device 300 through a network.
  • the server 100 may obtain required user data from the electronic device 300, and store the obtained user data as user portrait data. Based on the stored user portrait data, the server 100 may provide a user portrait query service externally.
  • each piece of user portrait data stored in the server 100 includes a user ID, a portrait label corresponding to the first-order dimension, the second-order dimensional information of the portrait label, and the portrait label in the first-order dimension.
  • the portrait label in the user portrait data usually corresponds to a first-order dimension
  • the first-order dimension may be a business dimension, for example, a game dimension, a social application dimension, and so on.
  • the portrait label can be a monitoring indicator of the business dimension. Taking the portrait tag as the game activity as an example, the first-order dimension is the game dimension; taking the portrait tag as the social application activity as an example, the first-order dimension is the social application dimension.
  • Each first-order dimension may include at least two second-order dimensions.
  • the second-order dimension information in the user portrait data is used to indicate a specific second-order dimension, and the portrait value in the user portrait data may correspond to the second-order dimension in its corresponding first-order dimension.
  • the second-order dimension may be business type information or business identification.
  • the portrait value of the portrait tag may be the monitoring value of the above-mentioned monitoring index, and the monitoring value corresponds to the service type information under the service dimension or the service indicated by the service identifier.
  • game dimensions can be further divided into dimensions corresponding to different game types.
  • the dimensions corresponding to MOBA (Multiplayer online battle arena) types and the dimensions corresponding to tower defense can be regarded as second-order dimensions.
  • the second-order dimensional information may be game type information.
  • game dimensions can be further divided into dimensions corresponding to different games, that is, a specific game can be regarded as a dimension, for example, the dimension corresponding to game A and the dimension corresponding to game B can all be regarded as second-order dimensions, corresponding to
  • the second-order dimensional information may be a game identifier or a game name. This embodiment has no limitation on this.
  • a piece of user portrait data is ⁇ user ID u1, game_fee, game_type1, value1>, where game_fee is the portrait tag, which represents the payment amount of the game dimension; game_type1 is the second-order dimensional information, used to indicate a specific The game type, value1 represents the amount paid by the user corresponding to the user identifier u1 in the game_type1 game in the game dimension.
  • the server 200 is deployed with a server program that needs to use the user portrait query service.
  • the server program can access the server 100 through the network and use the user portrait query service provided by the server 100.
  • the electronic device 300 may be, for example, a smart phone, a tablet computer, a notebook computer, a wearable device, or the like.
  • the servers 100 and 200 may be traditional servers, cloud servers, etc., which are not limited in the embodiment of the present application.
  • FIG. 2 shows a schematic flowchart of a data query method provided by an embodiment of the present application. The method can be applied to the server 100 shown in FIG. 1. The steps included in the method are described below.
  • Step S110 Obtain query conditions, where the query conditions include a target portrait label, target second-order dimensional information, and a target range of portrait values of the target portrait label.
  • the query condition is used to indicate the user portrait feature that needs to be queried. Based on the query condition, the user ID of the user matching the user portrait feature can be queried, so that corresponding processing can be performed according to the user ID that meets the query condition .
  • the target portrait label refers to the portrait label that needs to be queried, and represents the specific meaning of the user portrait feature that needs to be queried.
  • the target second-order dimension information is used to indicate the dimension corresponding to the portrait value of the target portrait label to be queried.
  • the target range limits the range of the portrait value of the target portrait label that needs to be queried, that is, what needs to be queried is the target portrait label whose portrait value corresponds to the target second-order dimension and the portrait value belongs to the target range.
  • the server 100 may obtain the query conditions in multiple ways.
  • the server 200 may send a user portrait query request to the server 100 according to configuration or needs, and the user portrait query request may carry query conditions. After the server 100 receives the user portrait query request sent by the server 200, it can identify and extract the query conditions from the user portrait query request.
  • the server 100 can be used as a server to communicate with the client in the electronic device 300.
  • the server 100 can determine the user profile features that need to be queried according to its own needs or configuration, and then generate instructions for use. The query condition of the user portrait feature that needs to be queried.
  • Step S120 Query the first user ID according to the target portrait label and the target range, and query the second user ID according to the target portrait label and the target second-order dimensional information.
  • the query requirements are constantly changing.
  • the server 100 in order to achieve fast query, the server 100 usually builds an index for the stored user profile data, but the query conditions adapted to different index structures are different.
  • a single index structure is adopted at the bottom layer. In other words, after the query conditions are split into single conditions, the query is performed based on each single condition, correspondingly , The bottom layer can be indexed separately for each single condition, so as to support fast query for that single condition.
  • a single condition can be a combination of two specific fields.
  • the query conditions in step S110 can be split into two single conditions of ⁇ target portrait label, target range> and ⁇ target portrait label, target second-order dimensional information>, which can be based on ⁇ target portrait label, target range>, Query the user ID that meets the single condition of ⁇ target portrait label, target range> as the first user ID; based on ⁇ target portrait label, target second-order dimensional information>, query meets ⁇ target portrait label, target second-order dimensional information> A user ID with a single condition serves as the second user ID.
  • Step S130 Compare whether the same user ID exists in the first user ID and the second user ID that are queried. If yes, step S140 is performed; if not, step S150 can be performed.
  • Step S140 Determine the same user ID as a target user ID that meets the query condition.
  • Step S150 Return an empty query result.
  • step S120 Obtained through step S120 are user identities satisfying each single condition, and the server 100 can compare the obtained user identities satisfying different single conditions to determine whether there are the same user identities. If it exists, the same user ID is a user ID that satisfies each single condition at the same time, that is, a user ID that satisfies the query condition. Therefore, the same user ID can be determined as the target user ID and returned as the query result.
  • the storage structure of user portrait data has been changed. Since different dimensional information is stored in a piece of user portrait data, compared to storing user portrait data of different dimensions for a user, the need is greatly reduced. The number of stored user profile data.
  • the user portrait data query process has been improved on this basis. In this way, the user portrait data based on the improved storage structure can still provide multi-dimensional user portrait data query services.
  • the server 100 when the server 100 serves as a server to communicate with the client in the electronic device 300, the server 100 can determine the content to be pushed according to the user profile characteristics defined by the query conditions, and determine that the content meets the query conditions based on the query conditions. After the target user ID is identified, the content to be pushed is pushed to the client corresponding to the target user ID.
  • the data query method provided in this embodiment may further include the following steps: determine the content to be pushed according to the target portrait tag, target second-order dimensional information, and target range, and send a message corresponding to the queried target user identification The client side pushes the content to be pushed.
  • the target user identification being the target user account as an example
  • the client corresponding to the target user identification may be the client currently logged in with the target user account.
  • FIG. 3 is a flowchart of a data query method provided by another embodiment of this application. The method can be applied to the server 100 shown in FIG. 1. The steps included in the method are described below.
  • Step S210 Obtain query conditions, the query conditions including a target portrait label, target second-order dimensional information, and a target range of portrait values of the target portrait label.
  • step S210 The detailed implementation process of step S210 is similar to that of step S110. Please refer to the detailed description of step S110 above, which will not be repeated here.
  • Step S220 Obtain a first inverted index established based on portrait tags and portrait values in the user portrait data.
  • the first inverted index is an inverted index established based on portrait tags and portrait values.
  • the server 100 may establish a first inverted index when storing user portrait data for the first time, and in a subsequent process, after storing any piece of user portrait data, update the established first inverted index.
  • the process of establishing the first inverted index may be shown in FIG. 4, which is described in detail as follows.
  • Step S410 For each portrait label and each portrait value corresponding to the portrait label, determine each user identifier corresponding to the portrait label and the portrait value from the stored user portrait data, and establish the portrait label and the portrait value. The first association relationship between the value and each user identifier.
  • each portrait tag may have a different value.
  • an inverted index can be established for each portrait label appearing in the user portrait data stored by the server 100 and each value of the portrait label (ie, portrait value).
  • the user portrait data including the portrait label and the portrait value can be searched from the user portrait data stored in the server 100, and the user portrait data can be retrieved from
  • the user identification is extracted from the searched user portrait data, and all the extracted user identifications form a first user identification sequence, then the first user identification sequence can be associated with the portrait tag and the portrait value to obtain the first association relationship.
  • a first association relationship can be obtained, and each first association relationship is a data record including the portrait label, the portrait value, and the first user identification sequence.
  • Step S420 According to the portrait value in each of the first association relationships, sequentially store each of the first association relationships to obtain the first inverted index.
  • the first association relationship may be stored in order according to the size order of the portrait values in the first association relationship, for example, from largest to smallest or from smallest to largest.
  • the first inverted index may include sequential storage The first association relationship of each.
  • the structure of the user portrait data in the server 100 is ⁇ ID, TagKey, DynamicClass, Value>, ID is the user identification, TagKey is the portrait tag, DynamicClass is the second-order dimensional information, and Value is the portrait value.
  • ID is the user identification
  • TagKey is the portrait tag
  • DynamicClass is the second-order dimensional information
  • Value is the portrait value.
  • the first user identification sequence may be a BitSet (binary bit) structure.
  • TagKey and Value1 can correspond to Invert ID BitSet1 (inverted user identification binary bit structure 1).
  • TagKey and Value2 can correspond to Invert ID BitSet2 (inverted user identification binary bit structure 2)
  • TagKey and Value3 can correspond to Invert ID BitSet3 (inverted user identification binary bit structure 3).
  • Step S230 According to the first inverted index, search for user identifiers corresponding to the target portrait tag and whose portrait value belongs to the target range as the first user identifier.
  • the server 100 may directly search for the first association relationship between the target portrait label and the portrait value belonging to the target range from the first inverted index based on the target portrait label and the target range, and combine the found first association relationship Each user ID in the first user ID sequence is determined as the first user ID.
  • Step S240 Obtain a second inverted index established based on the portrait label and the second-order dimensional information in the user portrait data.
  • the second inverted index is an inverted index established based on portrait tags and second-order dimensional information.
  • the server 100 may establish a second inverted index when storing user portrait data for the first time, and in a subsequent process, after storing any piece of user portrait data, update the established second inverted index.
  • step S220-step S230 and step S240-step S250 there is no restriction on the execution order between step S220-step S230 and step S240-step S250.
  • the establishment of the first inverted index and the second inverted index is not restricted in order, as long as the user portrait data is stored for the first time.
  • the process of establishing the second inverted index may be as shown in FIG. 6, which is described in detail as follows.
  • Step S610 for each portrait label and each second-order dimensional information corresponding to the portrait label, determine each user identifier corresponding to the portrait label and the second-order dimensional information from the stored user portrait data, and establish the portrait label , The second-order dimensional information and the second association relationship of each user identifier.
  • the portrait label corresponds to the first-order dimension
  • the first-order dimension may include at least two second-order dimensions
  • each second-order dimension may be represented by corresponding second-order dimension information.
  • the same portrait label may have different second-order dimensional information in different user portrait data. Therefore, for each portrait label appearing in the user portrait data stored by the server 100 and each second-order dimensional information corresponding to the portrait label, You can create an inverted index.
  • user portrait data including the portrait tag and the second-order dimensional information can be searched from the user portrait data stored in the server 100, and extracted from the searched user portrait data
  • User identification all the extracted user identifications can form a second user identification sequence, and then the second user identification sequence is associated with the portrait tag and the second-order dimensional information to obtain a second association relationship.
  • a second association relationship can be obtained, and each second association relationship is a data record including the portrait label, the second-order dimensional information, and the second user identification sequence.
  • FIG. 5 exemplarily shows the second inverted index B.
  • DynamicClass1 second-order dimensional information
  • DynamicClass2 second-order dimensional information 2
  • DynamicClass3 second-order dimensional information 2
  • you can search for user profile data including TagKey and DynamicClass1 extract the user ID from it, and get the second user ID sequence.
  • the second user identification sequence may adopt a BitSet structure.
  • TagKey and DynamicClass1 correspond to Invert ID BitSet1' (inverted user identification binary bit structure 1').
  • TagKey and DynamicClass2 correspond to Invert ID BitSet2' (inverted user identification binary bit structure 2 ')
  • TagKey and DynamicClass3 correspond to Invert ID BitSet3' (inverted user identification binary bit structure 3').
  • the data query method provided by this embodiment reduces the number of user profile data that needs to be stored without basically changing the amount of stored data, thereby reducing the workload of data processing and data maintenance. Reduce the difficulty of data maintenance.
  • Step S620 according to the second-order dimension information in each of the second association relationships, sequentially store each of the second association relationships to obtain the second inverted index.
  • the second-order dimensional information can be sorted according to a certain rule, for example, according to a given dictionary order, the server 100 can store each second association in sequence according to the order of the second-order dimensional information in the second association,
  • the second inverted index may include each second association relationship stored in sequence.
  • Step S250 According to the second inverted index, query the user identifier corresponding to the target portrait tag having the target second-order dimensional information as the second user identifier.
  • the server 100 may directly search for the second association relationship including the target portrait label and the target second-order dimensional information from the second inverted index based on the target portrait label and the target second-order dimensional information, and compare the found second association Each user identifier in the second user identifier sequence in the relationship is determined to be the second user identifier.
  • Step S260 Compare whether the same user ID exists in the first user ID and the second user ID that are queried. If yes, go to step S270; if not, go to step S280.
  • Step S270 Determine the same user ID as a target user ID that meets the query condition.
  • Step S280 Return an empty query result.
  • step S260 to step S280 is similar to step S130 to step S150.
  • step S130 to step S150 please refer to the relevant description above, which will not be repeated here.
  • the data query method provided in this embodiment can reduce the number of pieces of user portrait data that need to be stored while realizing a multi-dimensional query service of user portrait data, and reduce the difficulty of data processing and data maintenance.
  • by expanding the hierarchical structure of portrait tags, on the one hand it supports more detailed dimensional portrait tag data management.
  • support for more detailed user portrait query services can more accurately describe user portraits, such as label descriptions for a single game, a single application, etc., compared to the full game or full application dimension, which can be based on User characteristics can more accurately identify users, so as to achieve more accurate targeted push, thereby effectively improving user experience and increasing user stickiness.
  • FIG. 7 is a schematic flowchart of a data query method provided by another embodiment of this application. The method can be applied to the server 100 shown in FIG. 1. The steps included in the method are described below.
  • each piece of user portrait data stored by the server 100 may include a user ID, a portrait label corresponding to the first-order dimension, the second-order dimensional information of the portrait label, the third-order dimensional information of the portrait label, and the portrait value of the portrait label.
  • the portrait value corresponds to the third-order dimension in the second-order dimension in the first-order dimension.
  • the first-order dimension may be a game dimension
  • the second-order dimension may be a game type
  • the third-order dimension may be a specific game.
  • the second-order dimensional information may be game type information
  • the third-order dimensional information may be game identification or game name.
  • Step S710 Obtain query conditions.
  • the query conditions include at least a target portrait label, target second-order dimensional information, and a target range of portrait values of the target portrait label.
  • step S710 is similar to the above-mentioned step S110.
  • step S110 The detailed implementation process of step S710 is similar to the above-mentioned step S110.
  • step S110 For details, please refer to the relevant description above, which will not be repeated here.
  • Step S720 Query the first user ID according to the target portrait tag and the target range.
  • step S720 is similar to the above-mentioned step S120. For details, please refer to the relevant description above, which will not be repeated here.
  • Step S730 Identify whether the query condition includes the target third-order dimensional information of the target portrait tag. If yes, go to step S740; if not, go to step S750.
  • Step S740 Query a second user ID according to the target portrait tag, the target second-order dimensional information, and the target third-order dimensional information.
  • step S740 can be implemented through the process shown in FIG. 8, which is described in detail as follows.
  • Step S741 Obtain a second inverted index established based on the portrait label and second-order dimensional information in the user portrait data, and a third inverted index established based on the second-order dimensional information and third-order dimensional information in the user portrait data.
  • the method for establishing the second inverted index can refer to the above description of the steps shown in FIG. 6, which will not be described in detail here.
  • the method for establishing the third inverted index is similar to the first inverted index and the second inverted index, except that the third inverted index is established based on the second-order dimensional information and the third-order dimensional information.
  • the user portrait data including the second-order dimensional information and the third-order dimensional information can be searched, and the search
  • the user identification is extracted from the obtained user portrait data, and the extracted user identification forms a third user identification sequence.
  • the association relationship between the third user identification sequence, the second-order dimensional information and the third-order dimensional information is established, and the third connection relation. In this way, for each combination of second-order dimensional information and third-order dimensional information, a third association relationship can be obtained.
  • the server 100 may sort the third-order dimensional information in each third association relationship according to a certain rule (such as the above-mentioned dictionary order), and then store the third-order dimensional information in the third association relationship according to the sorting order. Three associations, you can get the third inverted index.
  • Step S742 According to the second inverted index and the third inverted index, query each user identifier corresponding to the target portrait tag having the target second-order dimensional information and the target third-order dimensional information, As the second user identifier.
  • the second association relationship including the target second-order dimensional information and the target portrait label can be searched from the second inverted index, and the second user identification sequence can be obtained from the found second association relationship.
  • Search for a third association relationship including target second-order dimensional information and target third-order dimensional information from the third inverted index and obtain a third user identification sequence from the found third association relationship.
  • the second user identification sequence is compared with the third user identification sequence, and the same user identification is determined therefrom as the second user identification.
  • step S740 can be implemented through the process shown in FIG. 9, which is described in detail as follows.
  • Step S743 Obtain a fourth inverted index established based on the portrait label, second-order dimensional information, and third-order dimensional information in the user portrait data, where the fourth inverted index is a multi-column joint index.
  • the query condition when the query condition can be split into more than three single conditions, at least two of the single conditions can be merged into one condition, and a multi-column joint index can be established for the conditions.
  • the user portrait data including portrait tags, second-order dimensional information, and third-order dimensional information can be searched from the user portrait data stored in the server 100, and the user ID can be extracted from the searched user portrait data, and the extracted user ID can be Form the fourth user identification sequence.
  • An association relationship between the fourth user identification sequence and the portrait label, the second-order dimensional information, and the third-order dimensional information is established to obtain a fourth association.
  • the four association relationships may be stored in sequence according to the order of the second-order dimensional information, and then the storage order of each fourth association relationship may be adjusted according to the order of the third-order dimensional information, so as to obtain the fourth inverted index.
  • Step S744 According to the fourth inverted index, query each user identifier corresponding to the target portrait tag having the target second-order dimensional information and the target third-order dimensional information as the second user identifier.
  • the fourth association relationship including the target second-order dimensional information, the target third-order dimensional information, and the target portrait tag can be searched from the fourth inverted index, and the fourth user in the found fourth association
  • the user identification in the identification sequence is determined to be the second user identification.
  • the process of comparing user identification sequences is omitted, the amount of operation is reduced, and the query speed is improved.
  • Step S750 Query a second user ID according to the target portrait tag and the target second-order dimensional information.
  • Step S760 Compare whether the same user ID exists in the first user ID and the second user ID that are queried. If yes, go to step S770; if not, go to step S780.
  • Step S770 Determine the same user ID as a target user ID that meets the query condition.
  • Step S780 Return an empty query result.
  • step S750-step S780 is similar to the above-mentioned step S120-step S150, and will not be repeated here.
  • each piece of user portrait data may also include other dimensional information of portrait tags, and is not limited to the above-mentioned second-order dimensional information and third-order dimensional information, which is not limited in this embodiment.
  • the data query processing process is similar to the foregoing embodiment.
  • a multi-column joint index can be established for a field that appears frequently in the query condition.
  • the data query method provided in this embodiment may further include the steps shown in FIG. 10.
  • Step S790 Count the number of target query conditions containing target third-order dimensional information in the obtained query conditions.
  • the target query condition refers to the query condition containing the target third-order dimensional information.
  • a first data variable can be set, which has an initial value.
  • the server 100 can determine whether the currently obtained query condition contains the target third-order dimensional information, and if so, the first data variable The value of accumulates by 1. In this way, the difference between the current value of the first data variable and the initial value may indicate the number of target query conditions currently obtained. Further, when the initial value is 0, the current value of the first data variable may indicate the number of target query conditions currently obtained.
  • Step S7100 If the number of the target query conditions reaches the first threshold, a fourth inverted index is established based on the portrait label, the second-order dimensional information, and the third-order dimensional information in the user portrait data.
  • the fourth inverted index may be established based on the portrait label, the second-order dimensional information, and the third-order dimensional information in the user portrait data.
  • the first threshold can be flexibly set, for example, it can be set based on statistical data or experience. For example, it can be 500-1000.
  • the frequency of use of the fourth inverted index can be periodically detected.
  • the fourth inverted index can be deleted.
  • the data query method provided in this embodiment may further include the following process: Step S790 is performed periodically, and if the number of target query conditions in the current period does not reach the second threshold, Then delete the fourth inverted index.
  • the server 100 may set the second data variable, and at the beginning of each cycle, set the current value of the second data variable as the initial value. In each cycle, every time a query condition is obtained, it can be judged whether the query condition contains the target third-order dimensional information. If it is, the current value of the second data variable is accumulated by 1. When the cycle ends, the third data can be added The value of the variable is set to the current value of the second data variable.
  • the server 100 may obtain the current value of the second data variable at the end of a period, and calculate the difference between the current value and the initial value, and the difference may be used as the target in the current period.
  • the number of query conditions may be obtained from the server 100.
  • the server 100 may obtain the current value of the third data variable as the number of the target query conditions in the current period.
  • the period can also be flexibly set, for example, it can be 1 minute, 10 minutes, half an hour, one hour, one day, and so on. It can be understood that the above-mentioned second threshold can be flexibly set according to the length of the period. For example, when the period is half an hour, the second threshold can be 300-500.
  • FIG. 10 shows a structural block diagram of a data query device provided by an embodiment of the present application.
  • the device 1000 may be applied to the server 100 shown in FIG. 1, and the device 1000 may include: an obtaining module 1010 and a query module 1020.
  • the obtaining module 1010 is configured to obtain query conditions, the query conditions including a target portrait label, target second-order dimensional information, and a target range of portrait values of the target portrait label.
  • the query module 1020 is configured to query the first user ID according to the target portrait label and the target range, and query the second user ID according to the target portrait label and the target second-order dimensional information; compare the queried first user ID Whether the same user ID exists in a user ID and the second user ID, if there is, the same user ID is determined as a target user ID that meets the query condition.
  • the device 1000 may further include a push module.
  • the push module can be used for the query module 1020 to determine the same user ID as the target user ID that meets the query conditions, and then determine the target user ID according to the target portrait tag, the target second-order dimensional information, and the target range.
  • Push content push the content to be pushed to the client corresponding to the target user identifier.
  • the query module 1020 may query the first user identification according to the target portrait label and the target range by: obtaining a first inverted index established based on the portrait label and portrait value in the user portrait data; The first inverted index is used to query the user ID corresponding to the target portrait label and whose portrait value of the target portrait label belongs to the target range as the first user ID.
  • the query module 1020 may query the second user identification according to the target portrait label and the target second-order dimensional information by: obtaining a second inverted index based on the portrait label and the second-order dimensional information in the user portrait data; The second inverted index searches for a user ID corresponding to the target portrait tag having the target second-order dimensional information as the second user ID.
  • the apparatus 1000 may further include an index establishment module.
  • the index establishment module can be used to establish the first inverted index in the following manner: for each portrait label and each portrait value corresponding to the portrait label, determine from the stored user portrait data to correspond to the portrait label and the portrait value And establish a first association relationship between the portrait label, the portrait value, and each user identifier; according to the portrait value in each first association relationship, store each first association relationship in turn to obtain The first inverted index.
  • the index establishment module can also be used to establish a second inverted index in the following way: for each portrait label and each second-order dimensional information corresponding to the portrait label, from the stored user portrait data, determine the portrait label and the portrait label Each user identifier corresponding to the second-order dimensional information is established, and a second association relationship between the portrait tag, the second-order dimensional information, and each user identifier is established; and the second-order dimensional information in each second association relationship is stored in sequence For each of the second association relationships, the second inverted index is obtained.
  • the apparatus 1000 may further include an index update module.
  • the index update module can be used to update the first inverted index according to the portrait label and portrait value in the piece of user portrait data after storing any piece of user portrait data; and after storing any piece of user portrait data, Update the second inverted index according to the portrait label and the second-order dimensional information in the piece of user portrait data.
  • each piece of user portrait data may also include the third-order dimensional information of the portrait label, the portrait value in the user portrait data and the third-order in the second-order dimension indicated by the second-order dimensional information in the user portrait data Corresponding dimensions.
  • the query module 1020 may also be used to: before querying the second user identifier according to the target portrait tag and the target second-order dimensional information, identify whether the query condition includes the target three of the target portrait tag. Order dimension information; if it is recognized that the query condition does not include the target third-order dimensional information, then execute the step of querying the second user ID according to the target portrait label and the target second-order dimensional information; if the The query condition includes target third-order dimensional information, and the second user ID can be queried according to the target portrait tag, the target second-order dimensional information, and the target third-order dimensional information.
  • one way for the query module 1020 to query the second user identifier according to the target portrait label, the target second-order dimensional information, and the target third-order dimensional information may be: obtaining a portrait label based on the user portrait data The second inverted index established with the second-order dimensional information, and the third inverted index established based on the second-order dimensional information and the third-order dimensional information in the user profile data; according to the second inverted index and the third An inverted index is used to query each user identifier corresponding to the target portrait tag having the target second-order dimensional information and the target third-order dimensional information as the second user identifier.
  • Another way for the query module 1020 to query the second user ID according to the target portrait label, the target second-order dimensional information, and the target third-order dimensional information may be: obtaining a portrait label based on the user portrait data and the second-order dimensional information.
  • the fourth inverted index established by the dimensional information and the third-order dimensional information, wherein the fourth inverted index is a multi-column joint index; according to the fourth inverted index, the query and the target second-order dimensional information and Each user identifier corresponding to the target portrait tag of the target third-order dimensional information serves as the second user identifier.
  • the index establishment module may also be used to: before the query module 1020 obtains the fourth inverted index established based on the portrait tags, the second-order dimensional information, and the third-order dimensional information in the user portrait data, in the query conditions obtained by statistics The number of target query conditions that include target third-order dimensional information; if the number of target query conditions reaches the first threshold, based on the portrait tag, second-order dimensional information, and third-order dimensional information in the user portrait data, a fourth inverse is established Row index.
  • the index update module can also be used to: periodically count the number of target query conditions that contain target third-order dimensional information in the obtained query conditions; if the number of target query conditions in the current period does not reach the second threshold, delete all query conditions.
  • the fourth inverted index is described.
  • the first-order dimension may be a business dimension
  • the second-order dimension information may be business type information or a business identifier
  • the portrait label may be a monitoring index of the business dimension
  • the portrait value of the portrait tag may be a monitoring value of the monitoring index, and the monitoring value may correspond to the service type information in the service dimension or the service indicated by the service identifier.
  • the business dimension may be a game dimension
  • the second-order dimension may be game type information or game name.
  • the coupling or direct coupling or communication connection between the displayed or discussed modules may be through some interfaces, and the indirect coupling or communication connection between the devices or modules may be electrical, Mechanical or other forms.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules.
  • FIG. 12 shows a structural block diagram of a server 100 provided by an embodiment of the present application.
  • the server 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more programs.
  • One or more programs may be stored in the memory 120 and configured to be composed of one or more programs.
  • Each processor 110 executes, and one or more programs are configured to execute the method described in the foregoing method embodiment.
  • the processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts of the entire server 100, and executes the server by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and calling data stored in the memory 120. 100's various functions and processing data.
  • the processor 110 may adopt at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PDA Programmable Logic Array
  • the processor 110 may be integrated with one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
  • the CPU mainly processes the operating system, user interface, and application programs; the GPU is used for rendering and drawing of display content; the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented by a communication chip alone.
  • the memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • the memory 120 may be used to store instructions, programs, codes, code sets or instruction sets.
  • the memory 120 may include a program storage area and a data storage area, where the program storage area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc.
  • the storage data area may also store data (such as user portrait data) created by the server 100 during use.
  • the structure of the server 200 is similar to that of the server 100, and will not be repeated here.
  • FIG. 13 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 1300 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment.
  • the computer-readable storage medium 1300 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 1300 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 1300 has storage space for the program code 1310 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
  • the program code 1310 may be compressed in an appropriate form, for example.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种数据查询方法、装置及服务器,涉及互联网技术领域。其中,该方法应用于服务器,服务器存储的每条用户画像数据包括用户标识、与一阶维度对应的画像标签、画像标签的二阶维度信息及画像标签在一阶维度中的二阶维度的画像值。该方法包括:获得包括目标画像标签、目标二阶维度信息和目标范围的查询条件;根据目标画像标签和目标范围查询第一用户标识,及根据目标画像标签和目标二阶维度信息查询第二用户标识,比较查询到的第一用户标识和第二用户标识中是否存在相同的用户标识,若存在,则将该相同的用户标识确定为符合查询条件的目标用户标识。如此,可以在实现用户画像查询的情况下,降低用户画像数据的维度难度。

Description

数据查询方法、装置及服务器 技术领域
本申请涉及互联网技术领域,更具体地,涉及一种数据查询方法、装置及服务器。
背景技术
随着互联网技术的飞速发展,互联网产品得到了广泛应用。目前,互联网产品通常会基于用户画像数据向用户提供精准的推送服务器。但是,现有的用户画像数据的存储方式,数据量巨大,难以维护。
发明内容
鉴于上述问题,本申请提出了一种数据查询方法、装置及电子设备,用以改善上述问题。
第一方面,本申请实施例提供了一种数据查询方法,应用于服务器,该服务器存储有用户画像数据,每条用户画像数据包括用户标识、与一阶维度对应的画像标签、画像标签的二阶维度信息以及画像标签在所述一阶维度中的所述二阶维度的画像值,所述方法包括:获得查询条件,该查询条件包括目标画像标签、目标二阶维度信息以及目标画像标签的画像值的目标范围;根据目标画像标签和目标范围查询第一用户标识,及根据目标画像标签和目标二阶维度信息查询第二用户标识;比较查询到的第一用户标识和第二用户标识中是否存在相同的用户标识,若存在,则将该相同的用户标识确定为符合查询条件的目标用户标识。
第二方面,本申请实施例提供了一种数据查询装置,应用于服务器,该服务器存储有用户画像数据,每条用户画像数据包括用户标识、与一阶维度对应的画像标签、画像标签的二阶维度信息以及画像标签在所述一阶维度中的所述二阶维度的画像值,所述装置包括:获得模块和查询模块。其中,获得模块用于获得查询条件,该查询条件包括目标画像标签、目标二阶维度信息以及目标画像标签的画像值的目标范围;查询模块用于根据目标画像标签和目标范围查询第一用户标识,及根据目标画像标签和目标二阶维度信息查询第二用户标识;比较查询到的第一用户标识和第二用户标识中是否存在相同的用户标识,若存在,则将该相同的用户标识确定为符合查询条件的目标用户标识。
第三方面,本申请实施例提供了一种服务器,包括:一个或多个处理器;存储器;一个或多个程序,其中所述一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述的方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有程序代码,所述程序代码可被处理器调用执行上述的方法。
相对于现有技术,本申请提供的方案,服务器存储的每条用户画像数据包括用户标识、与一 阶维度对应的画像标签、画像标签的二阶维度信息及画像标签在一阶维度中的二阶维度的画像值。服务器获得查询条件,查询条件包括目标画像标签、目标二阶维度信息以及目标画像标签的画像值的目标范围;根据目标画像标签和目标范围查询第一用户标识,及根据目标画像标签和目标二阶维度信息查询第二用户标识;比较查询到的第一用户标识和第二用户标识中是否存在相同的用户标识,若存在,则将该相同的用户标识确定为符合查询条件的目标用户标识。如此,可以在实现用户画像查询功能的情况下,减少需要存储的用户画像数据条数,从而降低了了用户画像数据的维护难度。
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了一种适用于本申请实施例的应用环境示意图。
图2示出了根据本申请一个实施例的数据查询方法流程图。
图3示出了根据本申请另一个实施例的数据查询方法流程图。
图4示出了图3所示实施例中建立第一倒排索引的流程图。
图5示出了图3所示实施例中第一倒排索引和第二倒排索引的结构示意图。
图6示出了图3所示实施例中建立第二倒排索引的流程图。
图7示出了根据本申请又一个实施例的数据查询方法流程图。
图8示出了图7所示步骤S740的一种子步骤示意图。
图9示出了图7所示步骤S740的另一种子步骤示意图。
图10示出了图7所示实施例的数据查询方法的另一流程图。
图11示出了本申请实施例提供的一种数据查询装置的框图。
图12是本申请实施例的用于执行根据本申请实施例的数据查询方法的服务器的框图。
图13是本申请实施例的用于保存或者携带实现根据本申请实施例的数据查询方法的程序代码的存储单元。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
一些场景中,用户画像数据的存储格式为:<用户标识,TagKey,Value>。其中,用户标识是用于表示用户身份的信息,比如,可以是用户帐户、用户ID等。TagKey又称标签键,用于表示画像数据的 具体含义,可以是特定维度的监控指标,比如可以是游戏维度的付费金额,游戏维度的活跃度等。Value是与TagKey对应的值,在TagKey是特定维度的监控指标的情况下,Value可以是该监控指标的具体监控值。采用上述的存储格式,对于每个用户,需要分别存储该用户的不同维度的用户画像数据,才能够为用户提供用户画像数据的多维度查询服务。
示例性地,为了提供不同用户在游戏上的支付金额、在特定游戏类型上的支付金额及在特定游戏上的支付金额等多个维度的用户画像数据查询服务,需要存储的数据至少包括:<用户标识,game_fee,Value>,<用户标识,game_type_fee,Value>,<用户标识,gameId_fee,Value>。其中,game_fee、game_type_fee、gameId_fee均为TagKey,game_fee表示游戏维度的支付金额,即用户在游戏上支付的所有费用;game_type_fee表示特定游戏类型的支付金额,表示用户在该特定游戏类型的游戏上支付的费用;gameId_fee表示特定游戏的支付金额,即用户在该特定游戏上支付的费用。此外,还需要存储游戏、游戏类型、具体游戏标识之间的对应关系等。
然而,实际应用中,用户量巨大,对应地,需要存储的用户画像数据的条数也会倍增,管理和维护的工作量也将增大,数据加工和维护难度上升。
发明人经过长期的研究,提出一种数据查询方法、装置及服务器,可以降低数据加工和数据维护的难度。下面将对该内容进行阐述。
请参照图1,图1为本申请实施例提供的应用环境示意图。其中,服务器100可以通过网络与服务器200和电子设备300通信连接。服务器100可以从电子设备300获取所需的用户数据,并将获取的用户数据存储为用户画像数据。基于存储的用户画像数据,服务器100可以对外提供用户画像查询服务。
本申请实施例中,服务器100中存储的每条用户画像数据包括用户标识、与一阶维度对应的画像标签、所述画像标签的二阶维度信息以及所述画像标签在所述一阶维度中的所述二阶维度的画像值。其中,用户画像数据中的画像标签通常与一阶维度对应,一阶维度可以是业务维度,例如,游戏维度、社交应用维度等。画像标签可以是业务维度的监控指标。以画像标签是游戏活跃度为例,其一阶维度为游戏维度;以画像标签是社交应用活跃度为例,其一阶维度为社交应用维度。
每个一阶维度可以包括至少两个二阶维度。用户画像数据中的二阶维度信息用于指示一个具体的二阶维度,用户画像数据中的画像值可以与其对应的一阶维度中的该二阶维度对应。在一阶维度是业务维度的情况下,二阶维度可以是业务类型信息或业务标识。画像标签的画像值可以是上述的监控指标的监控值,所述监控值与所述业务维度下的所述业务类型信息或所述业务标识指示的业务对应。
比如,游戏维度可以进一步划分为不同游戏类型对应的维度,例如MOBA(Multiplayer online battle arena,多人在线战斗竞技场游戏)类型对应的维度、塔防类对应的维度等均可以视为二阶维度,对应地,二阶维度信息可以是游戏类型信息。
又比如,游戏维度还可以进一步划分为不同的游戏对应的维度,即,一个具体的游戏可以作为一个 维度,例如游戏A对应的维度、游戏B对应的维度等均可以视为二阶维度,对应地,二阶维度信息可以是游戏标识或游戏名称等。本实施例对此没有限制。
一个具体的例子中,一条用户画像数据为<用户标识u1,game_fee,game_type1,value1>,其中,game_fee为画像标签,表示游戏维度的支付金额;game_type1是二阶维度信息,用于表示某个具体的游戏类型,value1表示用户标识u1对应的用户在游戏维度中game_type1类型的游戏上支付的金额。
服务器200部署有需要使用用户画像查询服务的服务端程序,该服务端程序可以通过网络访问服务器100,并使用服务器100提供的用户画像查询服务。电子设备300例如可以是智能手机、平板电脑、笔记本电脑、穿戴式设备等。服务器100和200可以是传统服务器、云服务器等,本申请实施例对此没有限定。
请参照图2,图2示出了本申请一实施例提供的数据查询方法的流程示意图,该方法可以应用于图1所示的服务器100。下面对该方法包括的步骤进行阐述。
步骤S110:获得查询条件,所述查询条件包括目标画像标签、目标二阶维度信息以及所述目标画像标签的画像值的目标范围。
本实施例中,所述查询条件用于指示需要查询的用户画像特征,基于所述查询条件可以查询符合所述用户画像特征的用户的用户标识,从而可以根据符合查询条件的用户标识进行相应处理。所述目标画像标签是指需要查询的画像标签,表示需要查询的用户画像特征的具体含义。目标二阶维度信息用于指示需要查询的目标画像标签的画像值对应的维度。所述目标范围限制了需要查询的目标画像标签的画像值的范围,即需要查询的是画像值与目标二阶维度对应,且画像值属于目标范围的目标画像标签。
可选地,服务器100获得查询条件的方式可以有多种。一种实施方式中,服务器200可以根据配置或需要向服务器100发送用户画像查询请求,该用户画像查询请求可以携带有查询条件。服务器100接收到服务器200发送的用户画像查询请求后,可以从该用户画像查询请求中识别并提取出所述查询条件。
另一种实施方式中,服务器100可以作为服务端与电子设备300中的客户端通信,在此情况下,服务器100可以根据自身需要或配置,确定需要查询的用户画像特征,进而生成用于指示所述需要查询的用户画像特征的查询条件。
步骤S120:根据所述目标画像标签和所述目标范围查询第一用户标识,及根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识。
实际应用中,查询需求是不断变化的,除了步骤S110中描述的查询条件外,还可能存在只包括目标画像标签和目标画像标签的画像值的目标范围的查询条件,或是包括更多维度信息的查询条件。此外,为了实现快速查询,服务器100通常会为存储的用户画像数据构建索引,但是不同索引结构适应的查询条件是不同的。本实施例中,为了使得服务器100可以实现对各种查询条件的快速查询,在底层采用单一索引结构,换言之,将查询条件拆分成单一条件后,分别基于每个单一条件进行查询,对应地,底层 可以针对每个单一条件分别建立索引,以用于支撑针对该单一条件的快速查询。其中,单一条件可以是两个具体字段的组合。
例如,步骤S110中的查询条件可以拆分为<目标画像标签,目标范围>,以及<目标画像标签,目标二阶维度信息>两个单一条件,从而可以基于<目标画像标签,目标范围>,查询符合<目标画像标签,目标范围>这一单一条件的用户标识作为第一用户标识;基于<目标画像标签,目标二阶维度信息>,查询符合<目标画像标签,目标二阶维度信息>这一单一条件的用户标识作为第二用户标识。
步骤S130:比较查询到的所述第一用户标识和所述第二用户标识中是否存在相同的用户标识。若是,则执行步骤S140;若否,则可以执行步骤S150。
步骤S140:将所述相同的用户标识确定为符合所述查询条件的目标用户标识。
步骤S150:返回空的查询结果。
通过步骤S120得到的是分别满足各个单一条件的用户标识,服务器100可以对获得的满足不同单一条件的用户标识进行比较,以确定其中是否存在相同的用户标识。如果存在,相同的用户标识即为同时满足各个单一条件的用户标识,即满足查询条件的用户标识,因而可以将所述相同的用户标识确定为目标用户标识,并作为查询结果返回。
对应地,如果分别满足不同单一条件的用户标识中不存在相同的用户标识,表示不存在满足查询条件的用户标识,则可以返回一个空集作为查询结果。
通过图2所示流程,对用户画像数据的存储结构进行了改动,由于将不同维度信息存储到了一条用户画像数据中,相较于分别存储一个用户的不同维度的用户画像数据,大大减少了需要存储的用户画像数据的条数。并且,在此基础上对用户画像数据的查询流程进行了改进,如此,基于改进后的存储结构的用户画像数据,仍旧可以提供多维度的用户画像数据查询服务。
进一步地,本实施例中,当服务器100作为服务端与电子设备300中的客户端通信时,服务器100可以根据查询条件限定的用户画像特征确定待推送内容,并在基于查询条件确定符合查询条件的目标用户标识后,向与目标用户标识对应的客户端推送该待推送内容。换言之,在执行步骤S140之后,本实施例提供的数据查询方法还可以包括以下步骤:根据目标画像标签、目标二阶维度信息及目标范围确定待推送内容,并向与查询到的目标用户标识对应的客户端推送所述待推送内容。其中,以目标用户标识是目标用户帐号为例,与目标用户标识对于的客户端可以是当前登录有目标用户帐号的客户端。
请参照图3,图3为本申请另一实施例提供的一种数据查询方法的流程图,该方法可以应用于图1所示的服务器100。下面对该方法包括的步骤进行阐述。
步骤S210:获得查询条件,所述查询条件包括目标画像标签、目标二阶维度信息以及所述目标画像标签的画像值的目标范围。
其中,步骤S210的详细实现流程与步骤S110类似,请参照上文关于步骤S110的详细描述,在此 不再赘述。
步骤S220:获得基于用户画像数据中的画像标签和画像值建立的第一倒排索引(inverted index)。
本实施例中,第一倒排索引是基于画像标签和画像值建立的倒排索引。服务器100可以在首次存储用户画像数据时建立第一倒排索引,并在后续过程中,存储任意一条用户画像数据之后,对已经建立的第一倒排索引进行更新。详细地,建立第一倒排索引的流程可以如图4所示,详细描述如下。
步骤S410:针对每个画像标签及与该画像标签对应的每个画像值,从存储的用户画像数据中确定与该画像标签和该画像值对应的各用户标识,并建立该画像标签、该画像值与所述各用户标识的第一关联关系。
本实施例中,画像标签可以有多种,例如可以为上述的游戏活跃度、游戏支付金额等,每个画像标签可以有不同的取值。对于服务器100存储的用户画像数据中出现每个画像标签,及该画像标签的每个取值(即,画像值),可以建立一个倒排索引。
详细地,基于一个画像标签和一个画像值(如前一实施例中的一个单一条件),可以从服务器100存储的用户画像数据中查找包括该画像标签和该画像值的用户画像数据,并从查找到的用户画像数据中提取用户标识,提取出的所有用户标识组成第一用户标识序列,则可以将第一用户标识序列与该画像标签和该画像值关联,从而得到第一关联关系。如此,针对每一画像标签和画像值的组合,可以得到一第一关联关系,每个第一关联关系为一条包括画像标签、画像值和第一用户标识序列的数据记录。
步骤S420:根据各所述第一关联关系中的画像值,依次存储各所述第一关联关系,得到所述第一倒排索引。
实施过程中,可以按照第一关联关系中的画像值的大小顺序,例如,从大到小的顺序或从小到大的顺序,依次存储各第一关联关系,第一倒排索引可以包括依次存储的各第一关联关系。
例如图5所示,假设服务器100中的用户画像数据的结构为<ID,TagKey,DynamicClass,Value>,ID为用户标识,TagKey为画像标签,DynamicClass为二阶维度信息,Value为画像值。则,可以基于存储的TagKey和Value建立第一倒排索引A。
[根据细则91更正 05.06.2020] 
图5所示示例中,服务器100中仅存在一个TagKey,分别出现了Value1(画像值1)、Value2(画像值2)、Value3(画像值3)三种取值,则可以查找包括TagKey和Value1的用户画像数据,从中提取用户标识,提取的用户标识可以组成第一用户标识序列。为节约存储空间,第一用户标识序列可以是BitSet(二进制位)结构。比如,TagKey和Value1可以和Invert ID BitSet1(倒排用户标识二进制位结构1)对应。类似地,TagKey和Value2可以和Invert ID BitSet2(倒排用户标识二进制位结构2)对应,TagKey和Value3可以和Invert ID BitSet3(倒排用户标识二进制位结构3)对应。
步骤S230:根据所述第一倒排索引,查询与所述目标画像标签对应、且所述目标画像标签的画像值属于所述目标范围的用户标识,作为第一用户标识。
详细地,服务器100可以直接基于目标画像标签和目标范围,从第一倒排索引中查找包括目标画像 标签和属于目标范围的画像值的第一关联关系,并将查找到的第一关联关系中的第一用户标识序列中的各用户标识确定为第一用户标识。
步骤S240:获得基于用户画像数据中的画像标签和二阶维度信息建立的第二倒排索引。
本实施例中,第二倒排索引是基于画像标签和二阶维度信息建立的倒排索引。服务器100可以在首次存储用户画像数据时建立第二倒排索引,并在后续过程中,存储任意一条用户画像数据之后,对已经建立的第二倒排索引进行更新。
可以理解,本实施例中,步骤S220-步骤S230与步骤S240-步骤S250之间没有执行顺序的限制。对应地,第一倒排索引和第二倒排索引的建立没有先后顺序限制,只要是在首次存储用户画像数据后即可。详细地,建立第二倒排索引的流程可以如图6所示,详细描述如下。
步骤S610,针对每个画像标签与该画像标签对应的每个二阶维度信息,从存储的用户画像数据中确定与该画像标签和该二阶维度信息对应的各用户标识,并建立该画像标签、该二阶维度信息和所述各用户标识的第二关联关系。
本实施例中,画像标签与一阶维度对应,一阶维度可以包括至少两个二阶维度,每个二阶维度可以通过对应的二阶维度信息表示。同一画像标签在不同的用户画像数据中可能具有不同的二阶维度信息,因而,对于服务器100存储的用户画像数据中出现的每个画像标签,及该画像标签对应的每个二阶维度信息,可以建立一个倒排索引。
详细地,基于一个画像标签和一个二阶维度信息,可以从服务器100存储的用户画像数据中查找包括该画像标签和该二阶维度信息的用户画像数据,并从查找到的用户画像数据中提取用户标识,提取出的所有用户标识可以组成第二用户标识序列,再将第二用户标识序列与该画像标签和该二阶维度信息关联,从而得到第二关联关系。如此,针对每一画像标签和二阶维度信息的组合,可以得到一第二关联关系,每个第二关联关系为一条包括画像标签、二阶维度信息和第二用户标识序列的数据记录。
[根据细则91更正 05.06.2020] 
请再次参照图5,其中示例性地示出了第二倒排索引B,假设服务器100存储的用户画像数据中仅出现了TagKey这一画像标签,且该画像标签分别与DynamicClass1(二阶维度信息1)、DynamicClass2(二阶维度信息2)、DynamicClass3(二阶维度信息2)对应,则可以查找包括TagKey和DynamicClass1的用户画像数据,从中提取用户标识,得到第二用户标识序列。可以理解,为了节约存储空间,第二用户标识序列可以采用BitSet结构。例如,图5所示场景中,TagKey和DynamicClass1与Invert ID BitSet1’(倒排用户标识二进制位结构1')对应,类似地,TagKey和DynamicClass2与Invert ID BitSet2’(倒排用户标识二进制位结构2')对应,TagKey和DynamicClass3和Invert ID BitSet3’(倒排用户标识二进制位结构3')对应。
结合图5所示场景,本实施例提供的数据查询方法在基本不改变存储数据量的情况下,减少了需要存储的用户画像数据的条数,从而降低了数据加工和数据维护的工作量,降低了数据维护难度。
步骤S620,根据各所述第二关联关系中的二阶维度信息,依次存储各所述第二关联关系,得到所述第二倒排索引。
其中,二阶维度信息可以按照一定规则进行排序,例如按照给定的字典顺序进行排序,服务器100可以按照第二关联关系中的二阶维度信息的所述排序,依次存储各第二关联关系,第二倒排索引可以包括依次存储的各第二关联关系。
步骤S250:根据所述第二倒排索引,查询与具有所述目标二阶维度信息的所述目标画像标签对应的用户标识,作为第二用户标识。
详细地,服务器100可以直接基于目标画像标签和目标二阶维度信息,从第二倒排索引中查找包括目标画像标签和目标二阶维度信息的第二关联关系,并将查找到的第二关联关系中的第二用户标识序列中的各用户标识确定为第二用户标识。
步骤S260:比较查询到的所述第一用户标识和所述第二用户标识中是否存在相同的用户标识。若是,执行步骤S270;若否,则可以执行步骤S280。
步骤S270:将所述相同的用户标识确定为符合所述查询条件的目标用户标识。
步骤S280:返回空的查询结果。
本实施例中,步骤S260-步骤S280的详细实现流程与步骤S130-步骤S150类似,详细请参照上文的相关描述,在此不再赘述。
本实施例提供的数据查询方法,可以在实现用户画像数据的多维度查询服务的情况下,减少需要存储的用户画像数据的条数,降低了数据加工和数据维护的难度。此外,通过扩展画像标签的层级结构,一方面支持了更细维度的画像标签数据管理。另一方面,支持更细维度的用户画像查询服务,可以更加精确地刻画用户画像,例如针对单个游戏、单个应用等维度的标签刻画,相比以全量游戏或全量应用的维度进行刻画,可以基于用户特征更精准地确定用户,从而实现更为精准的定向推送,从而有效改善用户体验,提升用户粘性。
请参照图7,图7为本申请又一实施例提供的一种数据查询方法的流程示意图,该方法可以应用于图1所示的服务器100。下面对该方法包括的步骤进行阐述。
本实施例中,服务器100存储的每条用户画像数据可以包括用户标识、与一阶维度对应的画像标签、画像标签的二阶维度信息、画像标签的三阶维度信息以及画像标签的画像值,其中,画像值与该一阶维度中的该二阶维度中的该三阶维度对应。一个例子中,一阶维度可以是游戏维度,二阶维度可以是游戏类型,三阶维度可以是具体的游戏。对应地,二阶维度信息可以是游戏类型信息,三阶维度信息可以是游戏标识或游戏名称。
步骤S710:获得查询条件,所述查询条件至少包括目标画像标签、目标二阶维度信息以及所述目标画像标签的画像值的目标范围。
步骤S710的详细实现流程与上述的步骤S110类似,详细请参照上文的相关描述,在此不再赘述。
步骤S720:根据所述目标画像标签和所述目标范围查询第一用户标识。
步骤S720的详细实现流程与上述的步骤S120类似,详细请参照上文的相关描述,在此不再赘述。
步骤S730:识别所述查询条件是否包括所述目标画像标签的目标三阶维度信息。若是,则执行步骤S740;若否,则执行步骤S750。
步骤S740:根据所述目标画像标签、所述目标二阶维度信息和所述目标三阶维度信息查询第二用户标识。
在查询条件中包含目标三阶维度信息的情况下,可以基于目标画像标签、目标二阶维度信息和目标三阶维度信息共同查询第二用户标识。一种可选的方式中,步骤S740可以通过图8所示流程实现,详细描述如下。
步骤S741:获得基于用户画像数据中的画像标签和二阶维度信息建立的第二倒排索引,以及基于用户画像数据中的二阶维度信息和三阶维度信息建立的第三倒排索引。
其中,第二倒排索引的建立方式可以参照上文关于图6所示步骤的描述,在此不再详述。第三倒排索引的建立方式与第一倒排索引和第二倒排索引类似,区别在于,第三倒排索引是基于二阶维度信息和三阶维度信息建立的。
详细地,对于服务器100存储的用户画像数据中出现的每个二阶维度信息和每个三阶维度信息,可以查找包括该二阶维度信息和该三阶维度信息的用户画像数据,并从查找到的用户画像数据中提取用户标识,提取的用户标识组成了第三用户标识序列,建立第三用户标识序列、该二阶维度信息和该三阶维度信息之间的关联关系,可以得到第三关联关系。如此,针对每一二阶维度信息和三阶维度信息的组合,可以得到一个第三关联关系。
服务器100可以按照一定规则(如,上述的字典顺序)各第三关联关系中的三阶维度信息进行排序,然后再按照第三关联关系中的三阶维度信息的所述排序,依次存储各第三关联关系,即可得到第三倒排索引。
步骤S742:根据所述第二倒排索引和所述第三倒排索引,查询与具有所述目标二阶维度信息和所述目标三阶维度信息的所述目标画像标签对应的各用户标识,作为所述第二用户标识。
实施时,可以从第二倒排索引中查找包括目标二阶维度信息和目标画像标签的第二关联关系,并从查找到的第二关联关系中获得第二用户标识序列。从第三倒排索引中查找包括目标二阶维度信息和目标三阶维度信息的第三关联关系,并从查找到的第三关联关系中获得第三用户标识序列。对第二用户标识序列和第三用户标识序列进行比较,从中确定相同的用户标识,作为第二用户标识。
另一种可选的方式中,步骤S740可以通过图9所示的流程实现,详细描述如下。
步骤S743:获得基于用户画像数据中的画像标签、二阶维度信息和三阶维度信息建立的第四倒排索引,其中,所述第四倒排索引为多列联合索引。
本实施例中,对于查询条件可以被拆分成三个以上单一条件时,可以将其中至少两个单一条件合并 为一个条件,并针对该条件建立多列联合索引。详细地,可以从服务器100存储的用户画像数据中查找包括画像标签、二阶维度信息和三阶维度信息的用户画像数据,并从查找到的用户画像数据中提取用户标识,提取的用户标识可以组成第四用户标识序列。建立第四用户标识序列与该画像标签、该二阶维度信息、该三阶维度信息的关联关系,得到第四关联关系。对于各第四关联关系,可以首先按照二阶维度信息的排序依次存储各四关联关系,再按照三阶维度信息的排序调整各第四关联关系的存储顺序,从而得到第四倒排索引。
步骤S744:根据所述第四倒排索引,查询与具有所述目标二阶维度信息和所述目标三阶维度信息的所述目标画像标签对应的各用户标识,作为所述第二用户标识。
本实施例中,可以从第四倒排索引中查找包括目标二阶维度信息、目标三阶维度信息和目标画像标签的第四关联关系,并将查找到的第四关联关系中的第四用户标识序列中的用户标识确定为第二用户标识。
通过第四倒排索引,省略了比较用户标识序列的过程,减少了操作量,提升了查询速度。
步骤S750:根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识。
步骤S760:比较查询到的所述第一用户标识和所述第二用户标识中是否存在相同的用户标识。若是,则执行步骤S770;若否,则执行步骤S780。
步骤S770:将所述相同的用户标识确定为符合所述查询条件的目标用户标识。
步骤S780:返回空的查询结果。
步骤S750-步骤S780的详细实现流程与上述的步骤S120-步骤S150类似,在此不再赘述。
可以理解,本实施例中,每条用户画像数据中还可以包括画像标签的其他维度信息,而不仅限于上述的二阶维度信息、三阶维度信息,本实施例对此没有限制。在用户画像数据包含更多维度信息的情况下,数据查询处理过程与上述实施例类似。
通过本实施例提供的数据查询方法,可以在实现多维度的用户画像查询服务的情况下,减少用户画像数据的存储条数,降低数据维护难度。
可选地,本实施例中,考虑到多列联合索引需要占据一定空间,因而可以对在查询条件中出现频率较高的字段建立多列联合索引。基于此,在执行步骤S743之前,本实施例提供的数据查询方法还可以包括图10所示的步骤。
步骤S790:统计获得的查询条件中包含目标三阶维度信息的目标查询条件的数量。
其中,目标查询条件是指包含目标三阶维度信息的查询条件。示例性地,可以设置一第一数据变量,其具有一初始值,服务器100每获得一个查询条件,可以判断当前获得的查询条件是否包含目标三阶维度信息,若是,则对该第一数据变量的值累加1。如此,所述第一数据变量的当前值与初始值的差值,可以表示当前已获得的目标查询条件的数量。进一步地,当所述初始值为0时,所述第一数据变量的当 前值可以表示当前已获得的目标查询条件的数量。
步骤S7100:若所述目标查询条件的数量达到第一阈值,则基于用户画像数据中的画像标签、二阶维度信息和三阶维度信息,建立第四倒排索引。
本实施例中,如果当前已获得的目标查询条件的数量达到第一阈值,则可以基于用户画像数据中的画像标签、二阶维度信息和三阶维度信息建立第四倒排索引。其中,建立第四倒排索引的详细过程可以参照上文的相关描述。所述第一阈值可以灵活设定,例如可以基于统计数据或经验来设置。比如,可以为500-1000。
进一步地,为了减少存储空间的浪费,在建立第四倒排索引之后,可以周期性地检测对该第四倒排索引的使用频率,当使用频率较低时,可以删除该第四倒排索引。基于此,在建立第四倒排索引之后,本实施例提供的数据查询方法还可以包括如下流程:周期性地执行步骤S790,若当前周期内所述目标查询条件的数量没有达到第二阈值,则删除所述第四倒排索引。
本实施例中,服务器100可以设置第二数据变量,在每个周期开始时,将第二数据变量的当前值设置为初始值。在每个周期内,每获得一个查询条件,则可以判断该查询条件是否包含目标三阶维度信息,若是,则对第二数据变量的当前值累加1,当周期结束时,可以将第三数据变量的值设置为第二数据变量的当前值。
一种可选的方式中,服务器100可以在一个周期结束时,获取第二数据变量的当前值,并计算该当前值与初始值的差值,该差值可以被作为当前周期内所述目标查询条件的数量。另一种可选的方式中,服务器100可以获取第三数据变量的当前值作为当前周期内所述目标查询条件的数量。
本实施例中,周期也可以灵活设置,例如,可以为1分钟、10分钟、半小时、一小时、一天等。可以理解,上述的第二阈值可以随周期的长短而灵活设置,例如,在周期为半小时的情况下,第二阈值可以为300-500。
通过本实施例提供的数据查询方法,可以在实现多维度的用户画像查询服务的情况下,减少需要存储的用户画像数据的条数,从而降低数据维护难度。
请参照图10,其示出了本申请实施例提供的一种数据查询装置的结构框图。该装置1000可以应用于图1所示的服务器100,该装置1000可以包括:获得模块1010和查询模块1020。
获得模块1010用于获得查询条件,所述查询条件包括目标画像标签、目标二阶维度信息以及所述目标画像标签的画像值的目标范围。
查询模块1020用于根据所述目标画像标签和所述目标范围查询第一用户标识,及根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识;比较查询到的所述第一用户标识和所述第二用户标识中是否存在相同的用户标识,若存在,则将所述相同的用户标识确定为符合所述查询条件的目标用户标识。
可选地,装置1000还可以包括推送模块。推送模块可以用于查询模块1020将所述相同的用户标识确定为符合所述查询条件的目标用户标识之后,根据所述目标画像标签、所述目标二阶维度信息及所述目标范围,确定待推送内容;向与所述目标用户标识对应的客户端推送所述待推送内容。
可选地,查询模块1020根据所述目标画像标签和所述目标范围查询第一用户标识的方式可以为:获得基于用户画像数据中的画像标签和画像值建立的第一倒排索引;根据所述第一倒排索引,查询与所述目标画像标签对应、且所述目标画像标签的画像值属于所述目标范围的用户标识,作为所述第一用户标识。
查询模块1020根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识的方式可以为:获得基于用户画像数据中的画像标签和二阶维度信息建立的第二倒排索引;根据所述第二倒排索引,查询与具有所述目标二阶维度信息的所述目标画像标签对应的用户标识,作为所述第二用户标识。
可选地,装置1000还可以包括索引建立模块。索引建立模块可以用于通过如下方式建立第一倒排索引:针对每个画像标签及与该画像标签对应的每个画像值,从存储的用户画像数据中确定与该画像标签和该画像值对应的各用户标识,并建立该画像标签、该画像值与所述各用户标识的第一关联关系;根据各所述第一关联关系中的画像值,依次存储各所述第一关联关系,得到所述第一倒排索引。
索引建立模块还可以用于通过如下方式建立第二倒排索引:针对每个画像标签和与该画像标签对应的每个二阶维度信息,从存储的用户画像数据中确定与该画像标签和该二阶维度信息对应的各用户标识,并建立该画像标签、该二阶维度信息和所述各用户标识的第二关联关系;根据各所述第二关联关系中的二阶维度信息,依次存储各所述第二关联关系,得到所述第二倒排索引。
可选地,装置1000还可以包括索引更新模块。索引更新模块可以用于在存储任意一条用户画像数据后,根据该条用户画像数据中的画像标签和画像值,对所述第一倒排索引进行更新;以及在存储任意一条用户画像数据后,根据该条用户画像数据中的画像标签和二阶维度信息,更新所述第二倒排索引。
可选地,每条用户画像数据还可以包括画像标签的三阶维度信息,该用户画像数据中的画像值与该用户画像数据中的二阶维度信息指示的二阶维度中的所述三阶维度对应。
在此情况下,查询模块1020还可以用于:在根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识之前,识别所述查询条件是否包括所述目标画像标签的目标三阶维度信息;若识别出所述查询条件不包括目标三阶维度信息,再执行所述根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识的步骤;若识别出所述查询条件包括目标三阶维度信息,则可以根据所述目标画像标签、所述目标二阶维度信息和所述目标三阶维度信息查询第二用户标识。
可选地,查询模块1020根据所述目标画像标签、所述目标二阶维度信息和所述目标三阶维度信息查询第二用户标识的一种方式可以为:获得基于用户画像数据中的画像标签和二阶维度信息建立的第二倒排索引,以及基于用户画像数据中的二阶维度信息和三阶维度信息建立的第三倒排索引;根据所述第 二倒排索引和所述第三倒排索引,查询与具有所述目标二阶维度信息和所述目标三阶维度信息的所述目标画像标签对应的各用户标识,作为所述第二用户标识。
查询模块1020根据所述目标画像标签、所述目标二阶维度信息和所述目标三阶维度信息查询第二用户标识的另一种方式可以为:获得基于用户画像数据中的画像标签、二阶维度信息和三阶维度信息建立的第四倒排索引,其中,所述第四倒排索引为多列联合索引;根据所述第四倒排索引,查询与具有所述目标二阶维度信息和所述目标三阶维度信息的所述目标画像标签对应的各用户标识,作为所述第二用户标识。
可选地,索引建立模块还可以用于:在查询模块1020获得基于用户画像数据中的画像标签、二阶维度信息和三阶维度信息建立的第四倒排索引之前,统计获得的查询条件中包含目标三阶维度信息的目标查询条件的数量;若所述目标查询条件的数量达到第一阈值,则基于用户画像数据中的画像标签、二阶维度信息和三阶维度信息,建立第四倒排索引。
索引更新模块还可以用于:周期性地统计获得的查询条件中包含目标三阶维度信息的目标查询条件的数量;若当前周期内所述目标查询条件的数量没有达到第二阈值,则删除所述第四倒排索引。
可选地,本申请实施例中,所述一阶维度可以为业务维度,所述二阶维度信息可以为业务类型信息或业务标识,所述画像标签可以为所述业务维度的监控指标;对应地,所述画像标签的画像值可以为所述监控指标的监控值,所述监控值可以与所述业务维度下的所述业务类型信息或所述业务标识指示的业务对应。
进一步地,所述业务维度可以为游戏维度,所述二阶维度可以为游戏类型信息或游戏名称。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,所显示或讨论的模块相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
请参考图12,其示出了本申请实施例提供的一种服务器100的结构框图。本申请中的服务器100可以包括一个或多个如下部件:处理器110、存储器120、以及一个或多个程序,其中一个或多个程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个服务器100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存 储器120内的数据,执行服务器100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储服务器100在使用中所创建的数据(比如用户画像数据)等。
可以理解,服务器200的结构与服务器100类似,在此不再赘述。
请参考图13,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质1300中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质1300可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质1300包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质1300具有执行上述方法中的任何方法步骤的程序代码1310的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码1310可以例如以适当形式进行压缩。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种数据查询方法,其特征在于,应用于服务器,所述服务器存储有用户画像数据,每条用户画像数据包括用户标识、与一阶维度对应的画像标签、所述画像标签的二阶维度信息以及所述画像标签在所述一阶维度中的所述二阶维度的画像值,所述方法包括:
    获得查询条件,所述查询条件包括目标画像标签、目标二阶维度信息以及所述目标画像标签的画像值的目标范围;
    根据所述目标画像标签和所述目标范围查询第一用户标识,及根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识;
    比较查询到的所述第一用户标识和所述第二用户标识中是否存在相同的用户标识,若存在,则将所述相同的用户标识确定为符合所述查询条件的目标用户标识。
  2. 根据权利要求1所述的方法,其特征在于,在所述将所述相同的用户标识确定为符合所述查询条件的目标用户标识之后,所述方法还包括:
    根据所述目标画像标签、所述目标二阶维度信息及所述目标范围,确定待推送内容;
    向与所述目标用户标识对应的客户端推送所述待推送内容。
  3. 根据权利要求1或2所述的方法,其特征在于,所述根据所述目标画像标签和所述目标范围查询第一用户标识,包括:
    获得基于用户画像数据中的画像标签和画像值建立的第一倒排索引;
    根据所述第一倒排索引,查询与所述目标画像标签对应、且所述目标画像标签的画像值属于所述目标范围的用户标识,作为所述第一用户标识。
  4. 根据权利要求3所述的方法,其特征在于,所述第一倒排索引通过如下方式建立:
    针对每个画像标签及与该画像标签对应的每个画像值,从存储的用户画像数据中确定与该画像标签和该画像值对应的各用户标识,并建立该画像标签、该画像值与所述各用户标识的第一关联关系;
    根据各所述第一关联关系中的画像值,依次存储各所述第一关联关系,得到所述第一倒排索引。
  5. 根据权利要求3或4所述的方法,其特征在于,所述方法还包括:
    在存储任意一条用户画像数据后,根据该条用户画像数据中的画像标签和画像值,对所述第一倒排索引进行更新。
  6. 根据权利要求1-5中任意一项所述的方法,其特征在于,所述根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识,包括:
    获得基于用户画像数据中的画像标签和二阶维度信息建立的第二倒排索引;
    根据所述第二倒排索引,查询与具有所述目标二阶维度信息的所述目标画像标签对应的用户标识,作为所述第二用户标识。
  7. 根据权利要求6所述的方法,其特征在于,所述第二倒排索引通过如下方式建立:
    针对每个画像标签和与该画像标签对应的每个二阶维度信息,从存储的用户画像数据中确定与该画像标签和该二阶维度信息对应的各用户标识,并建立该画像标签、该二阶维度信息和所述各用户标识的第二关联关系;
    根据各所述第二关联关系中的二阶维度信息,依次存储各所述第二关联关系,得到所述第二倒排索引。
  8. 根据权利要求6或7所述的方法,其特征在于,所述方法还包括:
    在存储任意一条用户画像数据后,根据该条用户画像数据中的画像标签和二阶维度信息,更新所述第二倒排索引。
  9. 根据权利要求1-8中任意一项所述的方法,其特征在于,每条用户画像数据还包括画像标签的三阶维度信息,该用户画像数据中的画像值与该用户画像数据中的二阶维度信息指示的二阶维度中的所述三阶维度对应。
  10. 根据权利要求9所述的方法,其特征在于,在所述根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识之前,所述方法还包括:
    识别所述查询条件是否包括所述目标画像标签的目标三阶维度信息;
    若识别出所述查询条件不包括目标三阶维度信息,则执行所述根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识的步骤。
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:
    若识别出所述查询条件包括目标三阶维度信息,则根据所述目标画像标签、所述目标二阶维度信息和所述目标三阶维度信息查询第二用户标识。
  12. 根据权利要求11所述的方法,其特征在于,所述根据所述目标画像标签、所述目标二阶维度信息和所述目标三阶维度信息查询第二用户标识,包括:
    获得基于用户画像数据中的画像标签和二阶维度信息建立的第二倒排索引,以及基于用户画像数据中的二阶维度信息和三阶维度信息建立的第三倒排索引;
    根据所述第二倒排索引和所述第三倒排索引,查询与具有所述目标二阶维度信息和所述目标三阶维度信息的所述目标画像标签对应的各用户标识,作为所述第二用户标识。
  13. 根据权利要求11所述的方法,其特征在于,所述根据所述目标画像标签、所述目标二阶维度信息和所述目标三阶维度信息查询第二用户标识,包括:
    获得基于用户画像数据中的画像标签、二阶维度信息和三阶维度信息建立的第四倒排索引,其中,所述第四倒排索引为多列联合索引;
    根据所述第四倒排索引,查询与具有所述目标二阶维度信息和所述目标三阶维度信息的所述目标画像标签对应的各用户标识,作为所述第二用户标识。
  14. 根据权利要求13所述的方法,其特征在于,在所述获得基于用户画像数据中的画像标签、二阶维度信息和三阶维度信息建立的第四倒排索引之前,所述方法还包括:
    统计获得的查询条件中包含目标三阶维度信息的目标查询条件的数量;
    若所述目标查询条件的数量达到第一阈值,则基于用户画像数据中的画像标签、二阶维度信息和三阶维度信息,建立第四倒排索引。
  15. 根据权利要求14所述的方法,其特征在于,在所述建立第四倒排索引之后,所述方法还包括:
    周期性地执行所述统计获得的查询条件中包含目标三阶维度信息的目标查询条件的数量的步骤;
    若当前周期内所述目标查询条件的数量没有达到第二阈值,则删除所述第四倒排索引。
  16. 根据权利要求1-8中任意一项所述的方法,其特征在于,
    所述一阶维度为业务维度,所述二阶维度信息为业务类型信息或业务标识,所述画像标签为所述业务维度的监控指标;所述画像标签的画像值为所述监控指标的监控值,所述监控值与所述业务维度下的所述业务类型信息或所述业务标识指示的业务对应。
  17. 根据权利要求16所述的方法,其特征在于,所述业务维度为游戏维度,所述二阶维度为游戏类型信息或游戏名称。
  18. 一种数据查询装置,其特征在于,应用于服务器,所述服务器存储有用户画像数据,每条用户画像数据包括用户标识、与一阶维度对应的画像标签、所述画像标签的二阶维度信息以及所述画像标签在所述一阶维度中的所述二阶维度的画像值,所述装置包括:
    获得模块,用于获得查询条件,所述查询条件包括目标画像标签、目标二阶维度信息以及所述目标画像标签的画像值的目标范围;
    查询模块,用于根据所述目标画像标签和所述目标范围查询第一用户标识,及根据所述目标画像标签和所述目标二阶维度信息查询第二用户标识;比较查询到的所述第一用户标识和所述第二用户标识中是否存在相同的用户标识,若存在,则将所述相同的用户标识确定为符合所述查询条件的目标用户标识。
  19. 一种服务器,其特征在于,包括:
    一个或多个处理器;
    存储器;
    一个或多个程序,其中所述一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-17中任意一项所述的方法。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-17中任意一项所述的方法。
PCT/CN2020/083809 2020-04-08 2020-04-08 数据查询方法、装置及服务器 WO2021203319A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080094719.XA CN115023697A (zh) 2020-04-08 2020-04-08 数据查询方法、装置及服务器
PCT/CN2020/083809 WO2021203319A1 (zh) 2020-04-08 2020-04-08 数据查询方法、装置及服务器

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/083809 WO2021203319A1 (zh) 2020-04-08 2020-04-08 数据查询方法、装置及服务器

Publications (1)

Publication Number Publication Date
WO2021203319A1 true WO2021203319A1 (zh) 2021-10-14

Family

ID=78022530

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/083809 WO2021203319A1 (zh) 2020-04-08 2020-04-08 数据查询方法、装置及服务器

Country Status (2)

Country Link
CN (1) CN115023697A (zh)
WO (1) WO2021203319A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064740A (zh) * 2022-01-17 2022-02-18 通联支付网络服务股份有限公司 用于查询数据的方法、设备和介质
CN115470254A (zh) * 2022-09-20 2022-12-13 中国建设银行股份有限公司 数据查询方法、装置、设备及存储介质
CN117009453A (zh) * 2023-10-07 2023-11-07 杭州雅拓信息技术有限公司 一种数字化营销实时查询客户所在客群列表的方法和系统
CN117422530A (zh) * 2023-12-19 2024-01-19 深圳华强电子交易网络有限公司 电子元器件信息推送方法、装置及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140280124A1 (en) * 2013-03-15 2014-09-18 Andrew Tikofsky Social Graph Sybils
CN105791157A (zh) * 2016-04-20 2016-07-20 腾讯科技(深圳)有限公司 一种流量的分配方法、分配系统、及服务器
CN109241408A (zh) * 2018-08-14 2019-01-18 深圳开黑科技有限公司 基于游戏陪玩平台的用户画像处理方法、设备及系统
CN110223186A (zh) * 2018-05-09 2019-09-10 腾讯科技(深圳)有限公司 用户相似度确定方法以及信息推荐方法
CN110489453A (zh) * 2019-07-02 2019-11-22 广东工业大学 基于大数据日志分析的用户游戏实时推荐方法及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140280124A1 (en) * 2013-03-15 2014-09-18 Andrew Tikofsky Social Graph Sybils
CN105791157A (zh) * 2016-04-20 2016-07-20 腾讯科技(深圳)有限公司 一种流量的分配方法、分配系统、及服务器
CN110223186A (zh) * 2018-05-09 2019-09-10 腾讯科技(深圳)有限公司 用户相似度确定方法以及信息推荐方法
CN109241408A (zh) * 2018-08-14 2019-01-18 深圳开黑科技有限公司 基于游戏陪玩平台的用户画像处理方法、设备及系统
CN110489453A (zh) * 2019-07-02 2019-11-22 广东工业大学 基于大数据日志分析的用户游戏实时推荐方法及系统

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064740A (zh) * 2022-01-17 2022-02-18 通联支付网络服务股份有限公司 用于查询数据的方法、设备和介质
CN115470254A (zh) * 2022-09-20 2022-12-13 中国建设银行股份有限公司 数据查询方法、装置、设备及存储介质
CN117009453A (zh) * 2023-10-07 2023-11-07 杭州雅拓信息技术有限公司 一种数字化营销实时查询客户所在客群列表的方法和系统
CN117009453B (zh) * 2023-10-07 2023-12-26 杭州雅拓信息技术有限公司 一种数字化营销实时查询客户所在客群列表的方法和系统
CN117422530A (zh) * 2023-12-19 2024-01-19 深圳华强电子交易网络有限公司 电子元器件信息推送方法、装置及电子设备
CN117422530B (zh) * 2023-12-19 2024-03-26 深圳华强电子交易网络有限公司 电子元器件信息推送方法、装置及电子设备

Also Published As

Publication number Publication date
CN115023697A (zh) 2022-09-06

Similar Documents

Publication Publication Date Title
WO2021203319A1 (zh) 数据查询方法、装置及服务器
CN111046034B (zh) 管理内存数据及在内存中维护数据的方法和系统
CN111061483B (zh) 编译优化方法、装置及电子设备
US9760604B2 (en) System and method for adaptive filtering of data requests
CN108228322B (zh) 一种分布式链路跟踪、分析方法及服务器、全局调度器
CN105511812A (zh) 一种存储系统大数据优化方法及装置
CN110765138A (zh) 数据查询方法、装置、服务器及存储介质
CN110505495A (zh) 多媒体资源抽帧方法、装置、服务器及存储介质
WO2023061177A1 (zh) 基于列式数据扫描的多数据发送和接收方法、装置和设备
WO2019226279A1 (en) Frequent pattern analysis for distributed systems
CN110727702A (zh) 数据查询方法、装置、终端和计算机可读存储介质
CN109710502B (zh) 日志传输方法、装置及存储介质
WO2022188646A1 (zh) 图数据处理方法、装置、设备、存储介质及程序产品
WO2022007596A1 (zh) 图像检索系统、方法和装置
US11556595B2 (en) Attribute diversity for frequent pattern analysis
CN113157609A (zh) 存储系统、数据处理方法、装置、电子设备及存储介质
CN113486025B (zh) 数据存储方法、数据查询方法及装置
CN115905168B (zh) 基于数据库的自适应压缩方法和装置、设备、存储介质
CN110674086A (zh) 数据合并方法、装置、电子设备及存储介质
WO2022001626A1 (zh) 注入时序数据的方法、查询时序数据的方法及数据库系统
CN114625805A (zh) 一种回测配置方法、装置、设备及介质
CN114756714A (zh) 一种图数据的处理方法、装置以及存储介质
CN115794876A (zh) 针对业务数据包的分片处理方法、装置、设备及存储介质
CN109739883A (zh) 提升数据查询性能的方法、装置和电子设备
CN114359610B (zh) 实体分类的方法、装置、设备以及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20929763

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 280223)

122 Ep: pct application non-entry in european phase

Ref document number: 20929763

Country of ref document: EP

Kind code of ref document: A1