Class attribute association method and device and electronic equipment

By updating and managing category attribute relationships in the graph database, the problem of inefficient category attribute query in relational databases is solved, and more efficient category attribute association relationship generation and query are achieved.

CN119537620APending Publication Date: 2025-02-28BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311118233.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, the binding and management methods of category attribute relationships use relational databases, resulting in low query efficiency and long time.

Method used

By obtaining the category and attribute information entered by the user, searching for leaf categories in the preset category tree, and determining relevant attribute information in the category attribute relationship library, generating instructions to send to the graph database, updating attribute information and establishing category attribute association relationship.

Benefits of technology

It realizes automatic generation of category attribute association relationships based on user input, improves the generation efficiency and query efficiency of category attribute relationships, and reduces time-consuming.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537620A_ABST
    Figure CN119537620A_ABST
Patent Text Reader

Abstract

The invention discloses a category attribute association method and device and electronic equipment, and the method comprises the steps: obtaining an input operation of a user on a display interface, searching at least one leaf category directly associated with a first category code in a preset category tree, determining second attribute information associated with each leaf category in a stored category attribute relationship library, wherein the category attribute relationship library comprises an association relationship between each leaf category and the second attribute information; generating at least one first instruction according to the first attribute information and the second attribute information; and sending at least one first instruction to the graph database, the at least one first instruction being used for instructing the graph database to update the second attribute information, generating first attribute information, and establishing an association relationship between the first category information and the first attribute information. Compared with a relational database for establishing the category attribute relationship, the method for automatically generating the category attribute relationship by using the graph database is more efficient and consumes less time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a category attribute association method, device and electronic equipment. Background Art

[0002] Category and attribute are two basic elements of item display. Usually, the item category and attribute will be associated during the item display process, so as to facilitate the introduction of the item from multiple angles. For example, through the category-attribute association, the attributes of items under a certain category can be displayed. Among them, the category itself can have multiple levels, generally a 3-4-layer tree structure, and the attribute is usually a one-to-many structure; therefore, when establishing the relationship between categories and attributes, the relationship will be bound according to different rules, resulting in numerous and complex category attribute relationships.

[0003] At present, the binding and management of category attribute relationships are stored in a relational database. Specifically, data is stored in the form of category tables, attribute tables, and category attribute relationship tables. When querying attributes associated with categories, or categories associated with attributes, multiple tables need to be used for associated queries, resulting in low query efficiency and long query time. Summary of the invention

[0004] In view of this, the present invention provides a category attribute association method, device and electronic device to solve the problems of low search efficiency and long time consumption when establishing category attribute relationships in a relational database.

[0005] In a first aspect, an embodiment of the present invention provides a method for associating category attributes, the method comprising:

[0006] Acquiring an input operation of a user on a display interface, the input operation comprising: filling in first category information and first attribute information for which an association relationship is to be established, the first category information comprising a first category and a first category code;

[0007] Searching for at least one leaf category directly associated with the first category code in the preset category tree, each leaf category being: a node connected to the first category and located at the end of the preset category tree;

[0008] Determining the second attribute information associated with each leaf category in a stored category attribute relationship library, wherein the category attribute relationship library includes an association relationship between each leaf category and the second attribute information;

[0009] generating at least one first instruction according to the first attribute information and the second attribute information;

[0010] At least one first instruction is sent to the graph database, and the at least one first instruction is used to instruct the graph database to update the second attribute information, generate the first attribute information, and establish an association relationship between the first category information and the first attribute information.

[0011] In combination with the first aspect, in a possible implementation manner of the first aspect, the at least one first instruction includes: a new addition instruction, an update instruction, and a deletion instruction;

[0012] Generating at least one first instruction according to the first attribute information and the second attribute information, including:

[0013] comparing the first attribute information and the second attribute information, and generating a new adding instruction if the second attribute information associated with at least one leaf category does not completely include the first attribute information;

[0014] If the second attribute information associated with at least one leaf category is different from the first attribute information, generating an update instruction;

[0015] If the second attribute information associated with at least one leaf category is greater than the first attribute information, a deletion instruction is generated.

[0016] In combination with the first aspect, in another possible implementation manner of the first aspect, the first attribute information includes: a first attribute, a first attribute value, or a first attribute and a first attribute value;

[0017] The association relationship between the first category information and the first attribute information includes:

[0018] The relationship between the first category and the first attribute;

[0019] or, an association relationship between the first category and the first attribute value;

[0020] Or, the association relationship between the first category, the first attribute and the first attribute value.

[0021] In combination with the first aspect, in another possible implementation of the first aspect, when the first attribute information includes a first attribute value, at least one first instruction is generated based on the first attribute information and the second attribute information, including: when generating a new instruction, determining whether an association has been established between the target attribute corresponding to the first attribute value and the first category; if not, generating a new instruction, the new instruction is used to establish an association relationship between the first category and the target attribute.

[0022] In combination with the first aspect, in another possible implementation manner of the first aspect, when the first attribute information includes a first attribute value, generating at least one first instruction according to the first attribute information and the second attribute information includes:

[0023] When generating a deletion instruction, determine whether the target attribute corresponding to the deleted first attribute value has no other attribute value association with the first category; if so, generate a removal instruction, which is used to remove the target attribute and the association relationship between the target attribute and the first category.

[0024] In combination with the first aspect, in another possible implementation of the first aspect, after sending at least one first instruction to the graph database, the method also includes: obtaining third attribute information; filling the content of the third attribute information into a preset programming language framework to generate a first programming language model; generating a second instruction based on the first programming language model and at least one first instruction; sending the second instruction to the graph database, the second instruction being used to instruct the graph database to generate an association relationship between the first attribute information, the third attribute information, and the first category information.

[0025] In combination with the first aspect, in another possible implementation manner of the first aspect, after sending the second instruction to the graph database, the method further includes: acquiring second category information, where the second category information includes a second category, and the second category and the first category are in a same-level category or a superior-subordinate category relationship;

[0026] Fill the content of the second category information into a preset programming language framework to generate a second programming language model; use the second programming language model and the second instruction to generate a third instruction; send the third instruction to the graph database, and the third instruction is used to instruct the graph database to generate an association relationship between the first attribute information, the third attribute information, the first category information, and the second category information.

[0027] In combination with the first aspect, in another possible implementation of the first aspect, after establishing an association relationship between the first category information and the first attribute information in the graph database, the method also includes: obtaining a node of any leaf category node in the association relationship; searching for a leaf attribute node connected to the leaf category in the association relationship according to a node identifier; and displaying the attribute or attribute value corresponding to the leaf attribute node.

[0028] In combination with the first aspect, in another possible implementation of the first aspect, after the graph database generates the association relationship between the first attribute information, the third attribute information, the first category information and the second category information, the method also includes: obtaining two nodes whose association relationship is to be disassociated, and the node types of the two nodes are any one of the following: two leaf category nodes, a leaf category node and a leaf attribute node, a leaf category node and a leaf attribute value node; generating a fourth instruction based on the node identification of the two nodes and the program code for disassociating the relationship; sending the fourth instruction to the graph database, the fourth instruction being used to instruct the graph database to disassociate the relationship between the two nodes.

[0029] In a second aspect, an embodiment of the present invention further provides a category attribute association device, the device comprising:

[0030] A receiving unit, configured to obtain an input operation of a user on a display interface, wherein the input operation includes: filling in first category information and first attribute information of a desired association relationship to be established, wherein the first category information includes a first category and a first category code;

[0031] A search unit, configured to search in a preset category tree for at least one leaf category directly associated with the first category code, each leaf category being: a node connected to the first category and located at the end of the preset category tree;

[0032] A determination unit, configured to determine the second attribute information associated with each leaf category in a stored category attribute relationship library, wherein the category attribute relationship library includes an association relationship between each leaf category and the second attribute information;

[0033] A generating unit, configured to generate at least one first instruction according to the first attribute information and the second attribute information;

[0034] A sending unit is used to send at least one first instruction to the graph database, wherein the at least one first instruction is used to instruct the graph database to update the second attribute information, generate the first attribute information, and establish an association relationship between the first category information and the first attribute information.

[0035] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are connected, wherein computer instructions are stored in the memory, and the processor executes the category attribute association method of the above-mentioned first aspect or any implementation method of the first aspect by executing the computer instructions.

[0036] In addition, an embodiment of the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the category attribute association method of the above-mentioned first aspect or any corresponding implementation method thereof.

[0037] The category attribute association method provided by the present invention first searches for the second attribute information associated with the leaf category in the stored category attribute relationship library according to the user input operation, and then compares it with the first attribute information to be associated, generates at least one instruction, and finally sends the generated at least one instruction to the graph database, so that the graph database updates the second attribute information to generate the first attribute information, and establishes an association relationship between the first category information and the first attribute information, thereby realizing the automatic generation of the association relationship between category attributes based on the user input operation. Compared with establishing category attribute relationships using relational databases, this method is more efficient and less time-consuming in that it uses a graph database to automatically generate category attribute relationships.

[0038] In addition, based on the category attribute association relationship, when you need to query the attributes associated with the category, you only need to query in the generated category attribute association relationship according to the category identification. Compared with the relational database to search multiple relationship tables, there is no need to perform a full table query or a combined query, which greatly improves the query efficiency of category attributes and reduces time consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 is a flow chart of a category attribute association method provided by an embodiment of the present invention;

[0041] Figure 2 is a schematic diagram of a preset category tree provided by an embodiment of the present invention;

[0042] Figure 3 is a schematic diagram of a category attribute association relationship provided by an embodiment of the present invention;

[0043] Figure 4 is a flow chart of another category attribute association method provided by an embodiment of the present invention;

[0044] Figure 5 It is a schematic diagram of generating a category attribute association relationship provided by an embodiment of the present invention;

[0045] Figure 6 is a flow chart of a method for searching a category attribute pattern provided by an embodiment of the present invention;

[0046] Figure 7a is a schematic diagram of a category-based attribute search provided by an embodiment of the present invention;

[0047] Figure 7b This is a schematic diagram of searching for attribute values ​​based on categories provided by an embodiment of the present invention;

[0048] Figure 8a is a schematic diagram of removing the association relationship of category attributes provided by an embodiment of the present invention;

[0049] Figure 8b is another schematic diagram of removing the category attribute association relationship provided by an embodiment of the present invention;

[0050] Fig. 9 It is a structural block diagram of a category attribute association device provided by an embodiment of the present invention;

[0051] Fig.10 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0053] The technical solution of the present invention can be applied to an application scenario of associating the categories and attributes of goods / articles, such as a goods entry scanning system, a warehousing system, etc. Before goods, articles or commodities are entered into the warehouse, or when they are registered and scanned, an association relationship between attributes and categories needs to be established.

[0054] In addition, for the sake of convenience, in this embodiment, articles, goods, and commodities are collectively referred to as objects.

[0055] The technical terms involved in the technical solution of the present invention are introduced below.

[0056] 1. Category

[0057] A category is a classification to which an object belongs, and a category is used to determine the affiliation of an object. Generally, categories can be divided into multiple levels, such as first-level categories, second-level categories, and third-level categories. There is an inheritance relationship between categories at different levels, and these relationships can be displayed through a category tree. For example, kitchen appliances belong to the first-level category, and the first-level category includes second-level categories such as induction cookers and refrigerators. In addition, there will be third-level categories under the second-level directory. For example, under refrigerators, there will be variable-frequency refrigerators, non-variable-frequency refrigerators, etc. as third-level categories.

[0058] The bottom category of the category tree is the leaf category; generally speaking, only leaf categories can be used to list goods, items, etc.

[0059] At present, the platform system includes two major types of category systems. One type is the background category, which is mainly used for publishing objects; the other type is the front-end category, which is mainly used for front-end shopping guides.

[0060] 2. Category level

[0061] The category level indicates the position of a category in the entire category tree. For example, under the first-level category of kitchen appliances, there are second-level categories such as induction cookers and refrigerators, and under refrigerators there are third-level categories such as inverter refrigerators and non-inverter refrigerators. The category level of kitchen appliances is 1, the category level of induction cookers and refrigerators is 2, and the category level of inverter refrigerators and non-inverter refrigerators is 3.

[0062] 3. Category information

[0063] Category information is used to describe the category itself in detail. For a category, it includes category ID, category code (CODE), category name, parent category ID (used to indicate which category it is under, such as the parent category ID of a refrigerator is the category ID of kitchen appliances. Kitchen appliances are a first-level category, so the parent category ID of kitchen appliances is 0), category level, whether it is a leaf category, status (used to indicate whether the current category is enabled or disabled), etc.

[0064] 4. Attributes and attribute values

[0065] Attributes describe the properties of an object. For example, a mobile phone object has multiple attributes, such as color, material, and model. Attribute values ​​are specific descriptions of attributes. For example, for color attributes, the attribute values ​​include red, yellow, and green, and for material attributes, the attribute values ​​include wood, plastic, and alloy.

[0066] Among them, categories and attributes are the basic elements for describing objects. All objects generally need to establish associations between categories and attributes, and then classify and introduce objects from multiple perspectives. The category itself has a hierarchical structure, generally a 3-4-layer tree structure; the attribute is a one-to-many two-level structure; therefore, the association relationship between categories and attributes is an M:N structure, and different category attribute relationship bindings will be performed according to different rules, making the category attribute relationship numerous and complex.

[0067] Based on the current M:N structure between categories and attributes, when querying attributes associated with categories, or categories associated with attributes, multiple tables need to be associated for query, resulting in low query efficiency. For example, when querying attributes associated with categories, it is necessary to first query which attribute IDs are associated with the category through the category attribute association table (data is stored in the form of category ID-attribute ID), and then query the attribute table (the attribute table includes the relationship between the attribute ID and the attribute detailed information) through the attribute ID, and then obtain the attribute detailed information, and then assemble and return it to the requester.

[0068] For another example, when performing a query, it is necessary to first establish an association between the category attribute association table (assuming the table data volume is m) and the attribute table (assuming the table data volume is n), generate an association table (data volume m*n), and then obtain the category-related attributes through the category ID. Among them, the process of generating the association table is time-consuming and inefficient.

[0069] The technical solution provided by the embodiment of the present invention aims to solve the complex relationship between categories and attributes: by taking categories and attributes as nodes, category-category relationship, attribute-attribute value relationship, category-attribute relationship and category-attribute value relationship as edges, and using a graph database to construct category-attribute association relationships, and then displaying various relationships between the categories, attributes and attribute values ​​of objects, compared to establishing a relational structure of a relational database, this solution takes less time to generate association relationships between category attributes, has lower development, operation and management costs, and is more efficient when searching for categories or attributes.

[0070] The technical solution provided by the embodiment of the present invention is described in detail below.

[0071] See also Figure 1 , is a category attribute association method provided by an embodiment of the present invention, the method can be executed by a category attribute service system, specifically, the method comprises the following steps:

[0072] S101: Obtaining an input operation of a user on a display interface, the input operation comprising: filling in first category information and first attribute information to establish an association relationship, the first category information comprising a first category and a first category code.

[0073] The user enters the first category information to establish an association on the display interface, for example, the first category information is spoon and bowl, which are two third-level categories under kitchen supplies. In this example, the first category information includes: spoon, spoon code (code 1) and bowl, bowl code (code 2).

[0074] In addition, the attribute information input by the user may include one or more of the following: attribute, name, attribute type, attribute value type, input method, whether required, and status.

[0075] S102: Searching for at least one leaf category directly associated with the first category code in a preset category tree.

[0076] Each leaf category is a node connected to the first category and located at the end of the preset category tree. The preset category tree includes a root node and at least one leaf node, which is used to represent the relationship between different categories, such as a parent category as a root node, and a second or third category as a leaf node connected to the root node.

[0077] Furthermore, if Figure 2 As shown, you can search for the first category code, such as code 1 and code 2. Figure 2 Find at least one leaf category "bowl" and "spoon" in the preset number of categories shown. Because the first category is "kitchen supplies", the nodes directly connected to the kitchen supplies and located at the end are "bowl" and "spoon". Figure 2 In the middle, the thick solid line is drawn. In addition, "tableware" is a secondary category under the first category, and it is associated with two leaf categories: "bowl" and "spoon".

[0078] S103: Determine the second attribute information associated with each leaf category in the stored category attribute relationship library.

[0079] The category attribute relationship library includes the association relationship between each leaf category and the second attribute information; for example, the second attribute information associated with the leaf category "bowl" includes: the color, material, size, etc. of the bowl. Similarly, the second attribute information associated with the leaf category "spoon" includes: the color, material, size, etc. of the spoon.

[0080] The associations between the leaf categories and the second attributes are pre-stored in a category attribute relationship library, which is a category attribute relationship previously used by a user or set by the system. This step is mainly based on finding the corresponding associated attribute information for each leaf category.

[0081] S104: Generate at least one first instruction according to the first attribute information and the second attribute information.

[0082] The first attribute information is the attribute to be associated and filled in by the user in step S101. For example, the first attribute information to be set for the category "bowl" includes: the color of the bowl, such as blue, the size of the bowl mouth, etc.

[0083] In addition, the attribute information may also include: attribute, name, attribute type, attribute value type, input method and status, etc. For example, see Table 1, which is the information content of one type of attribute information.

[0084] Table 1

[0085] Attribute CODE name Property Type Attribute value type Input method Is this field required? state COLOUR color Basic Attributes enumerate Single Choice Required Enable

[0086] When the attribute value type is an enumeration type, it means that the user can only select the attribute value under the existing attribute to describe the current object. For example, when the caller needs to use color to describe the leaf category "bowl", the attribute value under color only has three colors: red, white, and yellow. The caller can only select one from the enumeration values ​​of these three colors to describe.

[0087] In addition, the attribute value type also includes text type. When the attribute value type is text type, users can enter data as attribute values ​​to describe leaf categories. For example, if there is no blue and green in the first attribute information, the caller can enter blue and green in the text box to describe it. Therefore, compared with the enumeration type, the text type has more configurable attributes and is more flexible.

[0088] In addition, the above table structure may also include other fields, such as attribute description, attribute ID, etc., which is not limited in this embodiment.

[0089] In this step, the first attribute information is compared with the second attribute information corresponding to each leaf category, and at least one first instruction is generated according to the difference in the comparison, and the at least one instruction includes: a new instruction, an update instruction, and a delete instruction, etc. Specifically, it includes the following three situations:

[0090] Case 1: If the second attribute information associated with at least one leaf category does not include all of the first attribute information, a new instruction is generated. For example, the colors of the second attribute information associated with the leaf category "bowl" are only red and white, and do not include the yellow color in the first attribute information input by the user, then a new instruction is generated to establish an association relationship between the leaf category "bowl" and the attribute "yellow".

[0091] Case 2: If the second attribute information associated with at least one leaf category is different from the first attribute information, an update instruction is generated. For example, the attribute value type of the second attribute information associated with the leaf category "bowl" is "enumeration type", while the attribute value type of the first attribute information input by the user is "text type". Therefore, the two are different, and an update instruction needs to be generated to change the original attribute value type "enumeration type" to "text type" so that it is the same as the first attribute information input by the user.

[0092] Case 3: If the second attribute information associated with at least one leaf category is more than the first attribute information, a delete instruction is generated. For example, the leaf category "bowl" in the second attribute information is currently associated with three colors, red, white, and yellow; and the first attribute information input by the user only needs to be associated with the attribute white, so a delete instruction is generated to delete the association between bowl and red, and bowl and yellow.

[0093] It should be understood that the above examples only illustrate the differences between the first attribute information and the second attribute information in Cases 1 to 3, generating three different first instructions, and may also include other instructions for updating other attribute information so that the attribute information associated with all leaf categories after the update is the same as or consistent with the first attribute information input by the user.

[0094] S105: Send at least one first instruction to the graph database, wherein the at least one first instruction is used to instruct the graph database to update the second attribute information, generate the first attribute information, and establish an association relationship between the first category information and the first attribute information.

[0095] Among them, graph database is the abbreviation of graph database management system, which uses graphical models for querying databases, represents and stores data through nodes, edges and attributes, and supports operations such as adding, deleting, modifying and querying. Graph databases are generally used in OLTP (OnLine Transaction Processing) systems to provide online transaction processing capabilities. Its advantage is that it can quickly solve complex relationship problems.

[0096] For example Figure 3 As shown, a correlation diagram for generating first category information and first attribute information is shown. The correlation diagram includes the first category kitchenware, the second category tableware, and the third category (or leaf category) bowls and spoons.

[0097] The first attribute information includes: size and color. Specifically, the size includes: S, L and XL. The color includes: beige and green beige; as shown in Table 2.

[0098] Table 2

[0099] Attribute CODE Property Value name Serial number state COLOUR E10 Beige 1 Enable COLOUR Y01 Green Beige 2 Enable

[0100] According to the above size and color attributes and the first instructions of the leaf categories "bowl" and "spoon", after being processed by the graph database, the generated association relationship is as follows Figure 3 shown.

[0101] The category attribute association method provided herein first searches for the second attribute information associated with the leaf category in the stored category attribute relationship library according to the user input operation, and then compares it with the first attribute information to be associated, generates at least one instruction, and finally sends the generated at least one instruction to the graph database, so that the graph database updates the second attribute information to generate the first attribute information, and establishes an association relationship between the first category information and the first attribute information, thereby realizing the automatic generation of the association relationship between category attributes based on the user input operation. Compared with establishing category attribute relationships using relational databases, this method is more efficient and less time-consuming in that it uses a graph database to automatically generate category attribute relationships.

[0102] Optionally, the first attribute information includes: at least one of a first attribute and / or a first attribute value.

[0103] When the first attribute information includes the first attribute, after the graph database executes the at least one first instruction in step S105, an association relationship between the first category and the first attribute is generated, and the association relationship is represented by a table as shown in Table 3 below:

[0104] Table 3

[0105] Category Code Property Code Property Type Attribute value type Input method Is this field required? state SPOONS COLOUR Sales attributes enumerate Single Choice Optional Enable BOWLS COLOUR Sales attributes enumerate Single Choice Optional Enable

[0106] When the first attribute information includes the first attribute value, after the graph database executes at least one first instruction in step S105, an association relationship between the first category and the first attribute value is generated, and the association relationship is represented by a table as shown in Table 4 below:

[0107] Table 4

[0108] Category Code Property Code Attribute Value Code SPOONS COLOUR E10 BOWLS COLOUR Y01

[0109] When the first attribute information includes the first attribute and the first attribute value, after the graph database executes at least one first instruction in step S105, an association relationship among the first category, the first attribute and the first attribute value is generated. For the specific relationship, please refer to the contents of Tables 3 and 4 above.

[0110] It should be understood that the specific contents in Tables 1 to 4 above can be customized according to user input operations, and more or less contents can be set, which is not limited in this embodiment.

[0111] Optionally, in one embodiment, the above step S104 specifically also includes: when the first attribute information includes a first attribute value, when generating a new instruction, determining whether an association has been established between the target attribute corresponding to the first attribute value and the first category; if not, generating a new instruction, the new instruction is used to establish an association relationship between the first category and the target attribute.

[0112] For example, determine whether an association has been established between the target attribute "size" where the first attribute value "L code" is located and the leaf category "spoon". If not, generate a new instruction to establish an association relationship between the target attribute "size" and the leaf category "spoon".

[0113] Optionally, in another embodiment, the above step S104 specifically further includes: when the first attribute information includes the first attribute value, when generating the deletion instruction, determining whether the target attribute corresponding to the deleted first attribute value has no other attribute value association with the first category; if so, generating a removal instruction, the removal instruction is used to remove the target attribute and the association relationship between the target attribute and the first category. In other words, when executing the category attribute value relationship deletion operation, if the attribute to which the attribute value belongs has no direct category attribute value association with the category, the category attribute needs to be deleted.

[0114] For example, the three attribute values ​​S, L, and XL in size are not associated with the leaf category "bowl". When the association between the attribute values ​​S, L, and XL and the leaf category "bowl" is removed, the association between their corresponding attributes "size" and "bowl" is also removed.

[0115] In some embodiments, the above method further includes: adding new attribute information to the generated category attribute association relationship. Figure 4 As shown, after step S105, the method further includes:

[0116] S106: Acquire third attribute information, where the third attribute information is attribute information of other categories.

[0117] S107: Fill the content of the third attribute information into a preset programming language framework to generate a first programming language model.

[0118] The so-called preset programming language framework refers to the programming code structure that has not yet added specific content in the programming language code supported by the graph database. For example, the programming language framework includes the following fields: PropertyCode (property code), Name (name), PropertyType (property type), PropertyValueType (property value type), InputWay (input method), InputRequirement (whether the input is required), and EnabledStatus (enabled status).

[0119] The content of the third attribute information is represented by preset characters, and the preset characters include text, letters and numbers. For example, PropertyCode is represented by the preset characters "COLOUR", the preset characters corresponding to Name are "color", and other related fields: PropertyType, PropertyValueType, InputWay, InputRequirement and EnabledStatus are all represented by the number "1". The above characters are filled into the preset program language framework code to generate the first program language model.

[0120] S108: Generate a second instruction according to the first programming language model and the at least one first instruction.

[0121] The first programming language model including the third attribute information is combined with at least one first instruction of the aforementioned embodiment to generate a second instruction.

[0122] S109: Send the second instruction to the graph database, where the second instruction is used to instruct the graph database to generate an association relationship between the first attribute information, the third attribute information, and the first category information.

[0123] In this embodiment, new attribute information can be added to the original category attribute relationship, so as to realize the function of adding new attribute information to the current category attribute relationship and generate a pattern of category attribute association relationship.

[0124] Optionally, the third attribute information may also be an attribute value, wherein the attribute value includes at least one of the following fields: attribute (PropertyCode), attribute value (PropertyValueCode), name (Name), sequence number (Sequence), and status (EnabledStatus). The first programming language model is generated and obtained based on these fields, and then combined with the first instruction to generate the second instruction.

[0125] Optionally, after the association relationship is generated in the above step S105, the method further includes adding an association relationship of category information.

[0126] Specifically, the method includes:

[0127] Get the second category information, the second category information includes a second category, and the second category and the first category are of the same level or of a superior-subordinate category relationship. For example, the second category is knives and forks, which are of the same level as the aforementioned leaf categories "bowls" and "spoons", or the second category is dining tables, which are of the same level as tableware, and are of a subordinate category to "kitchen supplies". Fill the content of the second category information into a preset programming language framework to generate a second programming language model; combine the second programming language model and the second instruction to generate a third instruction; send the third instruction to the graph database, the third instruction is used to instruct the graph database to generate an association relationship between the first attribute information, the third attribute information, the first category information, and the second category information.

[0128] Specifically, Figure 5As shown, first obtain the following information to be associated: attributes, attribute values, category attributes, category attribute values, and categories. Among them, the association relationship between category attributes and category attribute values ​​can be implemented through steps S101 to S105 of the aforementioned embodiment. Then obtain the program language framework code corresponding to each of the above five types of information, which are the first to fifth program language framework codes, and then fill the contents of the five types of information, namely, attributes, attribute values, category attributes, category attribute values, and categories, into the corresponding program language framework codes to generate the first to fifth program language models.

[0129] Finally, the first to fifth programming language models are combined to generate the Nth instruction, where N is a positive integer and ≥ 1, and the Nth instruction is sent to the graph database. After receiving the instruction, the graph database automatically loads and generates the association relationship of the category attributes.

[0130] It should be noted that the first to fifth programming language models mentioned above can be freely combined to generate different category attribute relationships, and this embodiment does not impose any limitation on this.

[0131] In addition, in the above-mentioned category attribute association relationship, the number of each node and the number of connections between the nodes can be determined according to the size of the program language model. The size of the program language model depends on the content of the user input information in the above-mentioned S101. It should be understood that category attribute patterns with more nodes and more association relationships can be generated according to actual needs, and this embodiment does not limit this.

[0132] Compared with establishing category attribute relationships using relational databases, this method is more efficient, less time-consuming, and more scalable in that it uses graph databases to automatically create and generate category attribute relationships.

[0133] In addition, according to business needs, in the process of associating categories with attributes, or categories with attribute values, the association relationship between categories and attributes, or attribute values ​​can be one category associated with multiple attributes, multiple attribute values, or one attribute or attribute value associated with multiple categories, that is, an M:N structure.

[0134] In another embodiment, after the category attribute association relationship is generated based on the above S105, the method further includes a category attribute query method, such as Figure 6 As shown, the method can be executed by the aforementioned category attribute service system. Specifically, the method includes:

[0135] S201: Obtain a node identifier of any leaf category node in the association relationship.

[0136] The node identifier may be a category ID. For example, if the leaf category is spoon, the corresponding category ID is a spoon ID, and the spoon ID may be pre-set.

[0137] S202: searching, in the association relationship according to the node identifier, for a leaf attribute node connected to the leaf category.

[0138] Specifically, a search instruction is generated based on the category ID. The search instruction contains fields related to the category ID, such as: SPOONS spoon, CategoryCode category code, Category attribute, and match commands. For example, based on the spoon ID, a search instruction is generated: find the leaf attribute Property node that matches the category SPOONS spoon. After executing the search instruction, the leaf attribute node connected to it is determined. The leaf attribute node can be one or more.

[0139] S203: Display the attribute or attribute value corresponding to the leaf attribute node.

[0140] Based on the above search command, the graph database automatically searches for the associated attributes of the spoon ID. The searched leaf attribute nodes include color and size. Figure 7a The corresponding relationship is: Category_Property_Rel. After searching, the properties of the spoon displayed on the client are color and size.

[0141] Similarly, based on the above category attribute pattern, you can also find the attribute value associated with a category, such as Figure 7b As shown, the corresponding attribute value can be found through the category spoon ID, which includes beige and green beige. The search instruction generated by the search is the same as the above Figure 7a Similar to the search instructions shown, see Figure 7a The illustrated embodiment is described.

[0142] In addition, you can also search for related categories through attributes or attribute value information, such as using the attribute IDs "bowl" and "spoon" to search for their related attribute information. Enter the new search instruction into the graph database, and the category obtained after the search is "color".

[0143] In a graph database, the data model is described by nodes and edges. A category is a node in a graph database. When you need to query a category, you only need to query whether the ID of the current node is equal to the query ID. The entire query process does not involve edge-related queries, so it is a single-point operation. Specifically, computer programs are identified by the submitted code. Since the search instruction only involves points, it is also called a single-point query.

[0144] In the above single-point query process, it includes querying the attributes associated with the category, the attribute values ​​associated with the category, the categories associated with the attributes, and the categories associated with the attribute values. When querying the attributes associated with the category, you only need to query the category ID and then obtain it through the category attribute relationship query. When querying the attribute values ​​associated with the category, you need to pass the category ID and then query the category attribute value relationship to obtain it. Compared with the relational database that needs to search multiple relationship tables, there is no need to perform a full table query or a combined query, which greatly improves the query efficiency of the category attributes and reduces the time consumption.

[0145] In addition, in this embodiment, the associated categories and attributes, categories and attribute values, categories and categories, and attribute values ​​and attributes can be untied, that is, the edge between two nodes in the above category attribute pattern can be eliminated. Specifically, the method of disassociating the relationship includes:

[0146] First, two nodes whose association is to be disassociated are obtained, where the node types of the two nodes are any of the following: two leaf category nodes, a leaf category node and a leaf attribute node, or a leaf category node and a leaf attribute value node.

[0147] Then, a fourth instruction is generated according to the node identifications of the two nodes and the program code for disassociating the relationship; finally, the fourth instruction is sent to the graph database, and the fourth instruction is used to instruct the graph database to disassociate the relationship between the two nodes.

[0148] Specifically, it can be implemented through a preset program code. For example, the preset program code includes a delete instruction. When it is necessary to cancel the association between two nodes, it is only necessary to fill in the relevant fields of the category-attribute into the preset program code. For example, in a category attribute pattern including color COLOUR and bowl BOWLS, key fields such as "COLOUR" and "BOWLS" are added to the preset program code to generate a fourth program instruction.

[0149] The categories and attributes displayed after the graph database executes the fourth program instruction are as follows Figure 8a As shown in the figure, the association relationship (Category_Property_Rel) between the leaf category "bowl" and the attribute "color" is removed. Similarly, the association relationship between the category and the attribute value can also be deleted, such as Figure 8b As shown, the association relationship between the category "bowl" and the attribute value "S" is deleted to facilitate the association of these nodes with other categories or attributes.

[0150] It should be noted that, when establishing the association between the category and the attribute value as mentioned above, it is necessary to first associate with the attribute corresponding to the attribute value, and then establish an association with the attribute value. Therefore, when the category is disassociated from the attribute value, if there is no association between the category and any attribute value under the corresponding attribute, the category must be disassociated from the attribute at the same time.

[0151] The method for unbinding an association relationship provided in this embodiment has the following advantages over the unbinding process of a relational database: in a relational database, processing the above logic requires adding business code for judgment, but in a graph database, a trigger in the APOC library (such as a plug-in provided by Neo4j) can be used to automatically establish an association with the corresponding attribute when the category is first associated with an attribute value; when the category is unassociated from the attribute value, when there is no association between the category and any attribute value under the corresponding attribute, the category is automatically unassociated from the attribute, thereby realizing the function of automatically canceling the association relationship and reducing business complexity.

[0152] In addition, the method provided in this embodiment realizes the function of automatically creating and displaying the association relationship between categories and attributes on the graph database side, thereby improving the efficiency of managing categories, attributes and their relationships. It can automatically create and cancel category attribute relationships, reduce business complexity, and has higher scalability than relational databases.

[0153] In this embodiment, a category attribute association device is also provided, which is used to implement the method described in the above embodiment, and the description has been made no further. As used below, the term "unit" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0154] like Fig. 9 As shown, a category attribute association device provided in this embodiment includes:

[0155] The receiving unit 901 is used to obtain the input operation of the user on the display interface, and the input operation includes: filling in the first category information and first attribute information to establish the association relationship, and the first category information includes the first category and the first category code.

[0156] The searching unit 902 is used to search for at least one leaf category directly associated with the first category code in the preset category tree, where each leaf category is a node connected to the first category and located at the end of the preset category tree.

[0157] The determination unit 903 is used to determine the second attribute information associated with each leaf category in the stored category attribute relationship library, and the category attribute relationship library includes the association relationship between each leaf category and the second attribute information.

[0158] The generating unit 904 is configured to generate at least one first instruction according to the first attribute information and the second attribute information.

[0159] The sending unit 905 is used to send at least one first instruction to the graph database, and the at least one first instruction is used to instruct the graph database to update the second attribute information, generate the first attribute information, and establish an association relationship between the first category information and the first attribute information.

[0160] Optionally, in a specific implementation of the present embodiment, the generation unit 904 is specifically used to compare the first attribute information and the second attribute information, and if the second attribute information associated with at least one leaf category does not fully contain the first attribute information, a new addition instruction is generated; if the second attribute information associated with at least one leaf category is different from the first attribute information, an update instruction is generated; if the second attribute information associated with at least one leaf category has more content than the first attribute information, a deletion instruction is generated.

[0161] Optionally, the first attribute information includes: a first attribute, or a first attribute value, or a first attribute and a first attribute value;

[0162] The association relationship between the first category information and the first attribute information includes: an association relationship between the first category and the first attribute; or an association relationship between the first category and the first attribute value; or an association relationship between the first category, the first attribute and the first attribute value.

[0163] Optionally, in another specific implementation of this embodiment, when the first attribute information includes the first attribute value, the generating unit 904 is further configured to:

[0164] When generating a new instruction, it is determined whether an association has been established between the target attribute corresponding to the first attribute value and the first category; if not, a new instruction is generated, and the new instruction is used to establish an association relationship between the first category and the target attribute.

[0165] Alternatively, when generating a deletion instruction, determine whether the target attribute corresponding to the deleted first attribute value has no other attribute value association with the first category; if so, generate a removal instruction, which is used to remove the target attribute and the association relationship between the target attribute and the first category.

[0166] Optionally, in another specific implementation of the present embodiment, the generation unit 904 is further specifically used to: obtain third attribute information; fill the content of the third attribute information into a preset programming language framework to generate a first programming language model; generate a second instruction based on the first programming language model and at least one first instruction; send the second instruction to the graph database through the sending unit 905, and the second instruction is used to instruct the graph database to generate an association relationship between the first attribute information, the third attribute information and the first category information.

[0167] Optionally, in another specific implementation of the present embodiment, the generation unit 904 is further specifically used to: obtain second category information, the second category information includes a second category, the second category and the first category are in the same level category or a superior-subordinate category relationship; fill the content of the second category information into a preset program language framework to generate a second program language model; and generate a third instruction based on the second program language model and the second instruction.

[0168] The sending unit 905 is further used to send a third instruction to the graph database, where the third instruction is used to instruct the graph database to generate an association relationship between the first attribute information, the third attribute information, the first category information, and the second category information.

[0169] Optionally, in another specific implementation of this embodiment, the above device further includes: an acquisition unit and a display unit. The acquisition unit is used to acquire a node identifier of any leaf category node in the association relationship.

[0170] The searching unit 902 is further used to search for a leaf attribute node connected to the leaf category node in the association relationship according to the node identifier.

[0171] The display unit is used to display the attributes or attribute values ​​corresponding to the leaf attribute nodes.

[0172] Optionally, in another specific implementation of the present embodiment, the acquisition unit is also used to acquire two nodes whose association relationship is to be disassociated, and the node types of the two nodes are any of the following: two leaf category nodes, a leaf category node and a leaf attribute node, and a leaf category node and a leaf attribute value node.

[0173] The generating unit 904 is further configured to generate a fourth instruction according to the node identifiers of the two nodes and the program code for disassociating the relationship.

[0174] The sending unit 905 is further used to send a fourth instruction to the graph database, where the fourth instruction is used to instruct the graph database to release the association between two nodes.

[0175] Among them, the above-mentioned category attribute association device can be a category attribute service system.

[0176] It should be understood that the above device may further include other more or fewer units / modules, such as a storage unit, etc., which is not limited in this embodiment.

[0177] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0178] The embodiment of the present invention also provides an electronic device having the above Fig. 9 The associated device of the category attributes shown.

[0179] See also Fig.10 , is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Fig.10 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface).

[0180] In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides part of the necessary operations (for example, as a server array or a multi-processor system). Fig.10 A processor 10 is taken as an example.

[0181] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0182] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the category attribute association method shown in the above embodiment.

[0183] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of an electronic device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0184] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0185] The electronic device also includes an input device and an output device. Further, the input device can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.

[0186] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.

[0187] Optionally, in this embodiment, the electronic device may be a client, which includes the category attribute service system of the aforementioned embodiment and graph database software / model.

[0188] An embodiment of the present invention also provides a computer-readable storage medium, and the above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented by downloading through a network and originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.

[0189] The storage medium may be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid state drive, etc.; further, the storage medium may also include a combination of the above-mentioned types of memories. It is understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, processor or hardware, the method shown in the above embodiment is implemented.

[0190] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A category attribute association method, characterized in that: The method comprises: Acquiring an input operation of a user on a display interface, the input operation comprising: filling in first category information and first attribute information for which an association relationship is to be established, the first category information comprising a first category and a first category code; Searching for at least one leaf category directly associated with the first category code in a preset category tree, each leaf category being: a node connected to the first category and located at the end of the preset category tree; Determining the second attribute information associated with each of the leaf categories in a stored category attribute relationship library, wherein the category attribute relationship library includes an association relationship between each of the leaf categories and the second attribute information; Generate at least one first instruction according to the first attribute information and the second attribute information; The at least one first instruction is sent to a graph database, wherein the at least one first instruction is used to instruct the graph database to update the second attribute information, generate the first attribute information, and establish an association relationship between the first category information and the first attribute information.

2. The method according to claim 1, characterized in that The at least one first instruction includes: a new instruction, an update instruction and a delete instruction; The generating at least one first instruction according to the first attribute information and the second attribute information includes: comparing the first attribute information and the second attribute information, and generating a new adding instruction if the second attribute information associated with the at least one leaf category does not completely include the first attribute information; If the second attribute information associated with the at least one leaf category is different from the first attribute information, generating an update instruction; If the second attribute information associated with the at least one leaf category is greater than the content of the first attribute information, a deletion instruction is generated.

3. The method according to claim 2, characterized in that The first attribute information includes: a first attribute, or a first attribute value, or a first attribute and a first attribute value; The association relationship between the first category information and the first attribute information includes: an association relationship between the first category and the first attribute; or, an association relationship between the first category and the first attribute value; Or, an association relationship between the first category, the first attribute and the first attribute value.

4. The method according to claim 3, characterized in that When the first attribute information includes the first attribute value, the generating at least one first instruction according to the first attribute information and the second attribute information includes: When generating the new adding instruction, determining whether an association has been established between the target attribute corresponding to the first attribute value and the first category; If not, a new creation instruction is generated, where the new creation instruction is used to establish an association relationship between the first category and the target attribute.

5. The method according to claim 3, characterized in that: When the first attribute information includes the first attribute value, the generating at least one first instruction according to the first attribute information and the second attribute information includes: When generating the deletion instruction, determining whether the target attribute corresponding to the first attribute value to be deleted has no other attribute value association with the first category; If yes, a removal instruction is generated, where the removal instruction is used to remove the target attribute and the association relationship between the target attribute and the first category.

6. The method according to any one of claims 1 to 5, characterized in that: After sending the at least one first instruction to the graph database, the method further includes: Obtaining third attribute information; Filling the content of the third attribute information into a preset programming language framework to generate a first programming language model; generating a second instruction according to the first programming language model and the at least one first instruction; The second instruction is sent to the graph database, where the second instruction is used to instruct the graph database to generate an association relationship between the first attribute information, the third attribute information and the first category information.

7. The method according to claim 6, characterized in that After sending the second instruction to the graph database, the method further includes: Acquire second category information, where the second category information includes a second category, and the second category and the first category are in a same-level category or a superior-subordinate category relationship; Filling the content of the second category information into a preset programming language framework to generate a second programming language model; generating a third instruction according to the second programming language model and the second instruction; The third instruction is sent to the graph database, where the third instruction is used to instruct the graph database to generate an association relationship among the first attribute information, the third attribute information, the first category information, and the second category information.

8. The method according to claim 6, characterized in that After the graph database establishes the association relationship between the first category information and the first attribute information, the method further includes: Obtaining a node identifier of any leaf category node in the association relationship; Searching, according to the node identifier, for a leaf attribute node connected to the leaf category node in the association relationship; Display the attribute or attribute value corresponding to the leaf attribute node.

9. The method according to claim 7, characterized in that: After the graph database generates the association relationship among the first attribute information, the third attribute information, the first category information, and the second category information, the method further includes: Acquire two nodes whose association is to be disassociated, where the node types of the two nodes are any of the following: two leaf category nodes, a leaf category node and a leaf attribute node, or a leaf category node and a leaf attribute value node; Generate a fourth instruction according to the node identifiers of the two nodes and the program code for disassociating the relationship; The fourth instruction is sent to the graph database, where the fourth instruction is used to instruct the graph database to release the association between the two nodes.

10. A category attribute association device, characterized in that: The device comprises: A receiving unit, configured to obtain an input operation of a user on a display interface, wherein the input operation includes: filling in first category information and first attribute information of a desired association relationship to be established, wherein the first category information includes a first category and a first category code; A searching unit, configured to search in a preset category tree for at least one leaf category directly associated with the first category code, each leaf category being: a node connected to the first category and located at the end of the preset category tree; a determining unit, configured to determine the second attribute information associated with each of the leaf categories in a stored category attribute relationship library, wherein the category attribute relationship library includes an association relationship between each of the leaf categories and the second attribute information; a generating unit, configured to generate at least one first instruction according to the first attribute information and the second attribute information; A sending unit is used to send the at least one first instruction to the graph database, wherein the at least one first instruction is used to instruct the graph database to update the second attribute information, generate the first attribute information, and establish an association relationship between the first category information and the first attribute information.

11. An electronic device, characterized in that: comprising a memory and a processor, wherein the memory and the processor are connected; The memory stores computer instructions; The processor executes the category attribute association method described in any one of claims 1 to 9 by executing computer instructions.

12. A computer-readable storage medium, characterized in that: Computer instructions are stored on a computer-readable storage medium, and the computer instructions are used to enable a computer to execute the category attribute association method described in any one of claims 1 to 9.