Water conservancy data analysis method adaptive to multiple protocols

Through the multi-protocol water conservancy data analysis method, the complex data analysis problem caused by inconsistent protocols of different water conservancy equipment is solved, and the compatible analysis and accurate transmission of data is realized, which reduces system costs and improves data reliability.

CN119652991APending Publication Date: 2025-03-18SHENZHEN DONGSHEN INTELLIGENT TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411848283.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The communication protocols used by different water conservancy equipment and systems are inconsistent, resulting in complex data analysis, increasing system development and maintenance costs, and may lead to data errors or loss of information.

Method used

A water conservancy data analysis method adapted to multiple protocols is proposed. By receiving data to be parsed from multiple protocols, identifying the protocol type, calling the corresponding protocol parser for parsing, and performing data integrity checksum format conversion.

Benefits of technology

It realizes compatible analysis of data of multiple protocols, reduces system update costs, improves data accuracy and reliability, and supports remote data transmission and monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652991A_ABST
    Figure CN119652991A_ABST
Patent Text Reader

Abstract

The invention provides a water conservancy data analysis method adaptive to multiple protocols, and aims to solve the problem of water conservancy data analysis of different protocols. The system firstly receives to-be-analyzed water conservancy data from multiple protocols. The data comprises protocol data which can work on a specific physical layer and adopt a function code mode to agree register data access read-write. The system identifies the specific protocol type corresponding to the data by analyzing the specific field in the to-be-analyzed data, and determines the working mode according to the characteristics of the protocol. And once the protocol type is identified, the system calls a preset protocol analyzer and analyzes the data according to the specific characteristics of the protocol type, and the analyzed result data is output, uploaded and stored to the data server module for subsequent use and analysis. The method can efficiently adapt to multiple protocols, realizes automatic analysis of water conservancy data of different protocols, and is suitable for intelligent data processing requirements of the water conservancy industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer technology, and in particular relates to a water conservancy data parsing method adapted to multiple protocols. Background Art

[0002] Different water conservancy equipment and systems often use different communication protocols, which greatly increases the complexity of data parsing. For example, some old equipment may use more traditional and proprietary protocols, while new equipment may use more advanced but incompatible protocols. This requires a lot of time and effort to develop specific parsing programs when integrating data from different sources, increasing the cost of system development and maintenance. Moreover, differences in data formats between different protocols may lead to errors or information loss during data conversion. The collection environment of water conservancy data is complex and may be affected by various interference factors. In the process of data parsing, if abnormal data cannot be effectively identified and processed, the accuracy of the data will be reduced. For example, sensor failure, communication interference, etc. may cause erroneous values ​​in the data, but existing parsing methods may not be able to detect these problems in time. At the same time, the different precision and measurement range of different equipment will also bring difficulties to the unified parsing and analysis of data. Summary of the invention

[0003] The present invention solves the technical problem that adaptive adjustment cannot be performed according to the actual operation conditions and environmental changes of the water conservancy system by proposing a water conservancy data parsing method adapted to multiple protocols.

[0004] One of the embodiments of the present invention provides a water conservancy data parsing method that is adaptable to multiple protocols, comprising the following steps: a data receiving step: receiving water conservancy data to be parsed from multiple protocols, including protocol-related data to be parsed that can work in a specific physical layer and use a functional code mode to agree on register data access and reading and writing; a protocol type identification step: identifying the specific protocol type corresponding to the data to be parsed, and for the protocol, determining the working mode by analyzing specific fields in the data to be parsed; a data parsing step: according to the identified protocol type, calling a pre-set protocol parser corresponding to the protocol type to parse the data to be parsed, and for the protocol, calling the corresponding parsing rules and algorithms according to its specific characteristics; a result output step: outputting the parsed result data, and uploading and storing it in a data server module.

[0005] Furthermore, the protocol may be selected as the MODBUS protocol.

[0006] In one of the embodiments, the data receiving step also includes: performing an integrity check operation step based on the parsed data, if the check finds that the data is incomplete, issuing a prompt message and waiting for the complete data to be received again; setting data integrity check rules based on the received data and the protocol standard, wherein specific check parameters and logic are determined for the protocol; using a cyclic redundancy check algorithm to perform an integrity check operation on the data to be parsed, and performing the check in RTU mode; if the check finds that the data is incomplete, the prompt message issued should clearly point out the incomplete data and inform the operator in a visual form; after issuing the prompt message, enter a waiting state, continuously monitor whether there is an operation to re-receive the complete data, set a reasonable waiting time limit, and if the complete data is not re-received after the time limit, a reminder can be issued again or further processing can be performed according to a preset error handling process.

[0007] In one of the embodiments, the result output step further includes: converting the format of the water conservancy result data to meet the input format requirements of the data server module.

[0008] In one of the embodiments, the protocol type identification step also includes: starting flag field identification, checking whether there is a specific byte sequence as a starting flag at the beginning of the water conservancy data to be parsed; device address field analysis, analyzing the device address field in the data to be parsed to determine the source device of the data; function code field interpretation, determining the working mode of the protocol according to different function codes; data length field check, used to indicate the length of the subsequent data part.

[0009] In one of the embodiments, the data parsing step also includes: receiving water conservancy data to be parsed; identifying the specific protocol type corresponding to the data to be parsed, and determining the working mode and physical layer information data of the protocol by analyzing specific fields, data formats or feature codes in the data; dynamically loading a pre-set corresponding protocol parser according to the identified MODBUS protocol type, and parsing the data to be parsed after configuring parameters according to the specific situation, and calling corresponding parsing rules and algorithms according to specific features; outputting the parsed results in a standardized format, performing data caching and batch processing, and passing the results to the upper-level application for processing and analysis through an interface with the upper-level application.

[0010] In one of the embodiments, the data caching step includes setting time intervals and data volume conditions for data caching and batch processing, and performing batch storage or analysis after the conditions are met. The interface of the upper-level application is implemented through a function call interface.

[0011] In one of the embodiments, the specific field analysis of the protocol includes identifying the start flag field, analyzing the device address field, interpreting the function code field and checking the data length field.

[0012] In one of the embodiments, the result output step also includes: sorting and formatting the parsed water conservancy data, sorting and formatting the parsed water conservancy data before outputting the result data; verifying the parsed result data to determine the method and mechanism for uploading the data to the data server module; setting the data server module to receive and store the uploaded parsed water conservancy data according to the storage management mechanism.

[0013] Further, the present embodiment preferably uses a MODBUS protocol parser, and the MODBUS protocol parser includes a function code field interpretation and a data length field check, and the function code field interpretation includes determining the operation type of the data. Carefully analyzing the value of the function code field can determine the specific purpose and working mode of the data. For example, function code 0x03 indicates reading a holding register, and function code 0x06 indicates writing a single register. By identifying the function code, it can be inferred whether the data is used to read sensor data, set device parameters, or perform other specific operations. According to different function codes, the working mode of the MODBUS protocol can be further determined, such as master-slave mode, broadcast mode, etc. Data length field check, the data frame of the MODBUS protocol usually includes a data length field to indicate the length of the subsequent data part. By analyzing this field, the integrity and correctness of the data can be verified. If the value of the data length field does not match the length of the actual data part, there may be a data transmission error or a protocol mismatch. In this case, some error correction measures can be taken, such as re-requesting data, checking the communication line, etc.

[0014] In one of the embodiments, the step of setting up the data server module also includes the step of establishing an index and query mechanism, the data server module sets up a database system and a storage management mechanism, and formulates a backup and recovery strategy; a data verification and error correction step, the processing includes checking the value range, data type and consistency of the data, using preset error correction rules to repair errors that can be automatically repaired, and marking errors that cannot be automatically repaired and notifying manual inspection.

[0015] The present invention also provides an embodiment, an electronic device, comprising one or more processors; a storage device, on which one or more programs are stored, when the one or more programs are executed by the one or more processors, the one or more processors implement any method as described in claims 1-9.

[0016] The multi-protocol adapted water conservancy data parsing method provided in the above embodiment has the following beneficial effects: the protocol compatibility is wide, and there are often data sources of multiple different protocols in the water conservancy system. For example, water level sensors produced by different manufacturers may use different communication protocols, such as MODBUS protocol, CAN protocol, etc. The multi-protocol adapted parsing method can receive and process data of these different protocols, avoiding the situation where data is lost or cannot be processed due to protocol incompatibility. This compatibility enables the water conservancy data acquisition system to integrate various types of sensors and equipment, such as rain gauges, flow meters, etc., without the need to build a specific protocol processing system for each device separately, greatly improving the integration and flexibility of the system. Data integration is efficient, and water conservancy data usually needs to be comprehensively analyzed to evaluate the overall status of water conservancy facilities. By adapting the multi-protocol parsing method, data such as water level, flow, water quality, etc. from different protocols can be integrated into one data platform. Reduce the system update cost and improve data accuracy and reliability. This parsing method can strictly verify and correct data of different protocols. During the parsing process, the integrity, format correctness and logical rationality of the data can be checked according to the protocol specifications, supporting remote data transmission and monitoring, which is very important when water conservancy facilities are widely distributed. The parsing method that adapts to multiple protocols can ensure that data of different protocols can be correctly parsed and transmitted to the remote monitoring center. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0018] Figure 1 A working step diagram of a multi-protocol adapted water conservancy data analysis method provided by the first embodiment of the present invention

[0019] Figure 2 A function code response flow chart in the protocol provided for the first embodiment of the present invention;

[0020] Figure 3 A schematic diagram of a data frame in the protocol provided in the first embodiment of the present invention;

[0021] Figure 4 A schematic diagram of parsing function code response data in the protocol provided in the first embodiment of the present invention. DETAILED DESCRIPTION

[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly.

[0024] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features limited to "first" and "second" may explicitly or implicitly include at least one of the features. In addition, if "and / or" or "and / or" appears in the full text, its meaning includes three parallel solutions. Taking "A and / or B" as an example, it includes solution A, solution B, or solutions that satisfy both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in this field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0025] Example 1

[0026] refer to Figure 1 to Figure 4 The present invention solves the technical problem of not being able to perform adaptive adjustments according to the actual operation conditions and environmental changes of the water conservancy system by proposing a water conservancy data parsing method that is adapted to multiple protocols.

[0027] One of the embodiments of the present invention provides a water conservancy data parsing method that is adaptable to multiple protocols, comprising the following steps: a data receiving step: receiving water conservancy data to be parsed from multiple protocols, including protocol-related data to be parsed that can work in a specific physical layer and use a functional code mode to agree on register data access and reading and writing; a protocol type identification step: identifying the specific protocol type corresponding to the data to be parsed, and for the protocol, determining the working mode by analyzing specific fields in the data to be parsed; a data parsing step: according to the identified protocol type, calling a pre-set protocol parser corresponding to the protocol type to parse the data to be parsed, and for the protocol, calling the corresponding parsing rules and algorithms according to its specific characteristics; a result output step: outputting the parsed result data, and uploading and storing it in a data server module.

[0028] In this embodiment, the data receiving step is as follows: receiving water conservancy data to be parsed from a variety of different communication protocols, including but not limited to protocol-related data to be parsed that can run on a specific physical layer and use a function code mode to agree on register data access and reading and writing; the protocol type identification step is as follows: by analyzing specific fields, data formats, feature codes and other information in the data to be parsed, accurately identifying the specific protocol type corresponding to the data to be parsed, and for the protocol, focusing on determining its working mode by analyzing specific fields in the data to be parsed, including but not limited to master-slave mode, broadcast mode, etc.; the data parsing step is as follows: based on the identified protocol type, dynamically calling a pre-set protocol parser that completely corresponds to the protocol type, and deeply parsing the data to be parsed. For the protocol, strictly based on its specific characteristics, such as the specific meaning of the function code, data length and structure, etc., call the corresponding precise parsing rules and efficient algorithms; the result output step is as follows: the parsed result data is standardized and output, and securely uploaded and stored in the data server module to ensure the integrity and accessibility of the data.

[0029] There are often many different communication protocols involved in water conservancy systems. This is because different water conservancy equipment may be produced by different manufacturers, and each manufacturer may use different protocol standards to transmit data. These protocols may differ at various levels such as the physical layer, data link layer, and application layer. In this embodiment, the MODBUS protocol is preferred.

[0030] In addition to the MODBUS protocol, there may be other industrial communication protocols such as Profibus, HART, and some custom protocols. Receiving water conservancy data to be parsed from multiple protocols ensures that the system is compatible with different types of equipment and improves the versatility and flexibility of the system.

[0031] For the data to be parsed related to the MODBUS protocol, it can work on a specific physical layer, such as RS485, Ethernet, etc. Different physical layers determine the mode and medium of data transmission. For example, RS485 is a differential signal transmission method suitable for long-distance transmission; Ethernet transmits data through the network, which is high-speed and reliable. The function code mode is used to agree on register data access reading and writing, which means that specific function codes are used to indicate different operations on registers, such as reading register data, writing register data, etc.

[0032] Accurately receiving water conservancy data of various protocols is the basis of the entire parsing process. If the data reception is erroneous or incomplete, it will affect the subsequent steps of protocol type identification, data parsing and result output. Therefore, it is necessary to ensure the integrity and accuracy of the data during the data reception stage. The reliability of data reception can be improved through checksums, repeated requests, etc.

[0033] Identify the specific protocol type. Since the received water conservancy data may come from different protocols, it is necessary to accurately identify the protocol type corresponding to the data. This step is crucial because different protocols have different parsing methods and rules. If the protocol type cannot be correctly identified, the data cannot be parsed correctly.

[0034] Identifying the protocol type can be achieved by analyzing the specific fields, data formats, or feature codes of the data. For example, different protocols may have specific flag fields at the beginning or end of a data frame, or specific byte sequences at specific locations as feature codes. By identifying these specific information, the protocol type corresponding to the data can be preliminarily determined.

[0035] For the MODBUS protocol, the working mode is determined by analyzing specific fields in the data to be parsed. The MODBUS protocol may have different working modes, such as master-slave mode, broadcast mode, etc. In different working modes, the transmission method and meaning of data may be different. Therefore, accurately determining the working mode of the MODBUS protocol is crucial for correctly parsing the data. Protocol type identification is a complex process, because different protocols may have similar characteristics, or the same protocol may have different manifestations in different application scenarios. Therefore, it is necessary to comprehensively consider multiple factors to identify the protocol type. A combination of multiple methods can be used to improve the accuracy of identification, such as first making a preliminary judgment through a specific field, and then further confirming it in combination with the data format and feature code. At the same time, a protocol feature database can be established to store the feature information of known protocols in the database for rapid comparison during the identification process.

[0036] According to the identified protocol type, the pre-set protocol parser corresponding to the protocol type is called. Each protocol parser is designed for a specific protocol. It understands the data format, parsing rules and algorithms of the protocol and can convert the received raw data into meaningful information.

[0037] For example, if the identified data is the MODBUS protocol, a parser specifically for the MODBUS protocol is called. This parser will parse the data based on the specific features of the MODBUS protocol, such as function code, register address, data length, etc. For different protocols, the implementation of the parser may vary greatly. Some protocols may be relatively simple, and the implementation of the parser is relatively easy; while some protocols may be very complex and require a lot of code and algorithms to implement the parsing function. For the MODBUS protocol, the corresponding parsing rules and algorithms are called according to its specific features. The specific features of the MODBUS protocol include function code, data length, register address, etc. Different function codes correspond to different operations, such as reading registers, writing registers, reading coil status, etc. The parser needs to correctly parse the data based on the meaning of the function code, combined with information such as data length and register address.

[0038] For example, if the function code of the received MODBUS data is to read the register, the parser will extract the corresponding register value from the data according to the data length and register address, and convert it into actual physical quantities, such as water level, flow, etc. The accuracy and efficiency of data parsing are very important. If there is an error in the parsing, it will lead to deviations in subsequent data analysis and decision-making. Therefore, when designing a protocol parser, it is necessary to fully consider various possible situations to ensure the accuracy of the parsing. At the same time, in order to improve the parsing efficiency, some optimization technologies can be adopted, such as parallel parsing and caching mechanism. Parallel parsing can process multiple data frames at the same time to improve the parsing speed; the caching mechanism can cache the data that has been parsed, and the next time the same data is encountered, the result can be directly obtained from the cache to avoid repeated parsing.

[0039] The result data after parsing is usually meaningful information, such as water level value, flow value, equipment status, etc. This data needs to be output in a standardized format for subsequent storage, analysis and display. The output result data can be in a variety of formats, such as JSON, XML, CSV, etc. Choosing a suitable output format requires considering the purpose of the data and the needs of subsequent processing. For example, if the data needs to be read and processed by other systems, JSON or XML format may be selected; if the data needs to be imported into a spreadsheet for analysis, CSV format may be selected.

[0040] In order to achieve long-term storage and sharing of data, the parsed result data needs to be uploaded and stored in the data server module. The data server module can be a local server or a cloud server. The uploaded and stored data can be used for subsequent data analysis, report generation, decision support, etc. When uploading and storing data, the security and reliability of the data need to be considered. Encryption technology, backup mechanism and other measures can be used to ensure the security of the data; redundant storage, distributed storage and other technologies can be used to improve the reliability of the data. Therefore, in the result output stage, it is necessary to ensure the accuracy, completeness and timeliness of the data. At the same time, it is necessary to provide convenient data query and analysis tools so that users can quickly obtain the required data information.

[0041] In one of the embodiments, the data receiving step also includes: performing an integrity check operation step according to the parsed data, if the check finds that the data is incomplete, issuing a prompt message and waiting for the complete data to be received again; setting data integrity check rules based on the received data and the protocol standard, wherein specific check parameters and logic are determined for the MODBUS protocol; using a cyclic redundancy check algorithm to perform an integrity check operation on the data to be parsed, and performing the check in RTU mode; if the check finds that the data is incomplete, the prompt message issued should clearly point out the incomplete data and inform the operator in a visual form; after issuing the prompt message, enter a waiting state, continuously monitor whether there is an operation to re-receive the complete data, set a reasonable waiting time limit, and if the complete data is not re-received after the time limit, a reminder can be issued again or further processing can be performed according to a preset error handling process.

[0042] In one of the embodiments, the result output step further includes: converting the format of the water conservancy result data to meet the input format requirements of the data server module.

[0043] In one of the embodiments, the protocol type identification step also includes: starting flag field identification, checking whether there is a specific byte sequence as a starting flag at the beginning of the water conservancy data to be parsed; device address field analysis, analyzing the device address field in the data to be parsed to determine the source device of the data; function code field interpretation, determining the working mode of the MODBUS protocol according to different function codes; data length field check, used to indicate the length of the subsequent data part.

[0044] In one of the embodiments, the data parsing step also includes: receiving water conservancy data to be parsed; identifying the specific protocol type corresponding to the data to be parsed, and for the MODBUS protocol, determining its working mode and physical layer information data by analyzing specific fields, data formats or feature codes in the data; dynamically loading a pre-set corresponding protocol parser according to the identified MODBUS protocol type, and parsing the data to be parsed after parameter configuration according to the specific situation, and calling corresponding parsing rules and algorithms according to specific features; outputting the parsed results in a standardized format, performing data caching and batch processing, and passing the results to the upper-level application for processing and analysis through an interface with the upper-level application.

[0045] In one of the embodiments, the data caching step includes setting time intervals or data volume conditions for data caching and batch processing, and performing batch storage or analysis after the conditions are met. The interface of the upper-level application is implemented through a function call interface.

[0046] In one embodiment, the specific field analysis of the MODBUS protocol includes identifying the start flag field, analyzing the device address field, interpreting the function code field and checking the data length field.

[0047] In one of the embodiments, the result output step also includes: sorting and formatting the parsed water conservancy data, sorting and formatting the parsed water conservancy data before outputting the result data; verifying the parsed result data to determine the method and mechanism for uploading the data to the data server module; setting the data server module to receive and store the uploaded parsed water conservancy data according to the storage management mechanism.

[0048] Furthermore, the protocol parser also includes function code field interpretation and data length field verification, and the function code field interpretation includes determining the operation type of the data. Carefully analyzing the value of the function code field can determine the specific purpose and working mode of the data. For example, function code 0x03 indicates reading a holding register, and function code 0x06 indicates writing a single register. By identifying the function code, it can be inferred whether the data is used to read sensor data, set device parameters, or perform other specific operations. According to different function codes, the working mode of the MODBUS protocol can be further determined, such as master-slave mode, broadcast mode, etc. Data length field verification, the data frame of the MODBUS protocol usually contains a data length field to indicate the length of the subsequent data part. By analyzing this field, the integrity and correctness of the data can be verified. If the value of the data length field does not match the length of the actual data part, there may be a data transmission error or a protocol mismatch. In this case, some error correction measures can be taken, such as re-requesting data, checking the communication line, etc.

[0049] The MODBUS protocol in this embodiment is a common serial bus protocol in industrial buses. It can work on the RS485, 232, 433 physical layer and Ethernet protocol layer. The protocol agreement is simple and reliable. The protocol is in bytes and the register data access read and write is agreed upon in the function code mode. The protocol agrees on two serial working modes, ASCII and RTU. In this example, the RTU mode is the main mode. Although the protocol agrees on the frame data format and read and write commands, it does not agree on the data frame content such as the data unit, data direction, big end and small end alignment in the frame. In theory, the MODBUS frame content can be filled with data of any format. This is the trade-off between the versatility and flexibility involved in the protocol. At present, each sensor manufacturer implements MODBUS data frame encapsulation according to the protocol function agreement, and the data content filled in the response frame is designed according to the data structure characteristics of each sensor function and the design habits of the protocol designer, which is very flexible. For the application end of the sensor, it is necessary to communicate with the sensor normally and read and write register data according to the protocol instructions provided by the manufacturer. The traditional mode is that the developer needs to develop a program to design the adaptive communication. The purpose of this example is to analyze the protocol content data, summarize the mode method, and design a method that is compatible with most MOSBUS sensor protocol software on the market. It provides a method that does not require program developers to perform adaptation development. Users, on-site construction, operation and maintenance and other non-program developers can adapt and set up this software method to achieve data communication with the sensor.

[0050] In one of the embodiments, the step of setting up the data server module also includes the step of establishing an index and query mechanism, the data server module sets up a database system and a storage management mechanism, and formulates a backup and recovery strategy; a data verification and error correction step, the processing includes checking the value range, data type and consistency of the data, using preset error correction rules to repair errors that can be automatically repaired, and marking errors that cannot be automatically repaired and notifying manual inspection.

[0051] The present invention also provides an embodiment, an electronic device, comprising one or more processors; a storage device, on which one or more programs are stored, when the one or more programs are executed by the one or more processors, the one or more processors implement any step in a water conservancy data parsing method adapted to multiple protocols.

[0052] The multi-protocol adapted water conservancy data parsing method provided in the above embodiment has the following beneficial effects: the protocol compatibility is wide, and there are often data sources of multiple different protocols in the water conservancy system. For example, water level sensors produced by different manufacturers may use different communication protocols, such as MODBUS protocol, CAN protocol, etc. The multi-protocol adapted parsing method can receive and process data of these different protocols, avoiding the situation where data is lost or cannot be processed due to protocol incompatibility. This compatibility enables the water conservancy data acquisition system to integrate various types of sensors and equipment, such as rain gauges, flow meters, etc., without the need to build a specific protocol processing system for each device separately, greatly improving the integration and flexibility of the system. Data integration is efficient, and water conservancy data usually needs to be comprehensively analyzed to evaluate the overall status of water conservancy facilities. By adapting the multi-protocol parsing method, data such as water level, flow, water quality, etc. from different protocols can be integrated into one data platform. Reduce the system update cost and improve data accuracy and reliability. This parsing method can strictly verify and correct data of different protocols. During the parsing process, the integrity, format correctness and logical rationality of the data can be checked according to the protocol specifications, supporting remote data transmission and monitoring, which is very important when water conservancy facilities are widely distributed. The parsing method that adapts to multiple protocols can ensure that data of different protocols can be correctly parsed and transmitted to the remote monitoring center.

[0053] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the inventive concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.

Claims

1. A water conservancy data analysis method adapted to multiple protocols, characterized in that: The following steps are involved: Data receiving step: receiving water conservancy data to be parsed from various protocols, including protocol-related data to be parsed that can work on a specific physical layer and adopt a function code mode to agree on register data access reading and writing; Protocol type identification step: identifying the specific protocol type corresponding to the data to be parsed. For the protocol, determining the working mode by analyzing the specific fields in the data to be parsed; Data parsing step: according to the identified protocol type, calling the pre-set protocol parser corresponding to the protocol type to parse the data to be parsed, and calling the corresponding parsing rules and algorithms according to its specific characteristics; Result output step: output the parsed result data and upload it to the data server module for storage.

2. The multi-protocol adapted water conservancy data analysis method according to claim 1, characterized in that: The data receiving step further comprises: Perform integrity check according to the parsed data. If the data is found to be incomplete, a prompt message will be issued and the system will wait for complete data to be received again. According to the received data, data integrity verification rules are set based on the protocol standard, and specific verification parameters and logic are determined for the MODBUS protocol; The cyclic redundancy check algorithm is used to perform integrity check on the data to be parsed, and the check is performed in RTU mode; If the verification results in incomplete data, the prompt message issued should clearly indicate the incomplete data and inform the operator in a visual form; After sending the reminder message, it enters the waiting state and continuously monitors whether there is any operation to re-receive the complete data. A reasonable waiting time limit is set. If the complete data is not re-received after the limit, the reminder can be sent again or further processed according to the preset error handling process.

3. The multi-protocol adapted water conservancy data analysis method according to claim 1, characterized in that: The result output step also includes: The format of the water conservancy result data is converted to meet the input format requirements of the data server module.

4. The multi-protocol adapted water conservancy data analysis method according to claim 1, characterized in that: The protocol type identification step also includes: Start flag field identification, checking whether there is a specific byte sequence as the start flag at the beginning of the water conservancy data to be parsed; Device address field analysis: Analyze the device address field in the data to be parsed to determine the source device of the data; Interpretation of the function code field, and determination of the protocol working mode according to different function codes; The data length field is used to indicate the length of the subsequent data portion.

5. The multi-protocol adapted water conservancy data analysis method according to claim 1, characterized in that: The data analysis step also includes: Receive water conservancy data to be analyzed; Identify the specific protocol type corresponding to the data to be parsed, and determine its working mode and physical layer information data by analyzing specific fields, data formats or feature codes in the data; According to the identified protocol type, dynamically load the corresponding pre-set protocol parser, and parse the data to be parsed after configuring the parameters according to the specific situation, and call the corresponding parsing rules and algorithms according to the specific features; The parsed results are output in a standardized format for data caching and batch processing, and the results are passed to the upper-level application for processing and analysis through the interface with the upper-level application.

6. The multi-protocol adapted water conservancy data analysis method according to claim 5, characterized in that: The data caching step includes setting time intervals and data volume conditions for data caching and batch processing, and performing batch storage or analysis after the conditions are met. The interface of the upper-level application is implemented through a function call interface.

7. The multi-protocol adapted water conservancy data analysis method according to claim 5, characterized in that: The specific field analysis includes identifying the start flag field, analyzing the device address field, interpreting the function code field and checking the data length field.

8. The multi-protocol adapted water conservancy data analysis method according to claim 1, characterized in that: The result output step also includes: Arrange and format the parsed water conservancy data. Before outputting the result data, arrange and format the parsed water conservancy data. Verify the parsed result data and determine the method and mechanism for uploading the data to the data server module; A data server module is provided to receive and store the uploaded parsed water conservancy data according to a storage management mechanism.

9. The multi-protocol adapted water conservancy data analysis method according to claim 8, characterized in that: The step of setting the data server module also includes: Establish the index and query mechanism steps, the data server module sets up the database system and storage management mechanism, and formulates the backup and recovery strategy; Data verification and error correction steps include checking the data's value range, data type, and consistency, using preset error correction rules to repair errors that can be automatically repaired, and marking errors that cannot be automatically repaired and notifying manual inspection.

10. An electronic device, applied to a water conservancy data analysis method adapted to multiple protocols, characterized in that: include, one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement any step of the water conservancy data parser adapted to multiple protocols as described in claims 1-9.

Citation Information

Cited By

  • Dynamic monitoring platform of pollution source treatment system

    CN120186009A

  • A dynamic monitoring platform for pollution source treatment system

    CN120186009B

  • Data processing method and device based on multi-protocol heterogeneous equipment

    CN121509546A