Heterogeneous data semantic alignment method and system, electronic equipment and storage medium
By constructing a dynamic semantic knowledge base and a large language model, the problems of poor adaptability and semantic fragmentation in heterogeneous data processing in Web front-ends are solved, achieving efficient semantic alignment of heterogeneous data, improving the semantic relevance and scalability of data, and making it suitable for multi-source data statistics and correlation analysis.
Patent Information
- Application Number
- CN202511285668.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2025-12-23
AI Technical Summary
Existing technologies for processing heterogeneous data in web front-ends suffer from poor adaptability, semantic fragmentation, and weak scalability, making it impossible to effectively achieve semantic fusion across data units.
By constructing a dynamic semantic knowledge base, a large language model is used to perform type labeling, instruction extraction, field normalization, cross-data association, and semantic ambiguity resolution on heterogeneous data. Combined with small-sample fine-tuning to optimize the model, semantic alignment of heterogeneous data is achieved.
It improves the adaptability and semantic relevance of heterogeneous data, reduces the adaptation cost of new data types, ensures high semantic consistency and reliability of data, and supports cross-scenario data applications.
Smart Images

Figure CN121188367A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular relates to a heterogeneous data semantic alignment method and system, electronic equipment and a storage medium. BACKGROUND
[0002] At present, there is a large amount of heterogeneous data in the Web front end. Such data has multiple sources and various formats, covering structured form data (such as user registration information table), semi-structured list data (such as commodity parameter list), and unstructured text data (such as web news body and user comments), and even including picture text annotation and dynamically rendered temporary data. Effective processing of these heterogeneous data is the basis for realizing data integration analysis and cross-scene information reuse.
[0003] In the prior art, the extraction of heterogeneous data in the Web front end is usually performed by using the method of "customizing rules for different scenes": structured data is mapped by using fixed fields, semi-structured data is selected by using XPath or CSS selector, and unstructured data is selected by using regular expression. However, there are obvious defects: first, the adaptability is poor, different format data needs to be designed separately, and when facing mixed heterogeneous data (such as a page containing tables, texts, and picture texts), rule conflicts occur frequently; second, the semantics are fragmented, and the extracted data only retains surface information and lacks semantic association, for example, the fields of "commodity selling price", "product price", and "price" are stored as independent data and cannot realize semantic fusion across data units; third, the expansibility is weak, and when a new data type (such as text in an SVG image) is added, the extraction logic needs to be redeveloped, which has high iteration cost.
[0004] Therefore, the present application provides a heterogeneous data semantic alignment method to solve the above technical problems. SUMMARY
[0005] The present application aims to provide a heterogeneous data semantic alignment method, system, electronic equipment and storage medium, which solves the technical problems of poor adaptability, fragmented semantics and weak expansibility of heterogeneous data processing in the Web front end in the prior art.
[0006] To solve the above technical problems, the present application provides a heterogeneous data semantic alignment method, comprising:
[0007] The collected Web front end heterogeneous data is labeled by type according to a preset dimension, wherein the preset dimension includes data format, source location and basic field label;
[0008] Construct a mapping relationship between data types and extraction templates, generate extraction instructions corresponding to the data types based on the mapping relationship, input the type-annotated heterogeneous Web front-end data and the corresponding extraction instructions into the large language model, and output extraction results in a unified format from the large language model.
[0009] Construct a dynamic semantic knowledge base to support semantic alignment, the dynamic semantic knowledge base including a basic semantic dictionary, context association rules and incremental update interface;
[0010] Based on the dynamic semantic knowledge base, the extraction results are processed by the large language model to perform field normalization, cross-data association and semantic ambiguity resolution, and output semantic alignment results.
[0011] The semantic alignment results are validated according to rules, and the large language model is optimized by fine-tuning based on the validation results, while the dynamic semantic knowledge base is updated.
[0012] In some specific embodiments, the heterogeneous web front-end data collected includes:
[0013] Parse HTML structure to collect structured and semi-structured data in the form of tables, lists, and forms;
[0014] Extract unstructured text data from images and graphics;
[0015] Capture dynamically generated data content during asynchronous loading;
[0016] Add timestamps and source page information to the collected heterogeneous web front-end data.
[0017] In some specific embodiments, constructing a mapping relationship between data types and extraction templates, and generating extraction instructions corresponding to the data types based on the mapping relationship, further includes:
[0018] Based on structured data in tabular form, a first extraction instruction template is constructed, characterized by extracting the table header and corresponding cell content and outputting key-value pair format.
[0019] Based on unstructured data of continuous text segments, a second extraction instruction template is constructed, characterized by extracting preset fields and normalizing and mapping various synonyms to standard fields;
[0020] Based on the text data identified from the image, a third extraction instruction template is constructed, characterized by semantic segmentation and extraction of key fields.
[0021] Based on the data type to be processed, select and generate the corresponding extraction instructions.
[0022] In some embodiments, a dynamic semantic knowledge base is constructed to support semantic alignment, including a base semantic dictionary, context association rules, and an incremental update interface, further comprising:
[0023] A base semantic dictionary is constructed to store a set of synonymous fields and automatically merge based on vector similarity;
[0024] An association graph is constructed to record co-occurrence relationships between fields and dynamically adjust edge weights using a weighted strategy that combines co-occurrence statistics and prediction confidence;
[0025] An incremental update interface is constructed to support automatic discovery and prompt confirmation of new associations;
[0026] Through the constructed base semantic dictionary, association graph, and incremental update interface, the coverage and accuracy of the dynamic semantic knowledge base are optimized.
[0027] In some embodiments, based on the dynamic semantic knowledge base, the large language model is used to perform field normalization on the extraction results, further comprising:
[0028] Similarity comparison and semantic matching between each original field in the extraction results and the base semantic dictionary are performed;
[0029] Different field expressions expressing the same semantics are automatically identified and aggregated;
[0030] According to the standard field system predefined in the base semantic dictionary, the identified synonymous fields are uniformly mapped to the corresponding standard fields;
[0031] The field normalization result with consistent semantic identification is output.
[0032] In some embodiments, based on the dynamic semantic knowledge base, the large language model is used to perform semantic ambiguity resolution processing on the extraction results, further comprising:
[0033] Potential polysemous fields in the extraction results are detected;
[0034] The data source location and the context scenario to which the potential polysemous fields appear are analyzed;
[0035] Other related data fields appearing in the same scenario are combined for collaborative semantic reasoning;
[0036] According to the association rules and context weights in the dynamic semantic knowledge base, the semantic attribution of the potential polysemous fields is determined, and they are mapped to the corresponding standard fields to eliminate ambiguity.
[0037] In some embodiments, the semantic alignment result is checked according to rules, and the large language model is optimized by fine-tuning based on the checking result, and the dynamic semantic knowledge base is updated, further comprising:
[0038] The semantic alignment result is automatically checked based on the format constraints and logical rules defined in the dynamic semantic knowledge base;
[0039] Error samples and correction results generated during the checking process are collected to build a training data set for optimizing the large language model;
[0040] The large language model is incrementally trained and optimized using a small sample fine-tuning method;
[0041] The new field mapping relationship and semantic rules confirmed by the checking are updated to the dynamic semantic knowledge base.
[0042] Based on the same concept, the present application also provides a heterogeneous data semantic alignment system, comprising:
[0043] The heterogeneous data acquisition and labeling module is configured to perform type labeling on the collected Web front-end heterogeneous data according to the preset dimensions, wherein the preset dimensions include data format, source location and basic field label;
[0044] The extraction result output module is configured to build a mapping relationship between data types and extraction templates, generate extraction instructions corresponding to the data types based on the mapping relationship, input the type-labeled Web front-end heterogeneous data and the corresponding extraction instructions into the large language model, and output the extraction results in a unified format by the large language model;
[0045] The dynamic semantic knowledge base construction module is configured to construct a dynamic semantic knowledge base for supporting semantic alignment, wherein the dynamic semantic knowledge base includes a basic semantic dictionary, context association rules and an incremental update interface;
[0046] The alignment result output module is configured to perform field normalization, cross-data association and semantic ambiguity resolution processing on the extraction result by the large language model based on the dynamic semantic knowledge base, and output the semantic alignment result;
[0047] The iterative optimization module is configured to check the semantic alignment result according to rules, and optimize the large language model by fine-tuning based on the checking result, while updating the dynamic semantic knowledge base.
[0048] Based on the same concept, the present application also provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the heterogeneous data semantic alignment method.
[0049] Based on the same concept, the present application also provides a computer readable storage medium storing a computer program executable by an electronic device, and when the computer program runs on the electronic device, the electronic device executes the steps of the heterogeneous data semantic alignment method.
[0050] Compared with the prior art, the present application has the beneficial effects that:
[0051] The present application discloses a heterogeneous data semantic alignment method, system, electronic device and storage medium, which has the following beneficial effects: strong heterogeneous data adaptability: relying on the powerful cross-format understanding ability of the large model, without the need to design complex extraction rules for different types of data, mixed heterogeneous data can be efficiently and comprehensively processed; high semantic correlation: through dynamic semantic knowledge base and large model semantic alignment, extremely accurate synonymous field normalization processing is realized, and the error rate of cross-data correlation is greatly reduced; excellent scalability: when new data types are added, only the "data type-extraction template" mapping relationship needs to be supplemented, without the need to reconstruct the extraction logic, significantly reducing the adaptation cost of new functions; high result reliability: the double verification and iterative optimization mechanism effectively guarantees the high semantic consistency of the final data, providing a solid and reliable data foundation for subsequent cross-scene data application (such as multi-source data statistics and correlation analysis). BRIEF DESCRIPTION OF DRAWINGS
[0052] Other features, objects and advantages of the present application will become more apparent from the following detailed description of the non-limiting embodiments made with reference to the accompanying drawings:
[0053] Figure 1 is a flowchart of the heterogeneous data semantic alignment method of the present application in some specific embodiments;
[0054] Figure 2 is one of the flowcharts of the heterogeneous data semantic alignment method of the present application in another embodiment;
[0055] Figure 3 is the second flowchart of the heterogeneous data semantic alignment method of the present application in another embodiment;
[0056] Figure 4 is the third flowchart of the heterogeneous data semantic alignment method of the present application in another embodiment;
[0057] Figure 5 is a flow diagram of a fourth embodiment of a method for aligning heterogeneous data semantics according to the present application;
[0058] Figure 6 is a structural diagram of a system for aligning heterogeneous data semantics according to the present application in some embodiments;
[0059] Figure 7 is a structural diagram of an electronic device according to the present application in some embodiments;
[0060] In the figure, 710 is a processor; 720 is a memory; 730 is an input device; and 740 is an output device. DETAILED DESCRIPTION
[0061] For the purpose of making the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments of the present application, all the other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0062] The terms used in the embodiments of the present application are only for the purpose of describing particular embodiments and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. "Plural" generally includes at least two.
[0063] It should be understood that the term "and / or" used herein only describes an association relationship of associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects.
[0064] It should be understood that although the terms first, second, third, etc. can be used in the embodiments of the present application, these descriptions should not be limited to these terms. These terms are only used to distinguish the description. For example, without departing from the scope of the embodiments of the present application, the first can also be called the second, and similarly, the second can also be called the first.
[0065] Depending on the context, the word "if' can be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrase "if it is determined" or "if [a stated condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [the stated condition or event]" or "in response to detecting [the stated condition or event]."
[0066] It is also to be noted that the terms "comprising", "including", and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a product or process that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such product or process. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the product or process that comprises the stated element.
[0067] In particular, it is to be noted that symbols and / or numbers present in the description, if not marked in the description of the figures, are not figure references.
[0068] Referring to Figure 1 A heterogeneous data semantic alignment method comprises:
[0069] S101, in response to the collected Web front-end heterogeneous data, type labeling is performed according to preset dimensions, wherein the preset dimensions include data format, source location, and basic field label;
[0070] S102, a mapping relationship between data types and extraction templates is constructed, and based on the mapping relationship, an extraction instruction corresponding to the data type is generated; the Web front-end heterogeneous data after type labeling and the corresponding extraction instruction are input into a large language model, and a unified format extraction result is output by the large language model;
[0071] S103, a dynamic semantic knowledge base for supporting semantic alignment is constructed, and the dynamic semantic knowledge base includes a basic semantic dictionary, context association rules, and an incremental update interface;
[0072] S104, based on the dynamic semantic knowledge base, field normalization, cross-data association, and semantic ambiguity resolution processing are performed on the extraction result by the large language model, and a semantic alignment result is output;
[0073] S105, the semantic alignment result is subjected to rule verification, and based on the verification result, the large language model is optimized in a fine-tuning manner, and the dynamic semantic knowledge base is updated.
[0074] Specifically, in the embodiments of the present application, heterogeneous data of the Web front end is acquired through a multi-modal acquisition method, and the acquired data is labeled in multiple dimensions according to its data format, source position in the page, and basic semantic field tag; an extraction instruction mapping library for different types of data is constructed, the labeled data and the corresponding instruction are input into a large language model with multi-modal understanding capability, and the large language model is used to complete cross-format content understanding and output extraction results with a unified JSON structure, which includes original data segments, identified fields, and corresponding values; a dynamic knowledge base supporting semantic alignment is constructed, which adopts a hybrid architecture including a basic semantic dictionary based on the fusion of word vectors and ontology, a context association rule set stored in a graph structure and dynamically updated weights, and an update interface supporting artificial and automatic dual-channel increments; based on the constructed dynamic semantic knowledge base, the large language model is driven to perform semantic normalization mapping at the field level, cross-data source association index construction, and context disambiguation processing of ambiguous fields on the extraction results, and finally output aligned data that is semantically consistent and completely associated; for the semantic alignment results, automatic verification is performed according to predefined business rules, based on the error samples and correction results collected in the verification, small sample fine-tuning technology is used to iteratively optimize the large language model, and the dictionary and rule content in the dynamic semantic knowledge base are updated synchronously.
[0075] For example, in the scenario of e-commerce platform data processing, the product detail page includes structured table "product parameter table", asynchronously loaded "user review" text paragraph, and "limited time offer" text label in the main product image; respectively label its data format as table, text and picture text, source location as parameter area, comment area and main image area, basic field label as parameter related, evaluation related and price related. According to the data type, the corresponding instructions are generated: "extract table header and cell content and output in key-value pair" instruction is used for table data, "extract evaluation sentence and mentioned price" instruction is used for comment text, and "identify and extract price related information" instruction is used for picture text. The large language model outputs are as follows: {"field": "material", "value": "net surface"}, {"field": "user evaluation", "value": "wear comfortable"} and {"field": "promotion information", "value": "limited time 359 yuan"}. The dynamic semantic knowledge base presets "selling price", "list price" and "current price" to map to the standard field "product price", and dynamically adjusts the association weight between fields based on co-occurrence frequency and prediction confidence. In the semantic alignment process, "current price 359 yuan" and "selling price about 400 yuan" are unified to "product price", and different source data are associated through the product ID; for the expression "more expensive than Apple" in the comment, "Apple" is disambiguated as a brand combined with the "mobile phone" parameter information in the context. The verification link finds that "about 400 yuan" does not conform to the numerical format rule, marks the exception and corrects it to "product price: 400 yuan" after confirmation; after accumulating 200 samples, the model is fine-tuned using the LoRA method to improve the normalization ability for ambiguous expressions, and the verified "promotion information -> product price" mapping is updated into the knowledge base.
[0076] In some applications, in response to the collected Web front-end heterogeneous data, the HTML structure is parsed, the structured and semi-structured data in the form of tables, lists and forms are collected, the visual text information contained in pictures and graphics is recognized and extracted to obtain unstructured data, and the dynamically generated real-time data content through asynchronous loading technology is monitored and captured. The collected Web front-end heterogeneous data is attached with a timestamp and source page information.
[0077] It can be understood that collecting Web front-end heterogeneous data includes parsing the HTML document object model structure to collect structured and semi-structured data in the form of tables, lists and forms; recognizing and extracting visual text information contained in pictures and graphics to obtain unstructured data; monitoring and capturing real-time data content dynamically generated through asynchronous loading technology; and attaching a timestamp and source page information to all collected Web front-end heterogeneous data to support the needs of data timeliness and traceability in the subsequent data processing process.
[0078] For example, in the data collection of a product detail page, the page HTML structure is parsed to collect the product parameter table (structured data) and user review list (semi-structured data); the "limited time offer" text label (unstructured data) contained in the product main image is extracted; user real-time rating data loaded through asynchronous request (dynamic data) is captured; and a timestamp (e.g., October 26, 2023 14:30:25) and source page information (e.g., https: / / example.com / product / 12345) are attached to all collected data. In the image text extraction process, image preprocessing includes de-warping and super-resolution reconstruction (e.g., increasing image resolution from 640x480 to 1280x960), optical character recognition processing, and outputting recognized text content. The timestamp is accurate to the millisecond level, and the source page information records the protocol, domain name, and path parameters in detail, ensuring data traceability and reproducibility.
[0079] In some applications, a mapping relationship between data types and extraction templates is constructed, and extraction instructions corresponding to the data types are generated based on the mapping relationship, including constructing a first extraction instruction template characterized by extracting table headers and corresponding cell contents and outputting in key-value pair format based on structured data existing in table form; constructing a second extraction instruction template characterized by extracting preset fields and normalizing various synonymous expressions to standard fields based on unstructured data in continuous text segments; constructing a third extraction instruction template characterized by semantic segmentation and extraction of key fields based on text data recognized from images; and selecting and generating corresponding extraction instructions according to the data type of the data to be processed.
[0080] It can be understood that for structured data existing in table form, a first extraction instruction template is constructed characterized by extracting table headers and corresponding cell contents and outputting in key-value pair format; for unstructured data in continuous text segments, a second extraction instruction template is constructed characterized by extracting preset fields and normalizing various synonymous expressions to standard fields; for text data recognized from images, a third extraction instruction template is constructed characterized by semantic segmentation and extraction of key fields; and according to the specific data type of the data to be processed, the corresponding extraction instruction template is automatically selected and the corresponding structured extraction instruction is generated.
[0081] For example, when processing e-commerce platform commodity data, the first extraction instruction template is used for commodity parameter table data to generate the instruction: "extract all table headers and corresponding cell contents in the table, and output in the format of 'header: content' key-value pair". After processing the commodity specification table, the output is {"commodity name: sports shoes", "material: mesh", "price: 399 yuan"}; the second extraction instruction template is used for user comment text data to generate the instruction: "extract 'user evaluation' and'mentioned price' fields from the text, and map expressions such as'selling price' and'market price' to the standard field 'price'". After processing the comment "this shoe sells for more than 400 yuan", the output is {"user evaluation: this shoe", "price: more than 400 yuan"}; the third extraction instruction template is used for text data in commodity pictures to generate the instruction: "identify the text content and segment it according to the semantics, and extract the 'promotion information' field". After processing "limited time offer! Now 359", the output is {"promotion information: now 359 yuan"}.
[0082] In some applications, a dynamic semantic knowledge base is constructed for supporting semantic alignment, including a basic semantic dictionary, context association rules, and an incremental update interface. The basic semantic dictionary stores a set of synonymous fields and automatically merges them based on vector similarity. The association graph records the co-occurrence relationship between fields and dynamically adjusts the edge weight using a weighted strategy that combines co-occurrence statistics and prediction confidence. The incremental update interface supports automatic discovery and confirmation of new associations. The coverage and accuracy of the dynamic semantic knowledge base are optimized through the basic semantic dictionary, association graph, and incremental update interface.
[0083] It can be understood that the basic semantic dictionary stores a set of synonymous fields using a combination of word vectors and ontology, automatically identifies and merges different field expressions that express the same semantics based on semantic similarity in vector space. The association graph stores the co-occurrence relationship between fields in a graph structure, and dynamically adjusts the weight parameters of the edges in the graph using a weighted strategy that combines co-occurrence statistics and model prediction confidence. The incremental update interface supports automatic discovery and confirmation of new associations, and triggers the identification and verification process of potential semantic relationships through preset rules. Through the collaborative work of the above basic semantic dictionary, association graph, and incremental update interface, the semantic coverage and mapping accuracy of the dynamic semantic knowledge base are continuously optimized.
[0084] For example, in the application scenario of e-commerce, when building a basic semantic dictionary, the fields such as "selling price", "price", "discount price" and the like are calculated for semantic similarity by word vector (with a similarity threshold of 0.85), and when the cosine similarity between "selling price" and "price" reaches 0.92, they are automatically merged into the same semantic set and mapped to the standard field "product price"; when building a correlation graph, the formula for calculating the co-occurrence weight of the fields is: weight = 0.6 x (co-occurrence frequency / total frequency) + 0.4 x model confidence, and when "product name" and "product price" co-occur 800 times in 1000 extractions and the model confidence is 0.95, the edge weight is 0.6 x (800 / 1000) + 0.4 x 0.95 = 0.88; when the similarity between "activity price" and "product price" exceeds the threshold for more than 30 days, the incremental update interface automatically triggers the confirmation process, and after confirmation, they are added to the synonymous field set.
[0085] In some applications, based on the dynamic semantic knowledge base, the large language model performs field normalization on the extraction results, including similarity comparison and semantic matching between each original field in the extraction results and the basic semantic dictionary; automatically identifying and aggregating different field expressions expressing the same semantics; according to the standard field system predefined in the basic semantic dictionary, the identified synonymous fields are uniformly mapped to the corresponding standard fields; and outputting the field normalization result with consistent semantic identification.
[0086] It can be understood that the semantic similarity calculation and matching analysis are performed between each original field in the extraction results and the field set stored in the basic semantic dictionary; different fields expressing the same semantics but having different expressions in different data sources are automatically identified and aggregated; according to the standard field system and mapping rules predefined in the basic semantic dictionary, the identified synonymous fields are uniformly mapped to the corresponding standard field expressions; and the field normalization result with consistent semantic identification and standardized expression is output, providing standardized input for subsequent cross-data correlation and semantic alignment.
[0087] For example, in the scenario of e-commerce data processing, the large language model performs normalization processing on the price-related fields in the extraction results: first, calculate the cosine similarity between "selling price" and the "product price" standard field in the basic semantic dictionary (0.92), and calculate the similarity between "promotion price" and "product price" (0.89); automatically identify that "selling price", "price", "promotion price" and "activity price" all express the same semantics; according to the dictionary mapping rules, these fields are uniformly mapped to the standard field "product price"; finally, the expressions such as "selling price: 399 yuan" and "activity price: 359 yuan" in the original data are uniformly output as "product price: 399 yuan" and "product price: 359 yuan". In the processing process, a similarity threshold of 0.85 is set, and when the field similarity exceeds the threshold, the merging process is automatically triggered.
[0088] In some of the applications, based on the dynamic semantic knowledge base, the extracted results are processed by the large language model for semantic ambiguity resolution, including detecting potential ambiguity fields in the extracted results; analyzing the data source position and the context scene where the potential ambiguity fields appear; performing collaborative semantic reasoning with other related data fields appearing in the same scene; determining the semantic attribution of the potential ambiguity fields according to the association rules and context weights in the dynamic semantic knowledge base, and mapping them to the corresponding standard fields to eliminate ambiguity.
[0089] It can be understood that the potential ambiguity fields in the extracted results are detected, and the field expressions that may have multiple semantic interpretations are identified; the data source position and the context scene where the potential ambiguity fields appear are analyzed, and the specific page area and function module where the fields appear are investigated; collaborative semantic reasoning is performed with other related data fields appearing in the same scene, and the co-occurrence relationship and semantic association between the fields are utilized; the most possible semantic attribution of the potential ambiguity fields is comprehensively determined according to the association rules and context weight configuration in the dynamic semantic knowledge base, and it is accurately mapped to the corresponding standard field to eliminate ambiguity.
[0090] For example, in the data processing process of an e-commerce platform, it is detected that the field "apple" has ambiguity (may refer to fruit or brand); it is analyzed that the data source position where the field appears is "product detail page-parameter table", and the context scene where it is located is mobile product specification description; collaborative reasoning is performed with other fields appearing in the same scene such as "brand", "model", and "processor", and it is found that the field is highly related to "electronic product"; according to the association rules ("apple" and "brand" have a co-occurrence weight of 0.92, and "apple" and "fruit" have a co-occurrence weight of 0.15) and context weight configuration in the dynamic semantic knowledge base, it is determined that the semantic attribution of "apple" in this scene is the brand field, which is mapped to the standard field "brand"; in the processing process, a confidence threshold of 0.8 is set, and when the predicted confidence is lower than the threshold, an artificial review process is automatically triggered.
[0091] In some of the applications, the semantic alignment results are checked according to rules, and the large language model is optimized by fine-tuning based on the checking results, and the dynamic semantic knowledge base is updated, including automatically checking the semantic alignment results based on the format constraints and logical rules defined in the dynamic semantic knowledge base; collecting error samples and correction results generated in the checking process to construct a training data set for optimizing the large language model; using a small sample fine-tuning method to incrementally train and optimize the used large language model; synchronously updating the new field mapping relationship and semantic rules confirmed by the checking to the dynamic semantic knowledge base.
[0092] It can be understood that the semantic alignment result is automatically checked based on the format constraint conditions and logical consistency rules predefined in the dynamic semantic knowledge base, and the data expressions and mapping relationships that do not conform to the specifications are identified; error samples and their corresponding correction results generated in the checking process are collected to build a high-quality training data set for parameter optimization of a large language model; a small sample fine-tuning method with efficient parameters is used to incrementally train and optimize the performance of the large language model used, improving the model's understanding and processing ability of specific domain semantics; the new field mapping relationship and semantic rules confirmed through checking are updated to the dynamic semantic knowledge base, including expanding the synonymous field set and perfecting the context association rules, realizing the continuous evolution of the processing ability.
[0093] For example, in the verification of the semantic alignment result of e-commerce data, based on the format constraint (must be a number and can have a currency symbol) of the "product price" field in the dynamic semantic knowledge base, it is detected that "product price: about 400 yuan" does not conform to the specification, and is marked as an abnormal sample; collect such error samples and manual correction results (change to "product price: 400 yuan"), and build a training data set after collecting 200 samples in one day; use the LoRA fine-tuning method (set the rank to 64 and the learning rate to 0.0002) to incrementally train the large language model, and the training period is 50 epochs; after training, the confirmed "special price → product price" new mapping relationship is added to the basic semantic dictionary, and the edge connection of the corresponding node in the context association graph is increased (the weight is initialized to 0.75).
[0094] The following will be described in detail Figures 2 to 5 Another embodiment of the heterogeneous data semantic alignment method of the present application is described below:
[0095] As Figure 2 , Figure 3 , Figure 4 and Figure 5 shown, this embodiment includes the following steps:
[0096] Heterogeneous Data Multi-Source Acquisition and Type Labeling: This involves combining front-end tracking technology with multimodal acquisition tools to collect various heterogeneous data from the web front-end. DOM parsing tools (such as Cheerio and Jsoup) are used to collect structured and semi-structured data such as forms and lists from HTML structures. OCR technology (such as Tesseract and PaddleOCR) combined with image preprocessing layers (including distortion removal and super-resolution reconstruction modules) is used to extract unstructured text data from images and SVG graphics. Dynamic rendering monitoring tools (such as MutationObserver) are used to capture asynchronously loaded dynamic data, and timestamp information is added to all collected data. After collection, the data is labeled with multiple dimensions, including data format (such as "table", "text paragraph", "image text", etc.), source location (such as "product details page - parameter area", "comment area - user comments", etc.), and basic field tags (such as initially labeling as "price related", "name related", etc.).
[0097] Unified Extraction of Heterogeneous Data Based on Large Models: A large model with multimodal understanding capabilities (such as GPT-4o or GeminiPro) is selected, and a "data type-extraction template" mapping library is constructed. Adaptive extraction instructions are generated for data of different labeled types: For structured tabular data, the instruction template is "Extract the table header and corresponding cell content, outputting as 'header:content' key-value pairs"; for unstructured text data, the instruction template is "Extract [preset fields, such as 'product name' or 'user rating'] from the text; if synonyms exist, they are uniformly mapped to the preset fields"; for image text data, the instruction template is "Identify text content, semantically split into paragraphs, and extract [preset fields]." The labeled heterogeneous data and corresponding extraction templates are input into the large model. Based on its cross-format data understanding capabilities, the model outputs extraction results in a unified format (such as JSON), containing three sets of information: "original data - extracted fields - field values."
[0098] Dynamic semantic knowledge base construction: Construct a dynamic knowledge base that supports semantic alignment, which uses a hybrid representation architecture and contains three core components: Hybrid representation semantic dictionary: Store field semantic relationships using a combination of word vectors (Word2Vec) and ontology. The word vector dimension is set to 300, and when the cosine similarity is greater than or equal to 0.85, the same field is automatically merged. Context association graph: Store field co-occurrence relationships in a Neo4j graph database. The edge weight is dynamically updated using the following formula: Weight = a * (co-occurrence frequency / total frequency) + (1-a) * model confidence, where a = 0.6 and model confidence is the prediction confidence of the large model. Incremental update interface: Support two update modes: Manual review mode: When a user submits a new field pair, trigger the large model to generate three verification questions (e.g., "Please determine whether'member price' belongs to the 'product price' category"). Automatic discovery mode: When the vector similarity between a new field and an existing field exceeds the threshold of 0.85 for 30 consecutive days, automatically initiate a vote to confirm.
[0099] Large model-driven semantic alignment processing: Based on the dynamic semantic knowledge base, the large model is used to achieve semantic alignment of the extraction results: Field normalization processing: The large model compares the fields in the extraction results with the basic semantic dictionary and maps synonymous fields to standard fields (e.g., "price" and "selling price" are both mapped to "product price"); Cross-data association: Combine context association rules, and the large model analyzes the logical relationships of heterogeneous data from different sources to establish an association index (e.g., "product price" on the product details page and "user-mentioned price" in the comment area are associated through "product ID"); Semantic ambiguity resolution: When a field has multiple meanings (e.g., "apple" may refer to a fruit or a brand), the large model combines data source location and other data in the same scenario (e.g., if there is a "phone parameters" field on the same page, "apple" is determined to be a brand) to resolve semantic ambiguity and determine the field attribution.
[0100] Alignment result verification and iterative optimization: Set up a double verification mechanism: First, rule verification, based on the format constraints in the dynamic semantic knowledge base (e.g., "product price" must be a number with a currency symbol), verify the alignment results, and mark any results that do not meet the rules as "abnormal"; Second, manual verification, display "abnormal" results and 10% of randomly selected normal results to users, who can mark "alignment error" (e.g., "special price not mapped to product price") and make corrections. Collect the corrected samples to build an optimization dataset, and use a small sample fine-tuning method (e.g., LoRA) to fine-tune the large model every 200 samples, update the model's recognition weight for synonymous fields, and synchronize the user-confirmed new synonymous relationships to the dynamic semantic knowledge base.
[0101] The following describes this embodiment in conjunction with application scenarios:
[0102] In the context of processing heterogeneous data related to goods on e-commerce platforms:
[0103] The Cheerio library is used to parse the product detail page HTML structure and collect the "product parameter table" in table form (structured data). Puppeteer is used to monitor the user comments in the comment area that are dynamically loaded (unstructured text data). html2canvas and Tesseract are used to extract the "limited-time offer" text annotations from the main image of the product (picture text data). After collection, type labeling is performed: "product parameter table" is labeled as "format: table, source: product detail page - parameter area, label: parameter related"; user comments are labeled as "format: text paragraph, source: comment area, label: evaluation related"; picture text is labeled as "format: picture text, source: product detail page - main image area, label: price related". Multi-domain case expansion: in the medical health data extraction scenario, when processing electronic medical record data: collect XML format inspection reports exported by HIS system (structured data); OCR recognition results of doctor's handwritten notes (unstructured data); WebSocket push of patient real-time monitoring instruments (dynamic data). During semantic alignment, "BP→blood pressure" and "Blood Pressure→blood pressure" are mapped to the standard field "blood pressure (mmHg)"; when "ACE" appears in both medication records and inspection items, ambiguity resolution is performed through associated fields. GPT-4 model is selected to call the corresponding extraction template from the mapping library: for the product parameter table, use the instruction "extract the table header and cell content in the table, output as 'header: content' key-value pairs", the model outputs: {"product name: XX sports shoes", "material: mesh", "price: 399 yuan"}; for the user comment "this shoe is comfortable to wear, but the selling price of 400+ is a bit expensive", use the instruction "extract the 'user evaluation' mentioned price field", the model outputs: {"user evaluation: this shoe is comfortable to wear", "mentioned price: 400+ yuan"}; for the picture text "limited-time offer! Current price 359", use the instruction "extract price-related content", the model outputs: {"special offer price: 359 yuan"}. Initialize the basic semantic dictionary and include the e-commerce field synonym field mapping: "price, selling price, current price, special offer price"→"product price"; "product name, product name"→"product name". Support users to add "activity price"→"product price" through the interface; when the model detects that "selling price" and "selling price" appear in the same scene in 10 comments, automatically trigger the manual confirmation process, and after passing, add "selling price" to the "product price" synonym set. Large model calls knowledge base for intelligent processing: in the field normalization stage, "price: 399 yuan", "mentioned price: 400+ yuan", "special offer price: 359 yuan" are unified to "product price"; in the cross-data correlation stage, combined with the "product ID" extracted from the parameter table, the three price data are associated with the same product; in the ambiguity resolution stage, for the comment "this shoe is more expensive than Apple", it is determined that "Apple" is a brand and not price information based on the source context.Rule verification finds that the format of "Commodity price: more than 400 yuan" is abnormal (contains non-numeric characters), and is marked as an abnormal result; manual verification confirms that the expression is reasonable, and is corrected to "Commodity price: about 400 yuan"; after accumulating 200 correction samples, the model is fine-tuned using LoRA (rank = 64) to improve the processing capability of fuzzy expressions, and the alignment accuracy is improved from 88% to 94%.
[0104] For the method steps disclosed in the above embodiments, the method steps are described as a series of action combinations for the purpose of simple description, but those skilled in the art should know that the embodiments of the present application are not limited to the order of the described actions, because according to the embodiments of the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0105] As Figure 6 shown, the present application also provides a heterogeneous data semantic alignment system, comprising:
[0106] The heterogeneous data acquisition and labeling module 201 is configured to perform type labeling on the collected Web front-end heterogeneous data according to pre-set dimensions, wherein the pre-set dimensions include data format, source location and basic field label;
[0107] The extraction result output module 202 is configured to construct a mapping relationship between data types and extraction templates, generate extraction instructions corresponding to the data types based on the mapping relationship, input the type-labeled Web front-end heterogeneous data and the corresponding extraction instructions into the large language model, and output unified format extraction results from the large language model;
[0108] The dynamic semantic knowledge base construction module 203 is configured to construct a dynamic semantic knowledge base for supporting semantic alignment, wherein the dynamic semantic knowledge base includes a basic semantic dictionary, context association rules and an incremental update interface;
[0109] The alignment result output module 204 is configured to perform field normalization, cross-data association and semantic ambiguity resolution processing on the extraction results through the large language model based on the dynamic semantic knowledge base, and output semantic alignment results;
[0110] The iterative optimization module 205 is configured to perform rule verification on the semantic alignment results, and optimize the large language model through fine-tuning based on the verification results, and update the dynamic semantic knowledge base.
[0111] It is worth noting that, although only some basic function modules are disclosed in the embodiments of the present application, it does not mean that the composition of the system is limited to the above basic function modules, on the contrary, the meaning expressed by the present embodiment is: on the basis of the above basic function modules, those skilled in the art can add one or more function modules to form infinite embodiments or technical solutions in combination with the prior art, that is, the system is open rather than closed, and the protection scope of the present application claim cannot be limited to the disclosed basic function modules because the present embodiment only discloses individual basic function modules. At the same time, in order to describe conveniently, the above device is described as various units and modules in function. Of course, when implementing the present application, the functions of the units and modules can be implemented in the same or multiple software and / or hardware.
[0112] As shown in Figure 7 The present application also provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of a heterogeneous data semantic alignment method.
[0113] Figure 7 is a structural schematic diagram of an electronic device provided by the embodiments of the present application. As shown in the structure of Figure 7 The electronic device provided in the embodiments of the present application includes one or more processors 710 and memories 720; the processor 710 in the electronic device can be one or more, Figure 7 In the embodiment, the processor 710 is taken as an example; the memory 720 is used for storing one or more programs; the one or more programs are executed by the one or more processors 710, so that the one or more processors 710 implement a heterogeneous data semantic alignment method according to any one of the embodiments of the present application.
[0114] The electronic device can also include an input device 730 and an output device 740.
[0115] The processor 710, the memory 720, the input device 730 and the output device 740 in the electronic device can be connected through a bus or other means, Figure 7 In the embodiment, the connection through the bus is taken as an example.
[0116] The memory 720 in the electronic device, as a kind of computer readable storage medium, can be used to store one or more programs, which can be software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the heterogeneous data semantic alignment method provided in the embodiments of the present application.Processor 710 by running the software program, instruction and module stored in memory 720, thereby performing various functional applications and data processing of electronic device, that is, realizing the above-mentioned method embodiment of a kind of heterogeneous data semantic alignment method.
[0117] Memory 720 can include a program storage area and a data storage area, wherein the program storage area can store operating system, at least one application required by the function;The data storage area can store data created according to the use of electronic device and the like.In addition, the memory 720 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state memory device.In some examples, the memory 720 can further include a memory remotely arranged with respect to the processor 710, which can be connected to the device through a network.These examples of the above-mentioned network include but are not limited to the Internet, intranet, local area network, mobile communication network and combination thereof.
[0118] Input device 730 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of electronic device.Output device 740 can include display device such as display screen.
[0119] The present application also provides a computer readable storage medium, which stores a computer program executable by an electronic device, when the computer program runs on the electronic device, so that the electronic device executes the steps of a kind of heterogeneous data semantic alignment method.
[0120] In particular, a computer storage medium of embodiments of the present application can employ any combination of one or more computer readable medium or media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this embodiment, the computer readable storage medium can be any tangible medium that contains or stores a program used by an instruction execution system, apparatus, or device to function or to be combined with the instruction execution system, apparatus, or device.
[0121] Finally, it should be noted that the above embodiments are merely used to illustrate the technical solutions of the present application, rather than limit the present application; even though the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some or all of the technical features can be replaced equivalently; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for semantic alignment of heterogeneous data, characterized in that, include: The collected heterogeneous web front-end data is tagged with types according to preset dimensions, wherein the preset dimensions include data format, source location and basic field labels; Construct a mapping relationship between data types and extraction templates, generate extraction instructions corresponding to the data types based on the mapping relationship, input the type-annotated heterogeneous Web front-end data and the corresponding extraction instructions into the large language model, and output extraction results in a unified format from the large language model. Construct a dynamic semantic knowledge base to support semantic alignment, the dynamic semantic knowledge base including a basic semantic dictionary, context association rules and incremental update interface; Based on the dynamic semantic knowledge base, the extraction results are processed by the large language model to perform field normalization, cross-data association and semantic ambiguity resolution, and output semantic alignment results. The semantic alignment results are validated according to rules, and the large language model is optimized by fine-tuning based on the validation results, while the dynamic semantic knowledge base is updated.
2. The heterogeneous data semantic alignment method according to claim 1, characterized in that, The heterogeneous data collected from the web front-end includes: Parse HTML structure to collect structured and semi-structured data in the form of tables, lists, and forms; Extract unstructured text data from images and graphics; Capture dynamically generated data content during asynchronous loading; Add timestamps and source page information to the collected heterogeneous web front-end data.
3. The heterogeneous data semantic alignment method according to claim 1, characterized in that, Constructing a mapping relationship between data types and extraction templates, and generating extraction instructions corresponding to the data types based on the mapping relationship, further including: Based on structured data in tabular form, a first extraction instruction template is constructed, characterized by extracting the table header and corresponding cell content and outputting key-value pair format. Based on unstructured data of continuous text segments, a second extraction instruction template is constructed, characterized by extracting preset fields and normalizing and mapping various synonyms to standard fields; Based on the text data identified from the image, a third extraction instruction template is constructed, characterized by semantic segmentation and extraction of key fields. Based on the data type to be processed, select and generate the corresponding extraction instructions.
4. The heterogeneous data semantic alignment method according to claim 1, characterized in that, A dynamic semantic knowledge base is constructed to support semantic alignment. This dynamic semantic knowledge base includes a basic semantic dictionary, context association rules, and an incremental update interface, and further includes: Construct a basic semantic dictionary that stores a set of synonym fields and automatically merges them based on vector similarity; Construct a correlation graph by establishing co-occurrence relationships between record fields and dynamically adjusting edge weights using a weighted strategy that integrates co-occurrence statistics and prediction confidence. Build an incremental update interface that supports automatic discovery and prompts for confirmation of new associations; By constructing a basic semantic dictionary, a relational graph, and an incremental update interface, the coverage and accuracy of the dynamic semantic knowledge base are collaboratively optimized.
5. The heterogeneous data semantic alignment method according to claim 1, characterized in that, Based on the dynamic semantic knowledge base, the extraction results are normalized using the large language model, further including: The original fields in the extraction results are compared with the basic semantic dictionary for similarity and semantic matching; Automatically identify and aggregate different field representations that express the same semantics; Based on the predefined standard field system within the basic semantic dictionary, the identified synonym fields are uniformly mapped to the corresponding standard fields; Output the normalized results of fields with consistent semantic identification.
6. The heterogeneous data semantic alignment method according to claim 1, characterized in that, Based on the dynamic semantic knowledge base, the extraction results are further processed by the large language model to resolve semantic ambiguities, including: Detect potentially ambiguous fields in the extraction results; Analyze the data source location and context in which potentially ambiguous fields appear; Collaborative semantic reasoning is performed by combining other relevant data fields appearing in the same scenario; Based on the association rules and context weights in the dynamic semantic knowledge base, the semantic attribution of potentially ambiguous fields is determined and mapped to the corresponding standard fields to eliminate ambiguity.
7. A heterogeneous data semantic alignment method according to claim 1, characterized in that, The semantic alignment results are validated according to rules, and the large language model is optimized through fine-tuning based on the validation results, while the dynamic semantic knowledge base is updated. This further includes: The semantic alignment results are automatically verified based on the format constraints and logical rules defined in the dynamic semantic knowledge base. Collect error samples and correction results generated during the verification process to construct a training dataset for large language model optimization; A small-sample fine-tuning method is used to incrementally train and optimize the large language model. The new field mapping relationships and semantic rules confirmed through verification will be synchronously updated to the dynamic semantic knowledge base.
8. A heterogeneous data semantic alignment system, characterized in that, include: The heterogeneous data acquisition and labeling module is configured to label the collected heterogeneous web front-end data according to preset dimensions, wherein the preset dimensions include data format, source location and basic field labels; The extraction result output module is configured to construct a mapping relationship between data types and extraction templates, generate extraction instructions corresponding to the data types based on the mapping relationship, input the type-annotated heterogeneous Web front-end data and the corresponding extraction instructions into the large language model, and output extraction results in a unified format from the large language model. The dynamic semantic knowledge base construction module is configured to build a dynamic semantic knowledge base to support semantic alignment. The dynamic semantic knowledge base includes a basic semantic dictionary, context association rules, and an incremental update interface. The alignment result output module is configured to perform field normalization, cross-data association, and semantic ambiguity resolution on the extracted results based on the dynamic semantic knowledge base and the large language model, and output semantic alignment results. The iterative optimization module is configured to perform rule verification on the semantic alignment results, optimize the large language model through fine-tuning based on the verification results, and update the dynamic semantic knowledge base.
9. An electronic device, characterized in that, include: The system includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of the method according to any one of claims 1 to 7.