Label management system, label operation method, and data table operation method and device
By setting up the first and second types of data tables in the database and using the tag management system to uniformly manage tags, the problems of poor label scalability and waste of resources in the existing technology are solved, automatic detection and flexible selection are realized, and the reduction of the Cost and time consumption.
Patent Information
- Application Number
- CN202010108268.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-21
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2040-02-21
AI Technical Summary
In the prior art, the labels in the database have poor scalability, serious waste of storage resources, and lack unified management of different data table labels. Manual inspection is required when adding tags, which is easy to miss and needs to change the data table structure, resulting in high cost and time consumption. .
Store tag-related data in the form of records. By setting up the first and second types of data tables, using the tag management system to manage the first type of data tables, automatically detect similar tags, avoid adding data table fields, and realize flexible selection of tags and Unified management.
It solves the problem that data tables cannot be expanded when tags are multi-tagged, saves storage resources, realizes automatic detection and unified management of tags, and reduces the cost and time of increasing tags.
Smart Images

Figure CN113297197B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a label management system, a label operation method, and a data table operation method and device. Background Art
[0002] In Internet application systems, target object sets (e.g., user sets composed of specific users) often need to be tagged with various labels, such as "interests and hobbies", "region", "exempt from review", etc. In the prior art, relational databases are generally used to store target object set data, and each label usually corresponds to a field in a data table.
[0003] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems:
[0004] 1. Since the number of fields that can be defined in a data table is limited, it cannot be expanded after the number of tags reaches a certain value. In addition, the records in the data table may not use all tags, and the existing storage method will cause a large waste of storage resources.
[0005] 2. In the prior art, different data tables are usually used to store data of different target object sets. Since different target object sets may have the same labels, each data table may have fields with the same name. The above storage method cannot achieve unified management of the labels in each data table.
[0006] 3. When adding tags, it is generally necessary to check whether there are similar tags to avoid too many semantically repeated tags. In the prior art, the above check is performed manually, which is prone to omissions. At the same time, each new tag needs to add a data table field, which involves changes in the data table structure, so it takes a lot of cost and time. Summary of the invention
[0007] In view of this, the embodiments of the present invention provide a label management system, a label operation method, and a data table operation method and device, which can achieve unified management and good expansion of target object set labels.
[0008] To achieve the above objective, according to one aspect of the present invention, a label management system is provided.
[0009] The tag management system of an embodiment of the present invention is used to manage tags of at least one target object set stored in a database; wherein the database includes a data table corresponding to each target object set, and each record in the data table includes an identifier of a target object in the target object set, a name of a tag of the target object, and a value of the target object under the tag; the system stores information of each tag in the data table corresponding to the at least one target object set, and the information includes the name of the tag and the identifier of the data table where the tag is located; the system is used to: update locally stored tag information according to a first operation on the tag; and / or, verify a second operation on the data table corresponding to any target object set, and determine whether the second operation is allowed to be executed according to the verification result.
[0010] Optionally, the first operation includes: adding a label, deleting a label or modifying label information in the system; the second operation includes: adding data, deleting data or modifying data in a data table corresponding to any target object set; the label information stored in the system also includes at least one of the following: label description data, label value enumeration data, label creator identifier.
[0011] Optionally, the second operation is related to at least one label; and the system is further used to: when a second operation on a data table corresponding to any target object set is monitored, determine whether the name of the label related to the second operation is stored locally; when the name of the label is not stored locally, not allowing the second operation to be executed; when the name of the label is stored locally, determine whether the identifier of the data table where the label is located contains the identifier of the data table targeted by the second operation: if so, allowing the second operation to be executed; otherwise, not allowing the second operation to be executed.
[0012] Optionally, the label is a first-class label of a target object set, and the data table is a first-class data table corresponding to the target object set; each target object set also has a second-class label, and the database also includes a second-class data table corresponding to each target object set and using the second-class label name as the field name; the first-class data table and the second-class data table corresponding to the same target object set are associated through the identifier of the target object in the target object set.
[0013] To achieve the above objective, according to another aspect of the present invention, a tag operation method based on a tag management system is provided.
[0014] The tag operation method of the embodiment of the present invention includes: when receiving a first operation on the tag, updating the tag information stored in the system according to the first operation; wherein the first operation is related to the data table in the database; updating the data table according to the updated tag information.
[0015] Optionally, the first operation includes: adding a tag in the system; and, updating the tag information stored in the system according to the first operation, including: performing word segmentation processing on the name or description data of the tag to be added and obtaining the word vector of each word formed after the word segmentation processing; generating a sentence vector of the tag to be added according to the word vector, obtaining the similarity between the tag to be added and the sentence vector of each tag stored in the system, determining the tags stored in the system whose similarity meets preset conditions as similar tags of the tags to be added, and displaying the similar tags; when receiving a creation instruction for the tag to be added, storing the information of the tag to be added in the system.
[0016] Optionally, generating a sentence vector to which a label is to be added based on the word vector includes: determining a weighted average vector of the word vectors of each word formed after word segmentation as the sentence vector to which the label is to be added; wherein the weight value of each word used to determine the weighted average vector is determined by the part of speech of the word; and the preset conditions include: the similarity is greater than a preset threshold; the first operation also includes: deleting the label or modifying the label information in the system; the label information stored in the system also includes at least one of the following: label description data, label value enumeration data, and label creator identification.
[0017] To achieve the above objective, according to another aspect of the present invention, a data table operation method based on a tag management system is provided.
[0018] The data table operation method of an embodiment of the present invention includes: when a second operation on a data table corresponding to any target object set is monitored, determining whether the name of a label related to the second operation is stored locally; when the name of the label is stored locally and the identifier of the data table where the label is located contains the identifier of the data table targeted by the second operation, allowing the second operation to be executed.
[0019] Optionally, the method further includes: when the name of the tag is not stored locally, the second operation is not allowed to be executed; when the name of the tag is stored locally and the identifier of the data table where the second operation is located does not exist in the identifier of the data table where the second operation is targeted, the second operation is not allowed to be executed.
[0020] Optionally, the second operation includes: adding data, deleting data or modifying data in a data table corresponding to any target object set; the label information stored by the system also includes at least one of the following: label description data, label value enumeration data, and label creator identification.
[0021] To achieve the above objective, according to another aspect of the present invention, a data table operation device based on a tag management system is provided.
[0022] The data table operation device of an embodiment of the present invention may include: a judgment unit, used to: when monitoring a second operation on a data table corresponding to any target object set, determine whether the name of a label related to the second operation is stored locally; an execution control unit, used to: when the name of the label is stored locally and the identifier of the data table where the label is located stored locally contains the identifier of the data table targeted by the second operation, allow the second operation to be executed.
[0023] To achieve the above objective, according to another aspect of the present invention, an electronic device is provided.
[0024] An electronic device of the present invention comprises: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the label operation method or data table operation method provided by the present invention.
[0025] To achieve the above objective, according to yet another aspect of the present invention, a computer-readable storage medium is provided.
[0026] A computer-readable storage medium of the present invention stores a computer program, which, when executed by a processor, implements the label operation method or data table operation method provided by the present invention.
[0027] According to the technical solution of the present invention, one embodiment of the above invention has the following advantages or beneficial effects:
[0028] First, a first-class data table and a second-class data table are set in the database for the target object set to store the tag-related data of the specific target object. The first-class data table is used to store the related data of the tags that change more (i.e., the first-class tags). Each record in the table includes the identifier of a specific target object, the tag name, and the corresponding tag value; the second-class data table is used to store the related data of the tags that change less or remain unchanged (i.e., the second-class tags). Each tag in the table corresponds to a field. At the same time, a tag management system is set to manage the tags stored in the first-class data table, and the tag information stored in the tag management system is consistent with the tag-related data in the first-class data table. When the first operation on the label is performed externally (such as adding a label, deleting a label, modifying a label, etc.), it is necessary to first update it in the label management system and then synchronize it to the corresponding data table; when the second operation on the first type of data table is performed externally (such as adding data, deleting data, modifying data, etc.), it is necessary to first determine whether the label related to the second operation is compliant in the label management system. Only when the label management system stores the name of the label and the data table identifier in the same record (the identifier represents the data table that can use the label) has the data table identifier targeted by the second operation, it is determined to be compliant, and then the second operation is allowed to be performed, thereby avoiding arbitrary and erroneous operations on the second data table. Through the above settings, since records are used in the data table to store label-related data, the problem that the data table cannot be expanded when there are many current labels can be completely solved (theoretically, the number of records can be expanded infinitely). At the same time, in the storage method of the embodiment of the present invention, each target object can flexibly select labels without having to use all labels.
[0029] Secondly, the tag management system of the embodiment of the present invention can store the same tag in different data tables as a record, which includes the tag name, the data table identifier where the tag is located, the tag description data, etc. The tag management system can uniformly manage the tags in different data tables and perform operations such as adding, deleting, and modifying. The data table identifier where the tag is located can represent the scope attribute of the tag, which can be flexibly modified so that the tag acts on any data table, thereby avoiding repeated maintenance of the tag.
[0030] Third, in an embodiment of the present invention, when it is necessary to add a tag, the sentence vector of the name of the tag to be added or the tag description data can be obtained through the word2vec model. After calculating the similarity between the sentence vectors of the tag to be added and the existing tags in the tag management system, similar tags with higher similarity can be obtained for external display. When the external decision is still to add, the process of adding tags is executed; when the external decision is not to add (that is, to use similar tags), the process of adding tags is not executed. At this time, the same function can be achieved by modifying the database identifier corresponding to the similar tags to be used in the tag management system. In this way, automatic detection of similar tags can be achieved, thereby avoiding omissions. In addition, based on the data storage method of the embodiment of the present invention, when adding tags, there is no need to add data table fields, only insert records, so there is no need to change the data table structure, thereby consuming lower costs and shorter time.
[0031] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0033] Figure 1 It is a schematic diagram of components of a label management system in an embodiment of the present invention;
[0034] Figure 2 is a flowchart of the response operation of the label management system in an embodiment of the present invention;
[0035] Figure 3 is a schematic diagram of the overall architecture of a tag management system in an embodiment of the present invention;
[0036] Figure 4 Schematic diagram of the main steps of the label operation method in an embodiment of the present invention;
[0037] Figure 5 It is a schematic diagram of the main steps of the data table operation method in an embodiment of the present invention;
[0038] Figure 6 It is a schematic diagram of components of a data table operation device in an embodiment of the present invention;
[0039] Figure 7 It is a schematic diagram of the structure of an electronic device used to implement the method in the embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0041] It is understood that the terms "first", "second", etc. used in the present invention are used herein to describe various concepts, but these concepts are not limited by the above terms. The above terms are only used to distinguish one concept from another. For example, without departing from the scope of the present invention, the first operation can be called the second operation, and the second operation can be called the first operation. The first operation and the second operation are both operations, but they are not the same operation. It should be pointed out that the embodiments of the present invention and the technical features in the embodiments can be combined with each other without conflict.
[0042] Figure 1 It is a schematic diagram of components of a label management system in an embodiment of the present invention.
[0043] like Figure 1 As shown, the tag management system of the embodiment of the present invention is used to manage the tags of at least one target object set stored in the database. Among them, the target object set can be a set composed of specific target objects, or it can be a physical or virtual data object or information object. For example, when the target object is a specific user, the target object set is a user set composed of specific users; when the target object is a specific address, the target object set is an address set composed of specific addresses; when the target object is a specific manufacturer, the target object set is a manufacturer set composed of specific addresses. In practical applications, any target object set has at least one tag to describe its characteristics. For example, the tags of the user set can be hobbies (hobbies), area (area), audit-free (whether it is exempted from review, that is, whether it is exempted from review), the tags of the address set can be area, use (whether it is commonly used), and the tags of the manufacturer set can be area, audit-free, scale. It can be understood that the above hobbies, area, audit-free, use, and scale are all tag names used to identify each tag, and hobbies, area, whether it is exempted from review, whether it is commonly used, and production scale are all tag description data. Generally, the tag name and tag description data can be in any language such as Chinese or English.
[0044] In specific application scenarios, the above-mentioned tags can be divided into discrete tags and continuous tags. Among them, the value of the discrete tag is discrete data, and the value of the continuous tag is continuous data. For example, if the values of the hobbies tag are: music, movies, and basketball, then the tag is a discrete tag, and the above-mentioned hobbies, area, audit-free, and use are all discrete tags. In an embodiment of the present invention, all the values of the discrete tag can be referred to as the tag value enumeration data of the tag. If the value of the production scale label is a continuous number, then the label is a continuous label. In addition, each target object in the target object set has one or more tags and the values of the above-mentioned tags. It can be understood that any tag of the target object must be one of the tags of the target object set to which it belongs, but not every target object has all the tags of the target object set. For example, a user a only has the hobbies tag and the area tag, and does not have the audit-free tag (that is, the value of the user in the whether to exempt the audit tag is null).
[0045] In the prior art, the tag-related data of the target object set is generally stored through a relational database. Generally, the tag-related data of a target object set can be stored in a data table. Among them, the tag-related data may include the tag name and the value of the target object in the tag. In the data table corresponding to the target object set, each tag corresponds to a field (that is, each tag name is the name of a field), and the value of a target object in a tag corresponds to the record indicated by the identifier of the target object and the field indicated by the tag name. With the continuous increase in the number of tags, the above storage method gradually exposes the following disadvantages: First, since the number of fields that can be defined in the data table is limited, it cannot be further expanded when the number of tags reaches a certain number. In addition, the records in the data table may not use all tags, and the existing storage method will cause a large waste of storage resources. Secondly, different data tables are usually used in the prior art to store data of different target object sets. Since different target object sets may have the same tag, each data table may have a field with the same name. The above storage method cannot achieve unified management of tags in each data table. Thirdly, when adding tags, it is generally necessary to check whether there are similar tags to avoid too many semantically repeated tags. In the prior art, the above-mentioned check is performed manually, which is prone to omissions. At the same time, each time a new tag is added, a field in the data table needs to be added, which involves a change in the data table structure, thus consuming a large cost and a long time.
[0046] In order to overcome the above shortcomings, in an embodiment of the present invention, a method for storing tag-related data in the form of records is provided. In practical applications, the data table storing tag-related data in the form of fields (hereinafter referred to as the original data table) can be transformed into a data table in the following form (hereinafter referred to as the first type of data table) or the tag-related data of the target object set can be directly stored in a data table in the following form. Specifically, the first type of data table has a target object identification field, a tag name field, and a tag value field, so each record includes the target object identification, the name of the target object's tag, and the value of the target object in the tag. For example, for a record in the original data table:
[0047] User ID Hobbies area audit-free 123 music North China yes
[0048] This can be converted into the following records in the first type of data table:
[0049] Serial number User ID Tag Name Tag value 1 123 Hobbies music 2 123 area North China 3 123 audit-free yes
[0050] Through the above settings, the scalability of the data surface for a large number of tags can be greatly improved. When the number of tags is large or increases, the original data table can only be stored by adding fields, so it is necessary to frequently change the data table structure, which consumes more costs and takes a long time. For the first type of data table mentioned above, when adding tags, only the corresponding records of each target object need to be added. In theory, the number of tags can be increased infinitely. In addition, the records in the original data table may not use all the tags of the target object set, so there is a large waste of resources in the original data table. In the first type of data table, there are only records corresponding to the target object tags, and the above-mentioned waste of resources will not occur.
[0051] In the first type of data table, due to the lack of tag management, data errors may occur. For example, in the first type of data table in the above example, a record with a user ID of 123, a tag name of scale, and a tag value of 10000 can be inserted, but the scale tag is not a user tag. In order to overcome the above defects, it is necessary to establish a tag management system to manage the tags of the target objects in the first type of data table.
[0052] Specifically, a tag management system can be established to manage tags for multiple first-class data tables in one or more databases, and the above-mentioned databases can be relational databases. In actual applications, a first-class data table corresponds to a target object set, and each first-class data table has a data table identifier to distinguish among the data tables in one or more databases. The tag management system maintains a data table (hereinafter referred to as the tag management table), and the tag management table is provided with a tag name field and a scope field, wherein the value of each tag in the scope field is one or more data table identifiers, and the data table identifier is the identifier of the first-class data table where the tag is located. It can be understood that when the value of a tag in the scope field is the identifier of a data table, it means that the tag exists in the data table, that is, the tag acts on the data table, that is, the tag acts on the target object set corresponding to the data table. Preferably, the tag management table may also have a serial number field, a tag description field (whose value is the tag description data), a tag value enumeration field (whose value is the tag value enumeration data), and a tag creator field (whose value is the tag creator identifier). The above tag name, tag serial number, tag scope, tag description data, tag value enumeration data, and tag creator identifier may be collectively referred to as tag information. The corresponding tag management table in the above example is as follows:
[0053] Serial number Tag Name Scope Tag Description Tag value enumeration Tag creator 1 Hobbies 1 Hobbies Music Movie Basketball administrator 2 area 1、2、3 Area North China South China Southwest administrator 3 audit-free 1、3 Whether to exempt from review whether administrator 4 use 2 Is it commonly used? whether administrator 5 scale 3 Production scale administrator
[0054] Among them, 1 of the scope field is the identifier of the first type of data table corresponding to the user set, 2 is the identifier of the first type of data table corresponding to the address set, and 3 is the identifier of the first type of data table corresponding to the manufacturer set.
[0055] In specific applications, the tag information in the tag management table needs to be consistent with the tag-related data in the data table managed by the tag management system. In addition, in an embodiment of the present invention, the target object set also has a second-class tag. Generally, tags with more changes (such as more times of addition, deletion, and modification) can be determined as first-class tags, and tags with fewer changes can be determined as second-class tags. At the same time, the tag-related data of the second-class tags are stored in the second-class data table. The second-class data table can be stored in a traditional way, that is, the second-class tag name is stored as the field name. In addition, the first-class data table and the second-class data table corresponding to the same target object set can also be associated through the identification field of the target object. For example, the name (user name) tag and number (telephone number) tag of the user set can be used as second-class tags, and the following records can be stored in the second-class data table:
[0056] User ID name number 123 Xiao Liu xxxxx
[0057] By dividing the data table corresponding to the target object set into a first-class data table and a second-class data table, and storing the tag-related data of the first-class tags and the second-class tags respectively, the amount of data in the first-class data table can be reduced, thereby improving the query speed, and reducing the number of tags that the tag management system needs to manage. In addition, since the second-class tags are often used to set indexes, storing them in the second-class data table can reduce the number of index fields (for example, in actual applications, it is generally necessary to set an index for the name field. If the field is stored in the second-class data table, only one index field needs to be established. If the field is stored in the first-class data table in the form of a record, a joint index of the two fields of the tag name and the tag value needs to be established). In an embodiment of the present invention, if there is an original data table corresponding to the target object set, it can be transformed into a first-class data table and a second-class data table; if there is no original data table, the tag-related data can be directly stored in the first-class data table and the second-class data table directly created. Through the above settings, the first-class data table in the database can be uniformly managed by the tag management system, and the tags can be maintained separately as objects, so that the scalability and reusability of the tags are improved, and storage resources can be saved at the same time. It should be noted that the database operations on the second type of data tables can be directly executed on the second type of data tables without going through the tag management system.
[0058] After establishing a tag management system, the system can be used to process various operations to achieve the management of tags in the database. The above operations may include a first operation for tags and a second operation for a data table corresponding to any target object set. It can be understood that the first operation may be: adding (create) tags, deleting (delete) tags, or modifying (update) tag information in the tag management system, and the second operation may be: adding data, deleting data, or modifying data in a data table corresponding to any target object set. That is to say, the first operation requires updating (in an embodiment of the present invention, adding, deleting, and modifying are collectively referred to as updating) the tag information in the tag management system, and the second operation does not need to update the tag information, but only needs to update the data in the data table. The tag management system can be used to: update the locally stored tag information according to the first operation, and can also be used to verify the second operation and determine whether to allow the second operation to be executed based on the verification result.
[0059] The following first introduces the process of the tag management system processing the first operation. When an external person (such as a developer) performs the first operation of adding a tag (the operation is used to add a tag to a first-category data table), the tag management system can insert a record of the tag to be added into the tag management table according to the operation. In a specific application, in order to avoid a large number of semantically repeated tags in the tag management system, the following steps can be performed to automatically identify similar tags and process them to simplify the maintenance and management of tags.
[0060] First, the name or description data to be tagged can be segmented and the word vector of each word formed after the segmentation can be obtained. Generally, word2vec (a word vector generation model) can be used to obtain the word vector of the word, and accordingly, the word vector is a word embedding vector. It should be noted that the existing word segmentation tool can be used to perform the word segmentation process, and one or more words can be formed after the word segmentation process.
[0061] Next, the sentence vector of the tag to be added can be generated based on the above word vector. Specifically, the weighted average of the same dimension components of each word vector can be calculated, and then the weighted average values of all dimensions can be combined to obtain a weighted average vector, which is the sentence vector of the tag to be added. Generally, the weight value of each word vector used in calculating the weighted average vector can be determined by the part of speech of the word, for example, setting a higher weight value for nouns and verbs, and setting a lower weight value for other parts of speech.
[0062] Thereafter, the similarity between the sentence vector of the tag to be added and each tag stored in the tag management system can be calculated (for example, cosine similarity, Jaccard similarity, Pearson correlation coefficient or adjusted cosine similarity, etc.), and the tags stored in the tag management system whose similarity meets preset conditions (for example, greater than a preset threshold) can be determined as similar tags to the tag to be added.
[0063] Afterwards, the above-mentioned similar tags can be displayed to the outside. The outside can choose to abandon the tag to be added and select a similar tag or insist on adding the above-mentioned tag to be added. The tag management system can end the process of adding tags when it receives an abandonment instruction for the tag to be added, and at the same time modify the scope data of the similar tag selected by the outside to add the tag in the corresponding first-category data table. If the tag management system receives a creation instruction for the tag to be added, the corresponding tag information can be inserted. Finally, the outside can call the write interface in the corresponding first-category data table to insert tag-related data to keep the data of the tag management system and the first-category data table consistent. Through the above steps, similar tags of the tags to be added can be accurately and quickly determined while avoiding omissions.
[0064] When the first operation of deleting a tag is performed externally, the tag management system can delete one or more tag information stored locally according to the operation, and delete the tag-related data in the first-category data table related to the operation, thereby ensuring that the tag management system and the data in the first-category data table are consistent. For example, when the first operation deletes a data table identifier of a scope field in a tag record in the tag management system, it can be deleted in the tag management system first, and then the record related to the tag in the data table is deleted. When the first operation of modifying a tag is performed externally, the tag management system can modify one or more tag information stored locally according to the operation, and can modify the tag-related data in the corresponding first-category data table related to the operation to ensure that the data in the tag management system and the first-category data table are consistent. In addition, when the external needs to query tag information, SQL (Structured Query Language) statements can be entered in the tag management system for direct query.
[0065] The following introduces the processing process of the second operation by the tag management system. In practical applications, the second operation can be the addition, deletion or modification of tag value data in one or more records of the first type of data table, so the second operation is generally related to at least one tag. In an embodiment of the present invention, AOP (Aspect Oriented Programming) technology can be used to enhance all methods of the write interface of the first type of data table in advance, that is, to associate the aspect code (i.e., advice in AOP) with the write interface method in advance. In this way, when the second operation calls the write interface method, the tag management system can intercept the call and verify the second operation at the same time.
[0066] Specifically, when the tag management system detects the second operation on the data table corresponding to any target object set, it first determines whether the name of the tag related to the second operation is stored locally. If the name of the tag is not stored locally, it means that the tag does not exist in the tag management system and the corresponding first-category data table, and the second operation is a non-compliant operation. In this case, the second operation is not allowed to be executed. If the name of the tag is stored locally, it is further determined whether the identifier of the data table where the tag is located is stored locally (that is, the data of the scope field): if so, it means that the corresponding tag exists in the first-category data table targeted by the second operation, and the operation is a compliant operation, so the tag management system allows the second operation to be executed; otherwise, it means that the corresponding tag does not exist in the first-category data table targeted by the second operation, that is, the tag related to the second operation does not cover the first-category data table targeted by it, so the operation is a non-compliant operation, and the tag management system does not allow the second operation to be executed.
[0067] For example, when the second operation is: adding a tag-related data in the first-category data table identified as b, the tag-related data includes a tag name c and a tag value d. At this time, the tag management system first determines whether the tag name c exists locally. If not, the operation is not allowed. If so, it further determines whether b exists in the scope data of the record corresponding to c in the tag management table. If so, the operation is allowed. Otherwise, the operation is not allowed.
[0068] Through the above settings, effective tag management can be achieved for the first type of data table in the database, thereby avoiding data errors and keeping the data in the tag management system consistent with the data in the first type of data table. It can be understood that when an external query is performed on the data in the first type of data table, since an index is generally set in the second type of data table, the data in the second type of data table can be determined first, and then the association relationship between the second type of data table and the first type of data table is used to determine the data in the first type of data table to be returned to the external.
[0069] Figure 2 FIG. 1 is a flow chart of a response operation of a tag management system in an embodiment of the present invention, wherein the operation may be a first operation or a second operation. Figure 2 As shown, when a tag is created externally, the tag management system can perform a semantic comparison between the tag to be added and the locally stored tags and prompt similar tags. At this time, if the external party insists on creating it, the tag will be reviewed and the tag information will be added to the tag management system after the review is passed. If the external party continues to use similar tags, the scope data of the similar tags will be modified. When the business system executes the second operation and calls the write interface of the first type of data table, the tag management system intercepts the call and performs a compliance check on the tags related to the second operation based on the tag information stored in the tag management system. If the check passes, the second operation is executed. If the check fails, the second operation is not executed and an exception is returned.
[0070] Figure 3 FIG. 1 is a schematic diagram of the overall architecture of the tag management system in an embodiment of the present invention. Figure 3 As shown, the tag management system may include an operation layer, a service layer, and a data layer. The operation layer includes an operation page with a write interface and a read interface, which is used to provide read and write interfaces and corresponding pages to the outside world. The service layer is between the operation layer and the data layer, and is mainly responsible for logic implementation, such as semantic recognition, data review (for example, reviewing the semantics of the tags to be added), operation authentication (for example, confirming the operator's authority), etc. The data layer is mainly responsible for reading and writing data, storage, and adding, deleting, and modifying tag information. The tag management table is stored in the data layer.
[0071] According to the technical solution of the embodiment of the present invention, first, a first type of data table and a second type of data table are set for the target object set in the database to store the tag-related data of the specific target object, wherein the first type of data table is used to store the related data of the tag with more changes, and each record of the table includes the identifier of a specific target object, the tag name and the corresponding tag value; the second type of data table is used to store the related data of the tag with less changes or fixed, and each tag in the table corresponds to a field. At the same time, a tag management system is set to manage the tags stored in the first type of data table, and the tag information stored in the tag management system is consistent with the tag-related data in the first type of data table. When the first operation on the tag is performed externally, it is necessary to first update it in the tag management system and then synchronize it to the corresponding data table; when the second operation on the first type of data table is performed externally, it is first necessary to determine whether the tag related to the second operation is compliant in the tag management system. Only when the tag management system stores the name of the tag and the data table identifier in the same record contains the data table identifier for the second operation, it is determined to be compliant, and then the second operation is allowed to be performed, thereby avoiding arbitrary and erroneous operations on the second data table. Through the above settings, since records are used in the data table to store tag-related data, the problem that the data table cannot be expanded when there are many tags can be completely solved. At the same time, in the storage method of the embodiment of the present invention, each target object can flexibly select tags without using all tags. Secondly, the tag management system of the embodiment of the present invention can store the same tag in different data tables as a record, which includes the tag name, the data table identifier where the tag is located, the tag description data, etc. The tag management system can uniformly manage the tags in different data tables and perform operations such as adding, deleting, and modifying. Thirdly, in the embodiment of the present invention, when it is necessary to add a tag, the sentence vector of the name of the tag to be added or the tag description data can be obtained through the word2vec model. After calculating the similarity between the sentence vectors of the tag to be added and the existing tags in the tag management system, similar tags with high similarity can be obtained for external display. When the external decision is still to add, the process of adding tags is executed; when the external decision is not to add, the process of adding tags is not executed. At this time, the same function can be achieved by modifying the database identifier corresponding to the similar tag to be used in the tag management system. In this way, automatic detection of similar tags can be achieved, thereby avoiding omissions. In addition, based on the data storage method of the embodiment of the present invention, when adding a tag, it is not necessary to add a data table field but only to insert a record, so there is no need to change the data table structure, thereby consuming lower costs and less time.
[0072] Figure 4Schematic diagram of the main steps of the tag operation method in the embodiment of the present invention, which is based on the aforementioned tag management system. Since the specific implementation details of the tag operation method in the embodiment of the present invention have been described above, only the main implementation steps of the method are described here:
[0073] Step S401: upon receiving a first operation on a tag, updating the tag information stored in the system according to the first operation, wherein the first operation is related to a data table in the database. Step S402: updating the data table according to the updated tag information.
[0074] In an embodiment of the present invention, a first operation includes: adding a tag in the system; and, updating the tag information stored in the system according to the first operation, including: performing word segmentation processing on the name or description data of the tag to be added and obtaining the word vector of each word formed after the word segmentation processing; generating a sentence vector of the tag to be added according to the word vector, obtaining the similarity between the tag to be added and the sentence vector of each tag stored in the system, determining the tags stored in the system whose similarity meets the preset conditions as similar tags of the tags to be added, and displaying the similar tags; when receiving a creation instruction for the tag to be added, storing the information of the tag to be added in the system.
[0075] In an optional implementation, a sentence vector to which a label is to be added is generated based on the word vector, including: determining a weighted average vector of the word vectors of each word formed after word segmentation as the sentence vector to which the label is to be added; wherein the weight value of each word used to determine the weighted average vector is determined by the part of speech of the word.
[0076] In addition, in an embodiment of the present invention, the preset conditions include: the similarity is greater than a preset threshold; the first operation also includes: deleting the label or modifying the label information in the system; the label information stored in the system also includes at least one of the following: label description data, label value enumeration data, label creator identifier.
[0077] Figure 5 Schematic diagram of the main steps of the data table operation method in the embodiment of the present invention, which is based on the aforementioned tag management system. Since the specific execution details of the data table operation method in the embodiment of the present invention have been described above, only the main execution steps of the method are described here:
[0078] Step S501: When a second operation on a data table corresponding to any target object set is detected, it is determined whether the name of a tag related to the second operation is stored locally. Step S502: When the name of the tag is stored locally, and the identifier of the data table where the tag is located stored locally contains the identifier of the data table targeted by the second operation, the second operation is allowed to be executed.
[0079] In an embodiment of the present invention, the method further includes: when the name of the tag is not stored locally, the second operation is not allowed to be executed; when the name of the tag is stored locally and the identifier of the data table where the second operation is located does not exist in the identifier of the data table where the second operation is targeted, the second operation is not allowed to be executed.
[0080] In addition, in an embodiment of the present invention, the second operation includes: adding data, deleting data or modifying data in a data table corresponding to any target object set; the label information stored by the system also includes at least one of the following: label description data, label value enumeration data, label creator identifier.
[0081] It should be noted that, for the convenience of description, the aforementioned method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described action sequence, and some steps can actually be performed in other sequences or simultaneously. In addition, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily necessary to implement the present invention.
[0082] In order to better implement the above-mentioned solution of the embodiment of the present invention, relevant devices for implementing the above-mentioned solution are also provided below.
[0083] See also Figure 6 As shown, the data table operation device 600 provided by the embodiment of the present invention is based on the aforementioned tag management system and may include: a judgment unit 601 and an execution control unit 602 .
[0084] Among them, the judgment unit 601 can be used to: when monitoring the second operation on the data table corresponding to any target object set, determine whether the name of the label related to the second operation is stored locally; the execution control unit 602 can be used to: when the name of the label is stored locally and the identifier of the data table where the label is located stored locally contains the identifier of the data table targeted by the second operation, allow the second operation to be executed.
[0085] In an embodiment of the present invention, the execution control unit 602 can be further used to: when the name of the tag is not stored locally, not allow the second operation to be executed; when the name of the tag is stored locally and the identifier of the data table where the second operation is located does not exist in the identifier of the data table where the second operation is located, not allow the second operation to be executed.
[0086] As a preferred solution, the second operation includes: adding data, deleting data or modifying data in a data table corresponding to any target object set; the label information stored by the system also includes at least one of the following: label description data, label value enumeration data, and label creator identification.
[0087] The present invention also provides an electronic device. The electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the label operation method or data table operation method provided by the present invention.
[0088] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of an electronic device suitable for implementing an embodiment of the present invention. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0089] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the computer system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0090] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0091] In particular, according to the embodiments disclosed in the present invention, the process described in the main step diagram above can be implemented as a computer software program. For example, the embodiments of the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the main step diagram. In the above embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit 701, the above functions defined in the system of the present invention are executed.
[0092] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0093] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0094] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a judgment unit and an execution control unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the judgment unit may also be described as "a unit that provides a judgment result to the execution control unit".
[0095] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by the device, the steps executed by the device include: when receiving a first operation for a tag, updating the tag information stored in the tag management system according to the first operation; wherein the first operation is related to a data table in a database; updating the data table according to the updated tag information. Alternatively, when a second operation for a data table corresponding to any target object set is monitored, determining whether the name of the tag related to the second operation is stored in the tag management system; when the name of the tag is stored in the tag management system, and the identifier of the data table where the tag is stored contains the identifier of the data table targeted by the second operation, allowing the second operation to be executed.
[0096] According to the technical solution of the embodiment of the present invention, first, a first type of data table and a second type of data table are set for the target object set in the database to store the tag-related data of the specific target object, wherein the first type of data table is used to store the related data of the tag with more changes, and each record of the table includes the identifier of a specific target object, the tag name and the corresponding tag value; the second type of data table is used to store the related data of the tag with less changes or fixed, and each tag in the table corresponds to a field. At the same time, a tag management system is set to manage the tags stored in the first type of data table, and the tag information stored in the tag management system is consistent with the tag-related data in the first type of data table. When the first operation on the tag is performed externally, it is necessary to first update it in the tag management system and then synchronize it to the corresponding data table; when the second operation on the first type of data table is performed externally, it is first necessary to determine whether the tag related to the second operation is compliant in the tag management system. Only when the tag management system stores the name of the tag and the data table identifier in the same record contains the data table identifier for the second operation, it is determined to be compliant, and then the second operation is allowed to be performed, thereby avoiding arbitrary and erroneous operations on the second data table. Through the above settings, since records are used in the data table to store tag-related data, the problem that the data table cannot be expanded when there are many tags can be completely solved. At the same time, in the storage method of the embodiment of the present invention, each target object can flexibly select tags without using all tags. Secondly, the tag management system of the embodiment of the present invention can store the same tag in different data tables as a record, which includes the tag name, the data table identifier where the tag is located, the tag description data, etc. The tag management system can uniformly manage the tags in different data tables and perform operations such as adding, deleting, and modifying. Thirdly, in the embodiment of the present invention, when it is necessary to add a tag, the sentence vector of the name of the tag to be added or the tag description data can be obtained through the word2vec model. After calculating the similarity between the sentence vectors of the tag to be added and the existing tags in the tag management system, similar tags with high similarity can be obtained for external display. When the external decision is still to add, the process of adding tags is executed; when the external decision is not to add, the process of adding tags is not executed. At this time, the same function can be achieved by modifying the database identifier corresponding to the similar tag to be used in the tag management system. In this way, automatic detection of similar tags can be achieved, thereby avoiding omissions. In addition, based on the data storage method of the embodiment of the present invention, when adding a tag, it is not necessary to add a data table field but only to insert a record, so there is no need to change the data table structure, thereby consuming lower costs and less time.
[0097] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A label management system, characterized in that: The system is used to manage labels of at least one target object set stored in a database; wherein, The database includes a data table corresponding to each target object set, and each record in the data table includes an identifier of a target object in the target object set, a name of a tag of the target object, and a value of the target object in the tag; The system stores information of each tag in the data table corresponding to the at least one target object set, wherein the information includes the name of the tag and the identifier of the data table where the tag is located; The system is used to: update the locally stored tag information according to a first operation on the tag; and verify a second operation on a data table corresponding to any target object set, and determine whether the second operation is allowed to be executed according to the verification result; the second operation is related to at least one tag; The system is also used to: when a second operation on a data table corresponding to any target object set is monitored, determine whether the name of a label related to the second operation is stored locally; when the name of the label is not stored locally, not allow the second operation to be executed; when the name of the label is stored locally, determine whether the identifier of the data table where the label is located contains the identifier of the data table targeted by the second operation; if so, allow the second operation to be executed; otherwise, do not allow the second operation to be executed.
2. The system according to claim 1, characterized in that The first operation includes: adding a tag, deleting a tag, or modifying tag information in the system; The second operation includes: adding data, deleting data or modifying data in a data table corresponding to any target object set; The tag information stored in the system also includes at least one of the following: tag description data, tag value enumeration data, and tag creator identification.
3. The system according to claim 1 or 2, characterized in that: The label is a first-class label of the target object set, and the data table is a first-class data table corresponding to the target object set; Each target object set also has a second type of label, and the database also includes a second type of data table corresponding to each target object set and using the second type of label name as a field name; The first type of data table and the second type of data table corresponding to the same target object set are associated through the identifiers of the target objects in the target object set.
4. A label operation method based on the system of claim 1, characterized in that: include: When receiving a first operation for a tag, updating the tag information stored in the system according to the first operation; wherein the first operation is related to a data table in the database; The data table is updated according to the updated tag information.
5. The method according to claim 4, characterized in that The first operation includes: adding a tag in the system; and updating the tag information stored in the system according to the first operation, including: Perform word segmentation on the name or description data to be tagged and obtain the word vector of each word formed after the word segmentation; Generate a sentence vector of the tag to be added according to the word vector, obtain the similarity between the sentence vector of the tag to be added and each tag stored in the system, determine the tags stored in the system whose similarity meets the preset conditions as similar tags of the tag to be added, and display the similar tags; When a creation instruction for a tag to be added is received, information of the tag to be added is stored in the system.
6. The method according to claim 5, characterized in that Generating a sentence vector to which a label is to be added according to the word vector includes: Determine the weighted average vector of the word vectors of each word formed after word segmentation as the sentence vector to which the label is to be added; wherein the weight value of each word used to determine the weighted average vector is determined by the part of speech of the word; and The preset conditions include: the similarity is greater than a preset threshold; The first operation also includes: deleting a tag or modifying tag information in the system; The tag information stored in the system also includes at least one of the following: tag description data, tag value enumeration data, and tag creator identification.
7. A data table operation method based on the system of claim 1, characterized in that: include: When a second operation on a data table corresponding to any target object set is detected, determining whether a name of a tag related to the second operation is stored locally; When the name of the tag is stored locally, and the identifier of the data table where the tag is located stored locally contains the identifier of the data table targeted by the second operation, the second operation is allowed to be executed.
8. The method according to claim 7, characterized in that The method further comprises: When the name of the tag is not stored locally, the second operation is not allowed; When the name of the tag is stored locally and the identifier of the data table where the tag is located stored locally does not contain the identifier of the data table targeted by the second operation, the second operation is not allowed to be executed.
9. The method according to claim 7 or 8, characterized in that: The second operation includes: adding data, deleting data or modifying data in a data table corresponding to any target object set; The tag information stored in the system also includes at least one of the following: tag description data, tag value enumeration data, and tag creator identification.
10. A data table operation device based on the system according to claim 1, characterized in that: include: A judging unit, configured to: when a second operation on a data table corresponding to any target object set is detected, judge whether a name of a tag related to the second operation is stored locally; The execution control unit is used to: allow the second operation to be executed when the name of the tag is stored locally and the identifier of the data table where the tag is located stored locally contains the identifier of the data table targeted by the second operation.
11. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 4 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 4 to 9 is implemented.
Citation Information
Patent Citations
Physical attributes data process device and method
CN101046805A
Management method based on running object data in CRM system
CN103425490A
Persistence device and method of domain object model
CN103955370A
Data processing method, apparatus and system
CN105701112A
Method and device for creating service database, storing service data and determining service data
CN107220266A
