Data structuring method, device, terminal and storage medium based on product attributes
By generating the attribute information configuration rules and storage tables of IoT devices, the problem of cumbersome and repetitive work of IoT device data analysis is solved, and efficient and accurate data storage and analysis is achieved.
Patent Information
- Application Number
- CN202310478999.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-04-26
AI Technical Summary
In the prior art, the attribute information data of IoT devices is large and the structure is large, which leads to cumbersome data analysis process and error-prone. Different developers need to repeatedly understand the storage methods and logic, resulting in low work efficiency and high labor costs.
By determining the attribute information of the target device, the configuration rules, attribute constraint rules and attribute validity rules are generated, the initial working file is adjusted to generate the target working file, and then the target storage table is generated and the business structured data is stored to achieve accurate storage of business data.
Reduces the repetitive workload of developers, improves work efficiency, reduces error rates, and improves data quality.
Smart Images

Figure CN116680327B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, terminal and storage medium for data organization based on product attributes. Background Art
[0002] With the development of the Internet of Things (IoT), IoT platforms are gaining access to an increasing number of IoT device attributes. To extract useful information from this vast amount of IoT device attribute information, developers need to understand the storage methods and logic of IoT devices to obtain the necessary useful information. However, due to the large amount of data and diverse structures of IoT device attribute information, the subsequent data parsing of IoT device attribute information is cumbersome and prone to errors. Furthermore, when different developers analyze IoT device attribute information, they need to repeatedly understand the attribute data storage methods and logic, resulting in duplication of work, low work efficiency, and increased labor costs.
[0003] Therefore, how to achieve data structuring more accurately and efficiently is a hot topic being studied by those skilled in the art. Summary of the Invention
[0004] The main purpose of the embodiments of the present application is to provide a data structuring method, device, terminal and storage medium based on product attributes, aiming to accurately and efficiently achieve data structuring of target data.
[0005] In a first aspect, an embodiment of the present application provides a data structuring method based on product attributes, comprising:
[0006] Determining a target device, and determining attribute information corresponding to the target device based on the target device;
[0007] Determining, based on the attribute information, configuration rules, attribute constraint rules, and attribute validity rules between the attribute information, wherein the configuration rules are used to determine the data storage location of the attribute information, the attribute constraint rules are used to represent the conditions under which the attribute information is mutually constrained, and the attribute validity rules are used to represent the valid range of the attribute value of the attribute information;
[0008] generating an initial working file corresponding to the target device according to the attribute information, and adjusting the initial working file according to the configuration rule, the attribute constraint rule, and the attribute validity rule to obtain a target working file;
[0009] generating a target storage table corresponding to data storage of the attribute information in the target device according to the target working file;
[0010] Obtaining business data corresponding to the target device, and determining business structured data corresponding to the business data according to the target work file;
[0011] The business structured data is stored in the corresponding target storage table according to the target work file, thereby realizing the structuring of the business data.
[0012] In a second aspect, an embodiment of the present application further provides a data structuring device based on product attributes, comprising:
[0013] A data determination module, configured to determine a target device and determine attribute information corresponding to the target device based on the target device;
[0014] a rule determination module, configured to determine, based on the attribute information, configuration rules, attribute constraint rules, and attribute validity rules between the attribute information, wherein the configuration rules are used to determine the data storage location of the attribute information, the attribute constraint rules are used to represent the conditions under which the attribute information is mutually constrained, and the attribute validity rules are used to represent the valid range of the attribute value of the attribute information;
[0015] a data configuration module, configured to generate an initial working file corresponding to the target device according to the attribute information, and adjust the initial working file according to the configuration rules, the attribute constraint rules, and the attribute validity rules to obtain a target working file;
[0016] A generating module, configured to generate a target storage table corresponding to the attribute information in the target device when performing data storage according to the target working file;
[0017] A data processing module, configured to obtain business data corresponding to the target device and determine business structured data corresponding to the business data according to the target work file;
[0018] The data storage module is used to store the business structured data into the corresponding target storage table according to the target work file, thereby realizing the structuring of the business data.
[0019] In a third aspect, an embodiment of the present application further provides a terminal device, the terminal comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any one of the data structuring methods based on product attributes provided in the specification of this application are implemented.
[0020] In a fourth aspect, an embodiment of the present application further provides a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any product attribute-based data structuring method provided in the specification of this application.
[0021] The present application provides a data structuring method, apparatus, terminal device, and storage medium based on product attributes, wherein the method includes determining a target device and, based on the target device, determining that the target device can obtain attribute information of a target object; then, analyzing the attribute information to obtain configuration rules, attribute constraint rules, and attribute validity rules between the attribute information, wherein the configuration rules are used to determine the data storage location of the attribute information, the attribute constraint rules are used to characterize the conditions under which the attribute information is mutually constrained, and the attribute validity rules are used to characterize the valid range of the attribute values of the attribute information; thereby, firstly generating an initial working file corresponding to the target device based on the attribute information, and then adjusting the initial working file based on the configuration rules, the attribute constraint rules, and the attribute validity rules to obtain a target working file corresponding to the target device; the target working file is used to process the attribute information of the target device for structuring and storing the corresponding structured results in a corresponding location; after obtaining the target working file, firstly generating a target storage table corresponding to the data storage of the attribute information in the target device based on the target working file; then, after obtaining business data corresponding to the target device, performing structured processing based on the target working file to obtain business structured data; thereby, storing the business structured data in the corresponding target storage table, thereby achieving structuring of the business data and accurate storage of the business structured data. The target work file is then used to solve the existing problem of repeatedly setting the storage method and storage logic of attribute information when collecting attribute information related to IoT devices, thereby reducing the repetitive work content of developers and simplifying the process, thereby reducing labor costs while improving the work efficiency of developers, and better reducing the error rate in attribute information processing, and improving the data quality after attribute analysis of attribute information related to IoT devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0023] Figure 1 A flowchart of a data structuring method based on product attributes provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of the steps of a data structuring method based on product attributes provided in an embodiment of the present application;
[0025] Figure 3 for Figure 2 A flowchart of steps corresponding to a specific implementation of step S2;
[0026] Figure 4 A schematic diagram of the module structure of a data structuring device based on product attributes provided in an embodiment of the present application;
[0027] Figure 5 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0029] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0030] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0031] With the development of the Internet of Things (IoT), more and more IoT device attribute information is being reported to IoT platforms. For example, in KaiHong HyperTerminal, various IoT device log data is stored in an ElasticSearch database for subsequent data analysis. However, the data stored in the ElasticSearch database is mostly in string format, which is not convenient for subsequent data mining and analysis. Therefore, it is necessary to parse the data stored in the ElasticSearch database before performing mining and analysis.
[0032] To analyze IoT device data, existing developers need to understand the storage methods and logic behind the structured data. This allows them to accurately store the parsed data in the correct location. Consequently, when structuring IoT device attribute information and storing it, developers must repeatedly understand the storage methods and logic for each attribute, leading to duplication of effort and low efficiency. Furthermore, after analyzing the storage methods and logic for different IoT devices, developers must also perform data parsing on the attribute information, a cumbersome and error-prone process.
[0033] The present invention provides a method, apparatus, terminal, and storage medium for data structuring based on product attributes. The method can be applied to a terminal device, such as a tablet computer, a laptop computer, a personal digital assistant, a wearable device, or a server, wherein the server can be a standalone server or a server cluster.
[0034] Among them, the embodiments of the present application provide a data structuring method, device, terminal and storage medium based on product attributes, wherein the method includes determining a target device and determining, based on the target device, that the target device can obtain attribute information of a target object; then, analyzing the attribute information to obtain configuration rules, attribute constraint rules, and attribute validity rules between the attribute information, wherein the configuration rules are used to determine the data storage location of the attribute information, the attribute constraint rules are used to characterize the conditions under which the attribute information is mutually constrained, and the attribute validity rules are used to characterize the valid range of the attribute value of the attribute information; thereby, firstly generating an initial working file corresponding to the target device based on the attribute information, and then adjusting the initial working file based on the configuration rules, attribute constraint rules, and attribute validity rules to obtain a target working file corresponding to the target device; the target working file is used to process the attribute information of the target device for structuring and storing the corresponding structured results in the corresponding location; after obtaining the target working file, firstly generating a target storage table corresponding to the data storage of the attribute information in the target device based on the target working file; then, after obtaining the business data corresponding to the target device, performing structured processing based on the target working file to obtain business structured data; thereby, storing the business structured data in the corresponding target storage table, thereby achieving structuring of the business data and accurate storage of the business structured data. The target work file is then used to solve the problem of repeatedly setting the storage method and storage logic of attribute information when collecting attribute information related to IoT devices. This can reduce the repetitive work content of developers, simplify the process, and thus improve the work efficiency of developers while reducing labor costs. It also better reduces the error rate when processing attribute information and improves the data quality after attribute analysis of attribute information related to IoT devices. Among them, the flow chart of the data structuring method based on product attributes is as follows Figure 1 shown.
[0035] The following embodiments of the present application are described in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0036] Please refer to Figure 2 , Figure 2 A flowchart of a data structuring method based on product attributes provided in an embodiment of the present application.
[0037] like Figure 2 As shown, the data structuring method based on product attributes includes steps S1 to S6.
[0038] Step S1: Determine a target device, and determine attribute information corresponding to the target device according to the target device.
[0039] Exemplarily, a target device is determined and attribute information of a target object that can be collected by the target device is determined.
[0040] For example, if the target device is a fitness tracker, the target object is a person, and the attribute information that the fitness tracker can collect is person-related exercise information such as heart rate, running duration, running speed, etc. If the target device is a driving recorder, the target object is a vehicle, and the attribute information that the driving recorder can collect is vehicle-related operation information such as speed, driving history, destination information, etc.
[0041] Therefore, when using the data structuring method based on product attributes, it is first necessary to determine the target device and then determine the attribute information corresponding to the target device, that is, to determine the product attributes.
[0042] Furthermore, even if the target device type is the same, the attribute information may differ. For example, if the target device type is a sports bracelet, Xiaomi's sports bracelet and Huawei's sports bracelet may obtain different target object attribute information. Therefore, it is necessary to obtain the attribute information of Xiaomi's sports bracelet and Huawei's sports bracelet separately to perform subsequent steps.
[0043] Step S2: Determine the configuration rules, attribute constraint rules, and attribute validity rules between attribute information based on the attribute information. The configuration rules are used to determine the data storage location of the attribute information. The attribute constraint rules are used to represent the conditions of mutual constraints between attribute information. The attribute validity rules are used to represent the valid range of the attribute value of the attribute information.
[0044] For example, after obtaining the attribute information collected by the target device, it is necessary to analyze the attribute information to obtain the configuration rules, attribute constraint rules, and attribute validity rules between the attribute information. Among them, the configuration rules are used to indicate the location information where the attribute information should be stored after it is structured, the attribute constraint rules are used to indicate the mutual restriction strategy between the attribute information, and the attribute validity rules are used to detect the valid range of the attribute values in the attribute information after it is structured.
[0045] For example, let's assume that the target device is A. We now have multiple attribute information for target device A, including attribute information SX1, attribute information SX2, and attribute information SX3. Triple extraction is then performed to obtain the triples x, y, and z from attribute information SX1, SX2, and SX3. The Apriori algorithm is then used to perform relationship mining on the triples x, y, and z to obtain attribute constraint rules, thereby deriving a strategy for the mutual constraints between the attribute information. Attribute constraint rules can be used to represent negative correlations, positive correlations, dependencies, and other relationships between two indicators of the target device.
[0046] For example, if the target device is a sports bracelet, then the heart rate, exercise duration, running length, and exercise speed can be obtained by obtaining the attribute information of the target object measured by the sports bracelet. Among them, the exercise speed depends on the exercise duration and running length, and the exercise speed is positively correlated with the running length, and the exercise speed is negatively correlated with the exercise duration.
[0047] Exemplarily, the attribute validity rule is used to represent the valid range of the attribute value in the attribute information after the detection attribute information is structured. For example, if the target device is a sports bracelet, then the heart rate, exercise duration, running length, and exercise speed can be obtained by obtaining the attribute information of the target object measured by the sports bracelet. Among them, the heart rate should be between 60 minutes / minute and 100 minutes / minute under normal circumstances, and the attribute validity rule corresponding to the attribute value x corresponding to the heart rate should be 60≦x≦100.
[0048] Attribute validity rules can establish a product feature set based on user needs and the functions of the product (target device), and then map it into a set of configuration parameter variables. When the attribute information of the target device obtains the corresponding parameter belonging to the configuration parameter variable, the attribute rule corresponding to the parameter is set as the corresponding attribute validity rule.
[0049] For example, after obtaining the attribute information corresponding to the target device, the attribute information needs to be stored. If the attribute information is directly stored in a database like ElasticSearch, it is not convenient for subsequent data mining and analysis. Therefore, the attribute information can be structured in combination with attribute constraint rules and stored in different tables to facilitate subsequent data analysis.
[0050] Among them, the configuration rules can not only determine the destination information (storage location information) of the attribute information, but also configure the data source information of the attribute information source, and then determine the source information of the attribute information of the target device and the destination information of the attribute information after data processing.
[0051] See also Figure 3 In some implementations, configuration rules, attribute constraint rules, and attribute validity rules between attribute information are determined based on the attribute information, and step S2 includes steps S21 to S23.
[0052] Step S21: Obtain first attribute information and second attribute information corresponding to the target device.
[0053] Step S22: Perform attribute association analysis based on the first attribute information and the second attribute information to obtain the association relationship between the attribute information.
[0054] Step S23: Determine the configuration rules, attribute constraint rules, and attribute validity rules between attribute information based on the association relationship.
[0055] For example, in order to obtain configuration rules, attribute constraint rules, and attribute validity rules of the attribute information of the target device, it is necessary to obtain multiple sets of attribute information corresponding to the target device to facilitate subsequent analysis.
[0056] First attribute information and second attribute information corresponding to the target device are obtained, and attribute association analysis is performed on the attributes contained in the target device by using the first attribute information and the second attribute information, thereby obtaining the association relationship between the attribute information.
[0057] For example, the relationship between the first attribute information data1 and the second attribute information data2 is extracted respectively to obtain the structured data in data1 and data2, and then the FP-Growth algorithm is used to analyze the structured data to obtain the association relationship between the attribute information, and then the configuration rules, attribute constraint rules and attribute validity rules between the attribute information are determined based on the association relationship.
[0058] It can be understood that the first attribute information and the second attribute information represent different attribute information collected by the target device, and obtaining the association relationship between the attribute information does not limit the number of attribute information to 2. In actual use, in order to obtain a more accurate association relationship between the attribute information, multiple attribute information should be used to obtain better results.
[0059] In some embodiments, attribute association analysis is performed based on the first attribute information and the second attribute information to obtain the association relationship between the attribute information, including: performing keyword extraction based on the first attribute information and the second attribute information to obtain attribute characteristics corresponding to the target device, and determining the feature set of the target device based on the attribute characteristics; obtaining a first attribute value corresponding to the feature set based on the first attribute information and obtaining a second attribute value corresponding to the feature set based on the second attribute information; performing association relationship analysis based on the first attribute value and the second attribute value, and then determining the association relationship between the attribute information.
[0060] Exemplarily, named entity recognition technology is used to perform keyword extraction on the first attribute information and the second attribute information to obtain attribute features corresponding to the target device, and then entity unification, data deduplication and other technologies are performed based on the attribute features to determine the feature set of the target device; the feature set is used to perform a relationship extraction model to obtain the first attribute value corresponding to the feature set from the first attribute information and the second attribute value corresponding to the feature set from the second attribute information.
[0061] For example, keyword extraction is performed on the first attribute information using named entity recognition technology to obtain keyword group A, and keyword extraction is performed on the second attribute information using named entity recognition technology to obtain keyword group B. Then, the attribute feature C corresponding to the target device is the union of keyword group A and keyword group B. The keywords in attribute feature C are then deduplicated to obtain attribute feature C1. The similarity calculation method in entity unification technology is then used to calculate the identical keywords in attribute feature C1, remove duplicate keywords, and retain one keyword to ultimately determine the feature set of the target device.
[0062] After obtaining the target device's feature set, the attribute value corresponding to each keyword in the target device's feature set is obtained based on the relationship extraction model. Specifically, the first attribute value corresponding to the feature set in the first attribute information and the second attribute value corresponding to the feature set in the second attribute information are obtained. This structured data of the first and second attribute information can then be obtained. The first and second attribute values can then be used to analyze the association relationship and determine the association relationship between the attribute information.
[0063] For example, the feature set of the target device includes keyword 1, keyword 2, and keyword 3. The relationship extraction model extracts the first attribute value 1, first attribute value 2, and first attribute value 3 corresponding to keyword 1, keyword 2, and keyword 3 respectively in the first attribute information, and extracts the second attribute value 1, second attribute value 2, and second attribute value 3 corresponding to keyword 1, keyword 2, and keyword 3 respectively in the second attribute information. Then, an association relationship analysis is performed based on the first attribute value 1, first attribute value 2, first attribute value 3 and the second attribute value 1, second attribute value 2, and second attribute value 3, so as to determine the association relationship between keyword 1, keyword 2, and keyword 3 in the attribute information.
[0064] It can be understood that the first attribute information and the second attribute information represent different attribute information collected by the target device, and obtaining the association relationship between the attribute information does not limit the number of attribute information to 2. In actual use, in order to obtain a more accurate association relationship between the attribute information, multiple attribute information should be used to obtain better results.
[0065] Step S3: Generate an initial working file corresponding to the target device according to the attribute information, and adjust the initial working file according to the configuration rules, attribute constraint rules, and attribute validity rules to obtain the target working file.
[0066] For example, in the process of obtaining configuration rules, attribute constraint rules, and attribute validity rules in the above steps, a structured style can be obtained after analyzing the attribute information. Therefore, an initial working file corresponding to the target device can be generated according to the structured style, and then the configuration rules, attribute constraint rules, and attribute validity rules can be added to the corresponding attribute information in the initial working file to obtain the target working file.
[0067] For example, in the process of obtaining configuration rules, attribute constraint rules, and attribute validity rules, the feature set of the target device includes keyword 1, keyword 2, and keyword 3. In this case, keyword 1, keyword 2, and keyword 3 can be set in the initial working file, as well as attribute values 1, attribute value 2, and attribute value 3 corresponding to keywords 1, keyword 2, and keyword 3 that need to be filled. The method for obtaining attribute values 1, attribute value 2, and attribute value 3 corresponding to keywords 1, keyword 2, and keyword 3 from the attribute information corresponding to the target device is also set in the initial working file. After obtaining the initial working file, the constraint strategy between attribute values 1, attribute value 2, and attribute value 3 in the initial working file and the location information where attribute values 1, attribute value 2, and attribute value 3 should be stored after they are obtained are adjusted according to the configuration rules, attribute constraint rules, and attribute validity rules, thereby obtaining the target working file.
[0068] It can be understood that the target work file can achieve structuring of the attribute information corresponding to the target device and obtain structured results more accurately according to the constraint strategy.
[0069] In some embodiments, generating an initial working file corresponding to a target device based on attribute information includes: obtaining a template file from a template database based on a template selection instruction, the template file having multiple attribute options; adjusting the attribute options of the template file based on the attribute information, and obtaining an initial working file corresponding to the target device based on the adjusted template file.
[0070] For example, multiple template files can be set in the template database. When a target working file needs to be constructed for a target device, a template selection instruction is first sent to select one from the template database as a target template file, and then the attribute options of the target template file are adjusted using the attribute information corresponding to the target device to obtain the initial working file.
[0071] For example, template file A and template file B are set in the template database. Template file A is selected from the template database according to the template selection instruction, and then the feature set of attribute information corresponding to the target device including keyword 1, keyword 2, and keyword 3 is set in template file A to obtain the initial working file.
[0072] In some embodiments, the target working file is obtained by adjusting the initial working file according to the configuration rules, attribute constraint rules, and attribute validity rules, including: adjusting the data storage location of the attribute information in the initial working file according to the configuration rules to generate the initial adjustment working file; generating the attribute policy corresponding to the attribute information according to the attribute constraint rules and the attribute validity rules, and adding the attribute policy to the initial adjustment working file to obtain the target working file.
[0073] For example, the data storage location of the attribute information in the initial working file is first set according to the configuration rules, and the initial working file with the newly added configuration rules is generated into an initial adjustment working file. Then, the attribute policy corresponding to the attribute information is generated using regular expressions according to the attribute constraint rules and attribute validity rules. The attribute policy is added to the initial adjustment working file to further limit the constraints between the attribute information, and then the target working file is obtained.
[0074] Step S4: Generate a target storage table corresponding to the data storage of the attribute information in the target device according to the target working file.
[0075] Illustratively, after obtaining the target working file, a corresponding target storage table is generated according to the data storage location of the attribute information set in the target working file, so that data can be stored quickly during subsequent data structuring processing.
[0076] Step S5: Obtain business data corresponding to the target device, and determine business structured data corresponding to the business data according to the target work file.
[0077] For example, after establishing the target work file of the target device, relevant business data sent by the target device is received, and then the business data is processed using the attribute constraint rules and attribute validity rules in the target work file to obtain corresponding business structured data.
[0078] In some embodiments, determining the business structured data corresponding to the business data based on the target working file includes: obtaining target attribute information in the business data based on the target working file; obtaining target attribute values corresponding to the target attribute information in the business data based on the target attribute information, and obtaining dictionary structure data corresponding to the business data based on the target attribute information and the target attribute values; performing data verification on the dictionary structure data based on the target working file, and thereby determining the business structured data corresponding to the business data.
[0079] For example, when setting up a target work file, a feature set corresponding to the target device is set in the target work file. This feature set is obtained through entity unification and entity deduplication. Therefore, keywords in the business data are subjected to entity unification to obtain target attribute information in the business data. Target attribute values corresponding to the target attribute information are then obtained based on the target attribute information and the relationship extraction model. Based on the target attribute information and target attribute values, dictionary structure data corresponding to the business data can be obtained. The dictionary structure data can then be validated using the strategy generated by the attribute constraint rules and attribute validity rules in the target work file to determine the business structured data corresponding to the business data.
[0080] For example, the attribute information corresponding to the target device in the target work file includes keyword 1, keyword 2, and keyword 3, where keyword 1 and keyword 4 have the same meaning. If keyword 4 is detected in the business data, the entity unification technology can be used to convert keyword 4 into keyword 1, and then obtain the target attribute value corresponding to keyword 1. After obtaining the target attribute values 1, 2, and 3 corresponding to keywords 1, 2, and 3 in the business data, they are checked according to the attribute constraint rules and attribute validity rules in the target work file to ensure the accuracy of the dictionary structured data, and then the dictionary structured data corresponding to the business data is stored in the location corresponding to the configuration rules to facilitate subsequent data analysis.
[0081] In some embodiments, data verification is performed on the dictionary structure data according to the target working file, and then the business structured data corresponding to the business data is determined, including: obtaining the target attribute policy corresponding to the attribute constraint rules and the attribute validity rules according to the target working file, and performing data verification on the dictionary structure data according to the target attribute policy, and then determining the business structured data corresponding to the dictionary structure data.
[0082] For example, the attribute constraint rules and attribute validity rules in the target working file are generated into corresponding target attribute strategies using regular expressions or statements such as AND or NOT. Then, when the dictionary structure data is obtained, it is tested using the target attribute strategy. If the test is qualified, the qualified data is used as business structured data. If the test fails, the data needs to be stored and the corresponding business personnel need to review and check it.
[0083] In some embodiments, the dictionary structure data is data-verified according to the target attribute strategy, and then the business structured data corresponding to the dictionary structure data is determined, including: establishing a data processing mapping table according to the target attribute strategy; determining the data processing rules corresponding to each key-value pair in the dictionary structure data according to the data processing mapping table; and performing data verification on the dictionary structure data according to the data processing rules, and then determining the business structured data corresponding to the dictionary structure data.
[0084] For example, corresponding rules are established for different attributes in the target working file according to the target attribute strategy, and then a data processing mapping table corresponding to the attributes and attribute rules is established. After receiving the dictionary structure data, the data processing mapping table can be queried according to the key in the dictionary structure data to obtain the attribute rule of the value corresponding to the key, and the attribute rule is used to perform data verification on the value to determine the business structured data corresponding to the dictionary structure data.
[0085] For example, the attributes in the target working file include attribute 1, attribute 2, and attribute 3. Then, according to the target attribute strategy, the strategies corresponding to attribute 1, attribute 2, and attribute 3 are rule 1, rule 2, and rule 3 respectively. Then, the data processing mapping table is {attribute 1: rule 1, attribute 2: rule 2, attribute 3: rule 3}. Then, when the dictionary structure data {attribute 1: value 1, attribute 2: value 2, attribute 3: value 3} is received, the data processing strategy corresponding to attribute 1 in the dictionary structure data is rule 1, and then rule 1 can be used to perform data verification on value 1.
[0086] Step S6: Store the business structured data into the corresponding target storage table according to the target work file, thereby realizing the structuring of the business data.
[0087] Illustratively, after obtaining the business structured data, the business structured data is stored in a corresponding target storage table, thereby completing the structured storage of the business data.
[0088] See also Figure 4 , Figure 4A data structuring device 200 based on product attributes is provided in an embodiment of the present application. The data structuring device 200 based on product attributes includes a data determination module 201, a rule determination module 202, a data configuration module 203, a generation module 204, a data processing module 205, and a data storage module 206. The data determination module 201 is used to determine a target device and determine the attribute information corresponding to the target device according to the target device; the rule determination module 202 is used to determine the configuration rules, attribute constraint rules, and attribute validity rules between the attribute information according to the attribute information. The configuration rules are used to determine the data storage location of the attribute information, the attribute constraint rules are used to represent the conditions of mutual constraints between the attribute information, and the attribute validity rules are used to represent the The valid range of the attribute value of the attribute information; a data configuration module 203, which is used to generate an initial working file corresponding to the target device according to the attribute information, and adjust the initial working file according to the configuration rules, the attribute constraint rules, and the attribute validity rules to obtain a target working file; a generation module 204, which is used to generate a target storage table corresponding to the attribute information in the target device when storing data according to the target working file; a data processing module 205, which is used to obtain the business data corresponding to the target device, and determine the business structured data corresponding to the business data according to the target working file; a data storage module 206, which is used to store the business structured data in the corresponding target storage table according to the target working file, thereby realizing the structuring of the business data.
[0089] In some implementations, the rule determination module 202, in determining the configuration rules, attribute constraint rules, and attribute validity rules between the attribute information based on the attribute information, performs:
[0090] Acquire first attribute information and second attribute information corresponding to the target device;
[0091] Performing attribute association analysis based on the first attribute information and the second attribute information to obtain an association relationship between the attribute information;
[0092] The configuration rules, the attribute constraint rules, and the attribute validity rules between the attribute information are determined according to the association relationship.
[0093] In some implementations, when the rule determination module 202 performs attribute association analysis based on the first attribute information and the second attribute information to obtain the association relationship between the attribute information, the rule determination module 202 executes:
[0094] performing keyword extraction based on the first attribute information and the second attribute information to obtain attribute features corresponding to the target device, and determining a feature set of the target device based on the attribute features;
[0095] Obtaining a first attribute value corresponding to the feature set according to the first attribute information and obtaining a second attribute value corresponding to the feature set according to the second attribute information;
[0096] An association relationship analysis is performed based on the first attribute value and the second attribute value, thereby determining the association relationship between the attribute information.
[0097] In some implementations, the data configuration module 203 performs the following steps when generating the initial working file corresponding to the target device according to the attribute information:
[0098] Obtaining a template file from a template database according to a template selection instruction, wherein the template file has multiple attribute options;
[0099] The attribute options of the template file are adjusted according to the attribute information, and an initial working file corresponding to the target device is obtained according to the adjusted template file.
[0100] In some implementations, the data configuration module 203 performs the following steps when adjusting the initial working file to obtain the target working file according to the configuration rules, the attribute constraint rules, and the attribute validity rules:
[0101] Adjusting the data storage location of the attribute information in the initial work file according to the configuration rule to generate an initial adjustment work file;
[0102] An attribute policy corresponding to the attribute information is generated according to the attribute constraint rule and the attribute validity rule, and the attribute policy is added to the initial adjustment work file to obtain a target work file.
[0103] In some implementations, when determining the business structured data corresponding to the business data according to the target work file, the data processing module 205 performs:
[0104] Obtaining target attribute information in the business data according to the target work file;
[0105] Obtaining a target attribute value corresponding to the target attribute information in the business data according to the target attribute information, and obtaining dictionary structure data corresponding to the business data according to the target attribute information and the target attribute value;
[0106] The dictionary structure data is subjected to data verification according to the target working file, thereby determining the business structured data corresponding to the business data.
[0107] In some implementations, when the data processing module 205 performs data verification on the dictionary structure data according to the target working file and then determines the business structured data corresponding to the business data, the data processing module 205 executes:
[0108] Obtaining a target attribute policy corresponding to the attribute constraint rule and the attribute validity rule according to the target working file;
[0109] The dictionary structure data is subjected to data verification according to the target attribute strategy, thereby determining the business structured data corresponding to the dictionary structure data.
[0110] In some implementations, when the data processing module 205 performs data verification on the dictionary structure data according to the target attribute strategy and then determines the business structure data corresponding to the dictionary structure data, the data processing module 205 executes:
[0111] Establishing a data processing mapping table according to the target attribute strategy;
[0112] Determine the data processing rules corresponding to each key-value pair in the dictionary structure data according to the data processing mapping table;
[0113] The dictionary structure data is subjected to data verification according to the data processing rules, thereby determining the business structured data corresponding to the dictionary structure data.
[0114] In some implementations, the product attribute-based data structuring apparatus 200 is applied to a terminal device.
[0115] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned data structuring method embodiment based on product attributes, and will not be repeated here.
[0116] See also Figure 5 , Figure 5 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present application.
[0117] like Figure 5 As shown, the terminal device 300 includes a processor 301 and a memory 302, and the processor 301 and the memory 302 are connected via a bus 303, such as an I2C (Inter-integrated Circuit) bus.
[0118] Specifically, the processor 301 is used to provide computing and control capabilities to support the operation of the entire server. The processor 301 can be a central processing unit (CPU), and the processor 301 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0119] Specifically, the memory 302 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.
[0120] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the embodiment of the present application, and does not constitute a limitation on the terminal device to which the embodiment of the present application is applied. The specific terminal device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0121] The processor 301 is configured to run a computer program stored in the memory, and implement the product attribute-based data structuring method provided in any embodiment of the present application when executing the computer program.
[0122] In some embodiments, the processor 301 is configured to run a computer program stored in a memory, applied to a terminal device, and implement the following steps when executing the computer program:
[0123] Determining a target device, and determining attribute information corresponding to the target device based on the target device;
[0124] Determining, based on the attribute information, configuration rules, attribute constraint rules, and attribute validity rules between the attribute information, wherein the configuration rules are used to determine the data storage location of the attribute information, the attribute constraint rules are used to represent the conditions under which the attribute information is mutually constrained, and the attribute validity rules are used to represent the valid range of the attribute value of the attribute information;
[0125] generating an initial working file corresponding to the target device according to the attribute information, and adjusting the initial working file according to the configuration rule, the attribute constraint rule, and the attribute validity rule to obtain a target working file;
[0126] generating a target storage table corresponding to data storage of the attribute information in the target device according to the target working file;
[0127] Obtaining business data corresponding to the target device, and determining business structured data corresponding to the business data according to the target work file;
[0128] The business structured data is stored in the corresponding target storage table according to the target work file, thereby realizing the structuring of the business data.
[0129] In some implementations, the processor 301, in determining the configuration rule, attribute constraint rule, and attribute validity rule between the attribute information according to the attribute information, performs:
[0130] Acquire first attribute information and second attribute information corresponding to the target device;
[0131] Performing attribute association analysis based on the first attribute information and the second attribute information to obtain an association relationship between the attribute information;
[0132] The configuration rules, the attribute constraint rules, and the attribute validity rules between the attribute information are determined according to the association relationship.
[0133] In some implementations, when performing attribute association analysis based on the first attribute information and the second attribute information to obtain the association relationship between the attribute information, the processor 301 executes:
[0134] performing keyword extraction based on the first attribute information and the second attribute information to obtain attribute features corresponding to the target device, and determining a feature set of the target device based on the attribute features;
[0135] Obtaining a first attribute value corresponding to the feature set according to the first attribute information and obtaining a second attribute value corresponding to the feature set according to the second attribute information;
[0136] An association relationship analysis is performed based on the first attribute value and the second attribute value, thereby determining the association relationship between the attribute information.
[0137] In some implementations, during the process of generating the initial working file corresponding to the target device according to the attribute information, the processor 301 executes:
[0138] Obtaining a template file from a template database according to a template selection instruction, wherein the template file has multiple attribute options;
[0139] The attribute options of the template file are adjusted according to the attribute information, and an initial working file corresponding to the target device is obtained according to the adjusted template file.
[0140] In some implementations, the processor 301, in the process of adjusting the initial working file according to the configuration rule, the attribute constraint rule, and the attribute validity rule to obtain the target working file, executes:
[0141] Adjusting the data storage location of the attribute information in the initial work file according to the configuration rule to generate an initial adjustment work file;
[0142] An attribute policy corresponding to the attribute information is generated according to the attribute constraint rule and the attribute validity rule, and the attribute policy is added to the initial adjustment work file to obtain a target work file.
[0143] In some implementations, during the process of determining the business structured data corresponding to the business data according to the target work file, the processor 301 executes:
[0144] Obtaining target attribute information in the business data according to the target work file;
[0145] Obtaining a target attribute value corresponding to the target attribute information in the business data according to the target attribute information, and obtaining dictionary structure data corresponding to the business data according to the target attribute information and the target attribute value;
[0146] The dictionary structure data is subjected to data verification according to the target working file, thereby determining the business structured data corresponding to the business data.
[0147] In some implementations, when the processor 301 performs data verification on the dictionary structure data according to the target working file and thereby determines the business structured data corresponding to the business data, the processor 301 executes:
[0148] Obtaining a target attribute policy corresponding to the attribute constraint rule and the attribute validity rule according to the target working file;
[0149] The dictionary structure data is subjected to data verification according to the target attribute strategy, thereby determining the business structured data corresponding to the dictionary structure data.
[0150] In some implementations, when the processor 301 performs data verification on the dictionary structure data according to the target attribute policy and thereby determines the business structure data corresponding to the dictionary structure data, the processor 301 executes:
[0151] Establishing a data processing mapping table according to the target attribute strategy;
[0152] Determine the data processing rules corresponding to each key-value pair in the dictionary structure data according to the data processing mapping table;
[0153] The dictionary structure data is subjected to data verification according to the data processing rules, thereby determining the business structured data corresponding to the dictionary structure data.
[0154] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the terminal device described above can refer to the corresponding process in the aforementioned data structuring method embodiment based on product attributes, and will not be repeated here.
[0155] An embodiment of the present application also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any product attribute-based data structuring method provided in the embodiment of the present application specification.
[0156] The storage medium may be an internal storage unit of the terminal device in the aforementioned embodiment, such as a terminal device memory. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., provided on the terminal device.
[0157] It will be appreciated by those skilled in the art that all or some of the steps in the method disclosed above, and the functional modules / units in the device can be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0158] It should be understood that the term "and / or" used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system that includes a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements that are inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system that includes the element.
[0159] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments. The above are only specific embodiments of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A data structuring method based on product attributes, characterized in that: The method comprises: Determining a target device, and determining attribute information corresponding to the target device based on the target device; determining, based on the attribute information, configuration rules, attribute constraint rules, and attribute validity rules between the attribute information, wherein the configuration rules are used to determine a data storage location for the attribute information, the attribute constraint rules are used to characterize conditions under which the attribute information is mutually constrained, and the attribute validity rules are used to characterize a valid range of attribute values of the attribute information, wherein the attribute information includes first attribute information and second attribute information; performing keyword extraction based on the first attribute information and the second attribute information to obtain attribute features corresponding to the target device, and determining a feature set of the target device based on the attribute features; The extracting keywords based on the first attribute information and the second attribute information to obtain attribute features corresponding to the target device includes: performing keyword extraction on the first attribute information and the second attribute information respectively according to a named entity recognition technology to obtain a first keyword group and a second keyword group, and obtaining the attribute feature based on the first keyword group and the second keyword group; Wherein, determining the feature set of the target device according to the attribute characteristics includes: Calculating similarity for each keyword in the attribute feature, determining repeated keywords, and removing duplicates from the repeated keywords to obtain the feature set; generating an initial working file corresponding to the target device according to the attribute information, and adjusting the initial working file according to the configuration rule, the attribute constraint rule, and the attribute validity rule to obtain a target working file; The step of generating an initial working file corresponding to the target device according to the attribute information includes: selecting a template file from a template database according to a template selection instruction, setting all keywords in a feature set of attribute information corresponding to the target device in the template file, and obtaining the initial working file; generating a target storage table corresponding to data storage of the attribute information in the target device according to the target working file; Obtaining business data corresponding to the target device, and determining business structured data corresponding to the business data according to the target work file; The business structured data is stored in the corresponding target storage table according to the target work file, thereby realizing the structuring of the business data.
2. The method according to claim 1, wherein The determining of the configuration rules, attribute constraint rules, and attribute validity rules between the attribute information according to the attribute information includes: Acquire first attribute information and second attribute information corresponding to the target device; Performing attribute association analysis based on the first attribute information and the second attribute information to obtain an association relationship between the attribute information; The configuration rules, the attribute constraint rules, and the attribute validity rules between the attribute information are determined according to the association relationship.
3. The method according to claim 2, characterized in that The performing attribute association analysis based on the first attribute information and the second attribute information to obtain the association relationship between the attribute information includes: Obtaining a first attribute value corresponding to the feature set according to the first attribute information and obtaining a second attribute value corresponding to the feature set according to the second attribute information; An association relationship analysis is performed based on the first attribute value and the second attribute value, thereby determining the association relationship between the attribute information.
4. The method according to claim 1, wherein Generating an initial working file corresponding to the target device according to the attribute information includes: Obtaining a template file from a template database according to a template selection instruction, wherein the template file has multiple attribute options; The attribute options of the template file are adjusted according to the attribute information, and an initial working file corresponding to the target device is obtained according to the adjusted template file.
5. The method according to claim 1, wherein The adjusting the initial working file according to the configuration rule, the attribute constraint rule, and the attribute validity rule to obtain the target working file includes: Adjusting the data storage location of the attribute information in the initial work file according to the configuration rule to generate an initial adjustment work file; An attribute policy corresponding to the attribute information is generated according to the attribute constraint rule and the attribute validity rule, and the attribute policy is added to the initial adjustment work file to obtain a target work file.
6. The method according to claim 1, wherein The determining, according to the target work file, the business structured data corresponding to the business data includes: Obtaining target attribute information in the business data according to the target work file; Obtaining a target attribute value corresponding to the target attribute information in the business data according to the target attribute information, and obtaining dictionary structure data corresponding to the business data according to the target attribute information and the target attribute value; The dictionary structure data is subjected to data verification according to the target working file, thereby determining the business structured data corresponding to the business data.
7. The method according to claim 6, characterized in that The performing data verification on the dictionary structure data according to the target working file to thereby determine the business structured data corresponding to the business data includes: Obtaining a target attribute policy corresponding to the attribute constraint rule and the attribute validity rule according to the target working file; The dictionary structure data is subjected to data verification according to the target attribute strategy, thereby determining the business structured data corresponding to the dictionary structure data.
8. The method according to claim 7, characterized in that The performing data inspection on the dictionary structure data according to the target attribute strategy to thereby determine the business structure data corresponding to the dictionary structure data includes: Establishing a data processing mapping table according to the target attribute strategy; Determine the data processing rules corresponding to each key-value pair in the dictionary structure data according to the data processing mapping table; The dictionary structure data is subjected to data verification according to the data processing rules, thereby determining the business structured data corresponding to the dictionary structure data.
9. A data structuring device based on product attributes, characterized in that: include: A data determination module, configured to determine a target device and determine attribute information corresponding to the target device based on the target device; a rule determination module, configured to determine, based on the attribute information, configuration rules, attribute constraint rules, and attribute validity rules between the attribute information, wherein the configuration rules are used to determine a data storage location for the attribute information, the attribute constraint rules are used to characterize conditions constraining each other between the attribute information, and the attribute validity rules are used to characterize a valid range of attribute values of the attribute information, wherein the attribute information includes first attribute information and second attribute information; The rule determination module is further configured to extract keywords based on the first attribute information and the second attribute information to obtain attribute features corresponding to the target device, and determine a feature set of the target device based on the attribute features; The rule determination module is further configured to perform keyword extraction on the first attribute information and the second attribute information respectively according to a named entity recognition technology to obtain a first keyword group and a second keyword group, and obtain the attribute feature based on the first keyword group and the second keyword group; The rule determination module is further configured to calculate similarity between the keywords in the attribute features, determine repeated keywords, and perform deduplication processing on the repeated keywords to obtain the feature set; a data configuration module, configured to generate an initial working file corresponding to the target device according to the attribute information, and adjust the initial working file according to the configuration rules, the attribute constraint rules, and the attribute validity rules to obtain a target working file; The data configuration module is further configured to select a template file from a template database according to a template selection instruction, and set all keywords in the feature set of the attribute information corresponding to the target device in the template file to obtain the initial working file; A generating module, configured to generate a target storage table corresponding to the attribute information in the target device when performing data storage according to the target working file; A data processing module, configured to obtain business data corresponding to the target device and determine business structured data corresponding to the business data according to the target work file; The data storage module is used to store the business structured data into the corresponding target storage table according to the target work file, thereby realizing the structuring of the business data.
10. A terminal device, characterized in that: The terminal device includes a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the steps of the data structuring method according to any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, characterized in that When the computer-readable storage medium is executed by one or more processors, the one or more processors are caused to perform the steps of the data structuring method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for generating article template, equipment and storage medium
CN109635260A
Method and device for quickly realizing NL2SQL based on vectorized semantic rule
CN112001188A