A data analysis method based on automatic processing
By building an automated processing pipeline, unified processing of real-time data streams and offline files was achieved, solving the problem of tight coupling between data parsing and filtering logic. Support for format expansion does not require modification of existing code, thus improving the system's flexibility and maintainability.
Patent Information
- Application Number
- CN202611377353.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, real-time data streams and offline file analysis rely on independent execution paths and lack a unified abstract model. This results in tight coupling between data parsing and filtering logic, requiring simultaneous modification of filtering rules when expanding to new formats, and necessitates significant manual intervention.
By constructing a unified automated processing pipeline for data access, format recognition, plug-in decoupling parsing, and standardized filtering, we can achieve unified processing of different data sources and encoding formats. Using the parser registry and standardized structured data, we can support format expansion without modifying existing code logic.
It achieves fully automated processing of real-time streams and offline files, ensuring consistency of analysis results, reducing the integration complexity of format extensions, and improving the system's flexibility and maintainability.
Smart Images

Figure CN123178121A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically to a data parsing method based on automated processing. Background Technology
[0002] Data parsing is an indispensable basic processing step in fields such as network communication, industrial automation, Internet of Things and intelligent systems. Its core task is to extract structured information from raw data that is diverse and has various encoding formats, so that it can be directly used by business logic.
[0003] With the continuous expansion of application scenarios and the popularization of data-intensive businesses, the data to be processed exhibits significant characteristics of mixed sources and diverse encoding. At the source level, the system needs to process network telemetry data streams and message queue events in real time, as well as perform offline backtracking of historical files; at the encoding level, structured text and compact binary formats have long coexisted. In existing technologies, real-time stream processing and offline file analysis often rely on independent execution paths, lacking a unified abstract model between parsing, filtering, and searching stages. When businesses need to extract specific information from mixed data sources, manual coordination of data acquisition, format adaptation, and content searching between different tools is usually required. Furthermore, because the parsing logic is tightly coupled with subsequent filtering logic, once the system needs to be expanded to support new data formats, not only is it necessary to develop independent parsing units, but also to simultaneously modify the filtering rules.
[0004] Therefore, in complex mixed data environments, this field still needs a data parsing solution that can be compatible with real-time data streams and offline files, adapt to multiple encoding formats, and provide a consistency filtering mechanism, in order to reduce manual intervention and reduce the integration complexity caused by format expansion. Summary of the Invention
[0005] This invention provides a data parsing method based on automated processing. By constructing an automated processing pipeline that decouples parsing and standardized filtering through unified data access, format recognition, and plug-in functionality, it solves the technical problems in existing technologies such as tight coupling between parsing logic and filtering, separation of real-time and offline processing paths, and lack of a unified filtering mechanism for multi-source heterogeneous data.
[0006] This invention is achieved through the following technical solution:
[0007] A data parsing method based on automated processing includes:
[0008] Obtain raw data from different data sources and encapsulate various types of raw data into raw data objects with a unified internal structure;
[0009] The encoding format of the data body of the original data object is identified to determine the format type identifier corresponding to the data body;
[0010] Based on the format type identifier, a parser matching the format type identifier is called from the parser registry. The parser extracts fields and transforms values in the data body and outputs standardized structured data. The standardized structured data includes at least a uniformly regulated time attribute field and a content attribute field.
[0011] The system receives filtering conditions, compares the values of the time attribute field and / or the content attribute field in the standardized structured data with the filtering conditions, retains or excludes the corresponding record data based on the comparison results, and outputs the filtered record dataset.
[0012] As an optimization, the specific process of acquiring raw data from different data sources and encapsulating various types of raw data into raw data objects with a unified internal structure is as follows:
[0013] The different data sources include real-time network data sources and offline file data sources;
[0014] For real-time network data sources, data acquisition can be triggered when each complete message arrives by listening to a specified network port via Socket communication, or the message body can be automatically obtained when the message is delivered via a message queue subscription mechanism.
[0015] For offline file data sources, read the contents of files in the specified directory;
[0016] The acquired real-time network data or offline file data are all encapsulated into the original data object. The original data object contains at least a data body and metadata. The metadata includes a data source type identifier, time attribute, and source address information. The original data object has a unified data structure definition, that is, the original data objects from the real-time network data source and the offline file data source all contain the same set of fields, and the field names and data types of each field are consistent.
[0017] As an optimization, the specific process of identifying the encoding format of the data body of the original data object and determining the format type identifier corresponding to the data body is as follows:
[0018] Parse the data type identifier carried in the original data object;
[0019] Detect the header feature bytes and / or magic number of the data body;
[0020] The data body is subjected to structural trial parsing to verify whether the data body conforms to the predetermined syntax rules;
[0021] Based on the identification results of at least one of the above identification methods, the format type identifier is output; if it cannot be identified, an unknown format notification is issued and the processing of the original data object is terminated.
[0022] As an optimization, before calling the parser that matches the format type identifier from the parser registry, the following is also included: defining a parser interface specification, which defines a unified parser behavior contract, including at least: an input interface for receiving raw data bodies, a parsing execution interface for extracting fields and transforming values from the data bodies, and an output interface for outputting standardized structured data, and all parsers implement this interface specification;
[0023] Maintain the parser registry, which stores the mapping relationship between the format type identifier and the corresponding parser instance;
[0024] It provides registration and deregistration interfaces for external calls to dynamically add or remove parsers and their corresponding mappings from the parser registry.
[0025] As an optimization, when support for new encoding formats is required:
[0026] Develop a new parser based on the parser interface specification;
[0027] Call the registration interface to register the new parser and its corresponding format type identifier into the parser registry;
[0028] Once the new format type identifier is identified, the new parser is automatically called from the parser registry to perform parsing, obtain raw data from different data sources, identify the encoding format of the data body of the raw data object, and receive filtering conditions and output the filtered record dataset. The existing code logic does not need to be modified.
[0029] As an optimization, in the standardized structure data:
[0030] The time attribute field adopts a unified timestamp format, and the content attribute field adopts a unified character encoding format;
[0031] Data from different data sources and with different original encoding formats is parsed and output as standardized structured data with consistent field identifiers and data types, so that when receiving filtering conditions and outputting the filtered record dataset, it can be processed in a unified field access manner.
[0032] As an optimization, the filtering criteria include time-based filtering criteria:
[0033] Get the start and end times configured by the user, or get the sliding window offset configured by the user based on the current time.
[0034] Iterate through the time attribute field values of each data item in the standardized structured data;
[0035] If the value of the time attribute field falls within the absolute time interval defined by the start time point and the end time point, or falls within the time window defined by the sliding window offset, then the data is retained; otherwise, it is excluded.
[0036] As an optimization, the filtering criteria include content matching criteria:
[0037] Obtain user-configured keywords or string patterns, wherein the keywords or string patterns support fuzzy matching or exact matching;
[0038] Perform a matching operation on the content attribute field value of each piece of data in the standardized structured data;
[0039] If the content attribute field value contains the keyword or matches the string pattern, the data entry is retained; otherwise, it is excluded.
[0040] As an optimization, the specific process of comparing the values of the time attribute field and / or the content attribute field in the standardized structured data with the filtering conditions, retaining or excluding the corresponding record data based on the comparison results, and outputting the filtered record dataset is as follows:
[0041] Simultaneously accept time-based filtering conditions and content-matching conditions;
[0042] For each record, the value of the time attribute field is compared with the time filtering conditions, and the value of the content attribute field is compared with the content matching conditions;
[0043] The record data is retained only when the value of the time attribute field matches the time filter condition and the value of the content attribute field matches the content matching condition, and the record dataset after double filtering is output.
[0044] As an optimization, the encapsulation of the original data object, the identification and determination of the format type identifier, the calling of the parser and the output of standardized structured data, and the receiving of the filtering conditions and the output of the recorded dataset are executed sequentially, forming an automated processing pipeline from obtaining the original data to outputting the filtering results.
[0045] Data is transferred between each stage through the original data object and the standardized structure data. Adding or modifying any parser in the parser registry, as well as changing the filtering conditions, does not affect the execution logic of other stages.
[0046] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0047] This invention encapsulates and integrates real-time network reception and offline file reading data into the same processing path, eliminating the need for manual connection between real-time streams and historical files due to independent mechanisms. It achieves fully automated processing from acquisition to output, ensuring consistency between real-time and offline analysis results, and solving the problem that real-time stream processing and offline file analysis depend on mutually independent execution paths.
[0048] This invention separates automatic format recognition from the parser registry. When adding a new data format, only a new parser needs to be developed and registered according to the parser interface specification. There is no need to modify the existing code logic for data access, format recognition, and filtering output. This solves the problems of tight coupling between parsing and filtering logic and the need to modify filtering rules simultaneously when expanding to new formats.
[0049] This invention parses data from different sources and in different formats into structured records with standardized time attribute fields and content attribute fields, enabling time filtering and content matching filtering to be applied consistently to all data. This overcomes the problem of inconsistent field identifiers and the difficulty in establishing a universal filtering mechanism under multiple formats.
[0050] The time filtering conditions and content matching conditions of this invention can be used independently or in combination, and changes to the filtering conditions do not affect the data access, format recognition and parsing and other pre-processing steps, further improving the flexibility and maintainability of the system. Attached Figure Description
[0051] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0052] Figure 1 This is a flowchart of a data parsing method based on automated processing according to the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0054] Example 1 discloses a data parsing method based on automated processing, including the following steps:
[0055] S1. Obtain raw data from different data sources and encapsulate various types of raw data into raw data objects with a unified internal structure.
[0056] In this embodiment, the data source includes two types: real-time network data source and offline file data source.
[0057] For real-time network data sources, listen on a specified network port (e.g., TCP port 8080) via Socket communication, and trigger data retrieval immediately upon the arrival of each complete message. Alternatively, register a consumer callback function through a message queue subscription mechanism (e.g., Kafka or RabbitMQ) to automatically retrieve the message body when a message is delivered. The received raw data is temporarily stored in memory.
[0058] For example, in an IoT platform scenario, the system continuously receives UDP packets reported by thousands of temperature and humidity sensors via Socket. Each device reports one data packet every 10 seconds, and the packet content is a raw byte stream in binary format.
[0059] For offline file data sources, read the contents of files in a specified local directory, such as reading historical log files in the path / var / log / device / 2026-07-27.log.
[0060] The acquired real-time network data or offline file data is encapsulated into raw data objects. Each raw data object contains at least two parts: the data body (i.e., the original message or file content) and metadata. Metadata includes a data source type identifier (e.g., labeled "network" or "file"), time attributes (receive timestamp for real-time data, file modification time for offline files), source address information (source IP address and port number for real-time data, e.g., 192.168.1.100:54321; full file path for offline files, e.g., / var / log / device / 2026-07-27.log), and auxiliary information such as file size and reading method. This raw data object has a unified data structure definition; that is, raw data objects from both real-time network data sources and offline file data sources contain the same set of fields, with consistent field names and data types. Therefore, real-time and offline data are treated equally in subsequent processing, eliminating the connection costs associated with separating real-time and offline paths.
[0061] For example, a temperature and humidity report from a real-time network data source, after being encapsulated into a raw data object, has the following structure:
[0062] {
[0063] “data_body”: “0xAA 0x01 0x1F 0x4B 0x2C 0x0D”, / / Raw byte stream
[0064] “meta”:
[0065] {
[0066] "source_type": "network",
[0067] "timestamp": 1699876543,
[0068] "address": "192.168.1.100:54321"
[0069] }
[0070] }
[0071] At the same time, a historical log file from an offline file data source is read and also encapsulated into a raw data object with the same structure:
[0072] {
[0073] "data_body": "2026-07-26 14:30:00|device_100|temp=25.6 hum=68",
[0074] “meta”:
[0075] {
[0076] "source_type": "file",
[0077] "timestamp": 1699780000
[0078] “address”: “ / var / log / device / 2026-07-26.log”
[0079] }
[0080] }
[0081] As can be seen, although the two original data objects have different sources and completely different data body contents, their data structures are completely identical. Both contain a `data_body` field and a `meta` field, and the `meta` field contains three subfields: `source_type`, `timestamp`, and `address`. The field names and data types are exactly the same. Subsequent processing modules only need to read the data using the same set of field names, without needing to distinguish the data source.
[0082] S2. The encoding format of the data body of the original data object is identified to determine the format type identifier corresponding to the data body.
[0083] The identification methods include one or more combinations of the following:
[0084] (1) Parse the data type identifier carried in the original data object (e.g., the format type field actively reported by the data source).
[0085] (2) Detect the header feature bytes and / or magic number of the data body (e.g., the magic number of the header of a PNG image is "89 50 4E47", and JSON text usually starts with "{" or "[");
[0086] (3) Perform a structural trial parsing of the data body to verify whether it conforms to specific syntax rules (for example, try to parse it according to JSON syntax, and if no exception is thrown, it is determined to be in JSON format).
[0087] Based on the identification results of at least one of the above identification methods, output a format type identifier, such as format:json, format:xml, format:binary_sensor_v1, etc. If none of the identification methods can determine the format, issue a format unknown notification and terminate the processing of the original data object. It can be stored in an exception queue for manual intervention.
[0088] Continuing with the previous example, the data body from the real-time network data source in S1 is a binary byte stream "0xAA 0x01 0x1F0x4B 0x2C 0x0D". The format recognition module first parses the metadata and finds that it does not carry a data type identifier; then it checks the header feature bytes and finds that the first byte 0xAA does not conform to the magic number feature of known text formats (such as "{" in JSON or "<" in XML); finally, it attempts to perform structural probing according to common formats such as JSON and XML, all of which throw exceptions. Based on the above results, it is determined to be an unrecognizable unknown format, the system issues an unknown format notification and stores the data body in the exception queue.
[0089] Meanwhile, the data body from the offline file data source in S1 is the string "2026-07-26 14:30:00|device_100|temp=25.6 hum=68". The format recognition module detects the header character "2026-07-26" and, through tentative parsing, determines that it conforms to the system's predefined pipe-delimited text format (CSV variant), and outputs the format type identifier format:pipeline_csv.
[0090] For example, if a data body starts with "{" and is successfully parsed using JSON syntax, the output format type identifier is format:json; if the data body starts with "<" and the root node is fully closed, the output is format:xml.
[0091] S3. Before officially calling the parser, it is necessary to build the parser registry and parser interface specifications in advance.
[0092] The parser interface specification defines a unified parser behavior contract, which includes at least: an input interface for receiving raw data bodies, a parsing execution interface for extracting fields and transforming values from the data bodies, and an output interface for outputting standardized structured data. All parsers implement this interface specification.
[0093] The parser registry stores the mapping between format type identifiers and their corresponding parser instances. For example, the registry maintains the following mappings: format:json → JsonParser instance, format:xml → XmlParser instance, format:pipeline_csv → CsvParser instance. It also provides registration and deregistration interfaces for external calls to dynamically add or remove parsers and their corresponding mappings from the parser registry.
[0094] After format recognition is complete, the system searches for and calls a matching parser from the parser registry based on the format type identifier. The parser receives the raw data body as input, performs field extraction and value transformation operations on the data body, and outputs standardized structured data.
[0095] Field extraction refers to extracting the fields required for business operations from the data body according to the syntax rules of the current format. Value transformation refers to converting the extracted field values into a unified format required by the standardized structured data.
[0096] Continuing with the previous example, after the parser corresponding to format:pipeline_csv identified in S2 receives the data body "2026-07-26 14:30:00|device_100|temp=25.6 hum=68", it performs the following operations:
[0097] Field extraction: The string is split by the pipe symbol | to get three fields: the time string "2026-07-26 14:30:00", the device identifier "device_100", and the content string "temp=25.6 hum=68".
[0098] Value conversion: The time string "2026-07-26 14:30:00" is parsed in yyyy-MM-dd HH:mm:ss format and converted into a unified timestamp 1699780000; the content string "temp=25.6 hum=68" is directly used as the value of the content attribute field (using unified UTF-8 character encoding).
[0099] Finally, the parser outputs the following standardized structured data:
[0100] {
[0101] "standard_time": 1699780000,
[0102] “standard_content”: “temp=25.6 hum=68”
[0103] }
[0104] For example, for a JSON data body {"time":"2026-07-27 14:30:00","payload":"heartbeat"}, the corresponding JsonParser performs field extraction, extracting the "time" and "payload" fields. Then, it converts the string value of the "time" field to a unified timestamp (1699876543) and uses the "payload" field value as a content attribute, outputting standardized structured data.
[0105] {
[0106] "standard_time": 1699876543,
[0107] "standard_content": "heartbeat"
[0108] }
[0109] For data in a binary protocol format, assuming a device reports a binary protocol that specifies: bytes 0-3 are a timestamp (big-endian uint32), bytes 4-11 are a device ID string, and bytes 12-15 are a temperature value (big-endian float). The corresponding BinaryParser extracts the fields one by one according to the offset, decodes the bytes according to the agreed data type, and then maps them to the corresponding fields in the standardized structure.
[0110] Ultimately, the standardized structured data output by all parsers has the same field identifiers and data types, that is, it contains at least a time attribute field (using a unified timestamp format) and a content attribute field (using a unified character encoding format). As shown in the example above, regardless of whether the original data is pipe-separated text, JSON, or binary protocol, the final output is a JSON object containing two fields, standard_time and standard_content, with the field names and data types being completely consistent.
[0111] When new encoding formats need to be supported, there's no need to modify existing code logic for data ingestion, format recognition, and output filtering. For example, if the system needs to add support for the Protobuf format, developers only need to develop a ProtobufParser plugin according to the parser interface specification, and then call the registration interface to bind format:protobuf_v1 with the ProtobufParser instance and register it in the parser registry. Afterward, when the format recognition module recognizes the new format:protobuf_v1 identifier, it automatically calls ProtobufParser from the parser registry to perform parsing. Existing JsonParser, XmlParser, CsvParser, etc., remain unaffected, and the code for data ingestion and subsequent output filtering requires no modification. This solves the integration complexity problem of needing to simultaneously modify filtering rules when extending to new formats.
[0112] S4. Receive the filtering conditions configured by the user, compare the values of the time attribute field and / or content attribute field in the standardized structured data with the filtering conditions, retain or exclude the corresponding record data based on the comparison results, and output the filtered record dataset.
[0113] The filtering criteria include time-based filtering criteria and content-matching criteria, which can be used independently or in combination.
[0114] The processing logic for time-based filtering conditions is as follows: Obtain the user-configured start and end times (absolute time intervals), or obtain the user-configured sliding window offset based on the current time (e.g., "last 5 minutes"). Iterate through the time attribute field values of each data entry in the standardized structured data. If the value falls within the absolute time interval defined by the start and end times, or within the time window defined by the sliding window offset, then retain the data entry; otherwise, exclude it.
[0115] For example, if the user configures the absolute time range as "2026-07-26 00:00:00" to "2026-07-26 23:59:59", then the record with the normalized time of 1699780000 (corresponding to 2026-07-26 14:30:00) in S3 will be retained, while the record with the normalized time of 1699876543 (corresponding to 2026-07-27 14:30:00) will be excluded.
[0116] For example, if a user configures the sliding window to "last 5 minutes" and the current system time is 1699876543, then records with time attribute values in the range [1699876243, 1699876543] will be retained, while records earlier than this range will be excluded.
[0117] The content matching logic is as follows: Retrieve the user-configured keywords or string patterns. Keywords or string patterns support fuzzy matching (e.g., containing a specified substring) or exact matching (e.g., perfect equality). Perform a matching operation on the content attribute field value of each data entry in the standardized structured data. If the content attribute field value contains the keyword or matches the string pattern, retain the data entry; otherwise, exclude it.
[0118] For example, if a user configures the keyword as "temp" and selects fuzzy matching, then records in S3 with standard_content as "temp=25.6 hum=68" will be retained (because they contain the substring temp), while records with standard_content as "heartbeat" will be excluded (because they do not contain temp).
[0119] Combination of time and content filtering: When time filtering and content matching conditions are configured at the same time, each record is compared with both conditions simultaneously. Only when the time attribute field value matches the time filtering condition and the content attribute field value matches the content matching condition is the record data retained, and the record dataset after double filtering is output.
[0120] For example, if a user configures both the time filter condition as "all day on July 26, 2026" and the content matching condition as the keyword "temp", then only records that meet both the condition of "time falling on July 26" and "content containing temp" will be output.
[0121] The processes S1 through S4 are executed sequentially, forming an automated processing pipeline from raw data acquisition to filtered result output. Data is transferred between each execution process via raw data objects and standardized structured data: S1 outputs the raw data object to S2, S2 outputs the format type identifier to S3, and S3 outputs the standardized structured data to S4. Adding or modifying any parser in the parser registry (e.g., adding a ProtobufParser) or changing the filtering criteria (e.g., changing the keyword from "temp" to "hum") does not affect the execution logic of other processes, achieving full decoupling between each stage.
[0122] It should be noted that the above embodiments are one of the preferred embodiments of the present invention. Those skilled in the art can also use the following modifications to achieve the purpose of the present invention in actual implementation, all of which fall within the protection scope of the present invention:
[0123] Regarding data access, a proxy process approach can be used instead of the aforementioned embedded monitoring solution. For example, in a large-scale distributed deployment scenario, an independent data acquisition program can be set up to uniformly handle the reception of network data and the reading of offline files in multiple data centers. After acquisition, the data is passed to subsequent processing modules through inter-process communication or shared memory. This approach is suitable for deployment scenarios that require the physical separation of data acquisition and parsing logic.
[0124] Regarding format recognition, a pre-configured fixed mapping relationship between data sources and formats can be provided to users, eliminating the need for automatic recognition. For example, in an industry application scenario where the data source is fixed (e.g., always receiving binary protocol messages from the same type of sensor) and the format remains unchanged over a long period, users can directly specify "Data Source A → format: binary_sensor_v1" in the configuration file. The system will then skip automatic recognition and directly call the corresponding parser, further reducing runtime overhead.
[0125] Regarding parser extensions, a script engine approach can be used instead, which involves loading external script files to implement parsing logic for new formats. For example, in a data platform project that frequently interfaces with third-party devices, developers can write parsing scripts in Python or Lua format and place them in a designated system directory. The system will then dynamically load and execute these scripts without requiring compilation or restarting of the entire application. This approach is suitable for business environments where parsing logic needs frequent adjustments or hot deployment.
[0126] Regarding the filtering process, SQL queries can be used to uniformly perform filtering based on a combination of time ranges and content keywords. For example, in a technical operations team already accustomed to using SQL, users can directly enter `SELECT * FROM dataset WHERE time BETWEEN “2026-07-26” AND “2026-07-27” AND content LIKE “%temp%”`. The system will then parse this SQL condition statement into internal filtering criteria and apply them to the standardized structured dataset.
[0127] Those skilled in the art should understand that the above-described alternatives are equivalent to the corresponding steps in the foregoing embodiments, and both can achieve the inventive objective of the present invention and should fall within the protection scope of the present invention.
[0128] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A data parsing method based on automated processing, characterized in that, include: Obtain raw data from different data sources and encapsulate various types of raw data into raw data objects with a unified internal structure; The encoding format of the data body of the original data object is identified to determine the format type identifier corresponding to the data body; Based on the format type identifier, a parser matching the format type identifier is called from the parser registry. The parser extracts fields and transforms values in the data body and outputs standardized structured data. The standardized structured data includes at least a uniformly regulated time attribute field and a content attribute field. The system receives filtering conditions, compares the values of the time attribute field and / or the content attribute field in the standardized structured data with the filtering conditions, retains or excludes the corresponding record data based on the comparison results, and outputs the filtered record dataset.
2. The data parsing method based on automated processing according to claim 1, characterized in that, The specific process of acquiring raw data from different data sources and encapsulating various types of raw data into raw data objects with a unified internal structure is as follows: The different data sources include real-time network data sources and offline file data sources; For real-time network data sources, data acquisition can be triggered when each complete message arrives by listening to a specified network port via Socket communication, or the message body can be automatically obtained when the message is delivered via a message queue subscription mechanism. For offline file data sources, read the contents of files in the specified directory; The acquired real-time network data or offline file data are all encapsulated into the original data object. The original data object contains at least a data body and metadata. The metadata includes a data source type identifier, time attribute, and source address information. The original data object has a unified data structure definition, that is, the original data objects from the real-time network data source and the offline file data source all contain the same set of fields, and the field names and data types of each field are consistent.
3. The data parsing method based on automated processing according to claim 1, characterized in that, The specific process of identifying the encoding format of the data body of the original data object and determining the format type identifier corresponding to the data body is as follows: Parse the data type identifier carried in the original data object; Detect the header feature bytes and / or magic number of the data body; The data body is subjected to structural trial parsing to verify whether the data body conforms to the predetermined syntax rules; Based on the recognition results of at least one of the above recognition methods, the format type identifier is output; If the format cannot be identified, an unknown format notification is issued and processing of the original data object is terminated.
4. The data parsing method based on automated processing according to claim 1, characterized in that, Before calling the parser that matches the format type identifier from the parser registry, the process includes: defining a parser interface specification that defines a uniform parser behavior contract, including at least: an input interface for receiving raw data bodies, a parsing execution interface for extracting fields and transforming values from the data bodies, and an output interface for outputting standardized structured data, all of which are implemented by all parsers. Maintain the parser registry, which stores the mapping relationship between the format type identifier and the corresponding parser instance; It provides registration and deregistration interfaces for external calls to dynamically add or remove parsers and their corresponding mappings from the parser registry.
5. The data parsing method based on automated processing according to claim 4, characterized in that, When support for new encoding formats is required: Develop a new parser based on the parser interface specification; Call the registration interface to register the new parser and its corresponding format type identifier into the parser registry; Once the new format type identifier is identified, the new parser is automatically called from the parser registry to perform parsing, obtain raw data from different data sources, identify the encoding format of the data body of the raw data object, and receive filtering conditions and output the filtered record dataset. The existing code logic does not need to be modified.
6. The data parsing method based on automated processing according to claim 1, characterized in that, In the standardized structural data: The time attribute field adopts a unified timestamp format, and the content attribute field adopts a unified character encoding format; Data from different data sources and with different original encoding formats is parsed and output as standardized structured data with consistent field identifiers and data types, so that when receiving filtering conditions and outputting the filtered record dataset, it can be processed in a unified field access manner.
7. The data parsing method based on automated processing according to claim 1, characterized in that, The filtering criteria include time-based filtering criteria: Get the start and end times configured by the user, or get the sliding window offset configured by the user based on the current time. Iterate through the time attribute field values of each data item in the standardized structured data; If the value of the time attribute field falls within the absolute time interval defined by the start time point and the end time point, or falls within the time window defined by the sliding window offset, then the data is retained; otherwise, it is excluded.
8. The data parsing method based on automated processing according to claim 1, characterized in that, The filtering criteria include content matching criteria: Obtain user-configured keywords or string patterns, wherein the keywords or string patterns support fuzzy matching or exact matching; Perform a matching operation on the content attribute field value of each piece of data in the standardized structured data; If the content attribute field value contains the keyword or matches the string pattern, the data entry is retained; otherwise, it is excluded.
9. The data parsing method based on automated processing according to claim 1, characterized in that, The specific process of comparing the values of the time attribute field and / or the content attribute field in the standardized structured data with the filtering conditions, retaining or excluding the corresponding record data based on the comparison results, and outputting the filtered record dataset is as follows: Simultaneously accept time-based filtering conditions and content-matching conditions; For each record, the value of the time attribute field is compared with the time filtering conditions, and the value of the content attribute field is compared with the content matching conditions; The record data is retained only when the value of the time attribute field matches the time filter condition and the value of the content attribute field matches the content matching condition, and the record dataset after double filtering is output.
10. A data parsing method based on automated processing according to claim 1, characterized in that, The encapsulation of the original data object, the identification and determination of the format type identifier, the calling of the parser and the output of standardized structured data, and the receiving of the filtering conditions and the output of the recorded dataset are executed sequentially, forming an automated processing pipeline from obtaining the original data to outputting the filtering results. Data is transferred between each stage through the original data object and the standardized structure data. Adding or modifying any parser in the parser registry, as well as changing the filtering conditions, does not affect the execution logic of other stages.
