[go: up one dir, main page]

CN111414361A - Label data storage method, device, equipment and readable storage medium - Google Patents

Label data storage method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN111414361A
CN111414361A CN202010125560.5A CN202010125560A CN111414361A CN 111414361 A CN111414361 A CN 111414361A CN 202010125560 A CN202010125560 A CN 202010125560A CN 111414361 A CN111414361 A CN 111414361A
Authority
CN
China
Prior art keywords
tag
stored
label
data
group
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.)
Pending
Application number
CN202010125560.5A
Other languages
Chinese (zh)
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.)
Koubei Shanghai Information Technology Co Ltd
Original Assignee
Koubei Shanghai Information 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 Koubei Shanghai Information Technology Co Ltd filed Critical Koubei Shanghai Information Technology Co Ltd
Priority to CN202010125560.5A priority Critical patent/CN111414361A/en
Publication of CN111414361A publication Critical patent/CN111414361A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Landscapes

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

Abstract

The invention discloses a tag data storage method, a device, equipment and a readable storage medium, and relates to the technical field of Internet. The method comprises the following steps: the method comprises the steps of obtaining a plurality of label data to be stored, and dividing the plurality of label data to be stored into a low-frequency modified label group and a high-frequency modified label group; establishing a tag transverse table, and storing a low-frequency change tag group based on the tag transverse table; and establishing a tag longitudinal table, and storing the high-frequency change tag group based on the tag longitudinal table.

Description

Label data storage method, device, equipment and readable storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for storing tag data.
Background
With the wide popularization of internet technology, more and more enterprises can identify online users through some specific tag data, analyze the online behaviors of the users, and further provide services for the users in a targeted manner. A Point of interest (POI) is a technology for providing a personalized service for a user based on analyzing a geographical location of the user, and is widely applied to service provision, and data of the POI may be used as tag data. At present, in consideration of convenience, safety and process control of tag data, an enterprise usually establishes a tag data management platform, and based on the tag data management platform, operations such as storage, use, maintenance and analysis of tag data are realized.
In the related art, when the tag data management platform stores the tag data, since there is an association relationship between the tag data and the tag data, the tag data is usually stored completely by using a longitudinal table or completely using a transverse table. When the tag data are stored on the basis of the vertical table, the table structure of the vertical table comprises a main key, a field code and a field value, wherein the main key stores the main tag data, the field code stores associated tag data which are associated with the main tag data, and the field value stores values of the associated tag data. When storing the tag data based on the transverse table, the table structure of the transverse table is a main key, a field 1 and a field 2, the main key stores the main tag data, and the field 1 and the field 2 store the associated tag data having an association relation with the main tag and the value of the associated tag data.
In the process of implementing the invention, the inventor finds that the related art has at least the following problems:
along with the development of services, tag data are continuously changed, a large amount of query and application can be performed in the operation process of the services, the table structure of a transverse table needs to be changed when the tag data are changed by using the transverse table to store the tag data, and a longitudinal table needs to be converted into the transverse table when the tag data are queried by using a longitudinal table to store the tag data, so that the workload of a tag data management platform in the whole operation process is huge, the service which is being executed on the tag data management platform is likely to be crashed, a large amount of performance loss is caused, and the intelligence and the flexibility are poor.
Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus, a device and a readable storage medium for storing tag data, and mainly aims to solve the problems of a great amount of performance loss, and poor intelligence and flexibility caused by a crash of a service being executed on a tag data management platform at present.
According to a first aspect of the present invention, there is provided a tag data storage method, the method comprising:
the method comprises the steps of obtaining a plurality of label data to be stored, and dividing the plurality of label data to be stored into a low-frequency change label group and a high-frequency change label group;
establishing a tag transverse table, storing the low-frequency modified tag group based on the tag transverse table, and establishing the tag transverse table based on the incidence relation of at least one first to-be-stored tag data in the low-frequency modified tag group;
and establishing a tag longitudinal table, storing the high-frequency modified tag group based on the tag longitudinal table, and establishing the tag longitudinal table based on the tag name and the tag value of at least one second tag data to be stored in the high-frequency modified tag group.
In another embodiment, the dividing the plurality of tag data to be stored into a low frequency modified tag group and a high frequency modified tag group includes:
for each tag data to be stored in the plurality of tag data to be stored, extracting a tag attribute of the tag data to be stored, wherein the tag attribute is at least one of a static attribute or a dynamic attribute;
if the tag attribute is a static attribute, dividing the tag data to be stored into the low-frequency modified tag group;
and if the tag attribute is a dynamic attribute, dividing the tag data to be stored into the high-frequency change tag group.
In another embodiment, the dividing the plurality of tag data to be stored into a low frequency modified tag group and a high frequency modified tag group includes:
for each tag data to be stored in the plurality of tag data to be stored, counting the change frequency of the tag data to be stored in a specified period;
if the change frequency is lower than a change threshold value, dividing the tag data to be stored into the low-frequency change tag group;
and if the change frequency is higher than the change threshold, dividing the tag data to be stored into the high-frequency change tag group.
In another embodiment, the creating a tag bar table, and storing the low frequency change tag group based on the tag bar table includes:
counting the description object of the at least one first tag data to be stored in the low-frequency modified tag group as a first service main body;
establishing a first table structure according to a first association relation between the at least one first tag data to be stored and the first service main body;
and filling the at least one first tag data to be stored into the first table structure to generate the tag transverse table.
In another embodiment, the creating a tag longitudinal table, and storing the high-frequency-change tag group based on the tag longitudinal table includes:
counting the description object of the at least one second tag data to be stored in the high-frequency change tag group as a second service main body;
establishing a second table structure by taking the main body name of the second service main body, the label name of the at least one second label data to be stored and the label value as columns;
and filling the label name and the label value of the at least one second label data to be stored into the second table structure to generate the label longitudinal table.
In another embodiment, after the creating a tag longitudinal table and storing the high-frequency-change tag group based on the tag longitudinal table, the method includes:
receiving a tag output request;
if the tag output request carries a specified service main body and does not carry a specified tag name and a specified tag value, filtering the specified service main body based on the tag transverse table and the tag longitudinal table;
if the label output request carries the appointed label name and the appointed label value, format conversion is carried out on the label longitudinal table to generate a temporary transverse table, and the appointed label name and the appointed label value carried by the label output request are filtered based on the label transverse table and the temporary transverse table.
In another embodiment, the converting the format of the label vertical table to generate a temporary horizontal table includes:
establishing a third table structure according to a second incidence relation between the at least one second to-be-stored label data and a second service main body of the label longitudinal table;
and filling the at least one piece of second label data to be stored into the third table structure to generate the temporary transverse table.
According to a second aspect of the present invention, there is provided a tag data storage apparatus comprising:
the device comprises a dividing module, a storage module and a processing module, wherein the dividing module is used for acquiring a plurality of label data to be stored and dividing the plurality of label data to be stored into a low-frequency modified label group and a high-frequency modified label group;
the first establishing module is used for establishing a tag transverse table, storing the low-frequency modified tag group based on the tag transverse table, and establishing the tag transverse table based on the incidence relation of at least one first to-be-stored tag data in the low-frequency modified tag group;
and the second establishing module is used for establishing a tag longitudinal table, storing the high-frequency modified tag group based on the tag longitudinal table, and establishing the tag longitudinal table based on the tag name and the tag value of at least one second to-be-stored tag data in the high-frequency modified tag group.
In another embodiment, the dividing module is configured to, for each tag data to be stored in the plurality of tag data to be stored, extract a tag attribute of the tag data to be stored, where the tag attribute is at least one of a static attribute or a dynamic attribute; if the tag attribute is a static attribute, dividing the tag data to be stored into the low-frequency modified tag group; and if the tag attribute is a dynamic attribute, dividing the tag data to be stored into the high-frequency change tag group.
In another embodiment, the dividing module is configured to count, for each tag data to be stored in the plurality of tag data to be stored, a change frequency of the tag data to be stored in a specified period; if the change frequency is lower than a change threshold value, dividing the tag data to be stored into the low-frequency change tag group; and if the change frequency is higher than the change threshold, dividing the tag data to be stored into the high-frequency change tag group.
In another embodiment, the first establishing module includes:
a counting unit, configured to count, in the low-frequency modified tag group, the description object of the at least one first tag data to be stored as a first service main body;
the establishing unit is used for establishing a first table structure according to a first incidence relation between the at least one first to-be-stored label data and the first service main body;
and the filling unit is used for filling the at least one first tag data to be stored into the first table structure to generate the tag transverse table.
In another embodiment, the second establishing module includes:
the statistical unit is used for counting the description object of the at least one second tag data to be stored in the high-frequency change tag group as a second service main body;
the establishing unit is used for establishing a second table structure by taking the main body name of the second service main body, the label name of the at least one second label data to be stored and the label value as columns;
and the filling unit is used for filling the label name and the label value of the at least one second label data to be stored into the second table structure to generate the label longitudinal table.
In another embodiment, the apparatus further comprises:
the receiving module is used for receiving a label output request;
the filtering module is used for filtering the appointed service main body based on the label transverse table and the label longitudinal table if the label output request carries the appointed service main body and does not carry the appointed label name and the appointed label value;
and the conversion module is used for converting the format of the label longitudinal table to generate a temporary transverse table if the label output request carries the appointed label name and the appointed label value, and filtering the appointed label name and the appointed label value carried by the label output request based on the label transverse table and the temporary transverse table.
In another embodiment, the conversion module includes:
the establishing unit is used for establishing a third table structure according to a second incidence relation between the at least one second label data to be stored and a second service main body of the label longitudinal table;
and the filling unit is used for filling the at least one piece of second label data to be stored into the third table structure to generate the temporary transverse table.
According to a third aspect of the present invention, there is provided an apparatus comprising a memory storing a computer program and a processor implementing the steps of the method of the first aspect when the processor executes the computer program.
According to a fourth aspect of the present invention, there is provided a readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of the first aspect as set forth above.
By means of the technical scheme, the tag data storage method, the device, the equipment and the readable storage medium provided by the invention divide a plurality of tag data to be stored into the low-frequency change tag group and the high-frequency change tag group, establish the tag transverse table to store the low-frequency change tag group, establish the tag longitudinal table to store the high-frequency change tag group, combine the performance of querying tags by the tag transverse table with the flexibility of adding and deleting tag data by the tag longitudinal table, avoid service breakdown caused by the change of a table structure for many times, reduce performance loss and have better intelligence and flexibility.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart illustrating a tag data storage method according to an embodiment of the present invention;
fig. 2A is a schematic flow chart illustrating a tag data storage method according to an embodiment of the present invention;
FIG. 2B is a schematic diagram illustrating a tag data storage method according to an embodiment of the present invention;
FIG. 2C is a schematic diagram illustrating a tag data storage method according to an embodiment of the present invention;
FIG. 2D is a schematic diagram illustrating a tag data storage method according to an embodiment of the present invention;
FIG. 2E is a schematic diagram illustrating a tag data storage method according to an embodiment of the present invention;
FIG. 3A is a schematic structural diagram of a tag data storage device according to an embodiment of the present invention;
FIG. 3B is a schematic structural diagram of a tag data storage device according to an embodiment of the present invention;
FIG. 3C is a schematic structural diagram of a tag data storage device according to an embodiment of the present invention;
FIG. 3D is a schematic structural diagram of a tag data storage device according to an embodiment of the present invention;
FIG. 3E is a schematic structural diagram of a tag data storage device according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating an apparatus structure of an apparatus according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
An embodiment of the present invention provides a tag data storage method, as shown in fig. 1, the method includes:
101. the method comprises the steps of obtaining a plurality of label data to be stored, and dividing the plurality of label data to be stored into a low-frequency change label group and a high-frequency change label group.
102. And establishing a tag transverse table, storing the low-frequency modified tag group based on the tag transverse table, and establishing the tag transverse table based on the incidence relation of at least one first to-be-stored tag data in the low-frequency modified tag group.
103. And establishing a tag longitudinal table, storing the high-frequency modified tag group based on the tag longitudinal table, and establishing the tag longitudinal table based on the tag name and the tag value of at least one second tag data to be stored in the high-frequency modified tag group.
The method provided by the embodiment of the invention divides a plurality of label data to be stored into the low-frequency change label group and the high-frequency change label group, establishes the label transverse table for storing the low-frequency change label group, establishes the label longitudinal table for storing the high-frequency change label group, combines the performance of label inquiry of the label transverse table with the flexibility of adding and deleting label data of the label longitudinal table, avoids service collapse caused by the change of the table structure for many times, reduces performance loss, and has better intelligence and flexibility.
An embodiment of the present invention provides a tag data storage method, as shown in fig. 2A, the method includes:
201. the method comprises the steps of obtaining a plurality of label data to be stored, and dividing the plurality of label data to be stored into a low-frequency change label group and a high-frequency change label group.
The inventor realizes that the label data management platform applied in the enterprise stores the label data by completely using the label horizontal table or the label vertical table. However, the tag data has uncertainty, and may change with the development of the service, and may be frequently applied in the service operation process, if the tag data is completely stored using the tag transverse table, when the tag data changes and needs to be added or deleted, the table structure of the tag transverse table needs to be changed, and the frequent adding or deleting of the tag data needs to be frequently changed. The advantages of using the label transverse table to store label data are that the label transverse table is traditional, easy to develop and simple to implement, but because the data volume of the label data related to the existing service scene is large and reaches billions level, changing the table structure under the background of big data is not easy, and the online service of the label data management platform is likely to be affected, so that the service is broken down. If the label longitudinal table is completely used for storing the label data, the method has the advantage of better flexibility of adding and deleting the label data, but when the label data is applied, conversion from the label longitudinal table to the transverse table is needed, and performance loss caused by the conversion is unacceptable. In order to combine the advantages of the label transverse table and the label longitudinal table, when the label data is managed by the conventional label data management platform, the addition and deletion of the label data are adjusted by soft deletion, so that the aim of not being revealed to the outside is fulfilled, and the addition of the label data is realized by adding a plurality of transverse tables. The method has the advantages that the table structure does not need to be changed frequently, the performance loss caused by vertical table format conversion does not exist, and the method is easy to realize. However, the disadvantage is that more and more tables are added for storing the tag data as time goes on, the newly added tag data is certainly applied at a high frequency, and the performance loss caused by the association of multiple tables is not negligible. Therefore, the invention provides a tag data storage method, which combines the tag inquiring performance of the tag transverse table and the tag data adding and deleting flexibility of the tag longitudinal table, and finally realizes the function of dynamically adding the tag data. The flexibility of the change of the label data brought by the invention is obvious, the application efficiency is improved, and the performance is further improved.
In the embodiment of the present invention, some tag data in all tag data currently managed in the tag data management platform are often applied to different services, and are easily changed along with changes in environment, scene, and the like, for example, a geographic location tag is often applied to services such as shopping, city service, taxi taking, and the like, and is continuously changed along with movement of a user. However, some tag data is only applied to a specific service and is not affected by changes in environment, scene, and the like, for example, a height tag, a gender tag, a birthday tag, and the like of a user are not changed in general, and even if the change occurs, the change is performed once for a long time. Therefore, for more active and unstable tag data, a storage mechanism of the tag transverse table is not applicable, and the greatest benefit is obtained by using the tag longitudinal table for storage. And for the more stable, can not take place the label data of this table often, and is not suitable for the storage mechanism of the label vertical table, use the horizontal table storage of label to receive the biggest profit. Therefore, in the embodiment of the present invention, in order to determine which tag data needs to be stored based on the tag longitudinal table and which tag data needs to be stored based on the tag transverse table, a plurality of tags to be stored that need to be currently stored may be divided into the low-frequency modified tag group and the high-frequency modified tag group according to the modification frequency, and then different ways are subsequently used for storing different tag groups.
When a plurality of tag data to be stored are grouped, the following two methods can be referred to: in a first approach, the partitioning may be based on tag attributes. Because some tag data have their own attributes determined to be a low-frequency-modified tag, the tag data are not modified for a long time, such as a height tag, a gender tag, and a birthday tag, and the tag data that are not modified for a long time have tag attributes that are static attributes; however, some tag data have been determined to be a tag with high frequency change by its own attribute, and may be changed frequently, for example, a geographical location tag, a temperature tag, and the like, and the tag attribute of the tag data that is changed frequently is a dynamic attribute, so that considering that the frequency of statistical change involves a large amount of statistical workload, when the tag data to be stored is grouped, the tag attribute of the tag data to be stored may be directly obtained, and the grouping of the tag data to be stored is realized based on the tag attribute. The specific process is as follows: for each tag data to be stored in a plurality of tag data to be stored, firstly, a tag attribute of the tag data to be stored is extracted, wherein the tag attribute is at least one of a static attribute or a dynamic attribute. Then, if the tag attribute is a static attribute, dividing the tag data to be stored into a low-frequency change tag group; and if the tag attribute is a dynamic attribute, dividing the tag data to be stored into high-frequency change tag groups.
In a second approach, the partitioning may be based on the change frequency. Considering that some tag data do not have corresponding self-attributes and are difficult to group according to the tag attributes, for example, number tags, some users may frequently change mobile phone numbers, and some users may not change mobile phone numbers for many years, therefore, when the tag data to be stored are grouped, a specified period and a change threshold value may be set, the change frequency of the tag data to be stored in the specified period is counted, and the group into which the tag data to be stored should be divided is judged based on the change threshold value. The specific process is as follows: for each tag data to be stored in a plurality of tag data to be stored, firstly, the change frequency of the tag data to be stored in a specified period is counted. Then, if the change frequency is lower than the change threshold, dividing the tag data to be stored into low-frequency change tag groups; and if the change frequency is higher than the change threshold value, dividing the tag data to be stored into high-frequency change tag groups.
It should be noted that, in the embodiment of the present invention, one of the two methods may be used to group a plurality of tag data to be stored, or a first method may be used to perform grouping once, and then a second method is used to perform filtering once on the grouped result, so as to ensure the grouping accuracy to the greatest extent. The grouping method of the plurality of tag data to be stored is not particularly limited.
202. And establishing a tag transverse table, and storing the low-frequency change tag group based on the tag transverse table.
In the embodiment of the invention, after the grouping of a plurality of label data to be stored is finished and the low-frequency modified label group and the high-frequency modified label group are obtained, the label data to be stored in the low-frequency modified label group and the high-frequency modified label group can be respectively stored.
For the low-frequency modified tag group, the modification frequency is low, the operations of adding, deleting, modifying and the like are less likely to occur, and the method is suitable for the storage mode of the transverse table. The tag list is used for representing an entity record by using a row, and a foreign key is needed to associate at least one first tag data to be stored included in the low-frequency modified tag group, so as to implement listing of the at least one first tag data to be stored. For example, assuming that the tag data to be stored is a height tag, a gender tag, and a birthday tag, and the description objects of these tag data to be stored are all "users", the "user name" or "user" of "users" may be directly used as the first business subject. And then, establishing a first table structure according to a first incidence relation between at least one first tag data to be stored and the first service main body, filling the at least one first tag data to be stored into the first table structure, generating a tag transverse table, and realizing the operation of establishing the tag transverse table based on the incidence relation of the at least one first tag data to be stored in the low-frequency change tag group. For example, referring to fig. 2B, ColA is the first business body, and all the tag data ColB, ColC, ColD and ColE have an association relationship with ColA, so a first table structure in the form of a large width table is established according to the association relationship between the tag data and the first business body, and then the tag data are filled into the first table structure, so that the tag width table shown in fig. 2B is obtained.
It should be noted that, in the process of practical application, description objects of at least one first to-be-stored tag data in the low-frequency modified tag group may be different, and thus, an association relationship cannot be established, so that, between the establishment of the tag transverse tables, at least one to-be-stored tag data may be firstly classified according to the theme of the at least one first to-be-stored tag data, the first to-be-stored tag data with the same description object may be divided into a group, and different tag transverse tables may be established for different groups, that is, the first to-be-stored tag data may be stored based on the tag transverse tables with different themes in the low-frequency modified group, and two or more tag transverse tables may be generated, without limitation generating one tag transverse table. For example, assuming that the first to-be-stored tag data includes a height tag, a gender tag, a birthday tag, a job position tag, and a work place tag, and the description object of the height tag, the gender tag, and the birthday tag is "user" and the description object of the job position tag, and the work place tag is "work", the height tag, the gender tag, and the birthday tag may be used as one group to generate one tag bar, and the job position tag, and the work place tag may be used as another group to generate another tag bar.
203. And establishing a tag longitudinal table, and storing the high-frequency change tag group based on the tag longitudinal table.
In the embodiment of the invention, for the high-frequency modified tag group, the modification frequency is higher, the operations of addition, deletion, modification and the like are more likely to occur, and the method is suitable for the storage mode of the longitudinal table. In order to meet the basic table structure of the tag longitudinal table, at least one description object of second tag data to be stored needs to be extracted from the high-frequency modified tag group as a second service main body, and a second table structure is established by taking the main body name of the second service main body, the tag name of the at least one second tag data to be stored, and a tag value as columns. And then, filling the label name and the label value of at least one second label data to be stored into a second table structure, and generating a label longitudinal table to realize the listing of the at least one second label data to be stored, namely the label longitudinal table needs to be established based on the label name and the label value of at least one second label data to be stored in the high-frequency change label group.
For example, referring to fig. 2C, if the ColA is the second service agent, the item of the label name is indicated by a Key, and the item of the label Value is indicated by a Value, a second table structure is generated, and the label names and the label values 4 and 5 of the ColD and the ColE are filled in the second table structure, so that the label longitudinal table can be generated.
204. Receiving a tag output request, and if the tag output request carries an appointed service body and does not carry an appointed tag name and an appointed tag value, executing the following step 205; if the tag output request carries the specified tag name and the specified tag value, the following step 206 is executed.
In the embodiment of the invention, the label vertical table has the advantages that the table structure is fixed, the change of the table structure caused by the addition and deletion of labels is avoided, but the label vertical table cannot intuitively express the direct relation of label data during query, and the query service can be provided by converting the label vertical table into the horizontal table. It should be noted that, the conversion into the horizontal table is not required in all cases, and if the tag output request only requests to query the service body, the vertical table and the horizontal table are both established on the basis of the service body, so that the corresponding line may be output directly according to the ID (identity) of the service body. For example, referring to the vertical table structure shown in fig. 2D, if the tag output request indicates which IDs the output Age is between 25 and 30, the tag output request may be directly output based on the vertical table structure shown in fig. 2D. However, if the tag output request is more specific, the tag vertical table needs to be converted into the horizontal table, and then filtering is performed to obtain the required tag data. For example, continuing with the example of fig. 2D, it is troublesome to use the ID and Name (Name) of the output Age of fig. 2D between 25 and 30, and therefore, the tag data can be directly output according to the ID and Name by converting the vertical table structure shown in fig. 2D into the horizontal table structure shown in fig. 2E. In summary, whether the format conversion operation of the tag longitudinal table needs to be executed can be determined according to whether the tag output request carries the specified tag name and the specified tag value.
If the tag output request carries the specified service body and does not carry the specified tag name and the specified tag value, it indicates that the tag output request of this time is only related to the service body, and does not relate to more detailed data query, and the vertical table may also provide corresponding data output service, and format conversion of the tag vertical table does not need to be performed, that is, the process in step 205 is performed. If the tag output request carries the specified tag name and the specified tag value, it indicates that the tag output request of this time is not only related to the service body, but also relates to more detailed contents such as the tag name and the tag value, and the vertical table cannot satisfy the tag output request of this time, and format conversion of the tag vertical table needs to be performed, that is, the process in step 206 below is performed.
205. And if the tag output request carries the specified service body and does not carry the specified tag name and the specified tag value, filtering the specified service body based on the tag transverse table and the tag longitudinal table.
In the embodiment of the invention, if the tag output request carries the specified service body and does not carry the specified tag name and the specified tag value, the tag output request at this time is only related to the service body, and more detailed data query is not involved.
206. And if the label output request carries the specified label name and the specified label value, performing format conversion on the label longitudinal table to generate a temporary transverse table, and filtering the specified label name and the specified label value carried by the label output request based on the label transverse table and the temporary transverse table.
In the embodiment of the present invention, if the tag output request carries the specified tag name and the specified tag value, it indicates that the current tag output request is not only related to the service body, but also relates to more detailed contents such as the tag name and the tag value, and the vertical table cannot satisfy the current tag output request, and format conversion of the vertical table needs to be performed, so that format conversion is performed on the vertical table to generate the temporary horizontal table, and the specified tag name and the specified tag value carried by the tag output request are filtered based on the horizontal table and the temporary horizontal table.
When format conversion is performed on the label longitudinal table, because the transverse table needs to be established based on the incidence relation between the service main body and the label data to be stored, a third table structure is established according to the second incidence relation between at least one second label data to be stored and the second service main body of the label longitudinal table, and the at least one second label data to be stored is filled into the third table structure to generate a temporary transverse table. The process of creating the third table structure and generating the temporary transverse table is consistent with the process of creating the first table structure and generating the label transverse table in step 202, and is not repeated here.
The method provided by the embodiment of the invention divides a plurality of label data to be stored into the low-frequency change label group and the high-frequency change label group, establishes the label transverse table for storing the low-frequency change label group, establishes the label longitudinal table for storing the high-frequency change label group, combines the performance of label inquiry of the label transverse table with the flexibility of adding and deleting label data of the label longitudinal table, avoids service collapse caused by the change of the table structure for many times, reduces performance loss, and has better intelligence and flexibility.
Further, as a specific implementation of the method shown in fig. 1, an embodiment of the present invention provides a tag data storage apparatus, and as shown in fig. 3A, the apparatus includes: a partitioning module 301, a first establishing module 302 and a second establishing module 303.
The dividing module 301 is configured to obtain a plurality of tag data to be stored, and divide the plurality of tag data to be stored into a low-frequency modified tag group and a high-frequency modified tag group;
the first establishing module 302 is configured to establish a tag transverse table, store the low-frequency modified tag group based on the tag transverse table, and establish the tag transverse table based on an association relationship between at least one first to-be-stored tag data in the low-frequency modified tag group;
the second establishing module 303 is configured to establish a tag longitudinal table, store the high-frequency modified tag group based on the tag longitudinal table, and establish the tag longitudinal table based on a tag name and a tag value of at least one second to-be-stored tag data in the high-frequency modified tag group.
In a specific application scenario, the dividing module 301 is configured to, for each to-be-stored tag data in the plurality of to-be-stored tag data, extract a tag attribute of the to-be-stored tag data, where the tag attribute is at least one of a static attribute or a dynamic attribute; if the tag attribute is a static attribute, dividing the tag data to be stored into the low-frequency modified tag group; and if the tag attribute is a dynamic attribute, dividing the tag data to be stored into the high-frequency change tag group.
In a specific application scenario, the dividing module 301 is configured to count, for each to-be-stored tag data in the plurality of to-be-stored tag data, a change frequency of the to-be-stored tag data in a specified period; if the change frequency is lower than a change threshold value, dividing the tag data to be stored into the low-frequency change tag group; and if the change frequency is higher than the change threshold, dividing the tag data to be stored into the high-frequency change tag group.
In a specific application scenario, as shown in fig. 3B, the first establishing module 302 includes: a statistics unit 3021, a setup unit 3022 and a padding unit 3023.
The statistical unit 3021 is configured to count, in the low frequency modified tag group, the description object of the at least one first tag data to be stored as a first service subject;
the establishing unit 3022 is configured to establish a first table structure according to a first association relationship between the at least one first to-be-stored tag data and the first service agent;
the filling unit 3023 is configured to fill the at least one first tag data to be stored into the first table structure, so as to generate the tag cross table.
In a specific application scenario, as shown in fig. 3C, the second establishing module 303 includes: a statistics unit 3031, a setup unit 3032 and a padding unit 3033.
The statistical unit 3031 is configured to count, in the high-frequency modified tag group, the description object of the at least one second tag data to be stored as a second service body;
the establishing unit 3032 is configured to establish a second table structure by taking the main body name of the second service main body, the tag name of the at least one second to-be-stored tag data, and the tag value as a column;
the filling unit 3033 is configured to fill the tag name and the tag value of the at least one second to-be-stored tag data into the second table structure, so as to generate the tag longitudinal table.
In a specific application scenario, as shown in fig. 3D, the apparatus further includes: a receiving module 304, a filtering module 305 and a converting module 306.
The receiving module 304 is configured to receive a tag output request;
the filtering module 305 is configured to, if the tag output request carries an assigned service body and does not carry an assigned tag name and an assigned tag value, filter the assigned service body based on the tag transverse table and the tag longitudinal table;
the conversion module 306 is configured to, if the tag output request carries the specified tag name and the specified tag value, perform format conversion on the tag vertical table to generate a temporary horizontal table, and filter the specified tag name and the specified tag value carried by the tag output request based on the tag horizontal table and the temporary horizontal table.
In a specific application scenario, as shown in fig. 3E, the converting module 306 includes: a building unit 3061 and a filling unit 3062.
The establishing unit 3061 is configured to establish a third table structure according to a second association relationship between the at least one second to-be-stored tag data and a second service body of the tag longitudinal table;
the filling unit 3062 is configured to fill the at least one second tag data to be stored into the third table structure, so as to generate the temporary cross table.
The device provided by the embodiment of the invention divides a plurality of label data to be stored into the low-frequency change label group and the high-frequency change label group, establishes the label transverse table for storing the low-frequency change label group, establishes the label longitudinal table for storing the high-frequency change label group, combines the performance of label inquiry of the label transverse table with the flexibility of adding and deleting label data of the label longitudinal table, avoids service collapse caused by the change of the table structure for many times, reduces performance loss, and has better intelligence and flexibility.
It should be noted that other corresponding descriptions of the functional units related to the tag data storage device provided in the embodiment of the present invention may refer to the corresponding descriptions in fig. 1 and fig. 2A to fig. 2E, and are not repeated herein.
In an exemplary embodiment, referring to fig. 4, there is further provided a device, where the device 400 includes a communication bus, a processor, a memory, and a communication interface, and may further include an input/output interface and a display device, where the functional units may communicate with each other through the bus. The memory stores computer programs, and the processor is used for executing the programs stored in the memory and executing the tag data storage method in the embodiment.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the tag data storage method.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by hardware, and also by software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application.
Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios.
The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.

Claims (10)

1. A tag data storage method, comprising:
the method comprises the steps of obtaining a plurality of label data to be stored, and dividing the plurality of label data to be stored into a low-frequency change label group and a high-frequency change label group;
establishing a tag transverse table, storing the low-frequency modified tag group based on the tag transverse table, and establishing the tag transverse table based on the incidence relation of at least one first to-be-stored tag data in the low-frequency modified tag group;
and establishing a tag longitudinal table, storing the high-frequency modified tag group based on the tag longitudinal table, and establishing the tag longitudinal table based on the tag name and the tag value of at least one second tag data to be stored in the high-frequency modified tag group.
2. The method of claim 1, wherein the dividing the plurality of tag data to be stored into a low frequency modified tag group and a high frequency modified tag group comprises:
for each tag data to be stored in the plurality of tag data to be stored, extracting a tag attribute of the tag data to be stored, wherein the tag attribute is at least one of a static attribute or a dynamic attribute;
if the tag attribute is a static attribute, dividing the tag data to be stored into the low-frequency modified tag group;
and if the tag attribute is a dynamic attribute, dividing the tag data to be stored into the high-frequency change tag group.
3. The method of claim 1, wherein the dividing the plurality of tag data to be stored into a low frequency modified tag group and a high frequency modified tag group comprises:
for each tag data to be stored in the plurality of tag data to be stored, counting the change frequency of the tag data to be stored in a specified period;
if the change frequency is lower than a change threshold value, dividing the tag data to be stored into the low-frequency change tag group;
and if the change frequency is higher than the change threshold, dividing the tag data to be stored into the high-frequency change tag group.
4. The method of claim 1, wherein the creating a tag bar table, and storing the low frequency change tag group based on the tag bar table comprises:
counting the description object of the at least one first tag data to be stored in the low-frequency modified tag group as a first service main body;
establishing a first table structure according to a first association relation between the at least one first tag data to be stored and the first service main body;
and filling the at least one first tag data to be stored into the first table structure to generate the tag transverse table.
5. The method of claim 1, wherein the creating a tag longitudinal table, and storing the high frequency change tag group based on the tag longitudinal table comprises:
counting the description object of the at least one second tag data to be stored in the high-frequency change tag group as a second service main body;
establishing a second table structure by taking the main body name of the second service main body, the label name of the at least one second label data to be stored and the label value as columns;
and filling the label name and the label value of the at least one second label data to be stored into the second table structure to generate the label longitudinal table.
6. The method of claim 1, wherein after creating the tag longitudinal table and storing the high frequency-modified tag group based on the tag longitudinal table, the method comprises:
receiving a tag output request;
if the tag output request carries a specified service main body and does not carry a specified tag name and a specified tag value, filtering the specified service main body based on the tag transverse table and the tag longitudinal table;
if the label output request carries the appointed label name and the appointed label value, format conversion is carried out on the label longitudinal table to generate a temporary transverse table, and the appointed label name and the appointed label value carried by the label output request are filtered based on the label transverse table and the temporary transverse table.
7. The method of claim 6, wherein the converting the format of the label vertical table to generate a temporary horizontal table comprises:
establishing a third table structure according to a second incidence relation between the at least one second to-be-stored label data and a second service main body of the label longitudinal table;
and filling the at least one piece of second label data to be stored into the third table structure to generate the temporary transverse table.
8. A tag data storage device, comprising:
the device comprises a dividing module, a storage module and a processing module, wherein the dividing module is used for acquiring a plurality of label data to be stored and dividing the plurality of label data to be stored into a low-frequency modified label group and a high-frequency modified label group;
the first establishing module is used for establishing a tag transverse table, storing the low-frequency modified tag group based on the tag transverse table, and establishing the tag transverse table based on the incidence relation of at least one first to-be-stored tag data in the low-frequency modified tag group;
and the second establishing module is used for establishing a tag longitudinal table, storing the high-frequency modified tag group based on the tag longitudinal table, and establishing the tag longitudinal table based on the tag name and the tag value of at least one second to-be-stored tag data in the high-frequency modified tag group.
9. An apparatus comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202010125560.5A 2020-02-20 2020-02-20 Label data storage method, device, equipment and readable storage medium Pending CN111414361A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010125560.5A CN111414361A (en) 2020-02-20 2020-02-20 Label data storage method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010125560.5A CN111414361A (en) 2020-02-20 2020-02-20 Label data storage method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN111414361A true CN111414361A (en) 2020-07-14

Family

ID=71491028

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010125560.5A Pending CN111414361A (en) 2020-02-20 2020-02-20 Label data storage method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111414361A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858609A (en) * 2020-07-27 2020-10-30 北京金山云网络技术有限公司 Fuzzy query method and device for block chain
CN111913966A (en) * 2020-08-03 2020-11-10 深圳证券交易所 User label storage method, device and computer-readable storage medium
CN112507017A (en) * 2020-12-03 2021-03-16 建信金融科技有限责任公司 Data table conversion method and device
CN115687353A (en) * 2022-11-04 2023-02-03 中电云数智科技有限公司 Storage method and system based on electronic trademark label data
CN117252558A (en) * 2023-11-17 2023-12-19 南京特沃斯清洁设备有限公司 Cleaning equipment management method and system based on face recognition

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046805A (en) * 2006-04-19 2007-10-03 华为技术有限公司 Physical attributes data process device and method
CN101770359A (en) * 2008-12-30 2010-07-07 华为技术有限公司 Method, device and system for generating interface and acquiring and storing data
US20140280479A1 (en) * 2013-03-15 2014-09-18 Edgecast Networks, Inc. Dynamic Tag Management for Optimizing Content Delivery
CN107766007A (en) * 2017-11-16 2018-03-06 郑州云海信息技术有限公司 A kind of date storage method and device
CN109102333A (en) * 2018-08-07 2018-12-28 深圳市丰巢科技有限公司 A kind of user tag processing method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046805A (en) * 2006-04-19 2007-10-03 华为技术有限公司 Physical attributes data process device and method
CN101770359A (en) * 2008-12-30 2010-07-07 华为技术有限公司 Method, device and system for generating interface and acquiring and storing data
US20140280479A1 (en) * 2013-03-15 2014-09-18 Edgecast Networks, Inc. Dynamic Tag Management for Optimizing Content Delivery
CN107766007A (en) * 2017-11-16 2018-03-06 郑州云海信息技术有限公司 A kind of date storage method and device
CN109102333A (en) * 2018-08-07 2018-12-28 深圳市丰巢科技有限公司 A kind of user tag processing method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张宝亮: "SOA在商业银行中间业务平台中的应用研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 *
陈庆波;: "浅谈构建客户标签体系思路", 福建电脑 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858609A (en) * 2020-07-27 2020-10-30 北京金山云网络技术有限公司 Fuzzy query method and device for block chain
CN111913966A (en) * 2020-08-03 2020-11-10 深圳证券交易所 User label storage method, device and computer-readable storage medium
CN112507017A (en) * 2020-12-03 2021-03-16 建信金融科技有限责任公司 Data table conversion method and device
CN115687353A (en) * 2022-11-04 2023-02-03 中电云数智科技有限公司 Storage method and system based on electronic trademark label data
CN117252558A (en) * 2023-11-17 2023-12-19 南京特沃斯清洁设备有限公司 Cleaning equipment management method and system based on face recognition
CN117252558B (en) * 2023-11-17 2024-01-19 南京特沃斯清洁设备有限公司 Cleaning equipment management method and system based on face recognition

Similar Documents

Publication Publication Date Title
CN111414361A (en) Label data storage method, device, equipment and readable storage medium
CN111311326B (en) User behavior real-time multidimensional analysis method, device and storage medium
CN111722918B (en) Service identification code generation method, device, storage medium and electronic device
CN108509437B (en) ElasticSearch query acceleration method
CN114328632A (en) User data analysis method and device based on bitmap and computer equipment
US20220101350A1 (en) Information pushing method and apparatus
CN111339171B (en) Data query method, device and device
CN106933836B (en) Data storage method and system based on sub-tables
CN104598557A (en) Method and device for data rasterization and method and device for user behavior analysis
CN110019754A (en) A kind of method for building up of knowledge base, device and equipment
CN104657435A (en) Storage management method for application data and network management system
CN112068812B (en) Micro-service generation method and device, computer equipment and storage medium
CN112506486A (en) Search system establishing method and device, electronic equipment and readable storage medium
CN118569223B (en) Multi-dimensional table generation method and device and computer equipment
CN106156040A (en) multi-dimensional data management method and device
CN111431818A (en) Cross-domain request traffic distribution method and device, storage medium and computer equipment
US10949409B2 (en) On-demand, dynamic and optimized indexing in natural language processing
CN106933873A (en) A kind of cross-platform data querying method and equipment
CN110222046A (en) Processing method, device, server and the storage medium of table data
CN110909072B (en) Data table establishment method, device and equipment
CN109697234B (en) Multi-attribute information query method, device, server and medium for entity
CN107016050A (en) Data processing method and device
CN112181391B (en) A method and system capable of dynamically expanding data
CN116010474A (en) Access data statistics method, device, computer equipment and storage medium
CN108763498B (en) User identity identification method and device, electronic equipment and readable storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200714