An underground pipe network data acquisition system
Through the underground pipeline network data acquisition system using Bluetooth master-slave inverted communication mode and anti-collision offset time algorithm in the underground pipe well system, the problem of difficulty in power supply and communication is solved, and low power consumption, reliable communication and security are achieved data collection reduces maintenance costs and security risks.
Patent Information
- Application Number
- CN202311735080.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-12-15
AI Technical Summary
In the prior art, underground pipe well monitoring systems are difficult to work normally in scenarios without power supply, have poor communication quality, and require personnel to go down to the well for maintenance, which poses safety hazards and high costs.
An underground pipeline data acquisition system was designed, including the platform end, the gateway end and the terminal, and adopts the Bluetooth master-slave inverted communication mode. The gateway end is a slave device and the terminal is a master device. It is in a low power state when data communication is not carried out. , reduce the probability of communication conflict through anti-collision offset time algorithm, and set up a gateway at the wellhead for easy management and data upload.
It realizes low-power communication in scenarios without mains power supply, extends battery life, reduces maintenance costs, improves communication success rate, avoids downhole maintenance, and enhances system scalability and safety.
Smart Images

Figure CN118102245B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of underground pipe network monitoring, in particular to a data acquisition system for underground pipe networks. Background Art
[0002] The primary pipe network of the urban heating network is mainly used to transport the heat generated by the heat source to the thermal power station. Most of the media transported in the primary pipe network is hot water, and the design temperature is generally 130°C. If there is a hydraulic imbalance in the primary pipe network, the water temperature of the end user will be uneven and the heating effect will be poor. Hydraulic imbalance problems often occur. For example, some users have a large flow rate, some users have a small flow rate, and some users' room temperature never meets the heating standard. In order to solve this problem of uneven cold and heat and thermal imbalance, it is necessary to adjust the hydraulic balance of the heating network to ensure the uniform cold and heat of the entire system. Data collection of the heating network is an important basis for the hydraulic balance management of the network. Only with the support of informatization and data can the balance adjustment of the network be carried out.
[0003] However, the informatization of heating pipe network has the following problems:
[0004] 1. Difficulty in power supply. Heating pipe wells are generally located outdoors and in the wild, without mains electricity. The use of solar power supply is expensive and easily damaged.
[0005] 2. Difficult communication. The pipe well is buried underground, and the communication environment is extremely harsh, which deteriorates the communication capability of the data acquisition equipment. For example, in order to improve the communication effect, the communication module placed at the bottom of the pipe well needs to be equipped with a long antenna, and the long antenna needs to be pulled to the wellhead, resulting in signal attenuation and low communication success rate.
[0006] 3. Pipe wells are difficult to maintain. In order to maintain pipe wells, personnel are often required to go down to operate. Due to the long-term closure of the well, the internal environment is hot and humid, and other harmful gases may exist. Therefore, monitoring equipment is needed to monitor the environment in the well. Only pipe wells that meet the conditions can be operated and maintained, otherwise it may cause life-threatening situations. However, this kind of monitoring equipment is expensive and difficult to install and use.
[0007] This problem of underground pipe well monitoring is widely used in the fields of water supply, gas supply, etc. Therefore, there is an urgent need in the prior art for a pipe well monitoring system that can work normally in a scenario without mains power supply, has reliable communication quality, can upload data smoothly and completely, and does not require personnel to go down to the well for maintenance. Summary of the invention
[0008] In order to solve at least one of the problems existing in the prior art, the present invention provides an underground pipe network data acquisition system, the system comprising:
[0009] Platform side, gateway side and terminal side;
[0010] The gateway end is located at the entrance of the underground pipe well;
[0011] The terminal is located inside the underground pipe well and is used to collect data from sensors or actuators in the underground pipe well;
[0012] The gateway end has a first communication module and a second communication module; the gateway end performs data communication with the platform end through the first communication module; the gateway end performs data communication with the terminal end through the second communication module;
[0013] The gateway is a slave device that is in a low-power broadcast state when not performing data communication;
[0014] The terminal is a main device, which is in sleep mode when no data communication is performed, that is, the main controller is in sleep mode and other unit modules are in power-off state. When it reaches the data communication time, the main controller ends the sleep mode and controls other unit modules to power on and be in working state. At the same time, it controls the second communication module to scan the broadcast signal of the gateway end. When the corresponding signal is scanned, it attempts to perform data communication with the gateway end. If the broadcast signal of the gateway end is not scanned, it re-enters the sleep mode after calculating the anti-collision offset time.
[0015] Furthermore, when the terminal reaches the data communication time, if the second communication module scans the broadcast signal of the gateway, it goes to step S1, if it does not scan the corresponding signal, it goes to step S2;
[0016] Wherein, step S1 includes the following sub-steps:
[0017] S11: The terminal establishes a data connection relationship with the gateway;
[0018] S12: The terminal sends a wake-up signal to the gateway to wake up the gateway and put it into normal working mode;
[0019] S13: The terminal sends data to the gateway, and the gateway receives the data; the gateway sends data to the terminal, and the terminal receives the data;
[0020] S14: The terminal enters sleep mode;
[0021] Step S2 includes the following sub-steps:
[0022] S21: terminal caches data;
[0023] S22: The terminal calculates the anti-collision offset time, which is the length of time required for the terminal to reach the next data communication time;
[0024] S23: The terminal enters sleep mode.
[0025] Furthermore, in step S13, after receiving the data sent by the terminal, the gateway performs anti-collision scheduling calculation and sends corresponding configuration information according to the address of the terminal, wherein the configuration information includes the length of time required for the terminal to reach the next data communication time.
[0026] Furthermore, the anti-collision scheduling calculation is to schedule the time of all terminals according to the terminal collection cycle and / or terminal upload cycle issued by the platform and the newly received terminal information, so as to minimize the conflict probability of data communication between each terminal and the gateway.
[0027] Furthermore, the terminal calculates the anti-collision offset time as follows: anti-collision offset time = RTC time of the terminal + ID of the terminal × adjustable time threshold; wherein the adjustable time threshold is a constant and can be set or modified.
[0028] Furthermore, in step S13, the information sent by the gateway to the terminal also includes the terminal collection cycle and / or the terminal upload cycle and / or the check value and / or the OTA upgrade instruction information of the terminal sent by the platform to it.
[0029] Furthermore, the terminal includes one or more of a pipe well supply and return temperature and pressure monitoring terminal, a pipe well gas detection terminal, and a manhole cover movement detection terminal.
[0030] Furthermore, when a new terminal is added, the newly added terminal is added to the gateway, and the gateway automatically adds it to the system and automatically reports it to the platform.
[0031] Furthermore, the gateway has button triggering and display functions, which facilitates localized meter reading and on-site data viewing, and solves the inconvenience of inspection personnel having to go down the well to check.
[0032] Furthermore, after receiving the information from the gateway, the terminal first identifies it and then enters the following sub-processes:
[0033] A. If the information includes OTA upgrade instruction information, the terminal enters the upgrade process, and after completion, enters the terminal acquisition cycle and / or terminal upload cycle and / or the terminal to reach the next data communication time length adjustment process.
[0034] B. If the information does not include OTA upgrade instruction information, the terminal directly enters the terminal acquisition cycle and / or the terminal upload cycle and / or the adjustment process of the length of time required for the terminal to reach the next data communication time;
[0035] Further, the gateway performs the following steps after completing step S1:
[0036] S3: The gateway sends terminal data to the platform;
[0037] S4: The platform receives and stores data from the gateway.
[0038] S5: The gateway receives data sent by the platform;
[0039] S6: The gateway caches the data sent by the platform that needs to be forwarded to the terminal.
[0040] Furthermore, the first communication module is a NBIoT communication module or a 4G communication module or a 5G communication module, and the second communication module is a Bluetooth BLE communication module or a Lora communication module.
[0041] The underground pipe network data acquisition system provided by the present invention includes a platform end, a gateway end and a terminal. The data of the terminal is first sent to the gateway end, and then sent to the platform end by the gateway end. The gateway end and the terminal adopt a Bluetooth communication mode, and the gateway end is a Bluetooth slave device, and the terminal is a Bluetooth master device. While ensuring the communication effect, the power consumption can be greatly reduced, so that the battery life is as long as six years. In addition, both the gateway end and the terminal have built-in anti-collision offset time algorithms, which can effectively reduce the probability of collision when multiple terminals communicate with the gateway end. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the specific implementation manner of the present invention, the drawings required for use in the specific implementation manner or the description of the prior art will be briefly introduced below.
[0043] Figure 1 This is a structural schematic diagram of the underground pipe well data acquisition system provided by the present invention.
[0044] Figure 2 This is a schematic diagram of the structure of the gateway end in the underground pipe well data acquisition system provided by the present invention.
[0045] Figure 3 A schematic diagram of the structure of a sensor for monitoring the temperature and pressure of a fluid in an underground pipe well in the underground pipe well data acquisition system provided by the present invention.
[0046] Figure 4 This is a schematic diagram of the structure of a sensor for monitoring oxygen concentration, harmful gases and water immersion in an underground pipe well in the underground pipe well data acquisition system provided by the present invention.
[0047] Figure 5 The present invention provides a flow chart of data interaction among the platform, gateway and terminal in the underground pipe well data acquisition system.
[0048] Figure 6 The present invention provides a working flow chart of a terminal in the underground pipe well data acquisition system.
[0049] Figure 7 The present invention provides a workflow diagram of the gateway end in the underground pipe well data acquisition system.
[0050] Figure 8 The invention discloses a calculation process of anti-collision offset time in the underground pipe well data acquisition system provided by the present invention. DETAILED DESCRIPTION
[0051] The structure and operation of the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the accompanying drawings are provided only for a better understanding of the present invention and should not be construed as limiting the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] In the description of the present invention, it should be noted that, if the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, if the terms "first" and "second" appear, they are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0053] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0054] In order to solve the problem of difficult data monitoring of underground pipe wells, the present invention proposes an underground pipe network data acquisition system, the data acquisition system platform end, gateway end and terminal, the system structure is as follows Figure 1 As shown. The gateway end is located at the entrance of the underground pipe well, and the terminals are generally multiple, located inside the underground pipe well, and are used to collect data from sensors or actuators in the underground pipe well, such as collecting the supply and return temperature and pressure information of the fluid in the pipe well, detecting the gas in the pipe well, or detecting the abnormal movement of the well cover, etc. The data collected by the terminal is first uploaded to the gateway end, and the gateway end then uploads the data to the platform end.
[0055] Among them, the platform mainly provides the following technical solutions, the main functions include: 1) terminal equipment management, mainly including terminal equipment offline, online status management, terminal collection cycle and terminal upload cycle setting, terminal equipment collection upload cycle display, collection parameter calibration and distribution, equipment OTA upgrade, equipment version maintenance, etc.; 2) data management, mainly including real-time data collection, abnormal data removal, storage and call of historical data, dynamic change calculation of collection parameters, change rate calculation, prediction of sudden abnormal situations and alarm status generation, etc.; 3) business processing management, mainly including real-time data display, historical data display, change rate display of single pipe well collection parameters, overall display of supply and return temperature of the entire pipe network system, display of uniform supply and return temperature distribution in the entire pipe network system, maximum and minimum points of supply and return pressure of the entire pipe network, and analysis and display of the best site for supply and return pressure control.
[0056] The gateway end has a first communication module and a second communication module. In a specific embodiment, the first communication module is an NB-IoT communication module, and the second communication module is a Bluetooth BLE communication module. The gateway end communicates data with the platform end through the NB-IoT communication module, and the gateway end communicates data with the terminal through the BLE communication module. In addition, the gateway end also has a case module and a display module, and its structure is as follows: Figure 2 In other embodiments, the first communication module may be a 4G communication module or a 5G communication module or other communication modules, and the second communication module may be a Lora communication module or other near field communication module.
[0057] The gateway has the following functions: 1) Management of terminal devices mounted on it, including automatic addition and mounting of terminal devices, reception management of terminal collection cycle and terminal upload cycle, anti-collision scheduling of downstream device uploads, OTA management of terminal devices, etc.; 2) Gateway data management, caching of data recently uploaded by terminals, data packaging and sending to the platform; 3) Basic functions of this machine, including low-power design management, BLE Bluetooth slave device is awakened to receive data, with trigger button wake-up, display of the last received terminal data and control of screen cycle display.
[0058] The terminal structure diagram is as follows Figure 3 or Figure 4 As shown. Figure 3 Schematic diagram of the structure of a sensor for monitoring the temperature and pressure of fluid in an underground pipe well. Figure 4This is a schematic diagram of the sensor structure for monitoring oxygen concentration, harmful gases, and water infiltration in pipe wells. The terminal is mainly composed of MCU, various sensor modules, BLE communication modules, buttons and LED indicators. The terminal has the following functions: 1) It has supply and return water temperature, pressure monitoring, pipe well harmful gases, and oxygen concentration detection; 2) It has low power management function, automatic sleep, RTC wake-up and button wake-up; 3) It has acquisition and communication unit power management functions to ensure low power consumption of the whole machine; 4) It has BLE communication function, and can quickly connect according to a specific Bluetooth name or MAC address; 5) It has scheduled upload, and caches data if the connection object cannot be found during the normal upload cycle, and adjusts the next upload time to avoid network conflicts; 6) It has OTA upgrade function.
[0059] Since underground pipe wells are mostly located outdoors and in the wild, and lack mains electricity, the gateway and terminal are powered by batteries. The traditional gateway is a Bluetooth master device, and the terminal is a Bluetooth slave device. The terminal maintains a broadcast state, and the gateway periodically scans the terminal's broadcast signal and communicates. However, in this mode, the power consumption of the gateway is too high, and low-power operation cannot be achieved. The battery needs to be replaced frequently, increasing the maintenance cost. In order to reduce the overall power consumption of the gateway and the terminal, the present invention adopts an innovative Bluetooth master-slave inverted communication mode. The gateway and the terminal do not need to frequently replace the battery, and the battery can maintain the power supply requirements of the gateway and the terminal for up to six years.
[0060] The specific implementation method is that the gateway end is a Bluetooth slave device, which is in a low-power broadcast state when no data communication is performed; the terminal is a master device, which is in a sleep mode when no data communication is performed, that is, the main controller is in a sleep state, and other unit modules are in a power-off state. When it reaches the data communication time, the main controller ends the sleep state, and controls other unit modules to power on and be in a working state. At the same time, the second communication module is controlled to scan the broadcast signal of the gateway end. When the corresponding signal is scanned, it attempts to communicate data with the gateway end. If the broadcast signal of the gateway end is not scanned, it re-enters the sleep mode after calculating the anti-collision offset time.
[0061] Specifically, when the terminal reaches the data communication time, the dormant state ends and starts scanning the broadcast signal of the gateway. When the corresponding signal is scanned, the process goes to step S1. If the corresponding signal is not scanned, the process goes to step S2.
[0062] Wherein, step S1 includes the following sub-steps:
[0063] S11: The terminal establishes a data connection relationship with the gateway;
[0064] S12: The terminal sends a wake-up signal to the gateway to wake up the gateway and put it into normal working mode;
[0065] S13: The terminal sends data to the gateway, and the gateway receives the data; the gateway sends data to the terminal, and the terminal receives the data;
[0066] S14: The terminal enters sleep mode;
[0067] Step S2 includes the following sub-steps:
[0068] S21: terminal caches data;
[0069] S22: The terminal calculates the anti-collision offset time, which is the length of time required for the terminal to reach the next data communication time;
[0070] S23: The terminal enters sleep mode.
[0071] That is, the gateway changes from a Bluetooth master device to a Bluetooth slave device, and maintains a low-power broadcast state when no data communication is performed, and is awakened to a normal data communication state when communication is required. Therefore, compared with the master device mode that is always in high-power consumption, the power consumption is greatly reduced; although the terminal changes from a slave device to a master device, the power consumption is higher when scanning the broadcast signal, but the frequency of the terminal switching to the normal working mode is low, and it is in a dormant state most of the time, so the overall power consumption is not too high. The master-slave inverted Bluetooth communication mode can greatly reduce the overall power consumption of the gateway and the terminal.
[0072] However, the problem caused by the gateway being in slave mode and the terminal being in master mode is that if multiple terminals are scanning at the same time, it is easy for the gateway to only be able to establish a communication connection with one terminal, while other slave devices cannot be connected and need to wait. In order to reduce the waiting time of other terminals that have not established a connection, the present invention provides an anti-collision algorithm, that is, when the terminal cannot establish a connection with the gateway, the terminal will calculate an anti-collision offset time, which is the length of time it needs to wait to reach the next data communication time, and the terminal will end the sleep mode again after the corresponding anti-collision offset time has passed, and try to establish a data communication relationship with the gateway.
[0073] The anti-collision algorithm provided by the present invention is not only embodied in the terminal, but also in the gateway.
[0074] In a specific embodiment, in step S13, after receiving the data sent by the terminal, the gateway performs anti-collision scheduling calculation, and sends corresponding configuration information according to the address of the terminal, wherein the configuration information includes the length of time required for the terminal to reach the next data communication time. The anti-collision scheduling calculation is to schedule the time of all terminals according to the terminal acquisition cycle and / or terminal upload cycle issued by the platform end and the newly received terminal information, so as to minimize the probability of conflict between each terminal and the gateway end for data communication. Specifically, the gateway end can establish a management form for the terminals it manages, which lists the acquisition cycle, upload cycle, and the time of the last upload of each terminal. This information is continuously updated. The gateway end can predict the time of the next data upload of all terminals based on this information. When it is found that there is a conflict in the time of the next upload of two or more terminals, the anti-collision offset time of different terminals can be reallocated, so that the time of the next data upload of different terminals is staggered in timing to reduce the waiting time of a certain terminal. Figure 8 The calculation process of the anti-collision offset time in a simple case is shown. When the gateway calculates the upload cycle and the last upload time of the three terminals to obtain the estimated next upload time, it is found that there will be a conflict between terminal 1 and terminal 3, so the anti-collision offset time assigned to terminal 3 is 3 minutes. Figure 8 For illustration only, the calculation formula for assigning the anti-collision offset time may also adopt other common algorithms or methods that can be thought of by those skilled in the art.
[0075] That is, the gateway combines the acquisition cycle, upload cycle, specific upload time, and the last received terminal information of all terminals to generate a global information on how to avoid terminal upload conflicts, and can arrange the upload time of each terminal in a staggered manner. The next time the terminal communicates with it, the gateway can send the anti-collision offset time of the terminal to the terminal, so that the terminal can communicate data after the anti-collision offset time has passed after the next communication time.
[0076] In an optimized embodiment, the terminal calculates the anti-collision offset time as follows: anti-collision offset time = RTC time of the terminal + ID of the terminal × adjustable time threshold; wherein the adjustable time threshold is a constant and can be set or modified. For example, the adjustable time threshold can be set to 40ms, then the anti-collision offset time of the terminal = RTC time of the terminal + ID of the terminal × 40ms. When the terminal cannot establish communication with the gateway, it waits for the anti-collision offset time to pass before trying to establish communication with the gateway.
[0077] The platform, gateway, and terminal are in a relationship of information exchange. The platform will send data to the gateway and receive data from the gateway; the gateway will receive data from the terminal and send data to the terminal.
[0078] Part of the data sent by the platform to the gateway is information sent based on the management requirements of the gateway, such as the OTA upgrade instruction information of the gateway, and part of the data is information that needs to be forwarded by the gateway to the terminal, such as the terminal acquisition cycle and / or the terminal upload cycle and / or the check value and / or the OTA upgrade instruction information of the terminal. In some cases, the data sent by the platform to the gateway can be called configuration information, including the configuration information of the gateway and the configuration information of the terminal.
[0079] In a specific embodiment, after the gateway receives the data from the terminal, the following steps are performed:
[0080] S3: The gateway sends terminal data to the platform;
[0081] S4: The platform receives and stores data from the gateway.
[0082] S5: The gateway receives data sent by the platform;
[0083] S6: The gateway caches the data sent by the platform that needs to be forwarded to the terminal.
[0084] Therefore, in the above step S13, the information sent by the gateway to the terminal includes, in addition to the anti-collision offset time, the terminal collection cycle and / or the terminal upload cycle and / or the check value and / or the terminal OTA upgrade instruction information sent to it by the platform. The terminal collection cycle and / or the terminal upload cycle are the cycles in which the platform requires the terminal to collect data or upload data based on business needs. The check value is the data sent based on the needs of terminal identification or management. The OTA upgrade instruction information is the instruction information for online upgrading of the terminal. The terminal collection cycle and / or the terminal upload cycle and / or the check value and / or the OTA upgrade instruction information sent by the platform to the gateway can all be called configuration information.
[0085] The advantage of setting the gateway end at the entrance of the underground pipe well is that it is convenient for management. Personnel only need to replace the battery at the entrance of the pipe well without going down the well. In the optimized embodiment, the gateway end has button triggering and display functions, which is convenient for localized meter reading and on-site data viewing. The gateway end is set at the mouth of the pipe well to avoid signal attenuation caused by pulling the antenna to the wellhead because the equipment is at the bottom of the well, thereby avoiding affecting the communication effect. The data acquisition system provided by the present invention is scalable. There is no need to change the entire system. It only needs to install collection equipment such as environmental monitoring equipment containing BLE modules to achieve rapid expansion and meet the development needs of the collection system. The terminal of this system has the characteristics of strong scalability. When a new terminal is added, the newly added terminal is added to the gateway end, and the gateway end automatically adds it to the system and automatically reports it to the platform end.
[0086] In a specific embodiment, after receiving the information from the gateway, the terminal first identifies it and then enters the following sub-processes respectively:
[0087] A. If the information includes OTA upgrade instruction information, the terminal enters the upgrade process, and after completion, enters the terminal acquisition cycle and / or terminal upload cycle and / or the terminal to reach the next data communication time length adjustment process;
[0088] B. If the information does not include OTA upgrade instruction information, the terminal directly enters the terminal acquisition cycle and / or the terminal upload cycle and / or the adjustment process of the length of time required for the terminal to reach the next data communication time;
[0089] Combine the following Figure 5 How the platform, gateway, and terminal interact with each other in a specific embodiment is described below:
[0090] 1) The terminal reaches the data collection and sending cycle or the user triggers wake-up by pressing a button;
[0091] 2) The terminal device starts collecting data;
[0092] 3) The terminal controls the BLE module to connect to the gateway;
[0093] 4) The gateway is awakened and receives data sent by the terminal;
[0094] 5) The gateway queries the relevant configuration data based on the terminal ID number and sends the terminal configuration data;
[0095] 6) The terminal is reconfigured or upgraded according to the received data;
[0096] 7) The terminal device enters sleep mode;
[0097] 8) The gateway sends terminal data to the platform;
[0098] 9) The gateway receives the configuration information from the platform;
[0099] 10) The gateway caches terminal configuration information;
[0100] 11) The platform receives and stores data from the gateway;
[0101] 12) The platform queries based on the terminal ID number and sends the corresponding configuration information to the gateway.
[0102] Combine the following Figure 6 The working process of a terminal in a specific embodiment is described below:
[0103] 1) When the terminal reaches the data communication time or is awakened by a key, the terminal is powered on and initialized;
[0104] 2) The terminal controls the sensor and BLE module to power on;
[0105] 3) The terminal controls the sensor to collect data;
[0106] 4) The terminal controls the BLE module to connect with the gateway;
[0107] 5) The terminal tries three times to determine whether it is connected;
[0108] 6) If the connection is not successful, the terminal will collect data for buffering and calculate the anti-collision offset time;
[0109] 7) The terminal enters sleep mode;
[0110] 8) If the connection is successful, the terminal sends the data to the gateway;
[0111] 9) The terminal times out waiting for a reply from the gateway;
[0112] 10) The terminal identifies the information sent by the gateway;
[0113] 11) If it is an OTA upgrade instruction, enter the upgrade process, and after completion, enter the collection cycle and upload cycle adjustment process;
[0114] 12) If there is no OTA upgrade instruction, but there is information to adjust the collection cycle, upload cycle or upload time, then enter the corresponding cycle adjustment process;
[0115] 13) The terminal enters sleep mode;
[0116] Combine the following Figure 7 The following is a flowchart of the working process of the gateway in a certain embodiment:
[0117] 1) The gateway is powered on and initialized;
[0118] 2. The gateway connects to the platform;
[0119] 3) The gateway controls the BLE module to enter the slave device broadcast mode;
[0120] 4) The gateway controls the NB-IOT module to enter low power consumption mode;
[0121] 5) The gateway controls the MCU to enter low power consumption mode;
[0122] 6) The gateway waits to be awakened;
[0123] 7) The gateway is awakened and determines the signal source;
[0124] 8) If it is BLE wake-up, receive data and parse the data;
[0125] 9) The gateway determines whether the terminal is in the management list;
[0126] 10) If the terminal is not in the management list, add it to the management list;
[0127] 11) The gateway stores the terminal data in the buffer to be sent;
[0128] 12) The gateway queries the terminal upload cycle;
[0129] 13) The gateway calculates the anti-collision offset time of the terminal in combination with the management list;
[0130] 14) The gateway replies to the terminal with the updated terminal upload cycle and conflict release offset time;
[0131] 15) The gateway controls the NBIoT module to exit low power consumption mode;
[0132] 16) The gateway attempts to establish a network connection with the platform and determines whether the network connection fails more than three times;
[0133] 17) If networking fails, the gateway caches the data;
[0134] 18) If the network connection is successful, the gateway sends data to the platform;
[0135] 19) The gateway times out waiting for a reply. If there is no reply, try sending three rounds;
[0136] 20) If there is no response, go back to step 3;
[0137] 21) If there is a response, perform data analysis;
[0138] 22) If it is an OTA upgrade, download the version; if it is a local upgrade, upgrade it;
[0139] 23) If it is a terminal upgrade, save the upgrade file and upgrade it when the terminal goes online next time;
[0140] 24) If it is a terminal upload cycle or a terminal collection cycle, update the terminal management information;
[0141] 25) The gateway clears the data in the send buffer and returns to step 3.
[0142] The present invention can achieve the following beneficial effects:
[0143] 1. The gateway and the terminal use Bluetooth mode to communicate, the gateway is the slave device, and the terminal is the master device. The terminal is usually in a power-off state, and the gateway maintains a low-power broadcast mode. When the terminal needs to connect to the gateway, it ends the sleep mode, scans the broadcast signal of the gateway and establishes a connection, which can not only meet the rapid response of communication but also effectively reduce the power consumption of the entire system.
[0144] 2. Both the terminal and the gateway are equipped with terminal device anti-collision algorithms, which effectively prevent the probability of conflicts when multiple terminals communicate with the gateway at the same time.
[0145] 3. Distributed design, placing the gateway end at the wellhead, using BLE communication internally, compared with the traditional method of pulling the antenna from the bottom of the well to the wellhead to cause signal attenuation, it can effectively improve the communication success rate and avoid construction inconvenience.
[0146] 4. The gateway has a local point-copying function, so you can know the collected data of the pipe network without going down the well, which is convenient for on-site personnel to inspect; combined with the environmental monitoring inside the pipe well, you can know the pipe well environment before going down the well to prevent danger.
[0147] 5. High scalability. The data upload on the gateway side adopts the transparent transmission mode. The uploaded data can be transmitted to the platform side simply by adding a terminal device with a BLE module.
[0148] 6. The main MCU of the entire system adopts a low-power design and is battery-powered, which is easy to implement and install, and can quickly and low-costly realize the informatization of the entire pipe well network.
[0149] The above embodiments are only used to illustrate the present invention, wherein the structure, connection method and manufacturing process of each component may be changed. Any equivalent transformations and improvements based on this technical solution should not be excluded from the protection scope of the present invention.
Claims
1. An underground pipe network data acquisition system, characterized in that: The system comprises: Platform side, gateway side and terminal side; The gateway end is located at the entrance of the underground pipe well; The terminal is located inside the underground pipe well and is used to collect data from sensors or actuators in the underground pipe well; The gateway end has a first communication module and a second communication module; the gateway end performs data communication with the platform end through the first communication module; the gateway end performs data communication with the terminal end through the second communication module; The gateway is a slave device that is in a low-power broadcast state when not performing data communication; The terminal is a main device, which is in sleep mode when not performing data communication, that is, the main controller is in sleep mode, and other unit modules are in power-off state. When it reaches the data communication time, the main controller ends the sleep state, and controls other unit modules to be powered on and in working state, and at the same time controls the second communication module to scan the broadcast signal of the gateway end, and attempts to perform data communication with the gateway end when the corresponding signal is scanned. If the broadcast signal of the gateway end is not scanned, it re-enters the sleep mode after calculating the anti-collision offset time; When the terminal reaches the data communication time, if the second communication module scans the broadcast signal of the gateway, it goes to step S1, if it does not scan the corresponding signal, it goes to step S2; Wherein, step S1 includes the following sub-steps: S11: The terminal establishes a data connection relationship with the gateway; S12: The terminal sends a wake-up signal to the gateway to wake up the gateway and put it into normal working mode; S13: The terminal sends data to the gateway, and the gateway receives the data; the gateway sends data to the terminal, and the terminal receives the data; S14: The terminal enters sleep mode; Step S2 includes the following sub-steps: S21: terminal caches data; S22: The terminal calculates the anti-collision offset time, which is the length of time required for the terminal to reach the next data communication time; S23: The terminal enters sleep mode; In step S13, after receiving the data sent by the terminal, the gateway performs anti-collision scheduling calculation and sends corresponding configuration information according to the address of the terminal, wherein the configuration information includes the length of time required for the terminal to reach the next data communication time; The terminal calculates the anti-collision offset time specifically based on the ID information of the terminal; The anti-collision scheduling calculation of the gateway end is to schedule the time of all terminals according to the terminal collection cycle and / or terminal upload cycle issued by the platform end and the newly received terminal information, so as to minimize the conflict probability of data communication between each terminal and the gateway end.
2. The system according to claim 1, characterized in that: The terminal calculates the anti-collision offset time as follows: anti-collision offset time = RTC time of the terminal + ID of the terminal × adjustable time threshold; wherein the adjustable time threshold is a constant and can be set or modified.
3. The system according to claim 1, characterized in that: In step S13, the information sent by the gateway to the terminal also includes the terminal collection cycle and / or the terminal upload cycle and / or the check value and / or the OTA upgrade instruction information of the terminal sent to it by the platform.
4. The system according to claim 1, characterized in that: The terminal includes one or more of a pipe well supply and return temperature and pressure monitoring terminal, a pipe well gas detection terminal, and a manhole cover movement detection terminal.
5. The system according to claim 1, characterized in that: When a new terminal is added, add the newly added terminal to the gateway, and the gateway will automatically add it to the system and automatically report it to the platform.
6. The system according to claim 1, characterized in that: The gateway end has button triggering and display functions, which is convenient for localized meter reading and on-site data viewing, and solves the inconvenience problem that inspection personnel need to go down the well to check.
7. The system according to claim 3, characterized in that: After receiving the information from the gateway, the terminal first identifies it and then enters the following sub-processes: A. If the information includes OTA upgrade instruction information, the terminal enters the upgrade process, and after completion, enters the terminal acquisition cycle and / or terminal upload cycle and / or the terminal to reach the next data communication time length adjustment process; B. If the information does not include OTA upgrade instruction information, the terminal directly enters the process of adjusting the terminal acquisition cycle and / or the terminal upload cycle and / or the length of time required for the terminal to reach the next data communication time.
8. The system according to claim 1, characterized in that: The gateway performs the following steps after completing step S1: S3: The gateway sends terminal data to the platform; S4: The platform receives and stores data from the gateway. S5: The gateway receives data sent by the platform; S6: The gateway caches the data sent by the platform that needs to be forwarded to the terminal.
9. The system according to claim 1, characterized in that: The first communication module is an NBIoT communication module, a 4G communication module, or a 5G communication module, and the second communication module is a Bluetooth BLE communication module or a Lora communication module.
