Data table structure for recording product feature information, processing method and device
By using a horizontal table structure to record the label value of financial products, the problem of excessive data volume caused by the vertical table structure is solved, and the scalability of the data table and the convenient processing of label value is achieved.
Patent Information
- Application Number
- CN202411743741.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, the storage of label values of financial products adopts a vertical table structure, resulting in the increase of data volume as the number of products and labels increases, resulting in excessive data volume and affecting system performance.
A data table structure adopts a horizontal table structure, including at least one row and one column, each row corresponds to a target product, each column corresponds to a product label, and each cell records the label value of the corresponding product label. This structure corresponds to three data tables: the first data table records the label parameters of the product label, the second data table records the data table number and data column number corresponding to the label value of the product label, and the third data table records the mapping relationship between the product label and product attributes.
Through the design of the horizontal table structure, the problem of excessive data volume caused by vertical tables is avoided, the scalability of the data table is achieved, and the processing and operation of label values is facilitated.
Smart Images

Figure CN119513106A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data table structure, a processing method and a device for recording product feature information. Background Art
[0002] Financial products are non-physical assets with economic value that can be publicly traded or cashed. Examples include personal demand deposits, corporate deposits, personal first-hand commercial loans, credit cards, debit cards and other financial products. A series of product attributes are used to describe a financial product, such as name, sales start time, product status, etc. Financial products use labels to define corresponding feature information. Feature information refers to the most basic information about an object that best reflects the characteristics of an object. A label is an abstract classification and summary of a feature of a certain type of specific group or object, and its label value is classifiable.
[0003] At present, the tag values of product tags are mostly stored in a vertical table structure. For example, each row in the vertical table records the tag value of a product on a tag. If a product or tag is added, it is recorded in a new row. This method can record tag values infinitely and has strong scalability.
[0004] However, storing label values in this way will cause the amount of data in the vertical table to increase exponentially due to the increase in the number of products and labels, resulting in an excessive amount of data. Summary of the invention
[0005] In view of the above problems, the present application provides a data table structure, processing method and device for recording product feature information to solve the defect that the total table stores label values with too much data. The specific solution is as follows:
[0006] In a first aspect, the present application provides a data table structure for recording product feature information, the data table structure comprising:
[0007] At least one row; each row contains at least one column;
[0008] Wherein, each row in the data table structure corresponds to a target product; each column in the data table structure corresponds to a product tag; each cell in each column in the data table structure is used to record the tag value of the corresponding product tag corresponding to each target product;
[0009] The data table structure corresponds to a first data table, a second data table and a third data table; the first data table, the second data table and the third data table are used to process the label values in the data table structure;
[0010] The first data table is used to record label parameters corresponding to the product label, wherein the label parameters at least include a label source, and the label source indicates that the product label is a custom label or a label mapped to a product attribute;
[0011] The second data table is used to record the data table number and data column number corresponding to the tag value of each product tag, the data table number is used to indicate the data table structure where the product tag is located, and the data column number table is used to indicate the data column where the product tag is located in the data table structure where the product tag is located;
[0012] The third data table is used to record the mapping relationship between the product label and the product attribute according to the label source.
[0013] A second aspect of the present application provides a method for processing a data table structure for recording product feature information, the method comprising:
[0014] Obtain a data table structure for recording tag values; the data table structure corresponds to a first data table, a second data table and a third data table; the data table structure includes: at least one row; each row includes at least one column;
[0015] Wherein, each row in the data table structure corresponds to a target product; each column in the data table structure corresponds to a product label; each cell in each column in the data table structure is used to record the label value of the corresponding product label corresponding to each target product; the first data table is used to record the label parameters corresponding to the product label, and the label parameters at least include the label source, and the label source indicates that the product label is a custom label or a label mapped with a product attribute; the second data table is used to record the data table number and data column number corresponding to the label value of each product label, and the data table number is used to indicate the data table structure where the product label is located, and the data column number table is used to indicate the data column where the product label is located in the data table structure where the product label is located; the third data table is used to record the mapping relationship between the product label and the product attribute according to the label source;
[0016] In response to the processing instruction, the tag values in the data table structure are processed according to the first data table, the second data table and the third data table.
[0017] In a possible implementation, the processing instruction is an instruction to instruct to add a first tag to the first product, and the second data table is further used to record a tag state corresponding to each of the product tags, where the tag state indicates whether the corresponding product tag is in an activated state;
[0018] The tag value in the data table structure is processed, including:
[0019] In the second data table, query whether there is a data column number corresponding to a product tag whose tag status indicates that the tag is not in the startup state and its corresponding data table number;
[0020] If there is a data column number corresponding to a product label that has a label status indicating that the label is not in the start-up state, write the label value corresponding to the first label on the first product into a cell corresponding to the first product in the data column corresponding to the queried data column number in the data table structure corresponding to the queried data column number;
[0021] If there is no data column number corresponding to the product tag that does not exist in the tag status representation and is not in the startup state, write the tag value corresponding to the first tag on the first product into the corresponding data table structure according to the largest data table number in the second data table and its corresponding largest data column number;
[0022] In the second data table, it is recorded that the tag state corresponding to the first tag is the start state.
[0023] In a possible implementation, the method further includes:
[0024] monitoring whether the number of data columns where the product labels are located in the data table structure corresponding to the largest data table number in the second data table reaches a first threshold, and if so, creating a new data table structure;
[0025] Among them, when the number of data columns where the product tags are located in the data table structure corresponding to the largest data table number reaches a second threshold, the new product tags are written into the data columns of the newly created data table structure; the second threshold is greater than the first threshold.
[0026] In a possible implementation, in the second data table, querying whether there is a data column number corresponding to a product tag whose tag status indicates that it is not in the startup state and its corresponding data table number includes:
[0027] In the second data table, starting from the smallest data table number and the smallest data column number, it is queried whether there is a data column number and a corresponding data table number corresponding to a product tag whose tag status indicates that it is not in the start-up state.
[0028] In a possible implementation, the processing instruction is an instruction to write a second tag for a second product into the data table structure;
[0029] The tag value in the data table structure is processed, including:
[0030] Querying the tag source of the second tag from the first data table;
[0031] In the case where the tag source indicates that the second tag is a custom tag, performing a value check on the tag value of the second tag according to the tag type of the second tag to obtain a check result; and performing a write operation on the second tag in response to the check result;
[0032] In the case where the tag source indicates that the second tag is a tag mapped to a product attribute, querying the product attribute corresponding to the second tag and the corresponding processing type from the third data table; processing the attribute value of the product attribute corresponding to the second tag according to the processing type corresponding to the product attribute to obtain a tag value of the second tag; and performing a write operation on the second tag;
[0033] Among them, performing a write operation on the second tag includes: querying the data table number and data column number corresponding to the second tag in the second data table; determining the cell corresponding to the second product in the data column corresponding to the data column number queried in the data table structure corresponding to the queried data table number; and writing the tag value of the second tag in the cell corresponding to the second product.
[0034] In a possible implementation, the processing instruction is an instruction to instruct to update the tag value of the third tag; the third tag is a tag mapped to a product attribute, and the processing instruction is generated when it is monitored that the attribute value of the first attribute corresponding to the third tag in the third product and the tag value of the third tag corresponding to the third product meet a matching exception condition;
[0035] The tag value in the data table structure is processed, including:
[0036] querying the processing type corresponding to the first attribute from the third data table;
[0037] Processing the attribute value of the first attribute according to the processing type corresponding to the first attribute to obtain a label value of the third label;
[0038] Query the data table number and data column number corresponding to the third tag in the second data table;
[0039] Determine the cell corresponding to the third product in the data column corresponding to the data column number queried in the data table structure corresponding to the queried data table number;
[0040] In the cell corresponding to the third product, the tag value of the third tag is written.
[0041] In a possible implementation, the processing instruction is an instruction to add a fourth product to the data table structure;
[0042] The tag value in the data table structure is processed, including:
[0043] Adding a row corresponding to the fourth product in the data table structure;
[0044] The label value of each product label corresponding to the fourth product is written into the cell corresponding to the product label in the row corresponding to the fourth product.
[0045] In a possible implementation, the processing instruction is an instruction to instruct to delete the fifth product from the data table structure;
[0046] The tag value in the data table structure is processed, including:
[0047] The row corresponding to the fifth product is deleted from the data table structure.
[0048] A third aspect of the present application provides a processing device for a data table structure recording product feature information, the device comprising:
[0049] A table obtaining unit, used to obtain a data table structure for recording tag values; the data table structure corresponds to a first data table, a second data table and a third data table; the data table structure includes: at least one row; each row includes at least one column;
[0050] Wherein, each row in the data table structure corresponds to a target product; each column in the data table structure corresponds to a product label; each cell in each column in the data table structure is used to record the label value of the corresponding product label corresponding to each target product; the first data table is used to record the label parameters corresponding to the product label, and the label parameters at least include the label source, and the label source indicates that the product label is a custom label or a label mapped with a product attribute; the second data table is used to record the data table number and data column number corresponding to the label value of each product label, and the data table number is used to indicate the data table structure where the product label is located, and the data column number table is used to indicate the data column where the product label is located in the data table structure where the product label is located; the third data table is used to record the mapping relationship between the product label and the product attribute according to the label source;
[0051] The table processing unit is used to process the label value in the data table structure according to the first data table, the second data table and the third data table in response to the processing instruction.
[0052] The fourth aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the processing method of the data table structure for recording product feature information of the above-mentioned first aspect or any implementation method of the first aspect.
[0053] A fifth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0054] The memory is used to store computer programs;
[0055] The processor is used to execute the computer program so that the electronic device can implement the processing method of the data table structure for recording product feature information in the above-mentioned first aspect or any implementation manner of the first aspect.
[0056] In a sixth aspect, the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement a processing method for a data table structure that records product feature information in accordance with the first aspect or any implementation of the first aspect.
[0057] By means of the above technical scheme, the data table structure, processing method and device for recording product feature information provided by the present application improve the way of recording product feature information, specifically: each row in the data table structure corresponds to a target product, and each column corresponds to a product label, so that each cell in each column in the data table structure is used to record the label value of the corresponding product label corresponding to each target product, and the data table structure corresponds to three data tables: a first data table for recording the label parameters corresponding to the product label, a second data table for recording the data table number and the data column number corresponding to the label value of each product label, and a third data table for recording the mapping relationship between the product label and the product attribute, so that the label value in the data table structure can be processed based on these three data tables. It can be seen that in the present application, by improving the structure of the table for recording the label value of the product label, the product feature information is recorded in the form of horizontal labels, and the problem of excessive table data volume caused by the vertical table is avoided. In addition, in the present application, the label value processing can be performed based on the information recorded in the three data tables corresponding to the data table structure, which is convenient for realizing the operability of the label value, thereby ensuring the scalability of the table. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0059] Figure 1 A schematic diagram of a data table structure for recording product feature information provided in an embodiment of the present application;
[0060] Figure 2 Another schematic diagram of a data table structure for recording product feature information provided in an embodiment of the present application;
[0061] Figure 3 A flowchart of a method for processing a data table structure for recording product feature information provided in an embodiment of the present application;
[0062] Figure 4 A partial flow chart of a method for processing a data table structure for recording product feature information provided in an embodiment of the present application;
[0063] Figure 5 Another partial flow chart of a method for processing a data table structure for recording product feature information provided by an embodiment of the present application;
[0064] Figure 6 A flowchart of another part of a method for processing a data table structure for recording product feature information provided by an embodiment of the present application;
[0065] Figure 7 Another partial flow chart of a method for processing a data table structure for recording product feature information provided by an embodiment of the present application;
[0066] Figure 8 A schematic diagram of a structure of a processing device for a data table structure recording product feature information provided in an embodiment of the present application;
[0067] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0068] Fig.10 This is an example diagram of the interaction relationship between data models in the scenario of financial product feature information processing applicable to this application;
[0069] Fig.11 This is a schematic diagram of the calling relationship between each data model and each component in the scenario where this application is applicable to the processing of financial product feature information;
[0070] Fig.12 This is a schematic diagram of the label parameter information structure in the scenario where this application is applicable to the processing of financial product feature information;
[0071] Fig.13 This is a schematic diagram of the label sub-table definition structure in the scenario where this application is applicable to the processing of financial product feature information;
[0072] Fig.14 This is a schematic diagram of a tag special processing definition structure in the scenario where this application is applicable to the processing of financial product feature information;
[0073] Fig.15 This is a schematic diagram of the product tag value structure in the scenario where this application is applicable to the processing of financial product feature information;
[0074] Fig.16 This is a flowchart of the implementation of the product tag value field allocation component in the scenario where this application is applicable to the processing of financial product feature information;
[0075] Fig.17 This is a flowchart of the implementation of the product tag value recording component in the scenario where this application is applicable to the processing of financial product feature information;
[0076] Fig.18 This application is applicable to the implementation flow chart of the product addition and deletion timing synchronization component in the scenario of financial product feature information processing;
[0077] Fig.19 This application is applicable to the implementation flow chart of the label value synchronization component in the financial product feature information processing scenario. DETAILED DESCRIPTION
[0078] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0079] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0080] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0081] Reference Figure 1, is a schematic diagram of a data table structure for recording product feature information provided in an embodiment of the present application, wherein each cell in the data table structure is used to record the tag value of a target product under a product tag. The data table structure includes at least one row, and each row in the data table structure corresponds to a target product. Each row in the data table structure includes at least one column, and each column in the data table structure corresponds to a product tag.
[0082] Specifically, the cells in the first column of each row in the data table structure are used to record the product number of the corresponding target product, such as Figure 2 As shown in , the cells in other columns of each row in the data table structure are used to record the label values of the corresponding target products under the corresponding product labels.
[0083] The data table structure can also be called a product tag value model, and the data table structure corresponds to a first data table, a second data table, and a third data table. The first data table, the second data table, and the third data table are used to process the tag values in the data table structure in response to the processing instruction, such as writing processing of new tags, writing processing of tag values of product tags, updating processing of tag values of product tags, deleting processing of target products, adding processing of target products, etc.
[0084] The first data table, which can also be called a label parameter model, is used to record label parameters corresponding to product labels. The label parameters at least include a label source, which indicates that the product label is a custom label or a label mapped with a product attribute. The label mapped with a product attribute means that the label value of the product label is calculated based on the attribute value of at least one product attribute.
[0085] In addition, tag parameters can also include tag number, tag name, tag type, tag source, value list, and value range. The tag name can represent the meaning of the product tag. The tag type means: the tag value of the product tag whose tag source is a custom tag is obtained from the value list or value range.
[0086] The second data table, which can also be called the product tag value field sub-table relational model, is used to record the data table number and data column number corresponding to the tag value of each product tag. The data table number is used to represent the data table structure where the product tag is located, and the data column number table is used to represent the data column where the product tag is located in the data table structure where it is located. The data table number is used to uniquely represent the corresponding data table structure. Since there are many product tags, the product tags can be stored in a sub-table in this embodiment, so that the tag values of the product tags can be stored through multiple data table structures. For example, data table structure 1 can store the tag values of 60,000 target products in product tags 1 to product tags 200 respectively; data table structure 2 can store the tag values of 60,000 target products in product tags 201 to product 400 respectively, and so on. Based on this, the data table number of the data table structure where each product tag is located is recorded in the second data table, and the data column number of the data column of each product tag in the data table structure where it is located is also recorded, such as product tag 201 in data column 1 in data table structure 2.
[0087] The third data table, which may also be referred to as a label and product attribute mapping relationship model, is used to record the mapping relationship between product labels and product attributes according to the label source. For example, if the label source indicates that the product label is a custom label, it is not recorded in the third data table. If the label source indicates that the product label is a label mapped to a product attribute, the third data table records the mapping relationship between the product label and its corresponding target attribute on the corresponding target product.
[0088] It should be noted that in this embodiment, based on the first data table, the second data table and the third data table, the data table structure and corresponding data columns where the label value of any target product on any product label are located can be determined, and the product attributes mapped by the product label on each target product can also be determined. Therefore, no matter what processing is performed on the label value, it can be implemented based on these three data tables.
[0089] By means of the above technical scheme, in a data table structure for recording product characteristic information provided by the present application, the method of recording product characteristic information is improved, specifically: each row in the data table structure corresponds to a target product, and each column corresponds to a product label, so that each cell in each column in the data table structure is used to record the label value of the corresponding product label corresponding to each target product, and the data table structure corresponds to three data tables: a first data table for recording the label parameters corresponding to the product label, a second data table for recording the data table number and the data column number corresponding to the label value of each product label, and a third data table for recording the mapping relationship between the product label and the product attribute, so that the label value in the data table structure can be processed based on these three data tables. It can be seen that in the present application, by improving the structure of the table for recording the label value of the product label, the product characteristic information is recorded in the form of horizontal labels, and the problem of excessive table data volume caused by the vertical table is avoided. In addition, in the present application, the label value processing can be performed based on the information recorded in the three data tables corresponding to the data table structure, which is convenient for realizing the operability of the label value, thereby ensuring the scalability of the table.
[0090] refer to Figure 3 , is a flowchart of a method for processing a data table structure for recording product feature information provided in an embodiment of the present application, which can be applied to electronic devices capable of data processing, such as mobile phones, tablet devices, notebooks, computers or servers, etc. The technical solution in this embodiment is mainly used to record and process product feature information, i.e., product tags, while ensuring the scalability of the table and reducing the amount of table data.
[0091] Specifically, the method in this embodiment may include the following steps:
[0092] Step 301: Obtain a data table structure for recording tag values, where the data table structure corresponds to a first data table, a second data table, and a third data table.
[0093] Wherein, the data table structure includes: at least one row; each row includes at least one column;
[0094] It should be noted that each row in the data table structure corresponds to a target product. Figure 2 and Figure 3 As shown in , each column in the data table structure corresponds to a product label; each cell in each column in the data table structure is used to record the label value of the corresponding product label corresponding to each target product;
[0095] The first data table, which can also be called a label parameter model, is used to record label parameters corresponding to product labels. The label parameters at least include a label source, which indicates that the product label is a custom label or a label mapped with a product attribute. The label mapped with a product attribute means that the label value of the product label is calculated based on the attribute value of at least one product attribute.
[0096] In addition, tag parameters can also include tag code, tag name, tag type, tag source, value list, and value range. The tag name can represent the meaning of the product tag. The tag type means: the tag value of the product tag whose tag source is a custom tag is obtained from the value list or value range.
[0097] The second data table, which can also be called the product tag value field sub-table relational model, is used to record the data table number and data column number corresponding to the tag value of each product tag. The data table number is used to represent the data table structure where the product tag is located, and the data column number table is used to represent the data column where the product tag is located in the data table structure where it is located. The data table number is used to uniquely represent the corresponding data table structure. Since there are many product tags, the product tags can be stored in a sub-table in this embodiment, so that the tag values of the product tags can be stored through multiple data table structures. For example, data table structure 1 can store the tag values of 60,000 target products in product tags 1 to product tags 200 respectively; data table structure 2 can store the tag values of 60,000 target products in product tags 201 to product 400 respectively, and so on. Based on this, the data table number of the data table structure where each product tag is located is recorded in the second data table, and the data column number of the data column of each product tag in the data table structure where it is located is also recorded, such as product tag 201 in data column 1 in data table structure 2.
[0098] The third data table, which may also be referred to as a label and product attribute mapping relationship model, is used to record the mapping relationship between product labels and product attributes according to the label source. For example, if the label source indicates that the product label is a custom label, it is not recorded in the third data table. If the label source indicates that the product label is a label mapped to a product attribute, the third data table records the mapping relationship between the product label and its corresponding target attribute on the corresponding target product.
[0099] Specifically, in this embodiment, all data table structures related to the current project (such as an enterprise or unit) can be read from the database.
[0100] Step 302: In response to the processing instruction, the tag values in the data table structure are processed according to the first data table, the second data table and the third data table.
[0101] The processing instructions may include at least one of: a new tag writing processing instruction, a product tag tag value writing processing instruction, a product tag tag value update processing instruction, a target product deletion processing instruction, a target product addition processing instruction, etc.
[0102] By means of the above technical scheme, in a processing method of a data table structure for recording product characteristic information provided by the present application, the method of recording product characteristic information is improved, specifically: each row in the data table structure corresponds to a target product, and each column corresponds to a product label, so that each cell in each column in the data table structure is used to record the label value of the corresponding product label corresponding to each target product, and the data table structure corresponds to three data tables: a first data table for recording label parameters corresponding to product labels, a second data table for recording data table numbers and data column numbers corresponding to the label values of each product label, and a third data table for recording the mapping relationship between product labels and product attributes, so that the label values in the data table structure can be processed based on these three data tables. It can be seen that in the present application, by improving the structure of the table for recording the label values of product labels, the product characteristic information is recorded in the form of horizontal labels, and the problem of excessive table data volume caused by the vertical table is avoided. In addition, in the present application, the label value processing can be performed based on the information recorded in the three data tables corresponding to the data table structure, which is convenient for realizing the operability of the label value, thereby ensuring the scalability of the table.
[0103] In one implementation, the processing instruction may be an instruction to add a first tag to the first product, and the second data table is further used to record the tag status corresponding to each product tag, where the tag status indicates whether the corresponding product tag is in an activated state.
[0104] Based on this, when processing the tag value in the data table structure in step 302, it can be implemented in the following ways: Figure 4 As shown in:
[0105] Step 401: In the second data table, query whether there is a data column number corresponding to a product tag whose tag status indicates that it is not in the startup state and its corresponding data table number; if there is a data column number corresponding to a product tag whose tag status indicates that it is not in the startup state, execute step 402; if there is no data column number corresponding to a product tag whose tag status indicates that it is not in the startup state, execute step 403.
[0106] The product tag is in the start-up state, which means that the product tag has not been invalidated, that is, it cannot be overwritten. The product tag is not in the start-up state, which means that the product tag has been invalidated, that is, it can be overwritten.
[0107] In one implementation, in step 401, the product tags that are not in the startup state can be queried in the order of data table numbers from small to large and data column numbers from small to large. That is, in the second data table, starting from the smallest data table number and the smallest data column number corresponding to the smallest data table number, it is queried whether there is a product tag whose tag status indicates that it is not in the startup state, so as to query the data column number corresponding to the product tag whose tag status indicates that it is not in the startup state and the corresponding data table number.
[0108] Step 402: write the tag value corresponding to the first tag on the first product into the cell corresponding to the first product in the data column corresponding to the data column number queried in the data table structure corresponding to the queried data column number.
[0109] Specifically, in this embodiment, the product number of the first product can be searched row by row to determine the row where the first product is located, and in the data column corresponding to the data column number queried in the data table structure corresponding to the data column number queried in step 401, the cell corresponding to the first product on the first label is determined according to the row where the first product is located; then, the label value corresponding to the first label on the first product is written into the cell corresponding to the first product on the first label.
[0110] Step 403: According to the largest data table number in the second data table and its corresponding largest data column number, write the label value corresponding to the first label on the first product into the corresponding data table structure.
[0111] Specifically, in this embodiment, the largest data table number can be searched in the second data table first, and then the largest data column number can be searched in the data column number corresponding to the largest data table number, and then the label value corresponding to the first label on the first product can be written into the data table structure corresponding to the found data table number, in the next column (i.e., one column) of the data column corresponding to the found data column number, and in the cell corresponding to the first product.
[0112] Step 404: In the second data table, record that the tag state corresponding to the first tag is the start state.
[0113] Among them, in this embodiment, in the second data table, after recording the tag state corresponding to the first tag as the startup state, it indicates that the first tag is being used and has not expired, that is, it cannot be overwritten, so as to avoid the product label in the startup state from being overwritten.
[0114] It can be seen that in this embodiment, the data table structure and the data columns written in the first tag can be determined by the tag status of the product tag in the second data table, thereby realizing the writing process of the newly added product tag.
[0115] In one implementation, this embodiment can also continuously monitor whether the number of data columns where product labels are located in the data table structure corresponding to the largest data table number in the second data table has reached a first threshold. If so, it indicates that the most recently created data table structure is about to be full, that is, the large number of product labels leads to insufficient columns in the data table structure. At this time, a new data table structure can be created.
[0116] Based on this, when the number of data columns where product tags are located in the data table structure corresponding to the largest data table number reaches a second threshold, new product tags are written into the data columns of the newly created data table structure.
[0117] The second threshold is greater than the first threshold.
[0118] That is to say, in this embodiment, it is continuously monitored whether the remaining columns for storing product labels in the data table structure are insufficient. If insufficient, a new data table structure is created in advance. After the remaining columns are filled, the new product labels that need to be written are written into the corresponding data columns in the newly created data table structure. Therefore, by creating a new data table structure in advance, delays in writing product labels can be avoided, thereby improving the writing efficiency of label values.
[0119] In one implementation, the processing instruction may be an instruction to write a second tag for the second product into the data table structure.
[0120] Based on this, when processing the tag value in the data table structure in step 302, it can be implemented in the following ways, such as Figure 5 As shown in:
[0121] Step 501: query the tag source of the second tag from the first data table. If the tag source indicates that the second tag is a custom tag, execute step 502; if the tag source indicates that the second tag is a tag mapped to product attributes, execute step 503.
[0122] Step 502: according to the tag type of the second tag, perform a value check on the tag value of the second tag to obtain a check result; in response to the check result, perform a write operation on the second tag.
[0123] Specifically, the tag type of the second tag may be a value list type or a value range type. In this embodiment, the tag value of the second tag may be checked for accuracy according to the tag type, for example, whether the tag value of the second tag of the value list type is in the value list, and whether the tag value of the second tag of the value range type is between the maximum value and the minimum value of the value range, thereby obtaining a verification result. If the verification result indicates that the value verification has passed, such as the tag value is in the value list or between the maximum value and the minimum value of the value range, then a write operation may be performed on the second tag.
[0124] The writing operation is performed on the second tag, including the following process:
[0125] First, query the data table number and data column number corresponding to the second label in the second data table; then, determine the cell corresponding to the second product in the data column corresponding to the data column number queried in the data table structure corresponding to the queried data table number; finally, write the label value of the second label in the cell corresponding to the second product.
[0126] Step 503: query the product attribute corresponding to the second tag and its corresponding processing type from the third data table; process the attribute value of the product attribute corresponding to the second tag according to the processing type corresponding to the product attribute to obtain the tag value of the second tag; and perform a write operation on the second tag.
[0127] The writing operation is performed on the second tag, including the following process:
[0128] First, query the data table number and data column number corresponding to the second label in the second data table; then, determine the cell corresponding to the second product in the data column corresponding to the data column number queried in the data table structure corresponding to the queried data table number; finally, write the label value of the second label in the cell corresponding to the second product.
[0129] Based on this, in this embodiment, based on the second data table, the data table structure and data column where the second tag is located can be located, and then the tag value of the second tag can be written into the cell corresponding to the second product in the data column to realize the writing processing of the existing tag value.
[0130] In one implementation, the processing instruction may be an instruction to update the tag value of a third tag; the third tag is a tag mapped to a product attribute, and the processing instruction is generated when it is monitored that the attribute value of the first attribute corresponding to the third tag in the third product and the tag value corresponding to the third tag in the third product meet a matching exception condition.
[0131] Specifically, in this embodiment, the attribute value of each product attribute of each target product is continuously monitored. If the label value of the product label mapped to an attribute value satisfies the matching exception condition, it indicates that the attribute value has changed. At this time, the label value needs to be updated accordingly, thereby generating a processing instruction, which instructs the update of the label value of the third label corresponding to the first attribute of the product attribute with the changed attribute value.
[0132] Among them, the matching abnormal condition can be: the correspondence between the attribute value and the label value does not match the mapping relationship, that is, the correspondence between the attribute value of the first attribute and the label value of the third label mapped by the first attribute does not satisfy the processing type represented by the mapping relationship. In a specific implementation, the matching abnormal condition can be simplified to: the attribute value of the first attribute changes relative to the attribute value of the previous record.
[0133] Based on this, when processing the tag value in the data table structure in step 302, it can be implemented in the following ways, such as Figure 6 As shown in:
[0134] Step 601: Query the processing type corresponding to the first attribute from the third data table.
[0135] The processing type represents a processing algorithm for obtaining the tag value of the corresponding product tag based on the attribute value of the product attribute. Different product attributes may have the same or different processing types for obtaining the tag value of the corresponding product tag. For example, the tag value of the product tag mapped by the product attribute may be calculated according to different calculation methods for the attribute value to obtain the tag value of the product tag.
[0136] Specifically, the mapping relationship between the product label and the product attribute recorded in the third data table can characterize the processing method of processing the attribute value of the product attribute to obtain the label value of the product label. In this embodiment, the corresponding mapping relationship can be queried in the third data table according to the first attribute whose attribute value changes, and then the corresponding processing type can be determined.
[0137] Step 602: Process the attribute value of the first attribute according to the processing type corresponding to the first attribute to obtain a label value of the third label.
[0138] The attribute value of the first attribute in step 602 is the attribute value after the first attribute is changed.
[0139] Step 603: Query the data table number and data column number corresponding to the third tag in the second data table.
[0140] Step 604: Determine the cell corresponding to the third product in the data column corresponding to the data column number found in the data table structure corresponding to the found data table number.
[0141] Specifically, in this embodiment, in the data column corresponding to the data column number queried in the data table structure corresponding to the queried data table number, the cell corresponding to the third product can be located in the data column according to the product number of the third product.
[0142] Step 605: Write the tag value of the third tag in the cell corresponding to the third product.
[0143] The cell corresponding to the third product in step 605 refers to the cell corresponding to the third product in the data column corresponding to the data column number queried in the data table structure corresponding to the data table number queried in step 603 .
[0144] Based on this, in this embodiment, the processing type of the first attribute whose attribute value has changed can be determined according to the mapping relationship recorded in the third data table, and then the label value of the mapped third label can be calculated according to the processing type, and then the label value can be written into the corresponding cell in the data table structure, thereby achieving value synchronization from the attribute value of the product attribute to the label value of the product label.
[0145] In one implementation, the processing instruction may be an instruction to add a fourth product to the data table structure. The fourth product may be a newly added product of the current project. Specifically, in this embodiment, a product data table is configured, and the product data table records the currently processed product. If there is a newly added product, the product number of the newly added product is recorded in the product data table. If a product is removed from the shelf, the product number of the removed product can be deleted from the product data table. Based on this, in this embodiment, the product data table can be monitored, and if there is a newly added product, the corresponding processing instruction is generated.
[0146] Among them, when the tag value in the data table structure is processed in step 302, it can be implemented in the following ways, such as Figure 7 As shown in:
[0147] Step 701: Add a row corresponding to the fourth product in the data table structure.
[0148] Specifically, in this embodiment, a row corresponding to the fourth product may be added to each data table structure.
[0149] Step 702: Write the label value of each product label corresponding to the fourth product into the cell corresponding to the product label in the row corresponding to the fourth product.
[0150] In one implementation, in this embodiment, the label source of each product label can be determined from the first data table. Based on the label source, if the product label is a custom label, the label value of the product label corresponding to the fourth product can be set according to the maximum value and the minimum value of the value list or the value range; if the product label is a label mapped by product attributes, the label value of the product label corresponding to the fourth product can be obtained in the following manner:
[0151] First, query the processing type corresponding to the product attribute of the fourth product mapped by the product tag from the third data table; then, according to the processing type corresponding to the product attribute of the fourth product mapped by the product tag, process the attribute value of the product attribute of the fourth product mapped by the product tag to obtain the label value of the product tag corresponding to the fourth product.
[0152] Based on this, in this embodiment, the label value of each product label corresponding to the fourth product is written into the cell corresponding to the product label in the row corresponding to the fourth product in the corresponding data table structure, thereby realizing the writing process of the label value of the newly added product.
[0153] In one implementation, the processing instruction may be an instruction to instruct to delete the fifth product from the data table structure. Specifically, in this embodiment, a product data table is configured, and the product data table records the currently processed product. If there is a new product, the product number of the new product is recorded in the product data table. If a product is removed from the shelf, the product number of the removed product can be deleted from the product data table. Based on this, in this embodiment, the product data table can be monitored, and if there is a product removed from the shelf, a corresponding processing instruction is generated.
[0154] Based on this, when processing the tag value in the data table structure in step 302, the row corresponding to the fifth product is deleted from the data table structure, thereby achieving the deletion processing of the tag value of the removed product.
[0155] refer to Figure 8 , is a schematic diagram of a structure of a processing device for recording a data table structure of product feature information provided in an embodiment of the present application, and the device can be configured in an electronic device capable of data processing, such as a mobile phone, a tablet device, a notebook, a computer or a server, etc. The technical solution in this embodiment is mainly used to record and process product feature information, i.e., product tags, while ensuring the scalability of the table and reducing the amount of table data.
[0156] Specifically, the device may include the following units:
[0157] Table acquisition unit 801, used to obtain a data table structure for recording tag values; the data table structure corresponds to a first data table, a second data table and a third data table; the data table structure includes: at least one row; each row includes at least one column;
[0158] Among them, each row in the data table structure corresponds to a target product; each column in the data table structure corresponds to a product label; each cell in each column in the data table structure is used to record the label value of the corresponding product label corresponding to each target product; the first data table is used to record the label parameters corresponding to the product label, and the label parameters at least include the label source, and the label source indicates that the product label is a custom label or a label mapped with the product attribute; the second data table is used to record the data table number and data column number corresponding to the label value of each product label, the data table number is used to indicate the data table structure where the product label is located, and the data column number table is used to indicate the data column where the product label is located in the data table structure where it is located; the third data table is used to record the mapping relationship between the product label and the product attribute according to the label source.
[0159] The table processing unit 802 is used to process the label value in the data table structure according to the first data table, the second data table and the third data table in response to the processing instruction.
[0160] By means of the above technical scheme, in a processing device for recording product characteristic information of a data table structure provided by the present application, the method of recording product characteristic information is improved, specifically: each row in the data table structure corresponds to a target product, and each column corresponds to a product label, so that each cell in each column in the data table structure is used to record the label value of the corresponding product label corresponding to each target product, and the data table structure corresponds to three data tables: a first data table for recording label parameters corresponding to product labels, a second data table for recording data table numbers and data column numbers corresponding to the label values of each product label, and a third data table for recording the mapping relationship between product labels and product attributes, so that the label values in the data table structure can be processed based on these three data tables. It can be seen that in the present application, by improving the structure of the table for recording the label values of product labels, the product characteristic information is recorded in the form of horizontal labels, and the problem of excessive table data volume caused by the vertical table is avoided. In addition, in the present application, the label value processing can be performed based on the information recorded in the three data tables corresponding to the data table structure, which is convenient for realizing the operability of the label value, thereby ensuring the scalability of the table.
[0161] In one implementation, the processing instruction is an instruction to add a first tag to the first product, and the second data table is further used to record a tag state corresponding to each of the product tags, wherein the tag state indicates whether the corresponding product tag is in an activated state;
[0162] Among them, the table processing unit 802 is specifically used to: query in the second data table whether there is a data column number and a corresponding data table number corresponding to a product tag whose tag status represents that it is not in the startup state; if there is a data column number corresponding to a product tag whose tag status represents that it is not in the startup state, write the tag value corresponding to the first tag on the first product into the cell corresponding to the first product in the data column corresponding to the queried data column number in the data table structure corresponding to the queried data column number; if there is no data column number corresponding to the product tag whose tag status represents that it is not in the startup state, write the tag value corresponding to the first tag on the first product into the corresponding data table structure according to the largest data table number and the corresponding largest data column number in the second data table; in the second data table, record that the tag status corresponding to the first tag is the startup state.
[0163] Based on the above implementation, the table processing unit 802 is also used to: monitor whether the number of data columns where the product labels are located in the data table structure corresponding to the largest data table number in the second data table reaches a first threshold, and if so, create a new data table structure; wherein, when the number of data columns where the product labels are located in the data table structure corresponding to the largest data table number reaches a second threshold, the new product label is written into the data column of the newly created data table structure; and the second threshold is greater than the first threshold.
[0164] Among them, when the table processing unit 802 queries in the second data table whether there is a data column number and a corresponding data table number corresponding to a product tag whose tag status represents that it is not in the startup state, it is specifically used to: in the second data table, starting from the smallest data table number and the smallest data column number, query whether there is a data column number and a corresponding data table number corresponding to a product tag whose tag status represents that it is not in the startup state.
[0165] In one implementation, the processing instruction is an instruction to write a second tag for a second product into the data table structure;
[0166] The table processing unit 802 is specifically used for: querying the tag source of the second tag from the first data table; when the tag source indicates that the second tag is a custom tag, performing a value check on the tag value of the second tag according to the tag type of the second tag to obtain a check result; in response to the check result, performing a write operation on the second tag; when the tag source indicates that the second tag is a tag mapped to a product attribute, querying the product attribute corresponding to the second tag and its corresponding processing type from the third data table; processing the attribute value of the product attribute corresponding to the second tag according to the processing type corresponding to the product attribute to obtain the tag value of the second tag; performing a write operation on the second tag;
[0167] Among them, performing a write operation on the second tag includes: querying the data table number and data column number corresponding to the second tag in the second data table; determining the cell corresponding to the second product in the data column corresponding to the data column number queried in the data table structure corresponding to the queried data table number; and writing the tag value of the second tag in the cell corresponding to the second product.
[0168] In one implementation, the processing instruction is an instruction to update the tag value of the third tag; the third tag is a tag mapped to a product attribute, and the processing instruction is generated when it is monitored that the attribute value of the first attribute corresponding to the third tag in the third product and the tag value of the third tag corresponding to the third product meet a matching exception condition;
[0169] Among them, the table processing unit 802 is specifically used to: query the processing type corresponding to the first attribute from the third data table; process the attribute value of the first attribute according to the processing type corresponding to the first attribute to obtain the label value of the third label; query the data table number and data column number corresponding to the third label in the second data table; determine the cell corresponding to the third product in the data column corresponding to the data column number queried in the data table structure corresponding to the queried data table number; write the label value of the third label in the cell corresponding to the third product.
[0170] In one implementation, the processing instruction is an instruction to add a fourth product to the data table structure;
[0171] Among them, the table processing unit 802 is specifically used to: add a row corresponding to the fourth product in the data table structure; write the label value of each product label corresponding to the fourth product into the cell corresponding to the product label in the row corresponding to the fourth product.
[0172] In one implementation, the processing instruction is an instruction to delete the fifth product from the data table structure;
[0173] The table processing unit 802 is specifically used to delete the row corresponding to the fifth product from the data table structure.
[0174] It should be noted that the specific implementation method of each unit in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.
[0175] The present application also provides an electronic device, which may include the following structure:
[0176] Memory, used to store computer programs and data generated by the operation of computer programs;
[0177] A processor is used to execute a computer program to implement a method for processing a data table structure for recording product feature information as described in any one of the embodiments of the present application.
[0178] refer to Fig. 9 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include but is not limited to fixed terminals such as mobile phones, notebook computers, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Fig. 9 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0179] like Fig. 9 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0180] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a memory card, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig. 9An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0181] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements a processing method for a data table structure for recording product feature information provided in any one of the embodiments of the present application.
[0182] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When one or more computer programs are executed by an electronic device, the electronic device can implement any processing method of a data table structure for recording product feature information provided in an embodiment of the present application.
[0183] Taking the bank's financial products as an example, the technical solution of this application is described in detail below:
[0184] This application designs a setting scheme for financial product feature information, including the following components:
[0185] Data model component: a specific data model used to describe the value setting of financial product feature information and is called by other components, including: a label parameter model that describes label parameters (i.e., the first data table in the previous text), a product label value field sub-table relationship model that describes which data table the product value is stored in under a certain label (i.e., the second data table in the previous text), a label and product attribute mapping relationship model that describes which product attribute the attribute conversion label corresponds to (i.e., the third data table in the previous text), and a product label value model that describes the relationship between product and label values (i.e., the data table structure in the previous text, which can also be called the fourth data table). The interactive relationship between data models is as follows: Fig.10 as shown in .
[0186] Among them, the product tag value model obtains the tag source from the tag parameter model, obtains the sub-table number (i.e. the data table number in the previous article) and column number (i.e. the data column number in the previous article) corresponding to the tag value from the product tag value field sub-table relationship model, and obtains the product attribute corresponding to the tag from the tag and product attribute mapping relationship model; and the tag and product attribute mapping relationship model obtains the tag ID (IDentity) i.e. the tag number from the tag parameter model; the product tag value field sub-table relationship model obtains the tag ID from the tag parameter model.
[0187] Product tag value field assignment component: used to set up tag sub-tables in the product tag value field sub-table relationship model, and can also query sub-table relationships. Specifically, it can assign the value information (i.e. tag value) of a product under a certain tag to be recorded in which field of which product tag value sub-table. After completing the value field assignment, this information can be used to set tag values for products.
[0188] Product tag value recording component: used to query the tag value field sub-table number and column number from the product tag value field sub-table relationship model, query the tag source from the tag parameter model, query the product attribute corresponding to the tag from the tag and product attribute mapping relationship model, and record the product value information of a certain tag to the product tag value model, and store it in the database server.
[0189] Product attribute conversion label value (timing) synchronization component: Due to the real-time changes in product data, products are added and deleted at all times, and the product attribute information is also constantly changing. The definition of some labels is derived from product attributes, and the product value information under the label depends on the product attribute value. Therefore, a timing processing component can be used to regularly clear the product label value information of deleted products according to the set time. At the same time, for labels that depend on product attributes, the values under the label should be added for new products. These values are derived from the product attribute values; for products whose product attribute values (i.e. attribute values) have changed, their value information under these labels should be synchronized. From the perspective of product maintenance and the maintenance of product label value relationships, the product attribute conversion label value synchronization component can be divided into a product addition and deletion timing synchronization component and a product label value timing synchronization component. The product addition and deletion timing synchronization component is responsible for processing new or deleted products; the product label value timing synchronization component is responsible for synchronizing changes in product attribute values.
[0190] Attribute conversion label value processing component: When setting the value of the attribute conversion label, you can retrieve the corresponding product attribute value. Since the product attribute that the attribute conversion label depends on may exist in multiple different product attribute data tables, different processing components are set based on the data table where the product is located, such as component 1, 2, 3, etc. At the same time, the product label value setting and the comparison of product label value with product attributes and other functions must be completed in the processing component.
[0191] Fig.10 The calling relationship between each data model and each component can be referred to Fig.11 as shown in .
[0192] in, Fig.11 The specific design scheme of each component is as follows:
[0193] (1) Data model component design:
[0194] ① Design of label parameter model:
[0195] like Fig.12 The following is the label parameter information structure LabelInfo, which includes label ID (labelId), label meaning (namLabel), label type (labelType) such as list label (i.e., value list type in the previous text) or range label (i.e., value range type in the previous text), label source (labelStd), label value list (valLst), label value minimum value (valMin), label value maximum value (valMax), etc., all of which are of String type. Labels can be divided into list labels and range labels, which are distinguished by label type. The value domain of list labels is defined in the label value list, and the value range of range labels is defined in the label value range. The label source is used to identify the label as a custom label or an attribute conversion label.
[0196] ②Design of product tag value field sub-table relational model:
[0197] like Fig.13 The following is the label table definition structure LabelTableMap, which includes label ID (labelId), table number (tableNum), column number (colNum), and enable flag (indEnb) (i.e., the startup status mentioned above), all of which are of String type. The combination of table number and column number can determine which field of the product label value data table the product value information under the label is stored in. The enable flag can identify the enable status of the label. If a label is no longer enabled, the table number and column number where its value information is located can be used by other labels.
[0198] ③ Design of label and product attribute mapping relationship model:
[0199] like Fig.14 The following is a label special processing definition structure LabelProRln, which includes the attribute name (proId), label ID (labelId), and processing type (handleType), all of which are String types. The attribute name indicates which product attribute the label value depends on, and the processing type indicates which processor is selected when the product label value is synchronized regularly.
[0200] ④Product label value model design:
[0201] like Fig.15The product tag value structure TarfLabelRln is shown, including product ID (numTarfPrc), value column 1 to value column 200 (col1 to col200), all of which are String type. Each product tag value data table is designed to retain 200 value columns, and a data table can store a product's value information under 200 tags at most.
[0202] (2) Product label value field allocation component design:
[0203] When adding a new tag, the component will retrieve the sub-table relationship model of the product tag value field, starting from the smallest sub-table number and the smallest column number, query the sub-table number and column number assigned to the existing tag, and traverse the sub-table number and column number assigned to the existing tag to see if they are enabled. When a tag is retrieved and the activation mark under a certain column in a certain sub-table is not enabled, the product tag value of the newly added tag is segmented and assigned to the column of the table. If the unenabled data column is not retrieved, the next column number of the maximum column number of the current largest sub-table is assigned to the new tag based on the current maximum sub-table number and column number. The specific process is as follows: Fig.16 shown.
[0204] Since each sub-table can have a maximum of 200 labels, when the product label value table with the largest sub-table number has only 20 fields left to use, a new data table needs to be created according to the current largest sub-table number.
[0205] (3) Product tag value recording component design:
[0206] According to the definition and source of the tag, the tag can be divided into custom tags and attribute conversion tags (that is, tags mapped to product attributes). For custom tags, when setting the value of the product under the tag, if the tag value is a list type, the value should be within the value range; if it is a range type, the value should be within the maximum and minimum range. After the tag value is determined, the relationship between the product and the tag is recorded by retrieving the subtable and column number where the tag value is located. For attribute conversion tags, since their values depend on product attributes, when the product sets the attribute conversion tag value, it is necessary to retrieve the product attribute value corresponding to the tag based on the mapping relationship between the tag and the product attribute value, and record their relationship. The specific process is as follows: Fig.17 As shown, first determine whether it is a custom tag. If so, then determine whether it is a list type tag or a range type tag. If it is a list type tag, then check whether the product tag value is in the tag value list. If it is a range type tag, then check whether the product tag value is in the tag value range. If it is not a custom tag, then query the tag attribute value mapping relationship and query the product attribute value. Finally, query the product tag value table number and column number where the tag value character is located to facilitate tag value writing.
[0207] (4) Design of attribute conversion tag value timing synchronization component:
[0208] ①Design plan for adding and deleting timing synchronization components of products:
[0209] When the trigger time of the scheduled task arrives, the relevant processing program is called up. The program will first retrieve all the data in the label and product attribute mapping table, record the correspondence between the label and the product attribute, and the attribute conversion label value processing component used. Then retrieve the newly added product data in the system, process each newly added product, traverse the labels that need to be set with values, and use the corresponding attribute conversion label value processing component. When processing in the component, it will first query the value information of the product attributes, and then record it as the label value. When all attribute conversion labels have been processed, it will check whether there are any non-existent products in the current product attribute value table. If so, the label value data of the product will be cleared. The specific process is as follows: Fig.18 As shown, first query the label and product attribute mapping relationship table, then record the corresponding relationship between the label and product attribute and the processing module (i.e., processing component) used, and after retrieving the newly added product, traverse the newly added product, specifically traverse the attribute conversion label, for each attribute conversion label, call the attribute conversion label value processing component, query the product attribute value, set the product label value according to the product attribute value and record it; after the traversal is completed, query whether there is a product in the label value model that does not exist in the relative product data table, if so, delete the product label value.
[0210] ②Design of label value synchronization component:
[0211] When the product addition and deletion timing synchronization component block is processed, the label value synchronization component will run. This component will also retrieve all the data in the label label and product attribute mapping table, record the correspondence between the label and the product attribute, and the attribute conversion label value processing component used. Then it will retrieve all the data in the product label value table and process each product. Traverse the labels that need to be synchronized and use the corresponding label attribute value processing component. When processing in the component, it will first query the value information of the product attributes, and then compare the product attribute values with the product label values. If they are inconsistent, the product label value will be modified to the product attribute value and recorded. The specific process is as follows Fig.19As shown, first query the label and product attribute mapping relationship model, record the corresponding relationship between the label and the product attribute and the processing module (i.e., processing component) used, then query the product label value model, traverse the product label values, specifically: traverse each attribute conversion label, call the attribute conversion label processing component for each attribute conversion label to query the product attribute value, and then compare the product attribute value with the product label value to see if they match. If they do not match, set the product label value according to the product attribute value and record it.
[0212] In summary, the data models designed in this application: label parameter model, product label value field sub-table relationship model, label and product attribute mapping relationship model, product label value model can cover the need to store label information and product label attribute values, and avoid designing the product label value table as a vertical table when designing the data table, which greatly reduces the amount of data that increases due to the increase in labels. At the same time, combined with the product label value sub-table allocation component and the product label value recording component, it can automatically complete the allocation of label value fields in the product label value table and recycle unused fields to avoid invalid information recorded in the data table field; at the same time, it can be fully compatible with the value settings of custom labels and attribute conversion labels from two different sources. Using the product addition and deletion timing synchronization component and the attribute conversion label value synchronization component in the attribute conversion label value timing synchronization component, it is possible to set the timing task trigger time according to the specific usage scenario, and synchronize the addition of products, product deletions, and changes in product attribute values to the product label value information in a timely manner to ensure the accuracy of the product label value information. The information in the product label value table can be directly used to display the product label view and describe the relevant features of the product.
[0213] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0214] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0215] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0216] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A data table structure for recording product feature information, characterized in that: The data table structure includes: At least one row; each row contains at least one column; Wherein, each row in the data table structure corresponds to a target product; each column in the data table structure corresponds to a product tag; each cell in each column in the data table structure is used to record the tag value of the corresponding product tag corresponding to each target product; The data table structure corresponds to a first data table, a second data table and a third data table; the first data table, the second data table and the third data table are used to process the label values in the data table structure; The first data table is used to record label parameters corresponding to the product label, wherein the label parameters at least include a label source, and the label source indicates that the product label is a custom label or a label mapped to a product attribute; The second data table is used to record the data table number and data column number corresponding to the tag value of each product tag, the data table number is used to indicate the data table structure where the product tag is located, and the data column number table is used to indicate the data column where the product tag is located in the data table structure where the product tag is located; The third data table is used to record the mapping relationship between the product label and the product attribute according to the label source.
2. A method for processing a data table structure for recording product feature information, characterized in that: The method comprises: Obtain a data table structure for recording tag values; the data table structure corresponds to a first data table, a second data table and a third data table; the data table structure includes: at least one row; each row includes at least one column; Wherein, each row in the data table structure corresponds to a target product; each column in the data table structure corresponds to a product label; each cell in each column in the data table structure is used to record the label value of the corresponding product label corresponding to each target product; the first data table is used to record the label parameters corresponding to the product label, and the label parameters at least include the label source, and the label source indicates that the product label is a custom label or a label mapped with a product attribute; the second data table is used to record the data table number and data column number corresponding to the label value of each product label, and the data table number is used to indicate the data table structure where the product label is located, and the data column number table is used to indicate the data column where the product label is located in the data table structure where the product label is located; the third data table is used to record the mapping relationship between the product label and the product attribute according to the label source; In response to the processing instruction, the tag values in the data table structure are processed according to the first data table, the second data table and the third data table.
3. The method according to claim 2, characterized in that The processing instruction is an instruction to instruct to add a first tag to the first product, and the second data table is also used to record the tag status corresponding to each of the product tags, and the tag status represents whether the corresponding product tag is in an activated state; The tag value in the data table structure is processed, including: In the second data table, query whether there is a data column number corresponding to a product tag whose tag status indicates that the tag is not in the startup state and its corresponding data table number; If there is a data column number corresponding to a product label that has a label status indicating that the label is not in the start-up state, write the label value corresponding to the first label on the first product into a cell corresponding to the first product in the data column corresponding to the queried data column number in the data table structure corresponding to the queried data column number; If there is no data column number corresponding to the product tag that does not exist in the tag status representation and is not in the startup state, write the tag value corresponding to the first tag on the first product into the corresponding data table structure according to the largest data table number in the second data table and its corresponding largest data column number; In the second data table, it is recorded that the tag state corresponding to the first tag is the start state.
4. The method according to claim 3, characterized in that The method further comprises: monitoring whether the number of data columns where the product labels are located in the data table structure corresponding to the largest data table number in the second data table reaches a first threshold, and if so, creating a new data table structure; Among them, when the number of data columns where the product tags are located in the data table structure corresponding to the largest data table number reaches a second threshold, the new product tags are written into the data columns of the newly created data table structure; the second threshold is greater than the first threshold.
5. The method according to claim 3, characterized in that: In the second data table, querying whether there is a data column number corresponding to a product tag whose tag status indicates that it is not in the startup state and its corresponding data table number includes: In the second data table, starting from the smallest data table number and the smallest data column number, it is queried whether there is a data column number and a corresponding data table number corresponding to a product tag whose tag status indicates that it is not in the start-up state.
6. The method according to claim 2, characterized in that The processing instruction is an instruction to write a second label for a second product into the data table structure; The tag value in the data table structure is processed, including: Querying the tag source of the second tag from the first data table; In the case where the tag source indicates that the second tag is a custom tag, performing a value check on the tag value of the second tag according to the tag type of the second tag to obtain a check result; and performing a write operation on the second tag in response to the check result; In the case where the tag source indicates that the second tag is a tag mapped to a product attribute, querying the product attribute corresponding to the second tag and the corresponding processing type from the third data table; processing the attribute value of the product attribute corresponding to the second tag according to the processing type corresponding to the product attribute to obtain a tag value of the second tag; and performing a write operation on the second tag; Among them, performing a write operation on the second tag includes: querying the data table number and data column number corresponding to the second tag in the second data table; determining the cell corresponding to the second product in the data column corresponding to the data column number queried in the data table structure corresponding to the queried data table number; and writing the tag value of the second tag in the cell corresponding to the second product.
7. The method according to claim 2, characterized in that The processing instruction is an instruction to update the tag value of the third tag; the third tag is a tag mapped to a product attribute, and the processing instruction is generated when it is detected that the attribute value of the first attribute corresponding to the third tag in the third product and the tag value of the third tag corresponding to the third product meet a matching exception condition; The tag value in the data table structure is processed, including: querying the processing type corresponding to the first attribute from the third data table; Processing the attribute value of the first attribute according to the processing type corresponding to the first attribute to obtain a label value of the third label; Query the data table number and data column number corresponding to the third tag in the second data table; Determine the cell corresponding to the third product in the data column corresponding to the data column number queried in the data table structure corresponding to the queried data table number; In the cell corresponding to the third product, the tag value of the third tag is written.
8. The method according to claim 2, characterized in that The processing instruction is an instruction to add a fourth product to the data table structure; The tag value in the data table structure is processed, including: Adding a row corresponding to the fourth product in the data table structure; The label value of each product label corresponding to the fourth product is written into the cell corresponding to the product label in the row corresponding to the fourth product.
9. The method according to claim 2, characterized in that: The processing instruction is an instruction to delete the fifth product from the data table structure; The tag value in the data table structure is processed, including: The row corresponding to the fifth product is deleted from the data table structure.
10. A processing device for a data table structure recording product characteristic information, characterized in that: The device comprises: A table obtaining unit, used to obtain a data table structure for recording tag values; the data table structure corresponds to a first data table, a second data table and a third data table; the data table structure includes: at least one row; each row includes at least one column; Wherein, each row in the data table structure corresponds to a target product; each column in the data table structure corresponds to a product label; each cell in each column in the data table structure is used to record the label value of the corresponding product label corresponding to each target product; the first data table is used to record the label parameters corresponding to the product label, and the label parameters at least include the label source, and the label source indicates that the product label is a custom label or a label mapped with a product attribute; the second data table is used to record the data table number and data column number corresponding to the label value of each product label, and the data table number is used to indicate the data table structure where the product label is located, and the data column number table is used to indicate the data column where the product label is located in the data table structure where the product label is located; the third data table is used to record the mapping relationship between the product label and the product attribute according to the label source; The table processing unit is used to process the label value in the data table structure according to the first data table, the second data table and the third data table in response to the processing instruction.