Protocol conversion system and method supporting direct connection of physical equipment layer and communication layer
By directly connecting the physical equipment layer and the communication layer in the field of oil and gas power generation, and using CRC16 checksum and data parsing mechanism, the problems of high latency, high cost and insufficient data verification in the existing technology are solved, and low-latency, high-stability and low-cost data transmission is achieved.
Patent Information
- Application Number
- CN202511910294.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-02-24
AI Technical Summary
The existing data transmission at the industrial physical equipment layer suffers from high latency, high cost, limited scalability, and insufficient data verification mechanisms, especially in the oil and gas power generation sector, leading to unstable monitoring and high operation and maintenance costs.
By establishing direct communication between the physical device layer and the communication layer, and employing CRC16 checksum and data parsing mechanisms, the FSU layer is removed, enabling data to be directly converted to hexadecimal format and verified, thus reducing intermediate steps and hardware upgrade requirements.
Significantly reduces communication latency to 0.08 seconds, reduces data redundancy, lowers maintenance costs by $180,000 per year, and improves system reliability and data transmission stability.
Smart Images

Figure CN121567795A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial Internet of Things (IoT) communication technology, specifically relating to a protocol conversion system and method that supports direct communication between the physical device layer and the platform layer, enabling seamless communication between the physical device layer and the platform layer. Background Technology
[0002] In the field of oil and gas power generation, the amount of electricity generated is closely related to the amount of fuel oil, and also includes issues such as energy storage batteries and regional grids.
[0003] In some regions where resources are unevenly distributed, achieving regional power integration and consistent regional monitoring is crucial for the stable operation of the regional power grid. However, existing physical equipment-level control systems still suffer from significant data lag, primarily due to the following issues:
[0004] 1. The number of physical devices monitored is relatively large;
[0005] 2. The transmission format used for monitoring is cumbersome;
[0006] 3. Therefore, the system will inevitably have a lot of data. After the scheduled running period, the data accumulation will inevitably lead to system lag, which in turn will affect the stability of monitoring.
[0007] Existing industrial physical device layers (such as PLCs and sensors) generally use physical device-to-physical device protocols to connect to IoT platforms, requiring FSUs (Factory Units) for protocol conversion, which presents the following technical challenges:
[0008] 1. Low protocol conversion efficiency: FSU needs to process physical device layer data in real time and then upload it to EMQX in JSON format, resulting in high latency (up to 3.2 seconds in traditional architecture).
[0009] In other words, the data flow is lengthy: the data needs to go through multiple stages, including "battery physical device layer -> FSU -> cloud platform", which increases the data processing latency and the probability of errors.
[0010] 2. Limited scalability: Each FSU requires manual configuration of the register mapping table, and adding a new physical device layer requires hardware upgrades, resulting in high operation and maintenance costs;
[0011] 3. High cost: FSU hardware and maintenance costs account for more than 40% of the total system investment;
[0012] 4. Insufficient data verification mechanism: Traditional systems lack effective data link layer verification or only use a simple checksum mechanism, which has weak error detection capabilities and is difficult to effectively filter out erroneous data caused by network interference and other reasons, affecting the quality of data sent to the platform and causing the monitoring platform to display incorrect information or make misjudgments.
[0013] The full name of the FSU hardware is Data Acquisition Unit. It is a key intermediate physical device layer located between the field physical device layer and the cloud platform layer, mainly responsible for data acquisition, protocol conversion, and uploading; it can be understood as a "small data center" set up in the factory workshop: it connects downwards to various industrial physical device layers that support the Modbus protocol (such as PLC, sensors, battery physical device layers, etc.), and upwards to the cloud IoT platform (such as connecting to EMQX via the MQTT protocol). Summary of the Invention
[0014] The main objective of this invention is to propose a protocol conversion system and method that supports direct communication between the physical device layer and the communication layer. By removing the FSU layer, the physical device layer can communicate directly with the communication layer through a built-in gateway, significantly optimizing latency to 0.08 seconds and reducing costs.
[0015] To achieve the above objectives, this invention proposes a protocol conversion system that supports direct connection between the physical device layer and the communication layer.
[0016] It includes a monitoring platform, data acquisition micro-modules, message middleware, physical device layer, and database;
[0017] The monitoring platform is used to set up scheduled tasks, send command string requests to the data acquisition micro-module at predetermined time intervals, and receive the processed data returned by the data acquisition micro-module for display.
[0018] The data acquisition micro-module is used to receive requests from the monitoring platform, process them logically, convert them into hexadecimal format, and send them to the message middleware.
[0019] Simultaneously, the data of the specified at / data topic in the message middleware is monitored, the received data is parsed and CRC16 verified, the processed data that passes the verification is returned to the monitoring platform and inserted into the database;
[0020] The message middleware is used to receive hexadecimal requests sent by the data acquisition micro-module and forward them to the physical device layer.
[0021] Simultaneously, it receives hexadecimal byte array format data sent by the physical device layer and stores it in the at / data topic;
[0022] The physical device layer has its own gateway configured with the IP address, username, and password of the message middleware, which is used to listen for the request instructions of the message middleware, query device data, and send it to the at / data topic of the message middleware in hexadecimal byte array format.
[0023] The database is used to store the battery data processed by the data acquisition micro-module, thereby achieving data persistence.
[0024] The CRC16 verification module of the data acquisition micro-module includes an initialization unit, a byte-by-byte processing unit, a bit-by-bit cyclic processing unit, and a final processing unit.
[0025] The initialization unit is used to initialize the CRC register to 0xFFFF (to adapt to the Modbus RTU protocol).
[0026] The byte-by-byte processing unit is used to read each byte from the address field to the data field in the data frame in sequence, and to perform an XOR operation on each byte with the current value of the CRC register;
[0027] The bit-by-bit loop processing unit is used to process the 8 bits of each byte sequentially: shift the result of the XOR operation to the right by 1 bit, check if the least significant bit is 1, and if it is 1, perform an XOR operation with the preset polynomial 0x8005.
[0028] The final processing unit is used to invert the CRC register value after processing all bytes and output a 2-byte checksum to filter out data that fails the checksum.
[0029] A control method for a protocol conversion system supporting direct connection between the physical device layer and the communication layer, comprising the aforementioned system.
[0030] Includes the following steps:
[0031] S1: Configure the parameters of the physical device layer's built-in gateway, and enter the IP address, username, and password of the message middleware to establish a connection between the physical device layer and the message middleware;
[0032] S2: The monitoring platform starts a scheduled task to generate and send a command string request to the data acquisition micro-module every 5 minutes;
[0033] S3: After receiving the request, the data acquisition micro-module processes the request logically, converts the command string into hexadecimal format, and sends it to the message middleware;
[0034] S4: The physical device layer listens to messages from the message middleware in real time. When a hexadecimal request command is detected, it queries its own battery data (including performance parameters and location information).
[0035] S5: The physical device layer converts the retrieved battery data into a hexadecimal byte array format and sends it to the at / data topic of the message middleware;
[0036] S6: The data acquisition micro-module monitors the at / data topic of the message middleware. When data is detected, it retrieves the data under that topic.
[0037] S7: The data acquisition micro-module calls the CRC16 verification module to verify the acquired data. If the verification fails, the data is discarded; if the verification passes, the data is parsed according to the battery manufacturer's agreement document.
[0038] S8: The data acquisition micro-module returns the parsed and processed data to the monitoring platform for display, and inserts the processed data into the database to complete the persistent storage of the data.
[0039] Specifically, CRC16 checksum is used to verify data and prevent data errors, transmission errors, etc.
[0040] Specifically, it effectively ensures data reliability; that is, CRC16 checksums can filter out erroneous data in advance, reducing server load.
[0041] Error detection is avoided, and the verification mechanism enhances the monitoring capability of the data transmission process.
[0042] Specifically, the CRC16 verification process in step S7 includes:
[0043] S71: Initialize the CRC register to 0xFFFF;
[0044] S72: Read each byte from the address field to the data field in the data frame in sequence, and XOR the current byte with the current value of the CRC register to obtain the XOR result;
[0045] S73: Perform a loop operation on the 8 bits of the XOR result: shift the XOR result right by 1 bit and check if the least significant bit is 1;
[0046] If the result is 1, the right-shifted result is XORed with the 0x8005 polynomial, and the CRC register value is updated.
[0047] If the value is 0, the CRC register value is updated directly to the right-shifted result; this step is repeated until all 8 bits of the current byte have been processed.
[0048] S74: Determine whether all bytes in the data frame have been processed. If not, return to step S72. If processed, invert the CRC register value to obtain a 2-byte checksum.
[0049] S75: Compare the generated checksum with the check field in the data frame. If they match, the check passes; otherwise, the check fails.
[0050] The advantages of this application are:
[0051] 1. Latency Optimization: By removing the FSU layer, the communication latency is reduced from 3.2 seconds to 0.08 seconds, improving real-time performance by 40 times; at the same time, the data memory is smaller, the transmission is more stable, and data redundancy is reduced;
[0052] For the power generation physical equipment layer, it effectively ensures the stability of industrial power generation, especially in areas where the power grid is more difficult to use;
[0053] 2. Cost savings: Saves approximately $180,000 per year in FSU hardware procurement and maintenance costs; this means that each FSU requires manual configuration of the register mapping table, and the FSU needs to be upgraded when a new physical device layer is added.
[0054] If a direct connection is used, the DMS parsing program can be modified directly to upgrade the platform; there is no need to upgrade the FSU hardware physical device layer at the customer's site.
[0055] 3. Simplified architecture: Reduce intermediate steps and improve system reliability.
[0056] In addition, the data acquisition micro-module includes a data parsing mechanism, which analyzes different data based on different locations and different battery data, thereby reducing the data size of the data carrier;
[0057] 4. The communication layer is EMQX, and the physical device layer achieves authentication connection by configuring the IP address, username and password of EMQX. Attached Figure Description
[0058] Figure 1 This is a flowchart of this application;
[0059] Figure 2 Here is a flowchart of the CRC16 verification process;
[0060] Figure 3 Diagram of data control method;
[0061] Figure 4 This is a schematic diagram of existing technology. Detailed Implementation
[0062] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0063] It should be noted that if the embodiments of the present invention involve directional indicators (such as up, down, left, right, front, back, top, bottom, inside, outside, vertical, horizontal, longitudinal, counterclockwise, clockwise, circumferential, radial, axial, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0064] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0065] like Figures 1 to 3 As shown, a protocol conversion system supporting direct communication between the physical device layer and the communication layer includes,
[0066] It includes a monitoring platform, data acquisition micro-modules, message middleware, physical device layer, and database;
[0067] The monitoring platform is used to set up scheduled tasks, send command string requests to the data acquisition micro-module at predetermined time intervals, and receive the processed data returned by the data acquisition micro-module for display.
[0068] The data acquisition micro-module is used to receive requests from the monitoring platform, process them logically, convert them into hexadecimal format, and send them to the message middleware. This achieves lightweight data transmission at the physical device layer by using a hexadecimal byte array format instead of the JSON format.
[0069] This resulted in optimized data transmission, reducing the size of physical device-level messages to only 20% of that in JSON format, significantly reducing network load.
[0070] Transmission efficiency: Binary format is more efficient than text format.
[0071] Simultaneously, the data of the specified at / data topic in the message middleware is monitored, and the received data is parsed (supporting Modbus format parsing, distinguishing battery performance parameter data starting with 7003 and battery location information data starting with 9001 according to the battery manufacturer's protocol document) and CRC16 verification is performed. The processed data that passes the verification is returned to the monitoring platform and inserted into the database.
[0072] The message middleware is used to receive hexadecimal requests sent by the data acquisition micro-module and forward them to the physical device layer.
[0073] Simultaneously, it receives hexadecimal byte array format data sent by the physical device layer and stores it in the at / data topic;
[0074] The physical device layer has its own gateway configured with the IP address, username, and password of the message middleware, which is used to listen for the request instructions of the message middleware, query device data, and send it to the at / data topic of the message middleware in hexadecimal byte array format.
[0075] The database is used to store the battery data processed by the data acquisition micro-module, thereby achieving data persistence.
[0076] The advantages of this application are:
[0077] 1. Latency Optimization: By removing the FSU layer, the communication latency is reduced from 3.2 seconds to 0.08 seconds, improving real-time performance by 40 times; at the same time, the data memory is smaller, the transmission is more stable, and data redundancy is reduced;
[0078] For the power generation physical equipment layer, it effectively ensures the stability of industrial power generation, especially in areas where the power grid is more difficult to use;
[0079] 2. Cost savings: Saves approximately $180,000 per year in FSU hardware procurement and maintenance costs; this means that each FSU requires manual configuration of the register mapping table, and the FSU needs to be upgraded when a new physical device layer is added.
[0080] If a direct connection is used, the DMS parsing program can be modified directly to upgrade the platform, without needing to upgrade the FSU hardware physical device layer at the customer's site.
[0081] 3. Simplified architecture: Reduce intermediate steps and improve system reliability.
[0082] In addition, the data acquisition micro-module includes a data parsing mechanism, which analyzes different data based on different locations and different battery data, thereby reducing the data size of the data carrier;
[0083] 4. The communication layer is EMQX, and the physical device layer achieves authentication connection by configuring the IP address, username and password of EMQX.
[0084] A control method for a protocol conversion system that supports direct connection between the physical device layer and the communication layer.
[0085] Includes the following steps:
[0086] S1: Configure the parameters of the physical device layer's built-in gateway, and enter the IP address, username, and password of the message middleware to establish a connection between the physical device layer and the message middleware;
[0087] S2: The monitoring platform starts a scheduled task to generate and send a command string request to the data acquisition micro-module every 5 minutes;
[0088] S3: After receiving the request, the data acquisition micro-module processes the request logically, converts the command string into hexadecimal format, and sends it to the message middleware;
[0089] S4: The physical device layer listens to messages from the message middleware in real time. When a hexadecimal request command is detected, it queries its own battery data (including performance parameters and location information).
[0090] S5: The physical device layer converts the retrieved battery data into a hexadecimal byte array format and sends it to the at / data topic of the message middleware;
[0091] S6: The data acquisition micro-module monitors the at / data topic of the message middleware. When data is detected, it retrieves the data under that topic.
[0092] S7: The data acquisition micro-module calls the CRC16 verification module to verify the acquired data. If the verification fails, the data is discarded; if the verification passes, the data is parsed according to the battery manufacturer's protocol document (data starting with 7003 extracts performance parameters such as current, voltage, and SOC; data starting with 9001 extracts location information such as longitude and latitude).
[0093] S8: The data acquisition micro-module returns the parsed and processed data to the monitoring platform for display, and inserts the processed data into the database to complete the persistent storage of the data.
[0094] Specifically, CRC16 checksum is used to verify data and prevent data errors, transmission errors, etc.
[0095] Specifically, it effectively ensures data reliability; that is, CRC16 checksums can filter out erroneous data in advance, reducing server load.
[0096] Error detection is avoided, and the verification mechanism enhances the monitoring capability of the data transmission process.
[0097] The specific process of CRC16 verification in step S7 includes:
[0098] S71: Initialize the CRC register to 0xFFFF;
[0099] S72: Read each byte from the address field to the data field in the data frame in sequence, and XOR the current byte with the current value of the CRC register to obtain the XOR result;
[0100] S73: Perform a loop operation on the 8 bits of the XOR result: shift the XOR result right by 1 bit and check if the least significant bit is 1;
[0101] If the result is 1, the right-shifted result is XORed with the 0x8005 polynomial, and the CRC register value is updated.
[0102] If the value is 0, the CRC register value is updated directly to the right-shifted result; this step is repeated until all 8 bits of the current byte have been processed.
[0103] S74: Determine whether all bytes in the data frame have been processed. If not, return to step S72. If processed, invert the CRC register value to obtain a 2-byte checksum.
[0104] S75: Compare the generated checksum with the check field in the data frame. If they match, the check passes; otherwise, the check fails.
[0105] The specific implementation method is as follows:
[0106] like Figure 1 and Figure 2 ;
[0107] 1. The monitoring platform's scheduled task sends a command string request to DMS every 5 minutes;
[0108] 2. After receiving the request, DMS performs certain logical processing and transmits it to EMQX in hexadecimal format;
[0109] 3. After receiving a request command from EMQX, the battery device queries the relevant device data;
[0110] 4. In order for the battery device to communicate with EMQX, the corresponding IP address, username and password of EMQX must be configured in the battery's built-in gateway. After the connection is successful, the data is sent to an at / data topic in EMQX in the form of a byte array (hexadecimal).
[0111] After DMS detects relevant data in the at / data topic of EMQX, it retrieves and parses the data under this topic.
[0112] 5. Return the processed data to the monitoring platform for display and insert it into the corresponding database for persistent storage;
[0113] For example, the command 7003 0001 005e 9f13 is processed by DMS logic and then sent to EMQX. The battery device listens for this command, processes it, and returns the data in hexadecimal form (similar to 7003 bc01 e027 10000f00 ... 0000 0000 0054 50) to EMQX. DMS parses this data according to certain rules, sends it to the monitoring platform, and saves it in the database.
[0114] 6. DMS parsing process: When DMS receives Modbus format data, it parses it according to the battery manufacturer's protocol document. For example, 7003 indicates the battery's performance parameters, followed by information such as current, voltage, and SOC. 9001 indicates the battery's location information, followed by latitude and longitude information.
[0115] like Figure 3 ;
[0116] The detailed steps for CRC16 verification are as follows;
[0117] 1. Initialize the CRC register
[0118] Function: Initializes the CRC register to all 1s (e.g., 0xFFFF) or all 0s as the starting value for calculation. Different protocols may require different initial values (e.g., Modbus RTU uses 0xFFFF).
[0119] Principle: The initial value affects the final verification result, ensuring the sensitivity of the check code to data changes;
[0120] 2. Process data byte by byte;
[0121] Function: Read each byte of the data frame sequentially (from the address field to the data field) and participate in the calculation one by one;
[0122] Principle: Each byte is XORed with the current value of the CRC register to initially mix data characteristics.
[0123] 3. Bitwise circular right shift and polynomial XOR;
[0124] Function: Processes each byte's 8 bits sequentially.
[0125] a. Right shift by 1 bit: Check if the least significant bit is 1;
[0126] b. Polynomial XOR: If the result is 1, it is XORed with a preset polynomial (such as 0x8005 in Modbus), introducing polynomial characteristics.
[0127] Principle: The polynomial determines the mathematical properties of the verification, and the XOR operation simulates the calculation of the remainder in division; 4. Final processing and output;
[0128] Function: After processing all bytes, invert the CRC register value (depending on protocol requirements) and output a 2-byte checksum.
[0129] Principle: Inverting the checksum can prevent all-zero data frames from also having all-zero checksums, thus enhancing error detection capabilities.
[0130] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. A protocol conversion system supporting direct connection between the physical device layer and the communication layer, characterized in that, include, It includes a monitoring platform, data acquisition micro-modules, message middleware, physical device layer, and database; The monitoring platform is used to set up scheduled tasks, send command string requests to the data acquisition micro-module at predetermined time intervals, and receive the processed data returned by the data acquisition micro-module for display. The data acquisition micro-module is used to receive requests from the monitoring platform, process them logically, convert them into hexadecimal format, and send them to the message middleware. Simultaneously, the data in the specified at / data topic in the message middleware is monitored, and the received data is parsed and subjected to CRC16 verification. The processed data that passes verification is returned to the monitoring platform and inserted into the database; The message middleware is used to receive hexadecimal requests sent by the data acquisition micro-module and forward them to the physical device layer. Simultaneously, it receives hexadecimal byte array format data sent by the physical device layer and stores it in the at / data topic; The physical device layer has its own gateway configured with the IP address, username, and password of the message middleware, which is used to listen for the request instructions of the message middleware, query device data, and send it to the at / data topic of the message middleware in hexadecimal byte array format. The database is used to store battery data processed by the data acquisition micromodule.
2. The protocol conversion system supporting direct connection between the physical device layer and the communication layer according to claim 1, characterized in that: The CRC16 verification module of the data acquisition micro-module includes an initialization unit, a byte-by-byte processing unit, a bit-by-bit cyclic processing unit, and a final processing unit. The initialization unit is used to initialize the CRC register to 0xFFFF; The byte-by-byte processing unit is used to read each byte from the address field to the data field in the data frame in sequence, and to perform an XOR operation on each byte with the current value of the CRC register; The bit-by-bit loop processing unit is used to process the 8 bits of each byte sequentially: shift the result of the XOR operation to the right by 1 bit, check if the least significant bit is 1, and if it is 1, perform an XOR operation with the preset polynomial 0x8005. The final processing unit is used to invert the CRC register value after processing all bytes and output a 2-byte checksum to filter out data that fails the checksum.
3. A control method for a protocol conversion system supporting direct connection between the physical device layer and the communication layer, characterized in that, Including the protocol conversion system supporting direct communication between the physical device layer and the communication layer as described in any one of claims 1 or 2, Includes the following steps: S1: Configure the parameters of the physical device layer's built-in gateway, and enter the IP address, username, and password of the message middleware to establish a connection between the physical device layer and the message middleware; S2: The monitoring platform starts a scheduled task to generate and send a command string request to the data acquisition micro-module every 5 minutes; S3: After receiving the request, the data acquisition micro-module processes the request logically, converts the command string into hexadecimal format, and sends it to the message middleware; S4: The physical device layer listens to messages from the message middleware in real time. When a hexadecimal request instruction is detected, it queries its own battery data. S5: The physical device layer converts the retrieved battery data into a hexadecimal byte array format and sends it to the at / data topic of the message middleware; S6: The data acquisition micro-module monitors the at / data topic of the message middleware. When data is detected, it retrieves the data under that topic. S7: The data acquisition micro-module calls the CRC16 verification module to verify the acquired data. If the verification fails, the data is discarded; if the verification passes, the data is parsed according to the battery manufacturer's agreement document. S8: The data acquisition micro-module returns the parsed and processed data to the monitoring platform for display, and inserts the processed data into the database to complete the persistent storage of the data.
4. The protocol conversion system control method supporting direct connection between the physical device layer and the communication layer according to claim 3, characterized in that: The specific process of CRC16 verification in step S7 includes: S71: Initialize the CRC register to 0xFFFF; S72: Read each byte from the address field to the data field in the data frame in sequence, and XOR the current byte with the current value of the CRC register to obtain the XOR result; S73: Perform a loop operation on the 8 bits of the XOR result: shift the XOR result right by 1 bit and check if the least significant bit is 1; If the result is 1, the right-shifted result is XORed with the 0x8005 polynomial, and the CRC register value is updated. If the value is 0, the CRC register value is updated directly to the right-shifted result; this step is repeated until all 8 bits of the current byte have been processed. S74: Determine whether all bytes in the data frame have been processed. If not, return to step S72. If processed, invert the CRC register value to obtain a 2-byte checksum. S75: Compare the generated checksum with the check field in the data frame. If they match, the check passes; otherwise, the check fails.