CN111488386A - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN111488386A
CN111488386A CN202010289735.6A CN202010289735A CN111488386A CN 111488386 A CN111488386 A CN 111488386A CN 202010289735 A CN202010289735 A CN 202010289735A CN 111488386 A CN111488386 A CN 111488386A
Authority
CN
China
Prior art keywords
behavior data
user behavior
user
query
identification
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202010289735.6A
Other languages
Chinese (zh)
Other versions
CN111488386B (en
Inventor
张溪梦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yishu Technology Co ltd
Original Assignee
Beijing Yishu Technology Co ltd
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 Beijing Yishu Technology Co ltd filed Critical Beijing Yishu Technology Co ltd
Priority to CN202010289735.6A priority Critical patent/CN111488386B/en
Publication of CN111488386A publication Critical patent/CN111488386A/en
Application granted granted Critical
Publication of CN111488386B publication Critical patent/CN111488386B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2425Iterative querying; Query formulation based on the results of a preceding query
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Economics (AREA)
  • General Health & Medical Sciences (AREA)
  • Water Supply & Treatment (AREA)
  • Public Health (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure discloses a data query method and a data query device. One embodiment of the method comprises: acquiring a user behavior data set, wherein the user behavior data in the user behavior data set comprises a user identifier and behavior data; for user behavior data in the user behavior data set, storing the user identification in the user behavior data as a key and the behavior data in the user behavior data as a value; and responding to the received data query request for indicating the value corresponding to the query target key, and querying according to the target key to obtain a query result. The embodiment is beneficial to improving the query efficiency of the user behavior data.

Description

Data query method and device
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a data query method and device.
Background
With the rapid development of the internet and the increasing amount of users and user demands, mining and analysis of user behavior data are also developed. By accurately mining and analyzing the user behavior data, the intention of the user can be more accurately understood, and therefore more accurate service is provided for the user.
Currently, after the user behavior data is collected, the user behavior data is usually stored by using a relational database such as MySQ L, or by using a Distributed File system such as hdfs (hadoop Distributed File system).
Disclosure of Invention
The embodiment of the disclosure provides a data query method and a data query device.
In a first aspect, an embodiment of the present disclosure provides a data query method, including: acquiring a user behavior data set, wherein the user behavior data in the user behavior data set comprises a user identifier and behavior data; for user behavior data in the user behavior data set, storing the user identification in the user behavior data as a key and the behavior data in the user behavior data as a value; and responding to the received data query request for indicating the value corresponding to the query target key, and querying according to the target key to obtain a query result.
In some embodiments, for user behavior data in the user behavior data set, storing the user identifier in the user behavior data as a key and behavior data in the user behavior data as a value includes: and storing the user behavior data in the user behavior data set by utilizing an HBase or Cassandra or Bigtable database.
In some embodiments, the user behavior data in the user behavior data set further comprises at least one of: timestamp, session identification, event identification, page address, event attribute information.
In some embodiments, for user behavior data in the user behavior data set, storing the user identifier in the user behavior data as a key and behavior data in the user behavior data as a value includes: and for the user behavior data in the user behavior data set, taking the user identifier, the timestamp, the session identifier and the event identifier in the user behavior data as keys, and storing the event attribute information in the user behavior data as values.
In some embodiments, the target key includes a user identification and a timestamp.
In some embodiments, the target key includes a user identification, a timestamp, and a session identification.
In some embodiments, the target key includes a user identification, a timestamp, a session identification, and an event identification.
In a second aspect, an embodiment of the present disclosure provides a data query apparatus, including: an acquisition unit configured to acquire a user behavior data set, wherein user behavior data in the user behavior data set includes a user identifier and behavior data; a storage unit configured to store, for user behavior data in a user behavior data set, a user identifier in the user behavior data as a key and behavior data in the user behavior data as a value; and the query unit is configured to respond to the received data query request for indicating the value corresponding to the query target key, and perform query according to the target key to obtain a query result.
In some embodiments, the memory cell is further configured to: and storing the user behavior data in the user behavior data set by utilizing an HBase or Cassandra or Bigtable database.
In some embodiments, the user behavior data in the user behavior data set further comprises at least one of: timestamp, session identification, event identification, page address, event attribute information.
In some embodiments, the memory cell is further configured to: and for the user behavior data in the user behavior data set, taking the user identifier, the timestamp, the session identifier and the event identifier in the user behavior data as keys, and storing the event attribute information in the user behavior data as values.
In some embodiments, the target key includes a user identification and a timestamp.
In some embodiments, the target key includes a user identification, a timestamp, and a session identification.
In some embodiments, the target key includes a user identification, a timestamp, a session identification, and an event identification.
In a third aspect, an embodiment of the present disclosure provides a server, where the electronic device includes: one or more processors; storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, which computer program, when executed by a processor, implements the method as described in any of the implementations of the first aspect.
According to the data query method and device provided by the embodiment of the disclosure, after the user behavior data is acquired, the user behavior data is stored in a mode that the user identification in the user behavior data is used as a key and the behavior data in the user behavior data is used as a value. Therefore, after a data query request of a user is received, behavior data corresponding to a target key can be conveniently queried in real time from stored user behavior data according to the target key in the data query request, and therefore query efficiency for the user behavior data is improved.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a data query method according to the present disclosure;
FIG. 3 is a flow diagram of yet another embodiment of a data query method according to the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a data query method according to the present disclosure;
FIG. 5 is a schematic block diagram of one embodiment of a data query device according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary architecture 100 to which embodiments of the data query method or data query apparatus of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 interact with a server 105 via a network 104 to receive or send messages or the like. Various client applications may be installed on the terminal devices 101, 102, 103. For example, browser-like applications, search-like applications, instant messaging-like applications, social platform software, shopping-like applications, data analysis-like applications, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a server that processes user behavior data sets transmitted by the terminal devices 101, 102, 103. The server 105 may store the received user behavior data set according to a preset format, perform an inquiry from the stored user behavior data set when receiving an inquiry request sent by the terminal device 101, 102, 103, and the like, and may further return an inquiry result to the terminal device 101, 102, 103.
The user behavior data set may be directly stored locally in the server 105, and the server 105 may directly extract and process the locally stored user behavior data set, in which case the terminal apparatuses 101, 102, and 103 and the network 104 may not be present.
It should be noted that the data query method provided by the embodiment of the present disclosure is generally executed by the server 105, and accordingly, the data query apparatus is generally disposed in the server 105.
It should be further noted that the terminal devices 101, 102, and 103 may also have a data processing application installed therein, and the terminal devices 101, 102, and 103 may also store the user behavior data set according to a preset format based on the data processing application and respond to the query request of the user. In this case, the data query method may be executed by the terminal apparatuses 101, 102, and 103, and accordingly, the data query device may be provided in the terminal apparatuses 101, 102, and 103. At this point, the exemplary system architecture 100 may not have the server 105 and the network 104.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 105 is software, it may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a data query method according to the present disclosure is shown. The data query method comprises the following steps:
step 201, a user behavior data set is obtained.
In this embodiment, an executing body of the data query method (e.g., the server 105 shown in fig. 1) may obtain the user behavior data set from a local or other storage device (e.g., the terminal devices 101, 102, 103, etc. shown in fig. 1).
The user behavior data in the user behavior data set may include user identification and behavior data. Wherein the user identification may be used to identify the user. The representation method of the user identification can be flexibly set according to the actual application requirement. For example, an account of the user (e.g., an account registered by the user when using the client application) may be used as the user identifier.
Where the behavior data may be used to indicate various behaviors of the user. As an example, the behavior data may indicate various behaviors of the user when using the client application. It should be understood that the specific content of the behavior data can be flexibly set according to the actual application requirements and application scenarios.
Specifically, the behavior data may indicate, for example, the page browsing behavior of the user and the address of the browsed page, the clicking behavior and the clicked page element, the closing popup behavior and the content of the closed popup, and the like.
As another example, if the behavior data in the user behavior data set indicates the behavior of the user in the process of using the shopping application installed by the client, the behavior data may indicate, for example, the page browsing behavior of the user and the address of the browsed page, the behavior of joining a shopping cart and the name, price, etc. of the item joining the shopping cart, the ordering behavior and the attribute information of the item included in the order, and so on.
Step 202, regarding the user behavior data in the user behavior data set, taking the user identifier in the user behavior data as a key, and storing the user behavior data in the user behavior data as a value.
In this embodiment, each user behavior data in the user behavior data set may be stored in a key-value pair manner. Specifically, for each user behavior data in the user behavior data set, the user identifier in the user behavior data may be used as a key, and the behavior data in the user behavior data may be stored as a corresponding value.
Step 203, in response to receiving the data query request for indicating to query the value corresponding to the target key, performing query according to the target key to obtain a query result.
In this embodiment, after the user behavior data in the user behavior data set is stored, if a data query request is received, a corresponding query may be performed in the stored user behavior data to obtain a query result. Wherein, the data query request can be used for indicating the value corresponding to the query target key. The target key may index the key to which the value desired to be queried by the query request corresponds.
In this embodiment, the execution subject may receive a data query request sent by a user through a client used by the user. Then, the value corresponding to the target key can be queried, and the queried value is used as a query result.
Further, the execution subject may return the query result to the sender of the data query request, and the like. For example, the query results may be returned to the terminal device used by the user so that the user may view the query results.
Alternatively, a visualized query page may be provided to the user, through which the user may send a data query request. For example, in the query page, the user may be provided with an input box in which the target key can be input or selected, a button for transmitting a data query request including the target key input by the user, and the like. At this time, the user may input a target key and transmit a data query request for instructing to query a value corresponding to the target key to the execution main body by clicking the button.
Visual query pages such as graphics can ensure the intuitiveness and the operability of the data query process of a user.
In some optional implementation manners of this embodiment, when the database is used to store the user behavior data in the user behavior data set, a group of key value pairs corresponding to each user behavior data may be regarded as a unit, and each data row may be regarded as a mapping of a group of key value pairs, and the data row may be identified according to a key. The storage mode can greatly improve the data query speed when the quantity of the stored user behavior data is large.
In this embodiment, when storing the user behavior data in the user behavior data set, the non-relational distributed database may be used to store the user behavior data. Due to the self storage structure of the non-relational distributed database, compared with a relational database, the data query speed can be effectively improved.
It should be understood that the stored results for different non-relational databases may differ. For example, some non-relational distributed databases do not build secondary indexes or the like, thereby increasing data query speed.
In some optional implementations of this embodiment, the user behavior data in the user behavior data set further includes at least one of: timestamp, session identification, event identification, page address, event attribute information.
The timestamp may be used to indicate the time of occurrence of the corresponding user behavior data.
A Session identification (Session ID) may be used to identify a user Session. A session may refer to various sessions. For example, a session may refer to a complete session in which a user exits a client application from opening the client application while using the client application. It should be appreciated that the granularity of the session can be flexibly set by the skilled person depending on the requirements of the application.
The event identification may be used to identify an event. An event may refer to various behaviors of a user. For example, when the user uses the client application, the click operation of the user may be regarded as an event, the page browsing operation of the user may also be regarded as an event, and the user closes a page or pops a window. In general, a session may include several events. It should be understood that the granularity of the events can also be flexibly set by the skilled person according to the actual application requirements.
For example, the page address may be UR L (Uniform resource L atom), etc. of a page.
The event attribute information may refer to related attribute information of an event indicated by the corresponding event identification. In general, different events may have different attributes. For example, for an event that a user browses a page, the event attribute information corresponding to the event may include an address of the page browsed by the user, time to enter and leave the page, dwell time on the page, and the like. It should be understood that, for different events, the event attribute information recorded specifically may be flexibly set according to the actual application scenario.
Thus, the detailed user behavior data of the user indicated by the user identification can be queried through the user identification.
The method provided by the above embodiment of the present disclosure stores the user behavior data in a key value pair manner using the user identifier in the user behavior data as a key and using the behavior data in the user behavior data as a corresponding value. Therefore, when a data query request aiming at the target key is received, the stored user behavior data can be conveniently queried to obtain a query result, the query efficiency aiming at the user behavior data is improved, and the efficiency of subsequent processing work such as analysis and the like on the user behavior data is improved.
With further reference to FIG. 3, a flow 300 of yet another embodiment of a data query method is shown. The process 300 of the data query method includes the following steps:
step 301, a user behavior data set is obtained.
The specific implementation process of step 301 may refer to the related description of step 201 in the corresponding embodiment of fig. 2, and is not repeated herein.
Step 302, for the user behavior data in the user behavior data set, taking the user identifier in the user behavior data as a key and taking the behavior data in the user behavior data as a value, and storing the user behavior data in the user behavior data set by using the non-relational distributed database.
In this embodiment, the non-relational distributed database may include various existing and future non-relational distributed databases such as Redis, MongadDB, Neo4j, and the like.
Alternatively, the non-relational distributed database may include HBase, Cassandra, Bigtable, and the like. At this time, the user behavior data in the user behavior data set is stored by using a database such as HBase, Cassandra, or Bigtable.
Since Redis, MongodDB, Neo4j, HBase, Cassandra, and Bigtable are known data storage methods, specific storage results and usage methods of Redis, MongodDB, Neo4j, HBase, Cassandra, and Bigtable are not described herein again.
Step 303, in response to receiving a data query request for indicating to query a value corresponding to the target key, performing a query according to the target key to obtain a query result.
The specific execution process of step 303 may refer to the related description of step 203 in the corresponding embodiment of fig. 2, and is not repeated herein.
In the prior art, user behavior data are usually stored by using the techniques such as MySQ L and HDFS, but the MySQ L cannot well process massive user line behavior data, and the problems that data persistence is poor, multi-level indexes need to be established, only simple condition query can be performed and the like exist, so that the subsequent data query efficiency is low, the accuracy is poor, and full statistical analysis cannot be performed due to the fact that the user behavior data are stored by using the MySQ L.
The method provided by the embodiment of the present disclosure stores the user behavior data in the user behavior data set by using various non-relational distributed databases, and can improve the data query efficiency by using the characteristics of the storage structures of the non-relational distributed databases, thereby solving the problems in the prior art.
With further reference to FIG. 4, a flow 400 of yet another embodiment of a data query method is shown. The process 400 of the data query method includes the following steps:
step 401, a user behavior data set is obtained.
The specific execution process of step 401 may refer to the related description of step 201 in the corresponding embodiment of fig. 2, and is not repeated herein.
Step 402, for the user behavior data in the user behavior data set, taking the user identifier, the timestamp, the session identifier, and the event identifier in the user behavior data as keys, taking the event attribute information in the user behavior data as a value, and storing the user behavior data in the user behavior data set by using HBase.
In this embodiment, HBase uses a table to organize data, where the stored data has no specific data type and can be considered as an unexplained string, and each row in the table corresponds to one orderable row key and any number of columns.
When the HBase is used to store the user behavior data in the user behavior data set, the user identifier, the timestamp, the session identifier, and the event identifier in the user behavior data may be used as row keys, and the event attribute information in the user behavior data may be used as column values corresponding to the row keys.
It should be understood that the ordering of the row keys can be flexibly set according to the actual application requirements and different application scenes.
Alternatively, the row keys may be sequentially used in the order of the user identifier, the timestamp, the session identifier, and the event identifier.
Because HBase supports prefix query, behavior data of various granularities of each user can be conveniently queried by taking the sequence of user identification, timestamp, session identification and event identification as row keys.
For the user behavior data in the user behavior data set, when the user identifier, the timestamp, the session identifier, and the event identifier in the user behavior data are used as keys and the event attribute information in the user behavior data is used as a value, the behavior data in the user behavior data may include the event attribute information.
Step 403, in response to receiving the data query request for indicating to query the value corresponding to the target key, performing query according to the target key to obtain a query result.
In this embodiment, since the row key of the HBase may include several orderable keys, and the HBase supports prefix query, different types of queries may be performed according to the target key indicated by the data query request.
Alternatively, the target key may include only the user identification. At this time, the HBase is scanned according to the data query request indicating to query the value corresponding to the target key, and the obtained query result may include all user behavior data of the user indicated by the user identifier.
Optionally, the target key may include a user identification and a timestamp. At this time, the HBase is scanned according to the data query request indicating to query the value corresponding to the target key, and the obtained query result may include the user behavior data of the user indicated by the user identifier at the time indicated by the timestamp. Wherein the timestamp may indicate a point in time or may indicate a range of times. When the timestamp indicates a time range, the query result may include all user behavior data of the user indicated by the user identification within the time range indicated by the timestamp.
Optionally, the target key may include a user identification, a timestamp, and a session identification. At this time, the HBase is scanned according to the data query request indicating to query the value corresponding to the target key, and the obtained query result may include all user behavior data in the session indicated by the session identifier at the time indicated by the timestamp of the user indicated by the user identifier.
Optionally, the target key may include a user identification, a timestamp, a session identification, and an event identification. At this time, the HBase is scanned according to the data query request indicating to query the value corresponding to the target key, and the obtained query result may include all user behavior data in the event identified by the user identifier, the timestamp, the session identifier, and the event identifier.
Therefore, the user can flexibly send the data query request according to the actual application requirement so as to obtain the user behavior data with different granularities.
According to the data query method provided by the embodiment of the disclosure, the HBase is used for storing the user behavior data in the user behavior data set, and the user identifier, the timestamp, the session identifier and the event identifier are used as the row key, and the HBase can efficiently query according to the row key and can also quickly query according to the prefix matching of the row key, so that after the data query request is received, the HBase is used for querying, a query result can be returned in real time according to the data query request, the query time complexity is saved, the query efficiency is greatly improved, and meanwhile, the multidimensional combined analysis can be performed on the user behavior data.
With further reference to fig. 5, as an implementation of the method shown in the above-mentioned figures, the present disclosure provides an embodiment of a data query apparatus, which corresponds to the embodiment of the method shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 5, the data query apparatus 500 provided in the present embodiment includes an acquisition unit 501, a storage unit 502, and a query unit 503. Wherein the obtaining unit 501 is configured to obtain a user behavior data set, wherein the user behavior data in the user behavior data set includes a user identifier and behavior data; the storage unit 502 is configured to store, for user behavior data in a user behavior data set, a user identifier in the user behavior data as a key and behavior data in the user behavior data as a value; the query unit 503 is configured to, in response to receiving a data query request indicating that a value corresponding to a query target key is queried, perform a query according to the target key, and obtain a query result.
In the present embodiment, in the data query apparatus 500: the specific processing of the obtaining unit 501, the storing unit 502 and the querying unit 503 and the technical effects thereof can refer to the related descriptions of step 201, step 202 and step 203 in the corresponding embodiment of fig. 2, which are not repeated herein.
In some optional implementations of the present embodiment, the storage unit 502 is further configured to: and storing the user behavior data in the user behavior data set by utilizing an HBase or Cassandra or Bigtable database.
In some optional implementations of this embodiment, the user behavior data in the user behavior data set further includes at least one of: timestamp, session identification, event identification, page address, event attribute information.
In some optional implementations of the present embodiment, the storage unit 502 is further configured to: and for the user behavior data in the user behavior data set, taking the user identifier, the timestamp, the session identifier and the event identifier in the user behavior data as keys, and storing the event attribute information in the user behavior data as values.
In some alternative implementations of this embodiment, the target key includes a user identification and a timestamp.
In some alternative implementations of this embodiment, the target key includes a user identification, a timestamp, and a session identification.
In some optional implementations of this embodiment, the target key includes a user identification, a timestamp, a session identification, and an event identification.
The device provided by the above embodiment of the present disclosure acquires a user behavior data set through an acquisition unit, where user behavior data in the user behavior data set includes a user identifier and behavior data; the storage unit stores user behavior data in a user behavior data set in a mode that a user identifier in the user behavior data is used as a key and behavior data in the user behavior data is used as a value; the query unit responds to a received data query request for indicating a value corresponding to a query target key, queries according to the target key to obtain a query result, and therefore stored user behavior data can be conveniently queried to obtain the query result, query efficiency for the user behavior data is improved, and further efficiency of subsequent processing work such as analysis on the user behavior data is improved.
Referring now to FIG. 6, a schematic diagram of an electronic device (e.g., the server of FIG. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device/server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc., output devices 607 including, for example, a liquid crystal display (L CD), speaker, vibrator, etc., storage devices 608 including, for example, magnetic tape, hard disk, etc., and communication devices 609.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the server; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: acquiring a user behavior data set, wherein the user behavior data in the user behavior data set comprises a user identifier and behavior data; for user behavior data in the user behavior data set, storing the user identification in the user behavior data as a key and the behavior data in the user behavior data as a value; and responding to the received data query request for indicating the value corresponding to the query target key, and querying according to the target key to obtain a query result.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including AN object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a storage unit, and a query unit. Where the names of these units do not in some cases constitute a limitation of the unit itself, for example, the acquisition unit may also be described as a "unit for acquiring a user behavior data set".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A method of data query, comprising:
acquiring a user behavior data set, wherein the user behavior data in the user behavior data set comprises a user identifier and behavior data;
for the user behavior data in the user behavior data set, storing the user identification in the user behavior data as a key and the behavior data in the user behavior data as a value;
and responding to a received data query request for indicating a value corresponding to a query target key, and querying according to the target key to obtain a query result.
2. The method of claim 1, wherein storing the user behavior data in the user behavior data set with the user identifier in the user behavior data as a key and the behavior data in the user behavior data as a value comprises:
and storing the user behavior data in the user behavior data set by utilizing an HBase or Cassandra or Bigtable database.
3. The method of claim 1, wherein user behavior data in the set of user behavior data further comprises at least one of: timestamp, session identification, event identification, page address, event attribute information.
4. The method of claim 3, wherein storing the user behavior data in the user behavior data set with the user identifier in the user behavior data as a key and the behavior data in the user behavior data as a value comprises:
and for the user behavior data in the user behavior data set, taking the user identifier, the timestamp, the session identifier and the event identifier in the user behavior data as keys, and storing the event attribute information in the user behavior data as values.
5. The method of claim 4, wherein the target key includes a user identification and a timestamp.
6. The method of claim 4, wherein the target key comprises a user identification, a timestamp, and a session identification.
7. The method of claim 4, wherein the target key includes a user identification, a timestamp, a session identification, and an event identification.
8. A data query apparatus, wherein the apparatus comprises:
an obtaining unit configured to obtain a user behavior data set, wherein user behavior data in the user behavior data set includes a user identifier and behavior data;
a storage unit configured to store, for user behavior data in the user behavior data set, a user identifier in the user behavior data as a key and behavior data in the user behavior data as a value;
and the query unit is configured to respond to a received data query request for indicating a value corresponding to a query target key, and perform query according to the target key to obtain a query result.
9. A server, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202010289735.6A 2020-04-14 2020-04-14 Data query method and device Active CN111488386B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010289735.6A CN111488386B (en) 2020-04-14 2020-04-14 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010289735.6A CN111488386B (en) 2020-04-14 2020-04-14 Data query method and device

Publications (2)

Publication Number Publication Date
CN111488386A true CN111488386A (en) 2020-08-04
CN111488386B CN111488386B (en) 2023-09-29

Family

ID=71792527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010289735.6A Active CN111488386B (en) 2020-04-14 2020-04-14 Data query method and device

Country Status (1)

Country Link
CN (1) CN111488386B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821513A (en) * 2021-09-18 2021-12-21 阿里巴巴(中国)有限公司 Data processing method, device and storage medium
EP4134838A1 (en) * 2021-08-12 2023-02-15 Beijing Baidu Netcom Science Technology Co., Ltd. Word mining method and apparatus, electronic device and readable storage medium
US12086171B2 (en) 2021-08-12 2024-09-10 Beijing Baidu Netcom Science Technology Co., Ltd. Word mining method and apparatus, electronic device and readable storage medium

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298641A (en) * 2011-09-14 2011-12-28 清华大学 Method for uniformly storing files and structured data based on key value bank
US20120131355A1 (en) * 2009-07-29 2012-05-24 Nec Corporation Range search system, range search method, and range search program
CN102523131A (en) * 2011-12-07 2012-06-27 上海海高通信发展有限公司 User internet behavior collecting method and system and user internet behavior analyzing method and system
CN102855309A (en) * 2012-08-21 2013-01-02 亿赞普(北京)科技有限公司 Information recommendation method and device based on user behavior associated analysis
CN105426421A (en) * 2015-11-03 2016-03-23 武汉地大信息工程股份有限公司 Tense monitoring data quick visualization method and system
CN106021357A (en) * 2016-05-09 2016-10-12 泰华智慧产业集团股份有限公司 Distribution-based big data paging query method and system
CN106471501A (en) * 2016-03-24 2017-03-01 华为技术有限公司 The method of data query, the storage method data system of data object
CN106874316A (en) * 2015-12-14 2017-06-20 广州爱九游信息技术有限公司 A kind of methods of exhibiting of user's combined data, device and server
CN108090064A (en) * 2016-11-21 2018-05-29 腾讯科技(深圳)有限公司 A kind of data query method, apparatus, data storage server and system
US20180181606A1 (en) * 2014-07-07 2018-06-28 Xiaoying CHU Data storage methods, query methods, and apparatuses thereof
US20180189339A1 (en) * 2016-12-30 2018-07-05 Dropbox, Inc. Event context enrichment
CN108319608A (en) * 2017-01-16 2018-07-24 中国移动通信集团湖南有限公司 The method, apparatus and system of access log storage inquiry
CN109213781A (en) * 2018-08-27 2019-01-15 平安科技(深圳)有限公司 Air control data query method and device
CN109656930A (en) * 2018-12-27 2019-04-19 广州华多网络科技有限公司 Data query method, apparatus and system
CN110347722A (en) * 2019-07-11 2019-10-18 软通智慧科技有限公司 Data acquisition method, device, equipment and storage medium based on HBase
US20200057781A1 (en) * 2018-08-20 2020-02-20 Salesforce.org Mapping and query service between object oriented programming objects and deep key-value data stores

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120131355A1 (en) * 2009-07-29 2012-05-24 Nec Corporation Range search system, range search method, and range search program
CN102298641A (en) * 2011-09-14 2011-12-28 清华大学 Method for uniformly storing files and structured data based on key value bank
CN102523131A (en) * 2011-12-07 2012-06-27 上海海高通信发展有限公司 User internet behavior collecting method and system and user internet behavior analyzing method and system
CN102855309A (en) * 2012-08-21 2013-01-02 亿赞普(北京)科技有限公司 Information recommendation method and device based on user behavior associated analysis
US20180181606A1 (en) * 2014-07-07 2018-06-28 Xiaoying CHU Data storage methods, query methods, and apparatuses thereof
CN105426421A (en) * 2015-11-03 2016-03-23 武汉地大信息工程股份有限公司 Tense monitoring data quick visualization method and system
CN106874316A (en) * 2015-12-14 2017-06-20 广州爱九游信息技术有限公司 A kind of methods of exhibiting of user's combined data, device and server
CN106471501A (en) * 2016-03-24 2017-03-01 华为技术有限公司 The method of data query, the storage method data system of data object
CN106021357A (en) * 2016-05-09 2016-10-12 泰华智慧产业集团股份有限公司 Distribution-based big data paging query method and system
CN108090064A (en) * 2016-11-21 2018-05-29 腾讯科技(深圳)有限公司 A kind of data query method, apparatus, data storage server and system
US20180189339A1 (en) * 2016-12-30 2018-07-05 Dropbox, Inc. Event context enrichment
CN108319608A (en) * 2017-01-16 2018-07-24 中国移动通信集团湖南有限公司 The method, apparatus and system of access log storage inquiry
US20200057781A1 (en) * 2018-08-20 2020-02-20 Salesforce.org Mapping and query service between object oriented programming objects and deep key-value data stores
CN109213781A (en) * 2018-08-27 2019-01-15 平安科技(深圳)有限公司 Air control data query method and device
CN109656930A (en) * 2018-12-27 2019-04-19 广州华多网络科技有限公司 Data query method, apparatus and system
CN110347722A (en) * 2019-07-11 2019-10-18 软通智慧科技有限公司 Data acquisition method, device, equipment and storage medium based on HBase

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
曹丹丹;乐嘉锦;夏小玲;: "Redis数据库在视频推荐服务系统中的应用", no. 10 *
谭玉龙: "基于HBase的多维索引查询机制的优化研究", 中国优秀硕士学位论文全文数据库 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4134838A1 (en) * 2021-08-12 2023-02-15 Beijing Baidu Netcom Science Technology Co., Ltd. Word mining method and apparatus, electronic device and readable storage medium
US12086171B2 (en) 2021-08-12 2024-09-10 Beijing Baidu Netcom Science Technology Co., Ltd. Word mining method and apparatus, electronic device and readable storage medium
CN113821513A (en) * 2021-09-18 2021-12-21 阿里巴巴(中国)有限公司 Data processing method, device and storage medium

Also Published As

Publication number Publication date
CN111488386B (en) 2023-09-29

Similar Documents

Publication Publication Date Title
CN108804450B (en) Information pushing method and device
CN108846753B (en) Method and apparatus for processing data
CN111522927B (en) Entity query method and device based on knowledge graph
CN111046237B (en) User behavior data processing method and device, electronic equipment and readable medium
JP2021103506A (en) Method and device for generating information
CN110059172B (en) Method and device for recommending answers based on natural language understanding
CN110866040B (en) User portrait generation method, device and system
CN110297995B (en) Method and device for collecting information
CN111680799B (en) Method and device for processing model parameters
CN113010542B (en) Service data processing method, device, computer equipment and storage medium
CN111476595A (en) Product pushing method and device, computer equipment and storage medium
WO2023134134A1 (en) Method and apparatus for generating association viewing model, and computer device and storage medium
CN111488386B (en) Data query method and device
CN116244387A (en) Entity relationship construction method, device, electronic equipment and storage medium
CN111813685A (en) Automatic testing method and device
CN107291923B (en) Information processing method and device
CN111581356B (en) User behavior path analysis method and device
CN111552715B (en) User query method and device
CN109144864B (en) Method and device for testing window
US12050634B2 (en) Method and apparatus for distributing content across platforms, device and storage medium
CN110020166A (en) A kind of data analysing method and relevant device
CN111339124B (en) Method, apparatus, electronic device and computer readable medium for displaying data
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN109408716B (en) Method and device for pushing information
CN111460273B (en) Information pushing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant