A valve position opening wireless transmission system and method based on LoRa
Through the wireless transmission system of valve position opening with LoRa technology in oil and gas long-distance pipeline stations, the problems of high cost and inaccurate existing monitoring methods are solved, real-time monitoring and accurate data transmission of valve opening are achieved. Suitable for complex site environments.
Patent Information
- Application Number
- CN202210633273.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-06
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2042-06-06
AI Technical Summary
The valve status monitoring method in existing oil and natural gas long-distance pipeline stations is costly, difficult and cannot accurately reflect valve opening. The commonly used wireless transmission technology is not suitable for long-distance station environments.
Adopt a wireless transmission system for valve position opening based on LoRa, including a monitoring terminal, a LoRa reception gateway and a valve position monitoring transmitter. The valve opening information is collected and forwarded in real time through the LoRa reception gateway, and adopts a dual reporting mode (slave timing reporting and slave (actively report machine changes) to realize real-time monitoring and accurate data transmission.
Real-time monitoring and wireless reporting of multiple valve opening information is realized, which reduces construction and maintenance costs and is suitable for station application scenarios with high time requirements.
Smart Images

Figure CN115086797B_ABST
Abstract
Description
Background Art
[0002] In long-distance oil and gas pipeline stations, the status of each manual valve is an important monitoring content in daily production. Existing monitoring methods such as wired monitoring or manual inspection have problems such as high initial construction costs and high later maintenance costs, and can only collect the open and closed status of the valve and cannot accurately reflect the current valve opening. Specifically:
[0003] 1) The wired monitoring method connects the switch signal of the valve head on the valve to the PLC and other equipment in the station control room through a wire. This method requires trenching and wiring in the process area during construction. The more valves that need to be monitored, the greater the amount of trenching and wiring work. Therefore, the monitoring cost and difficulty are correspondingly large, and the later maintenance cost and difficulty are also large. And because the operation is in the process area, there are certain construction risks.
[0004] 2) Manual inspection method: staff members check the current status of each valve regularly. This method has problems such as untimely information feedback and missed inspections.
[0005] Therefore, it is necessary to establish a valve position wireless transmission system in the long-distance oil and gas pipeline stations. Compared with the wired data transmission method, the wireless data transmission method is more suitable for the complex environment of the station process area. However, since the location of the station valve is far away from the station control room, a transmission distance of 1 to 3 kilometers is required, so the commonly used short-distance wireless transmission technologies such as ZigBee, Bluetooth, and WiFi are not suitable for station valve position monitoring.
[0006] At present, the Chinese patent with publication number CN110345305A disclosed a rail valve opening feedback device on October 18, 2019, which proposed to realize long-distance wireless transmission of data signals through the lora module. Lora itself is a low-power long-distance wireless communication technology based on spread spectrum modulation technology, so it is suitable for scenes such as station valve position monitoring with long distances, complex environments, and high requirements for power consumption control.
[0007] Although the above-mentioned existing patent discloses the realization of long-distance wireless data transmission through the lora module, its data transmission method adopts the host polling method, which is time-consuming and suitable for networking applications with low time requirements, but not suitable for site application scenarios with high time requirements. Summary of the invention
[0008] The technical problem to be solved by the present invention is to address the deficiencies in the prior art and provide a LoRa-based valve position wireless transmission system and method.
[0009] The technical solution of a valve position opening wireless transmission system based on LoRa of the present invention is as follows:
[0010] It includes a monitoring terminal, a LoRa receiving gateway and a valve position monitoring transmitter installed on each valve to be monitored;
[0011] Each valve position monitoring transmitter is used to: collect valve opening information of the corresponding valve to be monitored and send it to the LoRa receiving gateway;
[0012] The LoRa receiving gateway is used to forward the valve opening information of each valve to be monitored to the monitoring terminal.
[0013] The beneficial effects of the valve position opening wireless transmission system based on LoRa of the present invention are as follows:
[0014] It can monitor the valve opening information of multiple valves in real time and report it wirelessly, so that users can accurately obtain the valve opening information of on-site valves, and can minimize the initial construction cost and later maintenance cost. It is suitable for site application scenarios with high time requirements.
[0015] The technical solution of a valve position opening wireless transmission method based on LoRa of the present invention is as follows:
[0016] Using a LoRa-based valve position opening wireless transmission system as described in any one of the above, the method includes:
[0017] S1. Each valve position monitoring transmitter collects valve opening information of the corresponding valve to be monitored and sends it to the LoRa receiving gateway;
[0018] S2. The LoRa receiving gateway forwards the valve opening information of each valve to be monitored to the monitoring terminal.
[0019] The beneficial effects of the valve position opening wireless transmission method based on LoRa of the present invention are as follows:
[0020] It can monitor the valve opening information of multiple valves in real time and report it wirelessly, so that users can accurately obtain the valve opening information of on-site valves, and can minimize the initial construction cost and later maintenance cost. It is suitable for site application scenarios with high time requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is one of the structural schematic diagrams of a valve position opening wireless transmission system based on LoRa according to an embodiment of the present invention;
[0022] Figure 2 This is a second structural schematic diagram of a valve position opening wireless transmission system based on LoRa according to an embodiment of the present invention;
[0023] Figure 3This is a flowchart of the first working mode;
[0024] Figure 4 Schematic diagram of the process of the second working mode;
[0025] Figure 5 This is a schematic diagram of the working process of the LoRa receiving gateway;
[0026] Figure 6 This is a schematic diagram of data interaction between the valve position monitoring transmitter and the LoRa receiving gateway;
[0027] Figure 7 It is a schematic diagram of data interaction between the register and the station control device;
[0028] Figure 8 The present invention is a flowchart of a method for wirelessly transmitting valve position opening based on LoRa. DETAILED DESCRIPTION
[0029] like Figure 1 As shown, a valve position opening wireless transmission system based on LoRa according to an embodiment of the present invention includes a monitoring terminal, a LoRa receiving gateway and a valve position monitoring transmitter installed on each valve to be monitored;
[0030] Each valve position monitoring transmitter is used to: collect valve opening information of the corresponding valve to be monitored and send it to the LoRa receiving gateway;
[0031] The LoRa receiving gateway is used to forward the valve opening information of each valve to be monitored to the monitoring terminal.
[0032] Among them, the monitoring terminal is connected to the LoRa receiving gateway, and the LoRa receiving gateway is connected to multiple valve position monitoring transmitters respectively.
[0033] They are used to collect the valve opening information of the corresponding valve to be monitored in real time and upload it to the LoRa receiving gateway. The LoRa receiving gateway receives and stores the valve opening information of each valve to be monitored, and forwards it to the monitoring terminal for user viewing.
[0034] Among them, the number of valve position monitoring transmitters can be set according to the actual situation, and can be recorded as the first valve position monitoring transmitter, the second valve position monitoring transmitter... the nth valve position monitoring transmitter, n is the total number of valve position monitoring transmitters, n is equal to 50 or 100, etc., which can be set according to the actual situation. Among them, multiple valve position monitoring transmitters are installed on each valve to be monitored. Specifically: a valve position monitoring transmitter can be installed on each valve to be monitored, and each valve position monitoring transmitter collects the valve opening information of the corresponding valve to be monitored, and uploads it to the LoRa receiving gateway according to the preset reporting mode. The preset reporting mode can be: uploading the valve opening information in the order set by the valve position monitoring transmitter manually, and the preset reporting mode can also be: a dual reporting mode combining the active reporting of machine changes and the timed reporting of slaves.
[0035] Among them, the LoRa receiving gateway is set up in the control center computer room to receive the monitoring data reported by each valve position monitoring transmitter, namely the valve opening information, and store the data and forward it to the monitoring terminal.
[0036] Among them, monitoring terminals, such as station control equipment or other PLC / RTU equipment, are used to analyze and process the monitoring data, realize real-time monitoring and wireless reporting of the valve position opening information of the station, so as to accurately obtain the opening information of the on-site valves and minimize the initial construction costs and later maintenance costs.
[0037] It can monitor the valve opening information of multiple valves in real time and report it wirelessly, so that users can accurately obtain the valve opening information of on-site valves, and can minimize the initial construction cost and later maintenance cost. It is suitable for site application scenarios with high time requirements.
[0038] Optionally, in the above technical solution, each valve position monitoring transmitter adopts a dual reporting mode combining active reporting of slave changes and scheduled reporting of slaves to send corresponding valve opening information to the LoRa receiving gateway. Specifically:
[0039] Taking into account that the core monitoring data of gas and oil transmission stations is valve opening, and valve opening data is data that changes infrequently or rarely, a dual reporting mode is determined based on the characteristics of this data. Under normal circumstances, the valve position monitoring transmitter adopts the slave machine timing reporting mode to regularly report the monitoring data of each slave machine, and monitors the valve opening data in real time. When the change in the valve opening data is detected to exceed the preset value, the slave machine change active reporting mode is adopted.
[0040] In the dual reporting mode, the slave refers to the valve position monitoring transmitter, and the host refers to the monitoring terminal; under normal working conditions, a different upload time is set for each valve position monitoring transmitter, so that each valve position monitoring transmitter reports the monitoring data regularly according to the set time. At the same time, each valve position monitoring transmitter monitors the changes in valve position data in real time, and actively reports the monitoring data when it detects that the data changes of the corresponding valve position exceed the preset range.
[0041] Since the valve opening does not change frequently in actual applications, it may not change for several days or even longer. In order to ensure the normal operation of the detection system, a timed reporting method is added. The timed reporting can be used to detect whether the data is updated and whether each device is working normally.
[0042] As a further technical solution, when the valve position monitoring transmitter detects that the change between the current valve opening and the previous valve opening exceeds a preset value, it continuously reads and actively reports the monitoring data for a preset time. The preset time is the time period in which the complete change of the valve opening can be monitored.
[0043] Specifically, the slave usually only monitors the valve opening data. When the change between the current valve opening and the previous valve opening exceeds the set value, it will continue to read and report the data 30 times, with an interval of 2 seconds each time, and will continue to report for a total of one minute. Generally speaking, this time period is sufficient to fully monitor the complete change of the valve opening.
[0044] Optionally, in the above technical solution, the LoRa receiving gateway includes a memory having multiple storage areas, each storage area being used to store valve opening information collected by a corresponding valve position monitoring transmitter. Specifically:
[0045] A different device ID is set for each valve position monitoring transmitter, and the memory is divided into multiple storage areas according to the device ID of each valve position monitoring transmitter. Each storage area is used to store monitoring data corresponding to the device ID, that is, each storage area is used to store the valve opening information collected by the corresponding valve position monitoring transmitter.
[0046] Optionally, in the above technical solution, the LoRa receiving gateway also includes a register, and the LoRa receiving gateway is also used to: map the valve opening information stored in each storage area to the register. Specifically: map the monitoring data stored in each storage area to a register with a standard Modbus RTU / TCP protocol.
[0047] In another embodiment, the LoRa receiving gateway needs to register all the device IDs of all valve position monitoring transmitters received before working. A maximum of 50, 100, etc. device IDs can be registered, which can be set according to actual conditions. After receiving the LoRa transmission data frame, the LoRa receiving gateway stores the valve opening information of each valve position monitoring transmitter in the storage area of the corresponding ID according to the device ID number, wherein all valve position monitoring transmitters send valve opening information to the LoRa receiving gateway in the form of data frames, i.e., LoRa transmission data frames. And the valve opening information of each valve position monitoring transmitter is mapped to a register with a standard Modbus RTU / TCP protocol; for example, DI and DO data are mapped to the 1000 register starting with 1001, and the 0x01 command is used to read. Among them, DI is a digital input signal, DO is a digital output signal, and the battery voltage, AI1 sampling value, AI2 sampling value, AI3 sampling value, AI4 sampling value, and valve position status are mapped to the 3000 register starting with 3001, and the 0x03 command is used to read. The current opening degree, fully opened degree, and fully closed degree are mapped to the 7000 register starting from 7001, and are read using the 0x03 command. The station control machine or PLC and other devices use the standard Modbus RTU / TCP protocol to read the data that needs attention.
[0048] Optionally, in the above technical solution, the valve position monitoring transmitter includes a non-contact valve position opening sensor and a control panel;
[0049] The non-contact valve position sensor is used to: obtain the valve position information of the valve to be monitored;
[0050] The control board is used to obtain valve opening information based on valve position information and upload it to the LoRa receiving gateway using LoRa communication. The valve opening information includes valve opening and valve position status information. The valve position status information is specifically divided into three types: open, closed and intermediate.
[0051] Among them, the valve position information includes the valve position rotation angle, and the non-contact valve position opening sensor is specifically used to measure the valve position rotation angle of the valve to be monitored through an absolute encoder. The non-contact valve position opening sensor uses an absolute encoder to measure the valve position rotation angle, and outputs the valve position opening position data through the RS485 data communication interface, which can solve the problem of digital acquisition of valve position and express the manual valve position status in digital quantities of 0 to 359 degrees. It can accurately indicate the current valve status.
[0052] Optionally, in the above technical solution, the valve position monitoring transmitter further includes a flameproof casing, and the non-contact valve position opening sensor and the control panel are located in the flameproof casing.
[0053] Since the valve position monitoring transmitter needs to be installed in the process area of the oil and gas station, which is an explosion-proof area, the valve position monitoring transmitter and the control panel are placed in a flameproof casing to achieve overall flameproofing to meet explosion-proof requirements.
[0054] Optionally, in the above technical solution, the control board includes a LoRa transmission module, a CPU module and an RS485 module;
[0055] The RS485 module is used to receive the valve position information of the valve to be monitored sent by the non-contact valve position opening sensor, that is, the RS485 module is used to transmit data with the non-contact valve position opening sensor.
[0056] The CPU module is used to obtain valve opening information according to valve position information; that is, the CPU module is used for information conversion processing;
[0057] The LoRa transmission module is used to upload the valve opening information to the LoRa receiving gateway through the LoRa communication method. In other words, the LoRa transmission module is used to transmit data with the LoRa receiving gateway.
[0058] Among them, the model of the LoRa wireless transmission module is E32-433T20S1, the CPU module is a microprocessor with the model number STM32F103C8T6, and the RS485 module is a serial communication interface based on the communication chip model max3078.
[0059] The control board also includes a power supply module, which is used to supply power to the LoRa transmission module, the CPU module and the RS485 module.
[0060] Among them, the control board is based on the STM32F103C8T6 microprocessor model, and also has the functions of monitoring its own power supply voltage, 4-channel DI acquisition, 4-channel AI acquisition, and 2-channel DO output control.
[0061] The control board has the function of collecting valve position information fed back by high-precision non-contact valve position opening sensor and converting it into corresponding opening and open, closed and intermediate valve position status information. It also has the function of monitoring its own power supply voltage, 4-way DI acquisition, 4-way AI acquisition and 2-way DO output control. The control board communicates with the high-precision non-contact valve position opening sensor in RS485 mode and reports data to the LoRa receiving gateway in LoRa communication mode.
[0062] Optionally, in the above technical solution, the monitoring terminal and the LoRa receiving gateway transmit data through a custom communication protocol. For example, the monitoring terminal, such as a station control machine or a PLC, can read the data that needs to be paid attention to in the LoRa receiving gateway through the standard Modbus RTU / TCP protocol. The LoRa receiving gateway forwards the valve opening information of each valve to be monitored to the monitoring terminal through the standard Modbus RTU / TCP protocol.
[0063] The valve position opening wireless transmission system based on LoRa of the present invention has the following beneficial effects:
[0064] 1) Install multiple valve position monitoring transmitters on each valve to be monitored, collect valve opening information in real time, and upload the monitoring data to the LoRa receiving gateway according to the preset reporting mode; set the LoRa receiving gateway in the control center computer room to receive the monitoring data reported by each valve position monitoring transmitter, store the data and forward it to the monitoring terminal; use the monitoring terminal such as station control equipment or other PLC / RTU equipment to analyze and process the monitoring data, realize real-time monitoring and wireless reporting of the valve position opening information of the station, so as to accurately obtain the opening information of the on-site valve, and minimize the initial construction cost and later maintenance cost.
[0065] 2) Considering that the core monitoring data of gas and oil transmission stations is valve opening, and valve opening data is data that does not change frequently or rarely changes, a dual reporting mode is determined based on the characteristics of this data. Under normal circumstances, the valve position monitoring transmitter uses the slave machine timing reporting mode to regularly report the monitoring data of each slave machine, and monitors the valve opening data in real time. When the change in the valve opening data exceeds the preset value, the slave machine change active reporting mode is adopted.
[0066] The following is another example of a LoRa-based wireless transmission system for valve position opening of the present application.
[0067] In view of the problems that the status monitoring of manual valves in existing oil and gas transmission stations requires trenching and wiring in the process area, the initial construction cost is high, the later maintenance cost is high, and it can only collect the open and closed status of the valve and cannot accurately reflect the current valve opening. The present invention provides a valve position opening wireless transmission system based on LoRa. The system mainly consists of a LoRa valve position monitoring transmitter with a high-precision non-contact valve position opening sensor and a LoRa receiving gateway. The LoRa valve position monitoring transmitter collects the valve position opening information of the valve position opening sensor and uses the LoRa low-power wireless transmission technology to transmit the data to the LoRa receiving gateway. The LoRa receiving gateway can connect 50 LoRa valve position monitoring transmitters, and other devices can communicate with the LoRa data receiving gateway through the serial port or network port to obtain relevant valve position data.
[0068] like Figure 2 As shown in the figure, the LoRa-based valve position opening wireless transmission system consists of a LoRa valve position monitoring transmitter with a high-precision non-contact valve position opening sensor and a LoRa data receiving gateway. The LoRa valve position monitoring transmitter is installed on the worm gear of the manual valve to collect valve opening information in real time. The LoRa receiving gateway is installed in the control center computer room to receive the data reported by each LoRa valve position monitoring transmitter, and forward the data to a third-party monitoring system (such as a station control system) or other equipment (such as PLC / RTU) after storage.
[0069] The high-precision non-contact valve position sensor uses an absolute encoder to measure the valve position rotation angle, and outputs the valve position data through the RS485 data communication interface, which can solve the problem of digital acquisition of valve position and express the manual valve position status in digital quantities of 0 to 359 degrees. It can accurately indicate the current valve status.
[0070] The high-precision non-contact valve position sensor is a non-contact magnetoelectric sensor. Compared with photoelectric encoders, it is more resistant to vibration, impact, water, gas, oil, temperature and humidity changes. The sensor does not require battery support, has strong anti-interference ability, never wears out, and the position information will not be wrong. The original position information can be maintained after power failure. The sensor has a high reliability of 100,000 hours without failure. The sensor resolution is 15 bits; the linear accuracy is 0.01 degrees. The sensor adopts a flameproof design, which is very suitable for explosion-proof occasions such as oil and gas chemical stations.
[0071] The control board of the valve position monitoring transmitter is based on STM32F103C8T6, and is mainly composed of a power supply module, a LoRa transmission module, a CPU module, and an RS485 communication module. The control board is a monitoring function that can collect the valve position information fed back by a high-precision non-contact valve position opening sensor and convert it into the corresponding opening and open, closed, and intermediate valve position status information. It also has the functions of monitoring its own power supply voltage, 4-way DI acquisition, 4-way AI acquisition, and 2-way DO output control. It uses RS485 to communicate with the high-precision non-contact valve position opening sensor and reports data to the LoRa receiving gateway in LoRa mode. The valve position monitoring transmitter control board is placed in a flameproof enclosure to achieve overall flameproofing, which is suitable for explosion-proof requirements.
[0072] The valve position monitoring transmitter needs to be installed in the process area of the oil and gas station. This area is an explosion-proof area. Therefore, the valve position monitoring transmitter control board and the high-precision non-contact valve position opening sensor need to be installed in a flameproof enclosure first, and then the enclosure is installed on the monitoring valve to achieve overall flameproof. The flameproof enclosure meets the EXDII CT6 standard and has relevant national certification. Protection level: IP67, ambient temperature -20℃~80℃; die-cast aluminum alloy shell.
[0073] The LoRa receiving gateway is the aggregation center of field data. It has the functions of receiving data from each LoRa valve position monitoring transmitter, data storage function (the last packet of data at each point) and data forwarding function (Modbus RTU / TCP). Users can use RTU / PLC, computer and other devices to obtain relevant field data through serial port and network port using corresponding communication protocols; the LoRa data receiving gateway uses the Cortex-M3 series 32-bit processor STM32F103VCT6, equipped with UCOS-II operating system to provide excellent multi-threaded task processing capabilities. The LoRa receiving gateway has one RS232 communication port and one RS485 communication port, supporting the standard Modbus RTU communication protocol. One RJ45 10 / 100M adaptive network port supports Modbus TCP protocol. A single LoRa receiving gateway can be networked with up to 50 valve position monitoring transmitters. The specific working method is as follows:
[0074] 1) The first working mode: after the work is completed, the valve position monitoring transmitter does not sleep, the working process is as follows Figure 3 As shown, specifically including:
[0075] S10, power on, system initialization;
[0076] S11, the valve position monitoring transmitter control board reads the opening information of the high-precision non-contact valve position opening sensor and calculates the current valve state based on the opening data;
[0077] S12, the valve position monitoring transmitter control board collects DI, AI, and DO, and packages all the above data according to the LoRa transmission data frame structure;
[0078] S13, the LoRa module sends a LoRa transmission data frame and receives the reception success feedback information returned by the LoRa receiving gateway;
[0079] S14, determine whether the reception success feedback information sent by the LoRa receiving gateway is received, if so, proceed to step S15; if not, proceed to S16;
[0080] S15, the valve position monitoring transmitter control board reads the opening of the high-precision non-contact valve position opening sensor every 1 second, and calculates the difference between the current opening and the previous opening, and proceeds to S17;
[0081] S16, determine whether the number of retransmissions has reached 10 times, if so, proceed to S15; if not, proceed to S13 after an interval of 1 second;
[0082] S17, judging whether the opening difference is greater than the set value, if so, proceeding to S18; if not, proceeding to S19;
[0083] S18, the reporting mode is changed to intensive reporting, which works continuously for 60 seconds, collects all data every 2 seconds and sends them in packages. This reporting mode does not monitor the feedback information of the LoRa receiving gateway;
[0084] S19, determine whether it is time to report regularly, if yes, proceed to S20, if not, proceed to S5;
[0085] S20, the valve position monitoring transmitter control board reads the opening information of the high-precision non-contact valve position opening sensor, and calculates the current valve state based on the opening data;
[0086] S21, the valve position monitoring transmitter control board collects its own DI, AI, and DO, and packages all the above data according to the LoRa transmission data frame structure;
[0087] S22, the LoRa module sends a LoRa transmission data frame and receives the reception success feedback information returned by the LoRa receiving gateway;
[0088] S23, determine whether the reception success feedback information sent by the LoRa receiving gateway is received, if so, proceed to S5, if not, proceed to S24;
[0089] S24. Determine whether the number of retransmissions has reached 10. If so, proceed to S5. If not, proceed to S22 after an interval of 1.2 seconds.
[0090] 2) The second working mode: After the work is completed, the valve position monitoring transmitter is dormant. Its working process is shown in Figure 4, which specifically includes:
[0091] S100, power on, system initialization;
[0092] S101, the valve position monitoring transmitter control board reads the opening information of the high-precision non-contact valve position opening sensor, and calculates the current valve state based on the opening data;
[0093] S102, the valve position monitoring transmitter control board collects DI, AI, and DO, and packages all the above data according to the LoRa transmission data frame structure;
[0094] S103, the LoRa module sends a LoRa transmission data frame and receives a successful reception feedback message returned by the LoRa receiving gateway;
[0095] S104, determine whether the reception success feedback information sent by the LoRa receiving gateway is received, if so, proceed to S105; if not, proceed to S106;
[0096] S105, the system is dormant, the valve position monitoring transmitter control board wakes up the system every 30 seconds, reads the opening of the high-precision non-contact valve position opening sensor, and calculates the difference between the current opening and the previous opening, and proceeds to S107;
[0097] S106, determine whether the number of retransmissions has reached 10 times, if so, proceed to step 6; if not, proceed to S103 after an interval of 1 second;
[0098] S107, judging whether the opening difference is greater than the set value, if so, proceeding to S108; if not, proceeding to S109;
[0099] S108, the reporting mode is changed to intensive reporting, which works continuously for 60 seconds, collects all data every 2 seconds and sends them in packages. This reporting mode does not monitor the feedback information of the LoRa receiving gateway;
[0100] S109, determine whether it is time to report regularly, if yes, proceed to S110, if not, proceed to S105;
[0101] S110, the valve position monitoring transmitter control board reads the opening information of the high-precision non-contact valve position opening sensor and calculates the current valve state based on the opening data;
[0102] S111, the valve position monitoring transmitter control board collects its own DI, AI, and DO, and packages all the above data according to the LoRa transmission data frame structure;
[0103] S112, the LoRa module sends a LoRa transmission data frame and receives a successful reception feedback message returned by the LoRa receiving gateway;
[0104] S113, determine whether the reception success feedback information sent by the LoRa receiving gateway is received, if so, proceed to S104, if not, proceed to S114;
[0105] S114, determine whether the number of retransmissions has reached 10 times, if so, proceed to S105, if not, after an interval of 1.2 seconds, proceed to S112.
[0106] Among them, Figure 5 As shown in the figure, the working process of the LoRa receiving gateway specifically includes:
[0107] S1000, system initialization;
[0108] S1001, create LoRa communication processing thread and external communication processing thread;
[0109] S1002, for the LoRa communication processing thread, determine whether the LoRa data frame is received, if so, proceed to S1003, if not, return to the LoRa communication processing thread; for the external communication processing thread, determine whether the ModusRTU protocol read command is received, if so, proceed to S1006, if not, return to the external communication processing thread;
[0110] S1003, sending and receiving successful feedback information;
[0111] S1004, parsing the LoRa data frame and saving the corresponding data to the storage area where the corresponding LoRa valve position monitoring transmitter ID is located;
[0112] S1005, map the data to the register of the standard Modbus RTU protocol and return to the LoRa communication processing thread;
[0113] S1006. Analyze the command and give feedback, returning to the external communication processing thread.
[0114] LoRa data transmission is a half-duplex communication mode (similar to wired 485). It only supports one device to send data in the same channel at the same time, and does not support multiple slave devices to send data to the master device at the same time; therefore, there is a conflict avoidance problem of sending data from multiple points to a single point at the same time. This system is a typical multi-point to single point transmission system, so a reasonable operation mechanism is needed to avoid data conflict problems.
[0115] The host polling method is a method in which the host polls and calls out numbers one by one. The principle is very simple, and the answer is achieved by calling the name. For example, the host sends to slave No. 1. Since the slaves have addresses set, only slave 1 can respond to the host. After receiving the command from the host, slave 1 uploads the data to the host. The host then polls the data of other slaves in the same polling method. To use an appropriate metaphor, when the teacher (host) is in class, he calls student No. 1 (slave) to answer questions. At this time, only student No. 1 can answer the teacher's questions. This is the host polling method. The advantage of the polling method is that it is not easy for conflicts to occur between devices, and the networking is relatively stable, but the disadvantage is that the host polling takes a long time. This networking method is suitable for networking applications that do not require high time, but it is not suitable for occasions like ours where the host can quickly receive changes in the slave. The host refers to the LoRa receiving gateway, and the slave refers to each valve position monitoring transmitter.
[0116] The slave timing upload method is to set different upload times for the slaves to avoid data uploading at the same time, so as to avoid data conflict. However, this method will cause data conflict when the timing interval is short and there are many slaves; but if the timing interval is long, there will be a problem of not being able to receive the slave change information in time.
[0117] The active upload mode of slave changes is that the slave does not upload data at ordinary times, and only uploads data to the host when the core monitoring data changes. This method can avoid data conflicts caused by simultaneous data upload and keep the communication link idle to the greatest extent, so as to avoid data conflicts. It is suitable for occasions where the core monitoring data does not change frequently.
[0118] This system is used in gas and oil transmission stations, and the core monitoring data is valve opening. This data is infrequently changing or rarely changing. According to the characteristics of the above three data transmission methods, a dual reporting mode of active reporting of slave changes + scheduled reporting of slave changes is determined. The slave usually only monitors the valve opening data. When the change in the current valve opening value compared with the previous valve opening value exceeds the set value, it will continue to read and report the data 30 times, each time at an interval of 2 seconds, and will continue to report for a total of one minute. Generally speaking, this time period is sufficient to fully monitor the complete change of the valve opening.
[0119] The processing data time of the valve position monitoring transmitter (referred to as transmitter) obtained from the experimental test is as follows:
[0120] The time it takes for the transmitter to read the high-precision non-contact valve position sensor is T1 = 30ms;
[0121] The time taken for transmitter ADC sampling, DI, DO acquisition, and data packaging is T2 = 110ms;
[0122] The transmitter processor sends data to the LoRa module, the baud rate is 9600, and the time for 32 bytes of data is T3 = 28ms;
[0123] The time it takes for the LoRa module to transmit data wirelessly @ air speed is 2.4k, 32 bytes T4 = 112ms;
[0124] The time it takes for the LoRa data receiving gateway to receive, parse, store data and send receipt data to the transmitter is about T5 = 838ms;
[0125] The complete data collection and transmission time, that is, the time T from the transmitter collecting data to the LoRa data receiving gateway responding to the transmitter, is the sum of the above times:
[0126] T = T1 + T2 + T3 + T4 + T5;
[0127] T=30ms+110ms+28ms+112ms+838ms=1118ms.
[0128] Because T = 1.12S, the minimum reporting interval of the transmitter is set to 2 seconds to ensure data transmission. Considering that multiple transmitters may report data concurrently, in order to improve data transmission efficiency, the transmitter no longer determines whether the packet data is successfully transmitted (i.e. whether the response information of the LoRa data receiving gateway is received), and sends a new data packet every 2 seconds until 30 times are completed. In this working mode, the wireless transmission channel time of each transmitter is T4 = 112ms. Theoretically, the wireless transmission channel time of 10 transmitters is 10*112ms = 1120ms = 1.12S, which is less than the reporting interval of 2S. In practical applications, the probability of 10 sets of valves acting at the same time is very small.
[0129] Because the valve opening does not change frequently in actual applications, it may not change for several days or even longer. In order to ensure the normal operation of the detection system, a timed reporting method is added. The timed reporting can be used to detect whether the data is updated and whether each device is working normally.
[0130] The transmitter's scheduled reporting time can be set to several hours or longer. Each transmitter can set a different scheduled reporting time, such as 1 minute apart, to avoid conflicts caused by simultaneous data reporting by the transmitter. In the scheduled reporting mode, the data transmission between the transmitter and the LoRa data receiving gateway needs to detect the response frame. Figure 6 As shown. After receiving the data sent by the transmitter, the LoRa receiving gateway needs to return a data receiving response frame to the transmitter. After receiving the response frame, the transmitter considers that the data has been sent, otherwise it will resend 10 times, each time at an interval of 1.2 seconds. To ensure that the data can be received by the LoRa data receiving gateway.
[0131] Regular reporting is a supplement to change reporting. When the valve opening is often unchanged, the management personnel can know that the transmitter is operating normally and know the working status, such as Figure 3 and 4 shown.
[0132] As an implementation method, the data frame format sent by the valve position monitoring transmitter is shown in Table 1.
[0133] Table 1:
[0134]
[0135] In Table 1, the frame header is: 0x55 0xAA 0x17. 0x55AA is the LoRa data receiving gateway ID number. 0x17 is the LoRa communication channel.
[0136] Data length: 0x1E: the total data length except the frame header.
[0137] Frame number: The current data frame number being sent, 0 to 0xffff in a cycle.
[0138] Device ID: The ID number of the current LoRa valve position monitoring transmitter.
[0139] DI: Sending device switch status, the lower 4 bits are valid, and each bit represents the switch status of one channel.
[0140] DO: Send device output control status, the lower 2 bits are valid, and each bit represents the output control status of one channel.
[0141] Battery voltage: current device power supply voltage, in Mv.
[0142] AI1 sampling value: current device AI1 4~20mA sampling value, unit is uA.
[0143] AI2 sampling value: current device AI2 4~20mA sampling value, unit is uA.
[0144] AI3 sampling value: current device AI3 4~20mA sampling value, unit is uA.
[0145] AI4 sampling value: current device AI4 4~20mA sampling value, unit is uA.
[0146] Current opening: The current opening value of the valve, floating point number, unit degree.
[0147] Full opening degree: valve full opening setting value, floating point number, unit degree. Used to judge the valve position switch status by the current opening degree.
[0148] Fully closed degree: The fully closed setting value of the valve, floating point number, unit degree. It is used to judge the valve position switch status by the current opening degree.
[0149] Valve position status: The valve position switch status determined by the current opening, 0-open, 1-closed, 2-intermediate state.
[0150] The format of the response frame sent by the LoRa receiving gateway is shown in Table 2.
[0151] Table 2:
[0152] Frame Header Device ID ACK 3 bytes 2 bytes 1 byte
[0153] In Table 2, frame header: device ID (2 bytes), 0x17, device ID: LoRa valve position monitoring transmitter ID that receives response information, ACK: 0x01, fixed value represents successful reception.
[0154] The data communication between the LoRa receiving gateway and the station control device is realized through the standard Modbus RTU / TCP protocol. The LoRa data receiving gateway needs to register all the received transmitter device IDs before working, and a maximum of 50 IDs can be registered. After the LoRa data receiving gateway receives the LoRa transmission data frame, it stores each data value in the storage area of the corresponding ID according to the transmitter device ID number. And map it to the register of the standard Modbus RTU / TCP protocol. DI and DO data are mapped to the 1000 register starting with 1001, and read using the 0x01 command. Battery voltage, AI1 sampling value, AI2 sampling value, AI3 sampling value, AI4 sampling value, and valve position status are mapped to the 3000 register starting with 3001, and read using the 0x03 command. The current opening, opening degree, and closing degree are mapped to the 7000 register starting with 7001, and read using the 0x03 command. The station control machine or PLC and other devices use the standard Modbus RTU / TCP protocol to read the data that needs attention. Such as Figure 7 shown.
[0155] The present invention proposes a wireless transmission system for valve position opening based on LoRa, which has the function of real-time monitoring of valve position status. It can not only convert the manual valve position status into accurate digital quantity of opening, but also avoid the heavy construction process of trenching and wiring, and use wireless data transmission to connect the data to the station control system. It can play a good auxiliary role in the daily production management of the station.
[0156] like Figure 8 As shown, a valve position opening wireless transmission method based on LoRa in an embodiment of the present invention adopts any one of the above-mentioned valve position opening wireless transmission systems based on LoRa, and the method includes:
[0157] S1. Each valve position monitoring transmitter collects the valve opening information of the corresponding valve to be monitored and sends it to the LoRa receiving gateway;
[0158] S2. The LoRa receiving gateway forwards the valve opening information of each valve to be monitored to the monitoring terminal.
[0159] It can monitor the valve opening information of multiple valves in real time and report it wirelessly, so that users can accurately obtain the valve opening information of on-site valves, and can minimize the initial construction cost and later maintenance cost. It is suitable for site application scenarios with high time requirements.
[0160] For the specific implementation process of each step in the above-mentioned method for wireless transmission of valve position opening based on LoRa of the present invention, reference can be made to the content in the above embodiment of a wireless transmission system for valve position opening based on LoRa, which will not be repeated here.
[0161] Those skilled in the art will appreciate that the present invention may be implemented as a system, method or computer program product.
[0162] Therefore, the present disclosure may be specifically implemented in the following forms, namely: it may be completely hardware, it may be completely software (including firmware, resident software, microcode, etc.), or it may be a combination of hardware and software, generally referred to herein as a "circuit", "module" or "system". In addition, in some embodiments, the present invention may also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.
[0163] Any combination of one or more computer-readable media can be used. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0164] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A valve position opening wireless transmission system based on LoRa, characterized in that: It includes a monitoring terminal, a LoRa receiving gateway and a valve position monitoring transmitter installed on each valve to be monitored; Each valve position monitoring transmitter is used to: collect valve opening information of the corresponding valve to be monitored and send it to the LoRa receiving gateway; The LoRa receiving gateway is used to: forward the valve opening information of each valve to be monitored to the monitoring terminal; Each valve position monitoring transmitter adopts a dual reporting mode combining active reporting of slave changes and scheduled reporting of slaves to send corresponding valve opening information to the LoRa receiving gateway; The LoRa receiving gateway includes a memory having a plurality of storage areas, each storage area being used to store valve opening information collected by a corresponding valve position monitoring transmitter; The LoRa receiving gateway also includes a register, and the LoRa receiving gateway is further used to: map the valve opening information stored in each storage area to the register; The valve position monitoring transmitter includes a non-contact valve position opening sensor and a control panel; The non-contact valve position sensor is used to: obtain valve position information of the valve to be monitored; The control panel is used to obtain valve opening information according to valve position information, and upload the valve opening information to the LoRa receiving gateway by using LoRa communication, wherein the valve opening information includes valve opening and valve position status information; Under normal circumstances, the valve position monitoring transmitter uses the slave timing reporting mode to regularly report the monitoring data of each slave, and monitors the valve opening data in real time. When the change in the valve opening data exceeds the preset value, the slave change active reporting mode is adopted; In the dual reporting mode, the slave refers to the valve position monitoring transmitter, and the host refers to the monitoring terminal. Under normal working conditions, different upload times are set for each valve position monitoring transmitter, so that each valve position monitoring transmitter reports monitoring data regularly according to the set time. At the same time, each valve position monitoring transmitter monitors the changes of valve position data in real time, and actively reports monitoring data when the corresponding valve position data changes beyond the preset range. When the valve position monitoring transmitter detects that the change between the current valve opening and the last valve opening exceeds the preset value, it will continue to read and actively report the monitoring data for a preset time, which is the time period in which the complete change of the valve opening can be monitored; A single LoRa receiving gateway is networked with multiple valve position monitoring transmitters to achieve the following working methods: 1) The first working mode: S10, power on, system initialization; S11, the valve position monitoring transmitter control board reads the opening information of the high-precision non-contact valve position opening sensor and calculates the current valve state based on the opening data; S12, the valve position monitoring transmitter control board collects DI, AI, and DO, and packages all the above data according to the LoRa transmission data frame structure; S13, the LoRa module sends a LoRa transmission data frame and receives the reception success feedback information returned by the LoRa receiving gateway; S14, determine whether the reception success feedback information sent by the LoRa receiving gateway is received, if so, proceed to step S15; if not, proceed to S16; S15, the valve position monitoring transmitter control board reads the opening of the high-precision non-contact valve position opening sensor every 1 second, and calculates the difference between the current opening and the previous opening, and proceeds to S17; S16, determine whether the number of retransmissions has reached 10 times, if so, proceed to S15; if not, proceed to S13 after an interval of 1 second; S17, judging whether the opening difference is greater than the set value, if so, proceeding to S18; if not, proceeding to S19; S18, the reporting mode is changed to intensive reporting, which works continuously for 60 seconds, collects all data every 2 seconds and sends them in packages. This reporting mode does not monitor the feedback information of the LoRa receiving gateway; S19, determine whether it is time to report regularly, if yes, proceed to S20, if not, proceed to S5; S20, the valve position monitoring transmitter control board reads the opening information of the high-precision non-contact valve position opening sensor, and calculates the current valve state based on the opening data; S21, the valve position monitoring transmitter control board collects its own DI, AI, and DO, and packages all the above data according to the LoRa transmission data frame structure; S22, the LoRa module sends a LoRa transmission data frame and receives the reception success feedback information returned by the LoRa receiving gateway; S23, determine whether the reception success feedback information sent by the LoRa receiving gateway is received, if so, proceed to S5, if not, proceed to S24; S24, determine whether the number of retransmissions has reached 10 times, if so, proceed to S5, if not, after an interval of 1.2 seconds, proceed to S22; The second working method: S100, power on, system initialization; S101, the valve position monitoring transmitter control board reads the opening information of the high-precision non-contact valve position opening sensor, and calculates the current valve state based on the opening data; S102, the valve position monitoring transmitter control board collects DI, AI, and DO, and packages all the above data according to the LoRa transmission data frame structure; S103, the LoRa module sends a LoRa transmission data frame and receives a successful reception feedback message returned by the LoRa receiving gateway; S104, determine whether the reception success feedback information sent by the LoRa receiving gateway is received, if so, proceed to S105; if not, proceed to S106; S105, the system is dormant, the valve position monitoring transmitter control board wakes up the system every 30 seconds, reads the opening of the high-precision non-contact valve position opening sensor, and calculates the difference between the current opening and the previous opening, and proceeds to S107; S106, determine whether the number of retransmissions has reached 10 times, if so, proceed to step 6; if not, proceed to S103 after an interval of 1 second; S107, judging whether the opening difference is greater than the set value, if so, proceeding to S108; if not, proceeding to S109; S108, the reporting mode is changed to intensive reporting, which works continuously for 60 seconds, collects all data every 2 seconds and sends them in packages. This reporting mode does not monitor the feedback information of the LoRa receiving gateway; S109, determine whether it is time to report regularly, if yes, proceed to S110, if not, proceed to S105; S110, the valve position monitoring transmitter control board reads the opening information of the high-precision non-contact valve position opening sensor and calculates the current valve state based on the opening data; S111, the valve position monitoring transmitter control board collects its own DI, AI, and DO, and packages all the above data according to the LoRa transmission data frame structure; S112, the LoRa module sends a LoRa transmission data frame and receives a successful reception feedback message returned by the LoRa receiving gateway; S113, determine whether the reception success feedback information sent by the LoRa receiving gateway is received, if so, proceed to S104, if not, proceed to S114; S114, determine whether the number of retransmissions has reached 10 times, if so, proceed to S105, if not, after an interval of 1.2 seconds, proceed to S112; The working process of the LoRa receiving gateway specifically includes: S1000, system initialization; S1001, create LoRa communication processing thread and external communication processing thread; S1002, for the LoRa communication processing thread, determine whether the LoRa data frame is received, if so, proceed to S1003, if not, return to the LoRa communication processing thread; for the external communication processing thread, determine whether the Modus RTU protocol read command is received, if so, proceed to S1006, if not, return to the external communication processing thread; S1003, sending and receiving successful feedback information; S1004, parsing the LoRa data frame and saving the corresponding data to the storage area where the corresponding LoRa valve position monitoring transmitter ID is located; S1005, map the data to the register of the standard Modbus RTU protocol and return to the LoRa communication processing thread; S1006. Analyze the command and give feedback, returning to the external communication processing thread.
2. According to a LoRa-based valve position wireless transmission system according to claim 1, it is characterized in that: The valve position monitoring transmitter further comprises a flameproof housing, and the non-contact valve position opening sensor and the control panel are located in the flameproof housing.
3. A valve position opening wireless transmission system based on LoRa according to claim 1, characterized in that: The control board includes a LoRa transmission module, a CPU module and an RS485 module; The RS485 module is used to: receive valve position information of the valve to be monitored sent by the non-contact valve position opening sensor; The CPU module is used to: obtain valve opening information according to valve position information; The LoRa transmission module is used to upload the valve opening information to the LoRa receiving gateway via the LoRa communication method.
4. A valve position opening wireless transmission system based on LoRa according to claim 1, characterized in that: The valve position information includes the valve position rotation angle. The non-contact valve position opening sensor is specifically used to measure the valve position rotation angle of the valve to be monitored through an absolute value encoder.
5. A valve position opening wireless transmission system based on LoRa according to claim 1, characterized in that: The monitoring terminal and the LoRa receiving gateway perform data transmission via a custom communication protocol.
6. A method for wireless transmission of valve position opening based on LoRa, characterized in that: Using a LoRa-based valve position wireless transmission system as described in any one of claims 1 to 5, the method comprises: S1. Each valve position monitoring transmitter collects valve opening information of the corresponding valve to be monitored and sends it to the LoRa receiving gateway; S2. The LoRa receiving gateway forwards the valve opening information of each valve to be monitored to the monitoring terminal.
