Structured data semantic compression method, apparatus, and medium

By extracting and fusing metadata and semantic text data from historical message sequences to generate feature data, the problem of information loss and resource consumption in existing technologies is solved, and efficient historical message compression and decision support are achieved.

CN123157701APending Publication Date: 2026-11-24BEIJING ELECTRONIC DIGITAL INTELLIGENCE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611458141.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing methods for compressing historical dialogues present a trade-off between preserving information integrity and consuming significant resources, leading to issues such as the easy loss of critical information or increased complexity in data processing.

Method used

By extracting metadata and semantic text data from historical message sequences, feature data is generated. Combined with information fusion strategies, compressed results are produced, retaining key decision-making information and reducing resource consumption.

Benefits of technology

It achieves effective compression of historical messages without increasing the amount of data, while retaining key decision-making information, enabling agents to make correct decisions without rereading data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123157701A_ABST
    Figure CN123157701A_ABST
Patent Text Reader

Abstract

This disclosure relates to a method, apparatus, and medium for semantic compression of structured data. The method includes: in response to a compression triggering condition, acquiring a historical message sequence to be compressed; extracting first structured information corresponding to metadata in the historical message sequence; extracting second structured information corresponding to semantic text data in the historical message sequence; fusing the structured data in the first and second structured information based on an information fusion strategy to generate feature data; and merging the feature data with the summary data corresponding to the historical message sequence to generate a compression result. This effectively extracts and preserves the structured information in the historical message sequence, avoiding the problem of data loss during direct compression, while consuming fewer resources and not increasing the space occupied by the summary data, achieving high-efficiency compression. The generated compression result can effectively assist an agent in making correct decisions without rereading historical data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and more specifically, to a method, apparatus, and medium for structured data semantic compression. Background Technology

[0002] In the current operation of intelligent agents, as the number of dialogue turns continues to increase, the contextual dialogue content becomes excessive, necessitating the compression of historical dialogues to free up storage and processing space. Existing methods for compressing historical dialogues mainly achieve this by generating summaries. However, this method suffers from the problem of discarding important data and key decision content. On the other hand, if the complete information is retained, the summaries become too long, failing to effectively free up significant resources and space. Summary of the Invention

[0003] The purpose of this disclosure is to provide a structured data semantic compression method, apparatus, and medium to solve the aforementioned technical problems.

[0004] To achieve the above objectives, in a first aspect, this disclosure provides a structured data semantic compression method, the method comprising: In response to compression trigger conditions, obtain the historical message sequence to be compressed; Extract the first structured information corresponding to the metadata in the historical message sequence; Extract the second structured information corresponding to the semantic text data in the historical message sequence; Based on the information fusion strategy, the structured data in the first structured information and the second structured information are fused to generate feature data; The feature data and the summary data corresponding to the historical message sequence are merged to generate a compression result, wherein the summary data is obtained by semantic compression based on the historical message sequence.

[0005] Optionally, the step of extracting the first structured information corresponding to the metadata in the historical message sequence includes: Traverse the metadata containing structured data in the historical message sequence; Extract one or more of the following from the metadata: minimum value, maximum value, number of unique values, number of null values, and field type, to generate the first structured information.

[0006] Optionally, the step of extracting the second structured information corresponding to the semantic text data in the historical message sequence includes: Traverse the semantic text data of the historical message sequence; Based on preset matching rules, numerical ranges, missing values, and field types are extracted from the semantic text data in the historical message sequence to generate second structured information.

[0007] Optionally, the step of fusing the structured data in the first structured information and the second structured information based on the information fusion strategy to generate feature data includes: Extract the minimum value, maximum value, number of unique values, and number of null values ​​from the first structured information; Based on the minimum value, maximum value, number of unique values, and number of null values, a numerical range, a cardinality level, a uniqueness level, and a missing value level are generated, wherein the number of unique values ​​is the total number of non-repeating values ​​in the fields of the first structured information, and the number of null values ​​is the number of rows with missing values ​​in the fields of the first structured information. Extract the semantic types from the second structured information; The feature data is generated based on the numerical range, the cardinality level, the uniqueness level, the missing level, and the semantic type. The cardinality level is used to characterize the number of unique values ​​in the structured data, the uniqueness level is used to characterize the degree of repetition in the structured data, and the missing level is used to characterize the degree of missing data in the structured data.

[0008] Optionally, the method further includes: If the minimum, maximum, number of unique values, or number of empty values ​​are missing in the first structured information, the corresponding values ​​in the second structured information are extracted and supplemented to generate the value range, base level, uniqueness level, and missing level.

[0009] Optionally, based on the minimum value, maximum value, number of unique values, and number of null values, a base level is generated, including: The base number level is determined based on the number of unique values. If the number of unique values ​​is in the first preset range, then the base number level is determined to be the first base number level. If the number of unique values ​​is in the second preset range, then the base number level is determined to be the second base number level; If the number of unique values ​​is within a third preset range, then the base number is determined to be the third base number, wherein the number of unique values ​​corresponding to the first base number, the second base number, and the third base number decreases sequentially.

[0010] Optionally, based on the minimum value, maximum value, number of unique values, and number of null values, a uniqueness level is generated, including: Calculate the quantity density based on the number of unique values; If the quantity density is within the first preset density range, then the uniqueness level is determined as the first uniqueness level; If the quantity density is within the second preset density range, then the uniqueness level is determined to be the second uniqueness level; If the quantity density is within the third preset density range, then the uniqueness level is determined to be the third uniqueness level.

[0011] Optionally, based on the minimum value, maximum value, number of unique values, and number of null values, a missing range is generated, including: Calculate the missing rate based on the number of null values; If the missing rate is within the first preset missing range, then the missing level is determined to be the first missing level. If the missing rate falls within the second preset missing range, then the missing level is determined to be the second missing level. If the missing rate is within the third preset missing range, then the missing level is determined to be the third missing level; If the missing rate is within the fourth preset missing range, then the missing level is determined to be the fourth missing level.

[0012] In a second aspect, the present invention provides a structured data semantic compression apparatus, the apparatus comprising: The acquisition module is used to acquire the historical message sequence to be compressed in response to compression trigger conditions; The first extraction module is used to extract the first structured information corresponding to the metadata in the historical message sequence; The second extraction module 203 is used to extract the second structured information corresponding to the semantic text data in the historical message sequence; The fusion module is used to fuse the structured data in the first structured information and the second structured information based on the information fusion strategy to generate feature data; The generation module is used to merge the feature data with the summary data corresponding to the historical message sequence to generate a compression result, wherein the summary data is obtained by semantic compression based on the historical message sequence.

[0013] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0014] The above technical solution extracts first structural information from the metadata of historical message sequences and second structural information from the semantic text data of historical message sequences. By fusing the first and second structural information, feature data is obtained. The feature data effectively extracts and preserves the structured information in the historical message sequences, avoiding the problem of data loss during direct compression. At the same time, it consumes fewer resources and does not increase the space occupied by the summary data, thus achieving high-efficiency compression. The generated compression result can effectively assist the agent in making correct decisions without rereading historical data.

[0015] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0016] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings: Figure 1 This disclosure provides a flowchart illustrating a structured data semantic compression method.

[0017] Figure 2 This is a structural block diagram illustrating a structured data semantic compression apparatus according to an exemplary embodiment.

[0018] Figure 3 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0019] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0020] Existing historical dialogue compression methods face a trade-off between preserving information integrity and consuming a large number of tokens when compressing contextual dialogues, rendering the compression meaningless. Enhancing compression prompts may lead to instability in the output format of the agent, i.e., the LLM (Large Language Model), resulting in the loss of key information. Using external knowledge bases for storage increases the complexity of data processing. Existing solutions have failed to effectively address the challenge of discarding most information while preserving crucial decision-making information during compression.

[0021] Figure 1 This is a flowchart illustrating a structured data semantic compression method provided in an embodiment of this disclosure. Figure 1 As shown, the method may include the following steps: S101. In response to the compression trigger condition, obtain the historical message sequence to be compressed.

[0022] Specifically, the compression trigger conditions are preset conditions for the structured data semantic compression process. For example, compression can be triggered when the agent's context approaches its preset upper limit, or when the length or size of the historical message sequence reaches a specific threshold. When compression is triggered, the historical message sequence to be compressed is obtained. The historical message sequence consists of dialogue records, tool call results, and other relevant information accumulated by the agent over a period of time. This sequence typically includes various data types, such as metadata and unstructured semantic text data.

[0023] S102. Extract the first structured information corresponding to the metadata in the historical message sequence.

[0024] Specifically, metadata refers to the original business data corresponding to the historical message sequence. In this embodiment, it mainly refers to structured metadata. First structured information is extracted from the metadata in the historical message sequence. This first structured information may include key attributes that summarize the metadata, such as numerical range, uniqueness, or missing information.

[0025] S103. Extract the second structured information corresponding to the semantic text data in the historical message sequence.

[0026] Specifically, semantic text data refers to the natural language text content included in historical message sequences, such as user input, agent responses, or summaries generated by large language models. Secondary structured information related to the structured data is extracted from the natural language text. This secondary structured information consists of semantic features identified and quantified from the unstructured semantic text data, and may include, for example, numerical ranges, dates, missing values, or fields.

[0027] S104. Based on the information fusion strategy, the structured data in the first structured information and the second structured information are fused to generate feature data.

[0028] Specifically, after obtaining the first structured information and the second structured information, based on an information fusion strategy, the first structured information and the second structured information can be concatenated and fused to generate feature data. For example, data from the same parts of the first structured information and the second structured information can be integrated, and the different parts can be weighted and summed, with the weights set to fixed values ​​according to a preset, to generate feature data.

[0029] S105. Merge the feature data with the summary data corresponding to the historical message sequence to generate a compression result, wherein the summary data is obtained by semantic compression based on the historical message sequence.

[0030] The summary data obtained through semantic compression retains the core semantics of the historical message sequence and can be obtained through direct compression based on contextual semantics by an intelligent agent. Feature data and summary data are merged; the merging method can be that the feature data is used as a prefix or suffix to the summary data, or the feature data is embedded into a preset position in the summary data, thereby generating the final compressed result. During contextual compression, by adding feature data, key decision-making information in historical messages is effectively extracted and retained, while achieving efficient compression without significantly increasing the data volume. This avoids the problems of information loss, excessive token consumption, and increased system complexity in existing technologies. The generated compressed result can effectively assist the intelligent agent in making correct decisions without rereading the data.

[0031] As an optional implementation, step S102, extracting the first structured information corresponding to the metadata in the historical message sequence, includes: Traverse the metadata containing structured data in the historical message sequence; Extract one or more of the following from the metadata: minimum value, maximum value, number of unique values, number of null values, and field type, to generate the first structured information.

[0032] In one implementation, after acquiring the historical message sequence to be compressed, traversal involves systematically examining and extracting each piece of metadata containing structured data within the historical message sequence. The traversal process ensures that all relevant metadata can be identified and extracted to generate accurate initial structured information. Traversal can be achieved, for example, by iterating through data records one by one, filtering specific fields using a database query language, or by using a file parser to structurally read data files of a specific format.

[0033] Based on this, key structured features are extracted from the traversed metadata, including but not limited to one or more of the following: minimum value, maximum value, number of unique values, number of null values, and field type, to generate the first structured information. The minimum and maximum values ​​can characterize the distribution range of numerical data, reflecting the upper and lower limits of the data, facilitating subsequent data range verification and outlier detection. The number of unique values ​​quantifies the number of non-repeating values ​​in a field, serving as an important indicator of data dispersion or cardinality. For example, a high number of unique values ​​may indicate that the field has unique identifiers, while a low number of unique values ​​may indicate that the field is categorical or other data. The number of null values ​​is used to count the number of rows with missing data in a field, reflecting the data's completeness and quality. The field type clarifies the attributes of the data itself, such as whether it is an integer, floating-point number, string, or date / time, which helps the agent understand the data semantics and provides a foundation for guiding subsequent data processing. By selectively extracting structured features, the amount of information and processing complexity can be flexibly balanced according to the actual application scenario and data characteristics, ensuring that the generated first structured information is both comprehensive and efficient.

[0034] In one implementation, metadata may include, for example, column definitions of a data table, key-value structures of JSON (JavaScript Object Notation) objects, or built-in metadata in a binary storage file. Upon starting the traversal, the column definitions of the data table corresponding to the historical message sequence, the key-value structures of the JSON objects, or the built-in metadata in the binary storage file are directly located and iterated through. The minimum value, maximum value, number of unique values, number of null values, and field types are extracted. The extracted fields are then standardized and stored in a preset table, thereby generating the first structured information.

[0035] As an optional implementation, step S103, extracting the second structured information corresponding to the semantic text data in the historical message sequence, includes: Traverse the semantic text data of the historical message sequence; Based on preset matching rules, numerical ranges, missing values, and field types are extracted from the semantic text data in the historical message sequence to generate second structured information.

[0036] In one implementation, the semantic text data of the historical message sequence is traversed to systematically match and extract all semantic text content included in the historical message sequence. This traversal can be sequential, parallel, or index-based, depending on the efficiency requirements of data storage and processing. For example, each message in the historical message sequence can be read one by one, and the semantic text portion of each message can be parsed.

[0037] Based on preset matching rules, numerical ranges, missing values, and field types are extracted from the semantic text data in the historical message sequence. The preset matching rules are predefined patterns, regularization rules, or semantic models used to identify and parse specific types of structured data in the text. For example, for numerical ranges, the rules can identify expressions such as "temperature range: 20-30℃" or "price between 100 and 200" and extract the numerical ranges from them. The preset matching rules can use regular expressions to match numeric patterns and range indicators. For missing values, the preset matching rules can identify text fragments representing missing information, such as "N / A," "unknown," "empty," or specific blank patterns. This can be achieved, for example, through keyword matching or judgment based on text length. For field types, the preset matching rules can infer the data type based on the text format, such as date format, number format, etc., or keywords or contextual information, such as order numbers, user IDs, etc. Data types can include, for example, date, numeric, text, identifier, and category types. The preset matching rules can be implemented in various forms, such as regular expressions, keyword matching, natural language processing techniques, or machine learning models, to adapt to semantic text data of different complexities.

[0038] The extraction process described above ultimately generates the second structured information. This second structured information is a collection of structured data identified from the semantic text data, transforming unstructured or semi-structured text content into a standardized data format. The second structured information maintains the same structure as the first structured information; for example, it can be a data table containing field names, corresponding numerical ranges, missing value statistics, and field types, providing a standardized data foundation for subsequent information fusion and feature data generation.

[0039] As an optional implementation, step S104, which involves fusing the structured data in the first structured information and the second structured information based on an information fusion strategy to generate feature data, includes: S1041. Extract the minimum value, maximum value, number of unique values, and number of null values ​​from the first structured information; S1042. Based on the minimum value, maximum value, number of unique values ​​and number of null values, generate a numerical range, a cardinality level, a uniqueness level and a missing value level, wherein the number of unique values ​​is the total number of non-repeating values ​​in the fields of the first structured information, and the number of null values ​​is the number of rows with missing values ​​in the fields of the first structured information. S1043. Extract the semantic types from the second structured information; S1044. Generate the feature data based on the numerical range, the cardinality level, the uniqueness level, the missing level, and the semantic type. The cardinality level is used to characterize the number of unique values ​​in the structured data, the uniqueness level is used to characterize the degree of repetition in the structured data, and the missing level is used to characterize the degree of missing values ​​in the structured data.

[0040] In one implementation, since the first and second structured information are related structured data extracted from data from different sources in a historical message sequence, an information fusion strategy is used to fuse the first and second structured information to ensure the accuracy of the final generated feature data. Because the most basic structured data in the first structured information has higher accuracy and completeness than that in the second structured information, the minimum value, maximum value, number of unique values, and number of null values ​​are extracted first from the first structured information. The minimum and maximum values ​​define the range of numerical data; the number of unique values ​​refers to the total number of non-repeating values ​​within a field in the first structured information; and the number of null values ​​refers to the number of rows with missing values ​​within a field in the first structured information, which can be used to indicate the degree of data completeness or missing values. These key statistics can be efficiently extracted by traversing each field in the first structured information and utilizing statistical functions, such as database queries, data processing libraries, or programming languages.

[0041] Secondly, based on the extracted minimum, maximum, number of unique values, and number of null values, numerical ranges, cardinality levels, uniqueness levels, and missing value levels are generated. This process organizes and labels the data, transforming discrete values ​​into corresponding ranges or levels, thereby enhancing the usability of the feature data. Numerical ranges can be directly composed of minimum and maximum values, or further mapped to preset intervals. Cardinality levels characterize the level of unique values ​​in the structured data. For example, based on the magnitude of the number of unique values, it can be divided into preset levels such as "low cardinality," "medium cardinality," and "high cardinality" to reflect different levels of data diversity. Uniqueness levels characterize the degree of repetition in the structured data, and missing value levels characterize the degree of missing data. The generation of cardinality levels, uniqueness levels, and missing value levels can be achieved through preset threshold rules or piecewise functions.

[0042] Simultaneously, semantic types are extracted from the second structured information. Semantic types categorize the meaning of text data content, such as date, numerical, text, identifier, and category types, providing semantic information for the agent to understand the meaning of text data. Semantic type extraction can utilize natural language processing techniques, such as named entity recognition, text classification, or keyword extraction, to analyze and classify semantic text data.

[0043] Finally, based on the generated numerical range, cardinality level, uniqueness level, missing level, and extracted semantic type, the feature data is generated. The fusion strategy may include encoding these levels and semantic types into vectors and then concatenating them. For example, the numerical range, cardinality level, uniqueness level, missing level, and semantic type can be integrated into a single vector. Alternatively, it can be a text format, separated by delimiters, for example: feature data as: [Semantic Type]|[Range / Cardinality Level]|[Uniqueness Level]|[Missing Level].

[0044] In one implementation, the fusion strategy performs a consistency check on the data in the first and second structured information. If the consistency check passes, the steps S1041-S1044 described above are followed. If the consistency check for the numerical range fails, the data extracted from the first structured information is still used, and the range extracted from the second structured information is used as the verification data. After generating the compression result, the historical message sequence can be re-acquired based on this verification data, and the first structured information can be re-extracted for repeated verification. If repeated verifications fail, the extraction method is adjusted, or a self-check is performed based on the intelligent agent.

[0045] In one implementation, since the agent may undergo multiple compressions, each compression generates a corresponding feature data. Therefore, when generating feature data, a unit identifier is added to distinguish feature data corresponding to different dialogue intervals. The unit identifier can be determined based on the generation time, the corresponding historical message sequence number, or a preset generation rule. The format of the feature data can be: [Unit Identifier]|[Semantic Type]|[Range / Cardinum Level]|[Uniqueness Level]|[Missing Level], or [Semantic Type]|[Range / Cardinum Level]|[Uniqueness Level]|[Missing Level]|[Unit Identifier]. It should be understood that the format of this feature data is only an example and does not constitute a limitation on the embodiments of this disclosure.

[0046] As an optional implementation, the method further includes: if the minimum value, maximum value, number of unique values, or number of null values ​​are missing in the first structured information, extract the corresponding values ​​from the second structured information to supplement them, so as to generate a value range, a base level, a uniqueness level, and a missing level.

[0047] In one implementation, when extracting first structured information from the metadata of a historical message sequence, if some statistics fail to be extracted or are marked as missing in the first structured information (e.g., some fields have empty or invalid values), they are extracted and supplemented from second structured information. This lack may be due to heterogeneity of the data source, incomplete data collection, or structural limitations of the metadata itself. When a specific statistic is missing in the first structured information, it is supplemented using the second structured information. Furthermore, the data structures of the first and second structured information are consistent. For example, if a certain number of null values ​​are missing, the number of missing values ​​identified in the second structured information is used to supplement the data. This ensures that feature data can be generated completely and accurately.

[0048] As an optional implementation, generating a base value tier based on the minimum value, maximum value, number of unique values, and number of null values ​​includes: determining a base value tier based on the number of unique values; if the number of unique values ​​is in a first preset interval, then the base value tier is determined to be a first base value tier; if the number of unique values ​​is in a second preset interval, then the base value tier is determined to be a second base value tier; if the number of unique values ​​is in a third preset interval, then the base value tier is determined to be a third base value tier. The number of unique values ​​corresponding to the first, second, and third base value tiers decreases sequentially.

[0049] In one implementation, categorizing the number of unique values ​​into tiers simplifies data representation, reduces the complexity of subsequent processing, and better captures the characteristics of data across different cardinality ranges. The number of unique values ​​can be divided into different tiers by defining a series of thresholds or intervals. For example, these intervals can be set based on data volume, business requirements, or rules of thumb. This approach transforms the raw number of unique values ​​into more generalized categories, thereby providing effective features for subsequent agent identification or processing.

[0050] In one implementation, the first preset interval is, for example, greater than or equal to 100. When the number of unique values ​​is greater than or equal to 100, the corresponding base level is the first base level, i.e., the high base level. The second preset interval is, for example, 10-100. When the number of unique values ​​is between 10 and 100, the corresponding base level is the second base level, i.e., the medium base level. The third preset interval is, for example, less than 10. When the number of unique values ​​is less than 10, the corresponding base level is the third base level, i.e., the low base level.

[0051] As an optional implementation, generating a uniqueness level based on the minimum value, maximum value, number of unique values, and number of null values ​​includes: calculating the quantity density based on the number of unique values; if the quantity density is within a first preset density interval, then the uniqueness level is determined as a first uniqueness level. If the quantity density is within a second preset density interval, then the uniqueness level is determined as a second uniqueness level. If the quantity density is within a third preset density interval, then the uniqueness level is determined as a third uniqueness level.

[0052] In one implementation, the quantity density is obtained by calculating the ratio of the number of unique values ​​to the total number of records. This density value is then mapped to different levels to intuitively reflect the amount of duplicate values ​​in the data. After obtaining the quantity density, it is divided into different uniqueness levels according to preset density intervals. The preset density intervals can be set according to the actual application scenario, data characteristics, or statistical analysis results. For example, a first preset density interval can be set as a high-density range, corresponding to the first uniqueness level; a second preset density interval can be set as a medium-density range, corresponding to the second uniqueness level; and a third preset density interval can be set as a low-density range, corresponding to the third uniqueness level, indicating a high degree of data duplication.

[0053] In one implementation, the first preset density range is where the number of unique values ​​is greater than 0.99. When the number density is greater than 0.99, it corresponds to the first uniqueness level, i.e., the low repetition level. The second preset density range is 0.5-0.99. When the number density is between 0.5 and 0.99, it corresponds to the second uniqueness level, i.e., the medium repetition level. The third preset density range is 0.01-0.5, which corresponds to the third uniqueness level, i.e., the high repetition level.

[0054] As an optional implementation, generating a missing value tier based on the minimum value, maximum value, number of unique values, and number of null values ​​includes: calculating a missing rate based on the number of null values; if the missing rate falls within a first preset missing value interval, then the missing value tier is determined as the first missing value tier. If the missing rate falls within a second preset missing value interval, then the missing value tier is determined as the second missing value tier. If the missing rate falls within a third preset missing value interval, then the missing value tier is determined as the third missing value tier. If the missing rate falls within a fourth preset missing value interval, then the missing value tier is determined as the fourth missing value tier.

[0055] In one implementation, the missing rate is calculated as the ratio of the number of null values ​​to the total number of records. This missing rate is then mapped to different levels based on a preset missing range to assess data integrity. Calculating the missing rate allows for a quantitative assessment of the degree of data loss. The preset missing range is determined based on actual application requirements and data characteristics.

[0056] In one implementation, for example, the first preset missing range can be set to 0%. If the missing rate is 0%, the missing level is the first missing level, representing no missing data. The second preset missing range can be set to 0%-5%. If the missing rate is within this range, the missing level is the second missing level, representing a small amount of missing data. The third preset missing range can be set to 5%-20%. If the missing rate is within this range, the missing level is the third missing level, representing moderate missing data. The fourth preset missing range can be set to greater than 20%. If the missing rate is greater than 20%, the missing level is the fourth missing level, representing a large amount of missing data. By dividing the continuous missing rate into several levels, the understanding and processing of the degree of data missing is simplified.

[0057] In one implementation, the generated compressed result includes summary data and feature data, which can be stored together in the agent's context for subsequent reference or processing. The compressed result can be read directly or invoked on demand using a predefined invocation tool.

[0058] Figure 2 This is a structural block diagram illustrating a structured data semantic compression apparatus 200 according to an exemplary embodiment. For example... Figure 2 As shown, the device 200 includes an acquisition module 201, a first extraction module 202, a second extraction module 203, a fusion module 204, and a generation module 205. The acquisition module 201 acquires a historical message sequence to be compressed in response to a compression trigger condition. The first extraction module 202 extracts first structured information corresponding to metadata in the historical message sequence. The second extraction module 203 extracts second structured information corresponding to semantic text data in the historical message sequence. The fusion module 204 fuses the structured data in the first and second structured information based on an information fusion strategy to generate feature data. The generation module 205 merges the feature data with the summary data corresponding to the historical message sequence to generate a compression result, wherein the summary data is obtained by semantic compression based on the historical message sequence.

[0059] As an optional implementation, the first extraction module 202 is specifically used to: traverse the metadata containing structured data in the historical message sequence; extract one or more of the minimum value, maximum value, number of unique values, number of null values, and field type from the metadata to generate first structured information.

[0060] As an optional implementation, the second extraction module 203 is specifically used to: traverse the semantic text data of the historical message sequence; and extract numerical ranges, missing values, and field types from the semantic text data of the historical message sequence based on preset matching rules to generate second structured information.

[0061] As an optional implementation, the fusion module 204 is specifically used to: extract the minimum value, maximum value, number of unique values, and number of null values ​​from the first structured information. Based on the minimum value, maximum value, number of unique values, and number of null values, generate a numerical range, cardinality level, uniqueness level, and missing value level, wherein the number of unique values ​​is the total number of non-repeating values ​​in the fields of the first structured information, and the number of null values ​​is the number of rows with missing values ​​in the fields of the first structured information. Extract the semantic type from the second structured information. Generate the feature data based on the numerical range, cardinality level, uniqueness level, missing value level, and semantic type. The cardinality level is used to characterize the level of unique values ​​in the structured data, the uniqueness level is used to characterize the degree of repetition in the structured data, and the missing value level is used to characterize the degree of missing values ​​in the structured data.

[0062] As an optional implementation, the first extraction module 202 further includes a supplementation module, which is used to: extract the corresponding values ​​from the second structured information to supplement the missing minimum value, maximum value, number of unique values ​​or number of null values ​​in the first structured information, so as to generate a value range, base level, uniqueness level and missing level.

[0063] As an optional implementation, the first extraction module 202 further includes a first generation module, which is used to: determine a base level based on the number of unique values; if the number of unique values ​​is in a first preset range, then the base level is determined to be a first base level; if the number of unique values ​​is in a second preset range, then the base level is determined to be a second base level; if the number of unique values ​​is in a third preset range, then the base level is determined to be a third base level, wherein the number of unique values ​​corresponding to the first base level, the second base level, and the third base level decreases sequentially.

[0064] As an optional implementation, the first extraction module 202 further includes a second generation module, which is used to: calculate the quantity density based on the number of unique values. If the quantity density is within a first preset density range, then the uniqueness level is determined as the first uniqueness level; if the quantity density is within a second preset density range, then the uniqueness level is determined as the second uniqueness level; if the quantity density is within a third preset density range, then the uniqueness level is determined as the third uniqueness level.

[0065] As an optional implementation, the first extraction module 202 further includes a third generation module, which is used to: calculate the missing rate based on the number of null values. If the missing rate falls within a first preset missing range, the missing value level is determined to be the first missing value level; if the missing rate falls within a second preset missing range, the missing value level is determined to be the second missing value level; if the missing rate falls within a third preset missing range, the missing value level is determined to be the third missing value level; and if the missing rate falls within a fourth preset missing range, the missing value level is determined to be the fourth missing value level.

[0066] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0067] Figure 3 This is a block diagram illustrating an electronic device 300 according to an exemplary embodiment. For example, the electronic device 300 may be provided as a server. (Refer to...) Figure 3 The electronic device 300 includes a processor 301, which may be one or more, and a memory 302 for storing computer programs executable by the processor 301. The computer program stored in the memory 302 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processor 301 may be configured to execute the computer program to perform the structured data semantic compression method described above.

[0068] Additionally, the electronic device 300 may also include a power supply component 303 and a communication component 304. The power supply component 303 can be configured to perform power management of the electronic device 300, and the communication component 304 can be configured to enable communication of the electronic device 300, such as wired or wireless communication. Furthermore, the electronic device 300 may also include an input / output (I / O) interface 305. The electronic device 300 can operate on an operating system, such as Windows Server, stored in the memory 302. TM Mac OSX TM Unix TM Linux TM etc.

[0069] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the structured data semantic compression method described above. For example, the computer-readable storage medium may be the memory 302 including the program instructions described above, which may be executed by the processor 301 of the electronic device 300 to complete the structured data semantic compression method described above.

[0070] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a processor, which, when executed by the processor, implements the steps of the structured data semantic compression method described above.

[0071] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and all such simple modifications fall within the protection scope of this disclosure. It should also be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this disclosure will not further describe the various possible combinations.

[0072] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A method for semantic compression of structured data, characterized in that, The method includes: In response to compression trigger conditions, obtain the historical message sequence to be compressed; Extract the first structured information corresponding to the metadata in the historical message sequence; Extract the second structured information corresponding to the semantic text data in the historical message sequence; Based on the information fusion strategy, the structured data in the first structured information and the second structured information are fused to generate feature data; The feature data and the summary data corresponding to the historical message sequence are merged to generate a compression result, wherein the summary data is obtained by semantic compression based on the historical message sequence.

2. The structured data semantic compression method according to claim 1, characterized in that, The step of extracting the first structured information corresponding to the metadata in the historical message sequence includes: Traverse the metadata containing structured data in the historical message sequence; Extract one or more of the following from the metadata: minimum value, maximum value, number of unique values, number of null values, and field type, to generate the first structured information.

3. The structured data semantic compression method according to claim 1, characterized in that, The step of extracting the second structured information corresponding to the semantic text data in the historical message sequence includes: Traverse the semantic text data of the historical message sequence; Based on preset matching rules, numerical ranges, missing values, and field types are extracted from the semantic text data in the historical message sequence to generate second structured information.

4. The structured data semantic compression method according to claim 1, characterized in that, The method of fusing structured data from the first structured information and the second structured information based on the information fusion strategy to generate feature data includes: Extract the minimum value, maximum value, number of unique values, and number of null values ​​from the first structured information; Based on the minimum value, maximum value, number of unique values, and number of null values, a numerical range, a cardinality level, a uniqueness level, and a missing value level are generated, wherein the number of unique values ​​is the total number of non-repeating values ​​in the fields of the first structured information, and the number of null values ​​is the number of rows with missing values ​​in the fields of the first structured information. Extract the semantic types from the second structured information; The feature data is generated based on the numerical range, the cardinality level, the uniqueness level, the missing level, and the semantic type. The cardinality level is used to characterize the number of unique values ​​in the structured data, the uniqueness level is used to characterize the degree of repetition in the structured data, and the missing level is used to characterize the degree of missing data in the structured data.

5. The structured data semantic compression method according to claim 4, characterized in that, The method further includes: If the minimum, maximum, number of unique values, or number of empty values ​​are missing in the first structured information, the corresponding values ​​in the second structured information are extracted and supplemented to generate the value range, base level, uniqueness level, and missing level.

6. The structured data semantic compression method according to claim 4, characterized in that, Based on the minimum value, maximum value, number of unique values, and number of null values, a base level is generated, including: The base number level is determined based on the number of unique values. If the number of unique values ​​is in the first preset range, then the base number level is determined to be the first base number level. If the number of unique values ​​is in the second preset range, then the base number level is determined to be the second base number level; If the number of unique values ​​is within a third preset range, then the base number is determined to be the third base number, wherein the number of unique values ​​corresponding to the first base number, the second base number, and the third base number decreases sequentially.

7. The structured data semantic compression method according to claim 4, characterized in that, Based on the minimum value, maximum value, number of unique values, and number of null values, a unique level is generated, including: Calculate the quantity density based on the number of unique values; If the quantity density is within the first preset density range, then the uniqueness level is determined as the first uniqueness level; If the quantity density is within the second preset density range, then the uniqueness level is determined to be the second uniqueness level; If the quantity density is within the third preset density range, then the uniqueness level is determined to be the third uniqueness level.

8. The structured data semantic compression method according to claim 4, characterized in that, Based on the minimum value, maximum value, number of unique values, and number of null values, a missing range is generated, including: Calculate the missing rate based on the number of null values; If the missing rate is within the first preset missing range, then the missing level is determined to be the first missing level. If the missing rate falls within the second preset missing range, then the missing level is determined to be the second missing level. If the missing rate is within the third preset missing range, then the missing level is determined to be the third missing level; If the missing rate is within the fourth preset missing range, then the missing level is determined to be the fourth missing level.

9. A structured data semantic compression device, characterized in that, The device includes: The acquisition module is used to acquire the historical message sequence to be compressed in response to compression trigger conditions; The first extraction module is used to extract the first structured information corresponding to the metadata in the historical message sequence; The second extraction module is used to extract the second structured information corresponding to the semantic text data in the historical message sequence; The fusion module is used to fuse the structured data in the first structured information and the second structured information based on the information fusion strategy to generate feature data; The generation module is used to merge the feature data with the summary data corresponding to the historical message sequence to generate a compression result, wherein the summary data is obtained by semantic compression based on the historical message sequence.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-8.