Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a storage medium for generating a customer portrait based on big data, which aim to solve the technical problem of how to generate customer portraits capable of meeting the requirement that users view different categories of customer information of customers in different scenes.
In order to achieve the above object, the present invention provides a customer portrait generation method based on big data, the customer portrait generation method includes the following steps:
mapping the big customer data into a database table through hive;
separating the information streams related to the clients in the client database table by adopting the separator to obtain small-section information streams;
based on preset customer keywords, matching the customer key information from the small-section information stream through a keyword matching algorithm, and establishing a label according to the key information, wherein the label comprises customer information and label display form information;
monitoring whether a client portrait generation request exists currently;
if a client portrait generation request exists, acquiring target display information from the client portrait generation request, wherein the target display information comprises information of a target label requesting display;
acquiring a target label appointed for display of the target display information according to the target display information;
and rendering the target label to obtain the customer portrait.
Preferably, after the step of matching the key information of the customer from the small-segment information stream by a key word matching algorithm based on the preset customer key word and creating a label by using the key information, the method further comprises:
carrying out category marking on the label according to a preset label classification rule to obtain a label with the category marking;
and storing the labels according to the classification of the category labels to obtain a first label database.
Preferably, the obtaining, according to the target display information, the target label of the target display information designated display includes:
analyzing the target display information to obtain information of target labels designated to be displayed in the target display information;
inquiring a second tag database of the category of the target tag according to the information and accessing the second tag database;
and extracting the target label from the second label database.
Preferably, after the step of rendering the target label to obtain the customer portrait, the method further includes:
counting the checked times of the target tag through buried points to obtain the historical checked times of the target tag;
and displaying the label with the largest historical checking frequency according to the historical checking frequency and the displaying number of the preset labels.
Preferably, the rendering the target display tag to obtain a customer portrait includes:
rendering the data of the target tag according to a preset JSP template to obtain a customer portrait frame;
and calculating the position coordinates of the target label on the customer portrait frame according to the display form information of the target label, and arranging the target label according to the position coordinates to obtain the customer portrait.
Further, in order to achieve the above object, the present invention provides a customer portrait generating device based on big data, the customer portrait generating device comprising:
the mapping module is used for mapping the big customer data into a database table through hive;
the separation module is used for separating the information streams related to the clients in the client database table by adopting the separator to obtain small-section information streams;
the matching module is used for matching the key information of the client from the small-section information stream through a key word matching algorithm based on preset client key words, and establishing a label according to the key information, wherein the label comprises the information of the client and the display form information of the label;
the monitoring module is used for monitoring whether a customer portrait generation request exists currently;
the first acquisition module is used for acquiring target display information from a client portrait generation request if the client portrait generation request exists, wherein the target display information comprises information of a target label requested to be displayed;
the second acquisition module is used for acquiring target labels appointed for display of the target display information according to the target display information;
and the rendering module is used for rendering the target label to obtain a customer portrait.
Preferably, the client portrait generating device further includes:
the marking module is used for marking the categories of the labels according to preset label classification rules to obtain labels with the category marks;
and the storage module is used for storing the labels according to the category labels in a classified mode to obtain a first label database.
Preferably, the second acquisition module includes:
the analysis unit is used for analyzing the target display information and obtaining information of target labels designated to be displayed in the target display information;
the query unit is used for querying a second tag database of the category where the target tag is located according to the information and accessing the second tag database;
and the extraction unit is used for extracting the target label from the second label database.
Preferably, the client portrait generating device further includes:
the statistics module is used for counting the checked times of the target tag through buried points to obtain the historical checked times of the target tag;
the display module is used for displaying the label with the largest historical checking frequency according to the historical checking frequency and the display number of the preset labels.
Preferably, the rendering module includes:
the rendering unit is used for rendering the data of the target tag according to a preset JSP template to obtain a customer portrait frame;
and the calculating unit is used for calculating the position coordinates of the target label on the customer portrait frame according to the display form information of the target label and arranging the target label according to the position coordinates to obtain the customer portrait.
Further, in order to achieve the above object, the present invention provides a client image generating apparatus based on big data, the client image generating apparatus including a memory, a processor, and a client image generating program stored on the memory and executable on the processor, the client image generating program implementing the steps of the client image generating method according to any one of the above when executed by the processor.
Further, in order to achieve the above object, the present invention provides a computer-readable storage medium having stored thereon a client image generation program which, when executed by a processor, implements the steps of the client image generation method according to any one of the above.
According to the invention, the client big data is mapped into the database table through hive, the client information stream is divided into the small-section information stream by adopting the separator, then the key information of the client is matched from the small-section information stream through the key word matching algorithm, the label of the client is established according to the key information, whether the client portrait generation request exists currently or not is monitored, if the client portrait generation request exists, the corresponding target label is acquired according to the request, then the target label is rendered, and the client portrait is generated.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides customer portrait generating equipment based on big data.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an operating environment of a client image generating device according to an embodiment of the present invention.
As shown in fig. 1, the customer portrait creation apparatus includes: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the hardware configuration of the client image generating device shown in fig. 1 does not constitute a limitation of the client image generating device, and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a computer program may be included in the memory 1005, which is a type of computer-readable storage medium. Wherein the operating system is a program that manages and controls the client portrayal generation device and software resources, supporting the execution of the client portrayal generation program and other software and/or programs.
In the hardware architecture of the client representation generating apparatus shown in fig. 1, the network interface 1004 is mainly used for accessing the network; the user interface 1003 is mainly used for detecting confirmation instructions, editing instructions, and the like. And the processor 1001 may be used to invoke a client representation generation program stored in the memory 1005 and to perform the operations of the following embodiments of the client representation generation method.
Based on the hardware structure of the customer portrait generation device based on big data, various embodiments of the customer portrait generation method of the present invention are proposed.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a big data-based client portrait creation method according to the present invention. In this embodiment, the customer portrait generation method includes the following steps:
step S10: mapping the big customer data into a database table through hive;
in this embodiment, a database table is established, and the client big data is mapped by hive to obtain the database table of the client big data, so as to provide a query condition for obtaining the client information next. Based on a database table of big data of clients, the hiveQL language similar to SQL is used for data query, and all hive data are stored in a Hadoop compatible file system. When the customer big data is loaded, the customer big data is moved to the directory in hdfs where hive is set. The client big data are stored in the relational database, so that the time for executing semantic check during query is greatly reduced, and the data stored in the Hadoop file system can be directly used.
Step S20: separating the information streams related to the clients in the client database table by adopting the separator to obtain small-section information streams;
in this embodiment, hive has no special data storage format, and no index is created for data, so that a user can customize a table in Hive, set column separator and row separator in Hive when creating the table, and control separator to separate client information flow of client database table into small information flow.
Further, in the configuration file corresponding to the row separator or the column separator of hive, the separator is declared to separate at a specific character, when separation is needed, character recognition is firstly performed on the information to be separated, and if a preset separation word is recognized, separation is performed through the separator.
For example, the "name Liu certain sex Man professional programmer age 28" is divided, and the "name Liu certain sex Man professional programmer age 28" is divided into small information streams of "name Liu certain", "sex Man", "professional programmer" and "age 28" according to preset dividing keywords of "name", "weight", "height", "occupation" and "age". In addition, the customer big data also comprises the position information of the customer such as the city, residence address and the like; work information such as company address, any job position, etc.; asset information such as the name of the property, the vehicle property, all other personal assets, etc.; insurance information such as the insurance seed charged, the insurance time, the insurance amount, the claim rate, etc.
Step S30: based on preset customer keywords, matching the customer key information from the small-section information stream through a keyword matching algorithm, and establishing a label according to the key information, wherein the label comprises customer information and label display form information;
in this embodiment, a keyword library is preset, keyword words are preset, matching is performed from a small-segment information stream through a keyword matching algorithm, whether a matching relationship exists between the separated small-segment information stream and the preset keyword words in the word library is judged, if the matching relationship exists, the small-segment information stream is extracted, the small-segment information stream is determined to be the key information of a client, and the label of the client is established according to the key information of the small-segment information stream. The keyword is set in a user-defined mode according to the user needs; when the information label is established, a user can set the display form of the label according to the key information type of the information label or the preference of the user, and the display form of the label can be regularly arranged horizontally or longitudinally, irregularly tiled and the like. In addition, the keyword matching algorithm includes kmp algorithm, and a keyword library is pre-established before that, and related keywords are set in the keyword library so as to provide comparison initial data for matching the keyword information.
Further, after the key information is determined, the information label of the client is formulated according to the key information. The key information comprises basic attributes of clients, asset characteristics, interests, shopping hobbies and demand characteristics, and the key information is used as an information label of the clients to identify the characteristics of the clients. A tag is typically a highly refined signature that is specified by man, such as an age group tag: 25 years old, regional tag: guangdong, the tag exhibits two important features: semanteme, people can conveniently and quickly understand the meaning of each label, so that the customer image has practical meaning, the service requirement of the user is better met, and the user can provide and develop corresponding service aiming at the customer attribute; short text, each label usually only represents one meaning, in other words, the detailed information of the client is extracted, the key information is extracted, and the key words capable of summarizing the whole piece of key information are extracted from the key information to represent the attribute of the client.
For example, when a preset matching keyword in a keyword matching algorithm is a name, and a small information stream of a certain customer is called for matching, if information such as a name XXX is matched in words of the small information stream, the small information stream is extracted and used as key information of the customer, and a label of the customer is established.
Step S40: monitoring whether a client portrait generation request exists currently;
step S50: if a client portrait generation request exists, acquiring target display information from the client portrait generation request, wherein the target display information comprises information of a target label requesting display;
in this embodiment, whether a client portrait generation request exists on a current display interface is monitored, if the client portrait generation request exists on the current display interface, request information carried in the display request is analyzed, target display information is determined from the request information, information of a target label requested to be displayed is obtained from the target display information, a label database of a category where the target display label is located is queried, an access path of the label database is obtained and accessed, and then the target label is extracted.
According to different application scenes, a plurality of information label categories associated with the same working link can be set, if information labels related to the working link to be displayed currently are indicated in a display request, information label category information preset associated with the working link is required to be acquired first, then an access path of a category label database designated in the information label category information is acquired from a central server, the information label library is accessed according to the access path, and related information labels are acquired for display.
Step S60: acquiring a target label appointed for display of the target display information according to the target display information;
in this embodiment, tag information to be displayed is obtained from target display information obtained by analysis, and a tag database of a category where a target tag pointed in the tag information is located is accessed according to the tag information, so that the target tag is obtained from the tag database.
Step S70: and rendering the target label to obtain the customer portrait.
In this embodiment, the data of the target tag is preferably rendered in a hash table according to a corresponding JSP template, and the position coordinates of the data in the rendered customer image frame are calculated and correspondingly arranged according to the position coordinates, so as to obtain the final customer image. The display form of the label can be customized by a user besides the display form of the initial setting. For example, the user can set the display position, sequence and shape of the information labels; furthermore, the user can hide part of the labels, and when the labels need to be checked, the users check the labels by clicking the display, so that visual interference is avoided.
For example, basic information tag data reflecting basic information of a client is obtained, the data is returned to a server in a hash table mode, the server renders the data according to a corresponding JSP template, a corresponding client portrait frame graph is generated through rendering and returned to a display interface, position coordinates of a preset display form of an information tag in the data in the client portrait frame graph are calculated, and the position coordinates are arranged to obtain a final client portrait. The frame graph of the customer portrait can be set in a self-defining way, and can be a portrait or a geometric figure, and the frame graph is determined according to actual situations.
Further, the information labels of the same customer have the same identification, and in the information label databases of different categories, the information labels of the same customer have an association relationship, when the information label of a customer needs to be displayed, all the association information of the information label category of the customer is obtained, then the information label is displayed according to a preset display form, if the information is too much, a user can selectively control to display a part of information labels according to the needs, and hide a part of information labels, so that the user can quickly know the customer information, conveniently formulate related service content for the customer, and improve the service quality.
According to the method, the client big data are mapped into the database table through hive, the client information flow is divided into the small-section information flow through separator, then the key information of the client is matched from the small-section information flow through key word matching algorithm, the label of the client is built according to the key information, whether a client portrait generation request exists currently or not is monitored, if the client portrait generation request exists, the corresponding target label is obtained according to the request, then the target label is rendered, and the client portrait is generated.
Referring to fig. 3, fig. 3 is a flowchart illustrating a second embodiment of the big data-based client portrait creation method according to the present invention. In this embodiment, after step S30, the method further includes:
step S001: carrying out category marking on the label according to a preset label classification rule to obtain a label with the category marking;
in this embodiment, according to different application scenarios, a tag classification rule is set, tags are classified into different categories, and category labels are built for the tags one by one according to the categories, so as to obtain the tags with the category labels. For example, the following sales service links are divided during service according to the insurance information of the clients in the security sales scene according to the sales scene formulation category: an insurance renewal link, a claim settlement processing link, an insurance sales link and the like. In the insurance renewal link, for example, basic information, insurance information and renewal information of a customer need to be checked, and the label of the customer is marked by the category according to the category of the information represented by the label, such as the basic information, the insurance information and the renewal information category, so as to obtain the label with the category mark.
Step S002: and storing the labels according to the classification of the category labels to obtain a first label database.
In this embodiment, after the labels of all the categories are classified according to the categories, further, the labels of the same customer are associated, so that when the label of one category of a customer needs to be displayed, all the labels of the one category of the customer are obtained.
In this embodiment, the labels are stored according to the category labels, and the labels with the same category label are stored in the same database, so as to obtain label databases with different categories. The database for storing the labels selects the HBASE database. In addition, the specific categories of the labels are determined by the actual application scenes and can be set by user definition.
For example, in the application scenario of insurance promotion, if the agent is in the client renewal link and needs the basic information, the insurance information and the asset information of the client, the category labels are established for the label corresponding to the basic information, the label corresponding to the insurance information and the label corresponding to the asset information of the client, and then the category labels are stored in the database to obtain the label database of the basic information label, the bid information label and the asset information label, and further, the basic information label, the bid information label and the asset information label database can be identified as category information labels required by the renewal link, and when the user determines the current link, the information labels of the basic information label, the bid information label and the asset information label are called.
Referring to fig. 4, fig. 4 is a detailed flowchart of an embodiment of step S60 in fig. 2. Based on the above embodiment, in the present embodiment, step S60 further includes:
step S601: analyzing the target display information to obtain information of target labels designated to be displayed in the target display information;
in this embodiment, the request information of the display request is analyzed, the target display information in the request is obtained, the information label type to be displayed is determined in the target display information, so as to access the information label database of the corresponding type, and the information label of the corresponding client is extracted.
Step S602: inquiring a second tag database of the category of the target tag according to the information and accessing the second tag database;
in this embodiment, according to the target display information in the above step, a tag database of a category where a tag to be displayed is located is queried, an access path corresponding to the tag database of the category is obtained, and the tag database of the category is accessed according to the access path.
Step S603: and acquiring the target tag from the second tag database.
In this embodiment, based on the access path of the second tag database obtained in the above step, the corresponding tag database is accessed, and the target tag to be displayed is extracted from the tag database. For example, after determining that the tag to be displayed is a tag of the basic information category, extracting the tag of the basic information category of the currently queried client from a tag database of the basic information category.
Referring to fig. 5, fig. 5 is a flowchart illustrating a third embodiment of a big data-based client portrait creation method according to the present invention. Based on the above embodiment, in this embodiment, after step S70, further includes:
step S010: counting the checked times of the target tag through buried points to obtain the historical checked times of the target tag;
in this embodiment, the embedded point processing is performed on the labels, so that the checked times of each label are recorded in real time, and the historical checked times of each label are obtained. The invention is not limited to the point burying mode, for example, modes of manual point burying, visual point burying, automatic point burying and the like are adopted. Meanwhile, the implantation position of the embedded point code is not limited, for example, the embedded point is carried out on the front end UI layer, and the embedded point is carried out in the bottom data table or the log.
Further, embedding point codes in display positions of the information labels in advance, when a user clicks to view, the embedded point codes automatically call related interfaces to upload embedded point data to a back-end server, and the back-end server obtains historical viewing times of the labels by counting the embedded point data.
Step S020: and displaying the label with the largest historical checking frequency according to the historical checking frequency and the displaying number of the preset information labels.
In this embodiment, based on the statistics data of the historical viewing times, the labels of the same category of the same customer are ordered, the label with the highest historical viewing times indicates that the customer views frequently, and then the label with the highest historical viewing times is ordered in the priority display queue according to the historical viewing times, and the label with the highest historical viewing times is displayed, wherein the label with the higher historical viewing times proves that the more frequently viewed labels indicate that the customer needs frequently, so that the priority display of the label is set, and the customer information needed by the customer can be obtained at the highest speed.
For example, the number of display labels of a category is preset to be 5, the historical checking times of all labels of the category are counted, the labels are arranged from high to low according to the historical checking times, 5 labels with the top 5 ranks of the checking times are displayed, and the rest labels are hidden. Further, the hidden rest labels are all checked through clicking display, and if the user check request is not monitored, 5 labels with high historical check times are displayed by default.
Referring to fig. 6, fig. 6 is a detailed flowchart of an embodiment of step S70 in fig. 2. Based on the above steps, in this embodiment, step S70 further includes:
step S701: rendering the data of the target tag according to a preset JSP template to obtain a customer portrait frame;
step S702: and calculating the position coordinates of the target label on the customer portrait frame according to the label display form information of the target label, and arranging the target label according to the position coordinates to obtain the customer portrait.
In this embodiment, when the information tag is built, the user sets the display form of the tag according to the key information type of the tag or his own preference, and the display form of the tag may be regularly arranged horizontally or vertically, or randomly tiled, etc. And preferably, returning the data of the label to be displayed to a server in a hash table mode, and rendering by the server according to a JSP template corresponding to the data, wherein the JSP template is a preset Java server page template to obtain a customer portrait frame, calculating the position coordinates of the label in the customer portrait frame according to the display form information pre-configured in the label, and correspondingly arranging according to the position coordinates to obtain a final customer portrait.
For example, basic information tag data reflecting basic information of a client is obtained, the data is returned to a server in a hash table mode, the server renders the data according to a preset JSP template, a corresponding client portrait frame graph is generated through rendering and returned to a display interface, then position coordinates of a preset display form of the information tag in the data in the client portrait frame graph are calculated according to preset display form information in the tag, and the position coordinates are arranged to obtain a final client portrait. The frame graph of the customer portrait can be set in a self-defining way, and can be a portrait or a geometric figure, and the frame graph is determined according to actual situations.
The invention also provides a customer portrait generating device based on big data.
Referring to fig. 7, fig. 7 is a schematic diagram showing functional blocks of an embodiment of the client image generating apparatus according to the present invention. In this embodiment, the client portrait creation apparatus includes:
a mapping module 10, configured to map the customer big data into a database table through hive;
the separation module 20 is configured to perform separation processing on the information stream related to the client in the client database table by using the separator, so as to obtain a small information stream;
the matching module 30 is configured to match key information of a client from the small-segment information stream through a key word matching algorithm based on a preset client key word, and establish a tag according to the key information, where the tag includes information of the client and display form information of the tag;
a monitoring module 40 for monitoring whether a customer representation generation request currently exists;
a first obtaining module 50, configured to obtain target display information from a client portrait generation request if the client portrait generation request exists, where the target display information includes information of a target tag that is requested to be displayed;
a second obtaining module 60, configured to obtain, according to the target display information, a target tag specified to be displayed by the target display information;
and the rendering module 70 is used for rendering the target label to obtain a customer portrait.
In this embodiment, the mapping module 10 maps big customer data into a database table through hive, the separation module 20 uses separator to separate the information streams related to customers in the customer database table to obtain small-segment information streams, the matching module 30 is configured to match key information of customers from the small-segment information streams through a key word matching algorithm based on preset customer key words, and build labels with the key information, the monitoring module 40 monitors whether a customer portrait generation request exists currently, the first obtaining module 50 obtains target display information from the customer portrait generation request when determining that a customer portrait generation request exists, the second obtaining module 60 obtains target labels specified to be displayed by the target display information according to the target display information, and the rendering module 70 renders the target labels to obtain the customer portrait.
The invention also provides a computer readable storage medium.
In this embodiment, the computer-readable storage medium stores a client image generation program which, when executed by a processor, implements the steps of the client image generation method according to any one of the embodiments described above.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM), comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server or a network device, etc.) to perform the method according to the embodiments of the present invention.
While the embodiments of the present invention have been described above with reference to the drawings, the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many modifications may be made thereto by those of ordinary skill in the art without departing from the spirit of the present invention and the scope of the appended claims, which are to be accorded the full scope of the present invention as defined by the following description and drawings, or by any equivalent structures or equivalent flow changes, or by direct or indirect application to other relevant technical fields.