CN111339093A - Method, device and equipment for acquiring user behavior data and storage medium - Google Patents

Method, device and equipment for acquiring user behavior data and storage medium Download PDF

Info

Publication number
CN111339093A
CN111339093A CN202010115860.5A CN202010115860A CN111339093A CN 111339093 A CN111339093 A CN 111339093A CN 202010115860 A CN202010115860 A CN 202010115860A CN 111339093 A CN111339093 A CN 111339093A
Authority
CN
China
Prior art keywords
array
key value
data
acquiring
value pairs
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
CN202010115860.5A
Other languages
Chinese (zh)
Other versions
CN111339093B (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.)
BOE Technology Group Co Ltd
Original Assignee
BOE Technology Group 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 BOE Technology Group Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN202010115860.5A priority Critical patent/CN111339093B/en
Publication of CN111339093A publication Critical patent/CN111339093A/en
Application granted granted Critical
Publication of CN111339093B publication Critical patent/CN111339093B/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification

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)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for acquiring user behavior data, and belongs to the technical field of data processing. The method comprises the following steps: acquiring a plurality of key value pairs of original data; replacing at least one value comprising an array in a plurality of key value pairs with at least one array identifier corresponding to the value comprising the array to obtain a plurality of key value pairs after replacement; storing the plurality of key value pairs after replacement into a total data table; storing the array and the array identification into an array table; and acquiring the number of at least one value in the key value pair reflecting the user behavior in the array table according to the total data table and the array table. This application is through depositing array and array sign in the array table, according to total data table and array table, obtains the number of at least one value in the key-value pair that reflects user's action in the array table. The problem that user behavior data are difficult to obtain in the related technology is solved. The effect of conveniently acquiring the user behavior data is achieved.

Description

Method, device and equipment for acquiring user behavior data and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for acquiring user behavior data.
Background
The user behavior data can reflect the preference of the user to each function of the terminal when the user uses the terminal, and the user behavior data can be acquired, so that the operator can conveniently know the preference of the user.
In the related technology, the original data is subjected to repetition deletion and error correction, then the original data is converted into an object format, so that a complete key value pair of the original data is obtained, the key value pair is a key and a value which correspond to each other one by one, the complete key value pair of the original data is put into a total data table, a key value pair reflecting a user behavior is obtained from the total data table, the values in the key value pair reflecting the user behavior are of multiple types, the number of values of each type is obtained, and thus data of various behaviors of a user are obtained.
However, when the values in the raw data are complex, it is difficult to acquire the behavior data of the user.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for acquiring user behavior data, and can solve the problem that the user behavior data is difficult to acquire when values in original data are complex in the related art. The technical scheme is as follows:
according to a first aspect of the present application, there is provided a method for acquiring user behavior data, the method comprising:
acquiring a plurality of key value pairs of original data;
replacing at least one value comprising an array in the plurality of key value pairs with an array identifier corresponding to the at least one value comprising the array to obtain a plurality of key value pairs after replacement, wherein the array comprises at least one key value pair;
storing the replaced multiple key value pairs into a total data table;
storing the array and the array identification into an array table;
and acquiring the number of at least one value in a key value pair reflecting user behaviors in the array table according to the total data table and the array table.
Optionally, the values of multiple key value pairs of the original data include at least one user identifier, where the user identifier corresponds to at least one array identifier;
the obtaining, according to the total data table and the array table, the number of at least one value in a key value pair reflecting a user behavior in the array table includes:
looking up a specified user identification in the total data table;
acquiring an array identifier corresponding to the specified user identifier;
and acquiring the number of at least one value in a key value pair corresponding to the appointed user identification and reflecting the appointed user behavior from the array identification corresponding to the appointed user identification from the array table.
Optionally, the searching for the specific user identifier in the total data table includes:
calling a function module corresponding to the total data table to search the specified user identifier in the total data table;
the acquiring, from the array table, the number of at least one value in a pair of key values corresponding to the specified user identifier and reflecting the specified user behavior according to the array identifier corresponding to the specified user identifier includes:
and calling a functional module corresponding to the array table, and acquiring the number of at least one value in a key value pair corresponding to the appointed user identification and reflecting the appointed user behavior from the array table according to the array identification corresponding to the appointed user identification.
Optionally, the obtaining multiple key value pairs of the original data includes:
converting the raw data into an object format;
when the conversion is normal, obtaining an iterator of the key of the original data;
obtaining, by the iterator, a key of the raw data;
and obtaining the value of the original data according to the key of the original data.
Optionally, before obtaining the plurality of key-value pairs of the original data, the method further includes:
storing the original data into a database;
creating a total data table class corresponding to the database, wherein the total data table class corresponds to the total data table and is used for storing key value pairs in the original data;
the storing the replaced plurality of key value pairs into a total data table includes:
storing the plurality of key value pairs after replacement into the total data table class;
and storing the replaced multiple key value pairs in the total data table class into the corresponding positions of the total data table.
Optionally, after storing the raw data in the database, the method further includes:
creating an array table class corresponding to the database, wherein the array table class corresponds to the array table and is used for storing the array and the array identifier;
the storing the array and the array identifier into an array table includes:
storing the array and the array identification into the array table class;
and storing the array and the array identification in the array table class into the corresponding position of the array table.
Optionally, replacing at least one value including an array in the plurality of key value pairs with an array identifier corresponding to the at least one value including an array to obtain a plurality of key value pairs after replacement, where the method includes:
storing the plurality of key value pairs into an intermediate set;
and replacing at least one value comprising the array in the intermediate set with the corresponding array identification to obtain the plurality of key value pairs after replacement.
In another aspect, an apparatus for acquiring user behavior data is provided, and the apparatus for acquiring user behavior data includes:
the key value pair acquisition module is used for acquiring a plurality of key value pairs of the original data;
a replacing module, configured to replace at least one value including an array in the plurality of key value pairs with an array identifier corresponding to the at least one value including an array, to obtain a plurality of key value pairs after replacement, where the array includes at least one key value pair;
a total data table storage module, configured to store the replaced multiple key value pairs into a total data table;
the array table storing module is used for storing the array and the array identifier into an array table;
and the data acquisition module is used for acquiring the number of at least one value in the key value pair reflecting the user behavior in the array table according to the total data table and the array table.
Optionally, the values of multiple key value pairs of the original data include at least one user identifier, where the user identifier corresponds to at least one array identifier;
the data acquisition module further comprises:
the searching submodule is used for searching a specified user identifier in the total data table;
the identification acquisition submodule is used for acquiring an array identification corresponding to the specified user identification;
and the number obtaining submodule is used for obtaining the number of at least one value in a key value pair corresponding to the appointed user identification and reflecting the appointed user behavior from the array identification.
Optionally, the search sub-module is further configured to:
calling a function module corresponding to the total data table to search the specified user identifier in the total data table;
the number obtaining submodule is further configured to:
and calling a functional module corresponding to the array table, and acquiring the number of at least one value in a key value pair corresponding to the appointed user identification and reflecting the appointed user behavior from the array table according to the array identification corresponding to the appointed user identification.
In a further aspect, there is provided a device for acquiring user behavior data, the device including a processor and a memory, the memory storing at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement the method for acquiring user behavior data according to the first aspect.
In yet another aspect, a storage medium is provided, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by a processor to implement the method for acquiring user behavior data according to the first aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
the method comprises the steps of obtaining a plurality of key value pairs of original data, replacing at least one value of a plurality of key value pairs comprising an array with at least one array identifier corresponding to the value comprising the array to obtain a plurality of key value pairs after replacement, storing the plurality of key value pairs after replacement into a total data table, storing the array and the array identifier into an array table, and obtaining the number of at least one value of the key value pairs reflecting user behaviors in the array table according to the total data table and the array table. The problem that user behavior data are difficult to obtain when values in original data are complex in the related technology is solved. The effect that when the value in the original data is complex, the user behavior data can be conveniently acquired is achieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of an implementation environment of a method for acquiring user behavior data according to an embodiment of the present application;
fig. 2 is a flowchart of a method for acquiring user behavior data according to an embodiment of the present application;
fig. 3 is a flowchart of another method for acquiring user behavior data according to an embodiment of the present disclosure;
FIG. 4 is a flow diagram of FIG. 3 illustrating the acquisition of multiple key value pairs of raw data;
fig. 5 is a block diagram of an apparatus for acquiring user behavior data according to an embodiment of the present application;
FIG. 6 is a block diagram of a data acquisition module in the apparatus for acquiring user behavior data shown in FIG. 5;
fig. 7 is a schematic structural diagram of an apparatus for acquiring user behavior data according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In the method for acquiring the user behavior data, the original data is subjected to deletion error correction, then the original data is converted into an object format, so that a complete key value pair of the original data is acquired, the key value pair is a key and a value which correspond to each other one by one, the complete key value pair of the original data is put into a total data table, a key value pair reflecting the user behavior is acquired from the total data table, the values in the key value pair reflecting the user behavior are of multiple types, the number of the values of each type is acquired, and thus the data of various behaviors of the user is acquired.
However, when the values in the raw data are complex, it is difficult to acquire the behavior data of the user.
The embodiment of the application provides a method, a device, equipment and a storage medium for acquiring user behavior data.
Fig. 1 is a schematic diagram of an implementation environment of a method for acquiring user behavior data according to an embodiment of the present application, where the implementation environment may include a server 11 and a terminal 12.
The server 11 may be a server or a cluster of servers.
The terminal 12 may be a mobile phone, a screen terminal, a tablet computer, a notebook computer, an intelligent wearable device, or other various terminals. The terminal 12 may be connected to the server 11 by wire or wirelessly (in the case of wireless connection shown in fig. 1).
Fig. 2 is a flowchart of a method for acquiring user behavior data according to an embodiment of the present application. The method for acquiring the user behavior data can be applied to the server of the implementation environment. The method for acquiring the user behavior data can comprise the following steps:
in step 201, a plurality of key value pairs of the original data are obtained.
Step 202, replacing at least one value including an array in the plurality of key value pairs with an array identifier corresponding to at least one value including an array, and obtaining a plurality of key value pairs after replacement.
The array includes at least one key-value pair.
Step 203, the plurality of key value pairs after replacement are stored in a total data table.
Step 204, storing the array and the array identifier into an array table.
Step 205, acquiring the number of at least one value in the key value pair reflecting the user behavior in the array table according to the total data table and the array table.
To sum up, the embodiment of the present application provides a method for acquiring user behavior data, where multiple key value pairs of original data are acquired, at least one value of multiple key value pairs including a data group is replaced with at least one array identifier corresponding to a value including a data group, multiple key value pairs after replacement are obtained, the multiple key value pairs after replacement are stored in a total data table, the data group and the data group identifier are stored in a data group table, and the number of at least one value of the key value pairs reflecting a user behavior in the data group table is acquired according to the total data table and the data group table. The problem that user behavior data are difficult to obtain when values in original data are complex in the related technology is solved. The effect that when the value in the original data is complex, the user behavior data can be conveniently acquired is achieved.
Fig. 3 is a flowchart of another method for acquiring user behavior data according to an embodiment of the present application, where the method for acquiring user behavior data may be applied to a server in the implementation environment, and the server may acquire data of a terminal connected to the server. As can be seen in fig. 3, the method for acquiring user behavior data may include:
step 301, storing the original data into a database.
The raw data may include data acquired by the terminal when the user operates the terminal, and the raw data may include behavior data of at least one user.
The original data are stored in a database, so that the original data can be classified and processed conveniently. The server performs duplication checking and error correction on the acquired data of the terminal to obtain original data, wherein the original data can be JavaScript object Notation (JSON) original data. JSON is a lightweight data exchange format, and JSON data can be easily transferred between networks or programs.
Illustratively, the raw data may be data provided by a screen terminal.
At step 302, a total data table class corresponding to the database is created.
The total data table class corresponds to the total data table and is used for storing key value pairs in the original data. The server can store the key-value pairs in the raw data into corresponding positions in the total data table by using the total data table class.
Step 303, create an array table class corresponding to the database.
The array table class corresponds to the array table and is used for storing the array and the array identification. The array and the array identification can be stored in the corresponding position in the array table through the array table class.
Step 303 may be executed after step 302 or before step 302, and fig. 3 illustrates a case where step 303 is executed after step 302, but this is not limited by the embodiment of the present application.
In step 304, a plurality of key value pairs of the original data are obtained.
Key-value pairs are a type of data commonly used in software development, through which values can be queried.
The values of the plurality of key value pairs of the original data comprise at least one user identification, and the user identification corresponds to at least one array identification.
As shown in FIG. 4, it is a flowchart of obtaining multiple key value pairs of the original data in step 304 shown in FIG. 3:
step 3041, convert the raw data to object format.
The JSON original data is generally a character string during transmission, and the JSON original data needs to be converted into a JSON object format to obtain a key value pair of the JSON original data. The JSON object format is a data format for obtaining JSON original data key value pairs.
Step 3042, when the conversion is normal, the iterator of the key of the original data is obtained.
And when the conversion is normal, the original data is complete, and the converted original data can be processed to obtain keys of the original data.
When the conversion is abnormal, an abnormal report can be generated and related personnel can be informed to process.
Step 3043, get the key of the original data through the iterator.
The keys of the original data are traversed by the iterator to obtain the keys of the original data.
Step 3044, get the value of the original data according to the key of the original data.
The value of the raw data is obtained using an acquisition function based on the key of the raw data.
Step 305, store a plurality of key-value pairs into an intermediate set.
And storing the plurality of key value pairs into an intermediate set (namely Map, wherein the Map is a mapping set of the plurality of key value pairs) so as to traverse the key value pairs and judge whether the values in the key value pairs are arrays or not.
Step 306, replacing at least one value including the array in the intermediate set with the corresponding array identifier to obtain a plurality of key value pairs after replacement.
The array includes at least one key-value pair. And traversing the intermediate set, and when the value in the key-value pair comprises an array, replacing the value comprising the array with an array identifier. The replaced plurality of key value pairs comprise key value pairs with values replaced by array identifications and key value pairs with values not replaced.
Step 307, the plurality of key value pairs after replacement are stored into the total data table class.
And storing the replaced multiple key value pairs in the intermediate set into the total data table class.
And 308, storing the replaced multiple key value pairs in the total data table class into the corresponding positions of the total data table.
And storing the key value pairs in the total data table classes into the corresponding positions of the total data tables.
Illustratively, as shown in table 1, it is a total data table, where ID represents user identifier, Results represents array identifier, and Time represents Time when the user operates in the terminal.
TABLE 1 Total data Table
ID Results Time
2820068 Results_15729 2020/01/14 00:03
2820068 Results_15788 2020/01/14 00:03
... ... ...
2820068 Results_15729 2020/01/15 19:39
2820069 Results_16729 2020/01/15 20:03
Each array identifier in Table 1 corresponds to an array, and each array corresponds to at least one key-value pair.
Step 309, store the array and the array id into the array table class.
By traversing the array to obtain the key-value pairs of the array, the server may store the obtained key-value pairs of the array and the array identifier in the array table class established in step 303.
Step 310, storing the array and the array identifier in the array table class into the corresponding position of the array table.
And storing the key value pairs and the array identifications of the arrays in the array table class into the corresponding positions of the array table.
Illustratively, as shown in table 2, it is an array table, where Results represents array identifiers, Index represents the order of the same array identifiers in the total data table, key Values with the same Index are in the array corresponding to the same array identifiers, Keys represent Keys, and Values represent Values.
TABLE 2 array table
Figure BDA0002391473650000081
Figure BDA0002391473650000091
Step 311, calling a function module corresponding to the total data table to search for the specified user identifier in the total data table.
The specified user identification may be a user identification of a certain user specified by the operator.
The original data comprises behavior data of at least one user, and when the server needs to perform the step of acquiring the behavior data of the appointed user, the server calls the functional module corresponding to the total data table so as to search the user identification of the appointed user in the total data table.
The functional modules corresponding to the total data table can realize operations of increasing data, deleting data, changing data, searching data and the like in the total data table.
Illustratively, a specified user identification, which may be 2820068, may be looked up in table 1.
In step 312, an array identifier corresponding to the specified user identifier is obtained.
After acquiring the designated user identifier from the total data table, the server may acquire an array identifier corresponding to the designated user identifier, where the designated user identifier may correspond to at least one array identifier.
Illustratively, when the specified user identifier is 2820068 in table 1, the array identifiers result _15729 and result _15788 corresponding to the specified user identifier may be obtained.
And 313, calling a function module corresponding to the array table, and acquiring the number of at least one value in a key value pair corresponding to the appointed user identification and reflecting the appointed user behavior from the array table according to the array identification corresponding to the appointed user identification.
And calling a functional module corresponding to the array table, and acquiring user behavior data of the specified user from the array table according to at least one array identifier corresponding to the specified user identifier, wherein the user behavior data is the number of at least one value in a key value pair reflecting the specified user behavior in the array table.
The user behavior data may reflect the user's preferences, which may include a preference for text chatting, playing voice, playing music, and interpreting a pictorial background using the terminal providing the original data. The category of the value of the key-value pair reflecting the specified user behavior may comprise at least one of the user's preferences.
The functional module corresponding to the array table can realize operations of adding data, deleting data, changing data, checking data and the like in the array table.
For example, the type of the median value of the key value pairs reflecting the user behavior may include a type of operations performed by a user in a voice operation, a type of operations performed by a user in a text input mode, and an operation performed by a user in an Artificial Intelligence (AI) interaction mode.
Illustratively, the array identifications corresponding to the designated user identification 2820068 in table 1 are Results _15729 and Results _15788, the value text and voice corresponding to the key ResultType in the key value pair corresponding to the Results _15729 and Results _15788 are obtained from table 2 according to the array identifications Results _15729 and Results _15788, and the number of the values of each type is counted. The preference of the user can be judged according to the number of at least one value in the key value pairs reflecting the user behaviors, and the more the number is, the higher the preference degree of the user is.
In a user behavior data acquiring method in the related art, when a value in original data includes an array, the original data including the array is stored in a total data table, and since data reflecting a user behavior is a value of a key value pair in the array, it is difficult to acquire the user behavior data in the original data.
When the user behavior data acquisition method provided by the embodiment of the application is used, when the value in the original data comprises the array, the user behavior number of the specified user can be acquired from the array table through the array identification corresponding to the specified user identification by using a simple query statement. Compared with the prior art, the method and the device for acquiring the user behavior data can acquire the user behavior data of the specified user more conveniently.
To sum up, the embodiment of the present application provides a method for acquiring user behavior data, where multiple key value pairs of original data are acquired, at least one value of multiple key value pairs including a data group is replaced with at least one array identifier corresponding to a value including a data group, multiple key value pairs after replacement are obtained, the multiple key value pairs after replacement are stored in a total data table, the data group and the data group identifier are stored in a data group table, and the number of at least one value of the key value pairs reflecting a user behavior in the data group table is acquired according to the total data table and the data group table. The problem that user behavior data are difficult to obtain when values in original data are complex in the related technology is solved. The effect that when the value in the original data is complex, the user behavior data can be conveniently acquired is achieved.
In an exemplary embodiment, the server performs a re-checking and error-correcting process on the data provided by the screen terminal to obtain raw data (the raw data may include:
{ "ID":2820068, "Results" [ { "groupType":0, "resultType": text "," values ": {" text ": good, i want to sing the next. "}," time ": 2020-01-1400: 03:19.0" }, { "ID":2820068, "Results" [ { "groupType":0, "resultType": voice "," values ": {" voice ":" { "voice": http:// XXX/x.mp3"} }," time ": 2020-01-1400: 03:19.0" }, { "ID":2820068, "Results" [ { "groupType":0, "resultType": text "," values ":" { "text": no answer to you. "}," "time": 2020-01-1519: 39:19.0"}, {" ID ":2820069," Results ": {" groupType ":0," resultType ": 0", "values": 0"}," time ": 2020-01-1520: 03:19.0" }).
Then, the original data can be stored in a database, a total data table class and an array table class corresponding to the database are created, a plurality of key value pairs of the original data are obtained, the plurality of key value pairs are stored in a middle set, the plurality of key value pairs in the middle set are traversed, at least one value including an array in the middle set is replaced by a corresponding array identifier, the plurality of key value pairs after replacement are obtained, the plurality of key value pairs after replacement are stored in the total data table class, the plurality of key value pairs after replacement in the total data table class are stored in a position corresponding to the total data table to obtain a table 1, the array and the array identifier are stored in the array table class, and the array identifier in the array table class are stored in a position corresponding to the array table to obtain a table 2. Calling the function module corresponding to the table 1 to search the designated user identifier 2820068 in the table 1, obtaining the array identifiers result _15729 and result _15788 corresponding to the designated user identifier 2820068, calling the function module corresponding to the table 2, and obtaining the number of at least one value in the key value pair corresponding to the designated user identifier 2820068 and reflecting the designated user behavior from the table 2 according to the array identifiers result _15729 and result _15788 corresponding to the designated user identifier 2820068.
Fig. 5 is a block diagram of an apparatus for acquiring user behavior data according to an embodiment of the present application. As can be seen from fig. 5, the apparatus 500 for acquiring user behavior data may include:
a key-value pair obtaining module 510, configured to obtain a plurality of key-value pairs of the original data. The values of the plurality of key value pairs of the original data comprise at least one user identification, and the user identification corresponds to at least one array identification.
A replacing module 520, configured to replace at least one value including an array in the plurality of key value pairs with at least one array identifier corresponding to the value including the array, to obtain a plurality of key value pairs after replacement, where the array includes at least one key value pair.
An overall data table storing module 530, configured to store the plurality of key value pairs after replacement into the overall data table.
The array table storing module 540 is configured to store the array and the array identifier in the array table.
The data obtaining module 550 is configured to obtain, according to the total data table and the array table, the number of at least one value in the key value pair reflecting the user behavior in the array table.
Referring to fig. 6, it is a block diagram of the data acquisition module 550 in the apparatus 500 for acquiring user behavior data shown in fig. 5:
a look-up sub-module 551 for looking up the specified user identity in the total data table. The searching submodule 551 is further configured to invoke a function module corresponding to the total data table to search for the specified user identifier in the total data table.
The identifier obtaining sub-module 552 is configured to obtain an array identifier corresponding to the specified user identifier.
The number obtaining sub-module 553, configured to obtain, from the array table, the number of at least one value in a key value pair corresponding to the specified user identifier and reflecting the specified user behavior according to the array identifier corresponding to the specified user identifier. The number obtaining sub-module 553 is further configured to invoke a function module corresponding to the array table, and obtain, according to the array identifier corresponding to the specified user identifier, the number of at least one value in the key value pair corresponding to the specified user identifier and reflecting the specified user behavior from the array table.
To sum up, the embodiment of the application provides an acquisition device of user behavior data, this device is through obtaining many key value pairs of original data to at least one value replacement including the array in a plurality of key value pairs includes the array sign that the value of array corresponds at least one, obtains many key value pairs after the replacement, again will replace many key value pairs and save total data table in, save array and array sign in the array table, according to total data table and array table, obtain the number of at least one value in the key value pair of the reaction user behavior in the array table. The problem that user behavior data are difficult to obtain when values in original data are complex in the related technology is solved. The effect that when the value in the original data is complex, the user behavior data can be conveniently acquired is achieved.
Referring to fig. 7, a schematic structural diagram of an apparatus 700 for acquiring user behavior data according to an embodiment of the present application is shown, where the apparatus 700 for acquiring user behavior data may be a server. Illustratively, as shown in FIG. 7, the apparatus 700 includes a Central Processing Unit (CPU)701, a memory 702, and a system bus 703 connecting the memory 702 and the central processing unit 701, the memory 702 may include a computer-readable medium (not shown) such as a hard disk or CD-ROM drive.
Without loss of generality, computer-readable storage media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing.
The memory 702 also includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU to implement the method provided by the embodiments of the present disclosure.
The embodiment of the present application further provides a storage medium, where at least one instruction, at least one program, a code set, or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the method for acquiring user behavior data, provided by the above method embodiment.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (12)

1. A method for acquiring user behavior data is characterized by comprising the following steps:
acquiring a plurality of key value pairs of original data;
replacing at least one value comprising an array in the plurality of key value pairs with an array identifier corresponding to the at least one value comprising the array to obtain a plurality of key value pairs after replacement, wherein the array comprises at least one key value pair;
storing the replaced multiple key value pairs into a total data table;
storing the array and the array identification into an array table;
and acquiring the number of at least one value in a key value pair reflecting user behaviors in the array table according to the total data table and the array table.
2. The method of claim 1, wherein values of a plurality of key value pairs of the original data comprise at least one user identifier, the user identifier corresponding to at least one of the array identifiers;
the obtaining, according to the total data table and the array table, the number of at least one value in a key value pair reflecting a user behavior in the array table includes:
looking up a specified user identification in the total data table;
acquiring an array identifier corresponding to the specified user identifier;
and acquiring the number of at least one value in a key value pair corresponding to the appointed user identification and reflecting the appointed user behavior from the array identification corresponding to the appointed user identification from the array table.
3. The method of claim 2, wherein said looking up a specified subscriber identity in said total data table comprises:
calling a function module corresponding to the total data table to search the specified user identifier in the total data table;
the acquiring, from the array table, the number of at least one value in a pair of key values corresponding to the specified user identifier and reflecting the specified user behavior according to the array identifier corresponding to the specified user identifier includes:
and calling a functional module corresponding to the array table, and acquiring the number of at least one value in a key value pair corresponding to the appointed user identification and reflecting the appointed user behavior from the array table according to the array identification corresponding to the appointed user identification.
4. The method of any of claims 1-3, wherein obtaining multiple key-value pairs of raw data comprises:
converting the raw data into an object format;
when the conversion is normal, obtaining an iterator of the key of the original data;
obtaining, by the iterator, a key of the raw data;
and obtaining the value of the original data according to the key of the original data.
5. The method of any of claims 1-3, wherein prior to obtaining the plurality of key-value pairs for the raw data, the method further comprises:
storing the original data into a database;
creating a total data table class corresponding to the database, wherein the total data table class corresponds to the total data table and is used for storing key value pairs in the original data;
the storing the replaced plurality of key value pairs into a total data table includes:
storing the plurality of key value pairs after replacement into the total data table class;
and storing the replaced multiple key value pairs in the total data table class into the corresponding positions of the total data table.
6. The method of claim 5, wherein after storing the raw data in a database, the method further comprises:
creating an array table class corresponding to the database, wherein the array table class corresponds to the array table and is used for storing the array and the array identifier;
the storing the array and the array identifier into an array table includes:
storing the array and the array identification into the array table class;
and storing the array and the array identification in the array table class into the corresponding position of the array table.
7. The method according to any one of claims 1-3, wherein the replacing the value of at least one of the plurality of key value pairs, including the array, with the array identification corresponding to the value of the at least one key value pair, resulting in a plurality of key value pairs after the replacing, comprises:
storing the plurality of key value pairs into an intermediate set;
and replacing at least one value comprising the array in the intermediate set with the corresponding array identification to obtain the plurality of key value pairs after replacement.
8. An apparatus for acquiring user behavior data, the apparatus comprising:
the key value pair acquisition module is used for acquiring a plurality of key value pairs of the original data;
a replacing module, configured to replace at least one value including an array in the plurality of key value pairs with an array identifier corresponding to the at least one value including an array, to obtain a plurality of key value pairs after replacement, where the array includes at least one key value pair;
a total data table storage module, configured to store the replaced multiple key value pairs into a total data table;
the array table storing module is used for storing the array and the array identifier into an array table;
and the data acquisition module is used for acquiring the number of at least one value in the key value pair reflecting the user behavior in the array table according to the total data table and the array table.
9. The apparatus of claim 8, wherein values of a plurality of key value pairs of the original data comprise at least one user identifier, the user identifier corresponding to at least one of the array identifiers;
the data acquisition module comprises:
the searching submodule is used for searching a specified user identifier in the total data table;
the identification acquisition submodule is used for acquiring an array identification corresponding to the specified user identification;
and the number obtaining submodule is used for obtaining the number of at least one value in a key value pair corresponding to the appointed user identification and reflecting the appointed user behavior from the array identification.
10. The apparatus of claim 9, wherein the lookup submodule is configured to:
calling a function module corresponding to the total data table to search the specified user identifier in the total data table;
the number obtaining submodule is further configured to:
and calling a functional module corresponding to the array table, and acquiring the number of at least one value in a key value pair corresponding to the appointed user identification and reflecting the appointed user behavior from the array table according to the array identification corresponding to the appointed user identification.
11. An apparatus for acquiring user behavior data, the apparatus comprising a processor and a memory, the memory storing at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement the method for acquiring user behavior data according to any one of claims 1 to 7.
12. A storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by a processor to implement a method of acquiring user behavior data as claimed in any one of claims 1 to 7.
CN202010115860.5A 2020-02-25 2020-02-25 Method, device, equipment and storage medium for acquiring user behavior data Active CN111339093B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010115860.5A CN111339093B (en) 2020-02-25 2020-02-25 Method, device, equipment and storage medium for acquiring user behavior data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010115860.5A CN111339093B (en) 2020-02-25 2020-02-25 Method, device, equipment and storage medium for acquiring user behavior data

Publications (2)

Publication Number Publication Date
CN111339093A true CN111339093A (en) 2020-06-26
CN111339093B CN111339093B (en) 2024-07-16

Family

ID=71185699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010115860.5A Active CN111339093B (en) 2020-02-25 2020-02-25 Method, device, equipment and storage medium for acquiring user behavior data

Country Status (1)

Country Link
CN (1) CN111339093B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7809752B1 (en) * 2005-04-14 2010-10-05 AudienceScience Inc. Representing user behavior information
CN104090895A (en) * 2013-12-18 2014-10-08 深圳市腾讯计算机系统有限公司 Method, device, server and system for obtaining cardinal number
CN107436872A (en) * 2016-05-25 2017-12-05 阿里巴巴集团控股有限公司 A kind of processing method and processing device of isomeric data
CN108345699A (en) * 2018-03-28 2018-07-31 腾讯音乐娱乐(深圳)有限公司 Obtain the method, apparatus and storage medium of multi-medium data
CN109684607A (en) * 2017-10-19 2019-04-26 腾讯科技(深圳)有限公司 JSON data analysis method, device, computer equipment and storage medium
CN109766100A (en) * 2018-12-11 2019-05-17 新华三技术有限公司合肥分公司 Data processing method and device
CN110201393A (en) * 2019-05-29 2019-09-06 北京金山安全软件有限公司 Configuration data storage method and device and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7809752B1 (en) * 2005-04-14 2010-10-05 AudienceScience Inc. Representing user behavior information
CN104090895A (en) * 2013-12-18 2014-10-08 深圳市腾讯计算机系统有限公司 Method, device, server and system for obtaining cardinal number
CN107436872A (en) * 2016-05-25 2017-12-05 阿里巴巴集团控股有限公司 A kind of processing method and processing device of isomeric data
CN109684607A (en) * 2017-10-19 2019-04-26 腾讯科技(深圳)有限公司 JSON data analysis method, device, computer equipment and storage medium
CN108345699A (en) * 2018-03-28 2018-07-31 腾讯音乐娱乐(深圳)有限公司 Obtain the method, apparatus and storage medium of multi-medium data
CN109766100A (en) * 2018-12-11 2019-05-17 新华三技术有限公司合肥分公司 Data processing method and device
CN110201393A (en) * 2019-05-29 2019-09-06 北京金山安全软件有限公司 Configuration data storage method and device and electronic equipment

Also Published As

Publication number Publication date
CN111339093B (en) 2024-07-16

Similar Documents

Publication Publication Date Title
CN110704398B (en) Database migration method and device from MySQL to Oracle and computer equipment
CN111061678B (en) Service data processing method, device, computer equipment and storage medium
CN110263104A (en) JSON character string processing method and device
CN112182174A (en) Business question-answer knowledge query method and device, computer equipment and storage medium
CN113342647A (en) Test data generation method and device
CN111124883B (en) Test case library introduction method, system and equipment based on tree form
CN117436963A (en) Telecommunication service recommendation method and device, electronic equipment and storage medium
CN111339093B (en) Method, device, equipment and storage medium for acquiring user behavior data
CN116127154A (en) Knowledge tag recommendation method and device, electronic equipment and storage medium
CN113590372A (en) Log-based link tracking method and device, computer equipment and storage medium
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN111159311B (en) Method, device, equipment and storage medium for integrating data mapping
CN108763498B (en) User identity identification method and device, electronic equipment and readable storage medium
CN114492844A (en) Method and device for constructing machine learning workflow, electronic equipment and storage medium
CN112256855A (en) User intention identification method and device
CN112579592A (en) Isomorphic data storage method and device
CN112799929B (en) Root cause analysis method and system of alarm log
CN117539962B (en) Data processing method, device, computer equipment and storage medium
CN110781370B (en) Mobile terminal information query method and computer equipment
CN114490095B (en) Request result determination method and device, storage medium and electronic device
CN115687413A (en) Data processing method, device, equipment and storage medium
CN117354154A (en) Network element determination method, device, computer equipment and storage medium
CN115757405A (en) Data query method, device, equipment and storage medium
CN117194221A (en) Test method, test device, computer equipment and storage medium
CN116562277A (en) Root cause positioning method, root cause positioning device, root cause positioning apparatus, root cause positioning program product, and root cause positioning program product

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