CN111245931B - GPRS module communication scheduling method based on water conservation RTU - Google Patents
GPRS module communication scheduling method based on water conservation RTU Download PDFInfo
- Publication number
- CN111245931B CN111245931B CN202010023862.1A CN202010023862A CN111245931B CN 111245931 B CN111245931 B CN 111245931B CN 202010023862 A CN202010023862 A CN 202010023862A CN 111245931 B CN111245931 B CN 111245931B
- Authority
- CN
- China
- Prior art keywords
- data
- communication module
- communication
- short message
- processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/12—Messaging; Mailboxes; Announcements
- H04W4/14—Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W72/00—Local resource management
- H04W72/12—Wireless traffic scheduling
- H04W72/1221—Wireless traffic scheduling based on age of data to be sent
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W72/00—Local resource management
- H04W72/50—Allocation or scheduling criteria for wireless resources
- H04W72/535—Allocation or scheduling criteria for wireless resources based on resource usage policies
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a GPRS module communication scheduling method based on a water conservancy RTU, which comprises the following steps: s1, receiving and processing data through a GPRS module; s2, scheduling and distributing the data according to the flag bit and the data type; s3, initializing the communication module step by step according to the zone bit; s4, socket processing is carried out step by step according to the flag bits; s5, short message processing is carried out step by step according to the zone bits; in the invention, each task is performed step by step according to the zone bit by adopting a state machine mode, so that the blockage condition of each task can not exist, namely the task can not influence the operation of other tasks, and each task can be operated in time, thereby realizing the processing of multiple channels of the GPRS module, solving the problem that the GPRS communication uses the multiple channels for communication at the same time, improving the communication efficiency and increasing the use occasions of the water conservancy RTU.
Description
Technical Field
The invention belongs to the technical field of water conservancy RTUs, and particularly relates to a GPRS module communication scheduling method based on a water conservancy RTU.
Background
The GPRS communication module on the water conservancy RTU can select and adopt a TCPUDP channel, a short message channel, a voice communication channel and other 3 different channels in GPRS or carry out data communication by mixed use according to the field application environment or the requirements of customers. Therefore, the water conservancy RTU is required to process the GPRS communication module, and communication compatible with three channels is required at the same time, however, the existing RTU equipment generally supports only one channel to be developed, and therefore, a GPRS module communication scheduling method based on the water conservancy RTU is provided.
Disclosure of Invention
The invention aims to provide a GPRS module communication scheduling method based on a water conservancy RTU (remote terminal unit) so as to solve the problems in the background technology.
In order to realize the purpose, the invention adopts the following technical scheme:
a GPRS module communication scheduling method based on water conservancy RTU comprises the following steps:
s1, receiving and processing data through a GPRS module;
s2, scheduling and distributing the data according to the flag bit and the data type;
s3, initializing the communication module step by step according to the zone bit;
s4, socket processing is carried out step by step according to the flag bits;
and S5, short message processing is carried out step by step according to the zone bit.
Preferably, in S2, the scheduling process includes the steps of:
s201, when the working mode is on line, a communication module is informed to be started;
s202, after the communication module is started, returning to a working mode, and checking whether data need to be sent;
s203, when data need to be sent, sending the data through a main channel;
s204, after the data are successfully transmitted, setting a data transmission success mark, and returning to the working mode;
s205, the communication module is informed to be closed in the working mode, and the working mode is in a dormant state.
Preferably, if the communication module is not started, the communication module returns to the working mode, the communication module is restarted, after the data transmission through the main channel fails, the standby channel is selected to transmit the data, after the data transmission through the standby channel fails, the data transmission failure flag is set, the communication module returns to the working mode, and if the communication module is not closed, the communication module returns to the working mode, and the communication module is closed again.
Preferably, in S3, the communication module initialization processing includes:
s301, after receiving the starting operation instruction, the communication module starts the communication module;
s302, after the communication module is started, setting a start completion mark;
s303, after the communication module receives the operation closing instruction, closing the communication module;
and S304, after the communication module is closed, setting a closing completion mark.
Preferably, after the communication module receives the start operation instruction, if the communication module is not started, the operation of starting the communication module is carried out again; and after the communication module receives the operation closing instruction, if the communication module is not closed, the operation of closing the communication module is carried out again.
Preferably, in S4, the Socket processing includes the following steps:
s401, when Socket connection is started successfully, checking whether data need to be sent;
s402, when checking whether data need to be sent or not, calling received data for processing to obtain the data;
s403, receiving the data and sending the data through a Socket;
s404, when the data transmission is successful, setting a successful transmission mark, returning to S401, when the data transmission is failed, setting a failed transmission mark, and entering the next step;
s405, when the Socket has an error, closing the Socket, waiting for three minutes, and returning to S401; when no error occurs in the Socket, the process returns to S402.
Preferably, in S5, the short message processing includes the following steps:
s501, checking whether a short message needs to be sent;
s502, when whether a short message needs to be sent or not is checked, received data processing is called, and the short message is obtained;
s503, receiving the short message and sending the short message;
s504, when the short message is successfully sent, setting a successful sending mark, and returning to S501; and when the short message is failed to be sent, setting a sending failure mark, and returning to the step S501.
Preferably, the method for transmitting data comprises the following steps:
s01, checking whether data need to be sent or not;
s02, when data needs to be actively sent, data setting and sending parameters are prepared;
and S03, returning to S01 when the data transmission is finished.
Preferably, when receiving the GPRS data, the receiving device processes the received data, and when receiving the short message data, the receiving device processes the received data.
Preferably, when the data is processed, each task is performed step by step according to the flag bit by adopting a state machine mode.
The invention has the technical effects and advantages that: compared with the prior art, the GPRS module communication scheduling method based on the water conservancy RTU has the following advantages that:
in the invention, each task is carried out step by adopting a state machine mode according to the zone bit, each task has no blocking condition, namely the task does not influence the operation of other tasks, and each task can be timely operated, thereby realizing the processing of the multiple channels of the GPRS module, solving the problem that the GPRS communication simultaneously uses the multiple channels for communication, improving the communication efficiency, increasing the use occasions of a water conservancy RTU, occupying serial ports to carry out data interaction with the GPRS module according to the distribution of a scheduling module, ensuring the orderly execution of a plurality of communication tasks such as socket connection, short messages, communication and the like, and realizing the simultaneous execution of each communication task.
Drawings
FIG. 1 is a flow chart of the scheduling process of the present invention;
FIG. 2 is a flow chart of a communication module initialization process of the present invention;
FIG. 3 is a Socket processing flow chart of the present invention;
FIG. 4 is a short message processing flow chart of the present invention;
FIG. 5 is a flow chart of data transmission according to the present invention;
FIG. 6 is a flow chart of the received GPRS data processing of the present invention;
fig. 7 is a flow chart of the processing of the received short message data according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The specific embodiments described herein are merely illustrative of the invention and do not delimit the invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The invention provides a GPRS module communication scheduling method based on a water conservancy RTU (remote terminal Unit) as shown in figures 1-7, which comprises the following steps:
s1, receiving and processing data through a GPRS module;
s2, scheduling and distributing the data according to the flag bit and the data type;
s3, initializing the communication module step by step according to the zone bit;
s4, socket processing is carried out step by step according to the zone bits;
and S5, short message processing is carried out step by step according to the zone bit.
In this embodiment, in S2, during the scheduling process, the following steps are included:
s201, when the working mode is on line, a communication module is informed to start;
s202, after the communication module is started, returning to a working mode, and checking whether data need to be sent;
s203, when data need to be sent, sending the data through a main channel;
s204, after the data are successfully sent, setting a data sending success mark, and returning to the working mode;
s205, the communication module is informed to be closed in the working mode, and the working mode is in a dormant state.
By adopting the technical scheme, the data received from the GPRS module can be processed uniformly, and the data can be distributed according to the occupation mark and the data type.
In this embodiment, if the communication module is not started, the communication module returns to the working mode, the communication module is restarted, after the data transmission through the main channel fails, the backup channel is selected to transmit the data, after the data transmission failure through the backup channel is selected, the data transmission failure flag is set, the communication module returns to the working mode, and if the communication module is not closed, the communication module returns to the working mode, and the communication module is closed again. The working mode adopts a low power consumption state, whether data needs to be sent is judged, if yes, the data is in a permanent online state, the communication module is continuously started to enter the working mode, and the working mode continuously adopts the low power consumption state to send the data through the main channel.
By adopting the technical scheme, the working personnel can be reminded of the current working state.
In this embodiment, in S3, when the communication module initializes, the method includes the following steps:
s301, after receiving the starting operation instruction, the communication module starts the communication module;
s302, after the communication module is started, setting a start completion mark;
s303, after the communication module receives the operation closing instruction, closing the communication module;
and S304, after the communication module is closed, setting a closing completion mark.
Preferably: after the communication module receives the starting operation instruction, if the communication module is not started, the operation of starting the communication module is carried out again; and after the communication module receives the operation closing instruction, if the communication module is not closed, the operation of closing the communication module is carried out again.
By adopting the technical scheme, the data can be distributed according to the occupation mark and the data type.
In this embodiment, in S4, when Socket processing, the method includes the following steps:
s401, when Socket connection is started successfully, checking whether data need to be sent;
s402, when checking whether data need to be sent or not, calling received data for processing to obtain the data;
s403, receiving the data and sending the data through a Socket;
s404, when the data transmission is successful, setting a transmission success mark, returning to S401, when the data transmission is failed, setting a transmission failure mark, and entering the next step;
s405, when the Socket has an error, closing the Socket, waiting for three minutes, and returning to S401; when no error occurs in the Socket, the process returns to S402.
By adopting the technical scheme, the data received from the GPRS module can be processed in a unified mode, the data are distributed according to the occupation mark and the data type, the data are sent to all Socket tasks to be processed, all the Socket tasks occupy serial ports to perform data interaction with the GPRS module according to the distribution of the scheduling module, and the orderly execution of all the Socket connection communication tasks is guaranteed.
In this embodiment, in S5, when processing the short message, the method includes the following steps:
s501, checking whether a short message needs to be sent;
s502, when whether a short message needs to be sent or not is checked, received data processing is called, and the short message is obtained;
s503, receiving the short message and sending the short message;
s504, when the short message is successfully sent, setting a successful sending mark, and returning to S501; and when the short message transmission fails, setting a transmission failure mark, and returning to the step S501.
The data received from the GPRS module can be processed in a unified mode, the data are distributed according to the occupation marks and the data types, the data are sent to each short message task to be processed, each short message task occupies a serial port to perform data interaction with the GPRS module according to the distribution of the scheduling module, and the orderly execution of each short message connection communication task is guaranteed.
Preferably: when data is transmitted, the method comprises the following steps:
s01, checking whether data need to be sent or not;
s02, when data needs to be actively sent, data setting and sending parameters are prepared;
and S03, returning to S01 when the data transmission is finished.
Preferably: and when receiving the GPRS data, processing the received data, and when receiving the short message data, processing the received data.
By adopting the technical scheme, GPRS data and short message data can be processed.
The working principle is as follows: the invention processes the data received from the GPRS module in a unified way, distributes the data according to the occupation mark and the data category, sends the data to each socket, short message and telephone task for processing, and each socket, short message and telephone task occupies a serial port to perform data interaction with the GPRS module according to the distribution of a scheduling module, thereby ensuring the orderly execution of a plurality of communication tasks such as each socket connection, short message and telephone, and realizing the simultaneous execution of each communication task.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments or portions thereof without departing from the spirit and scope of the invention.
Claims (8)
1. A GPRS module communication scheduling method based on a water conservation RTU is characterized by comprising the following steps:
s1, receiving and processing data through a GPRS module;
s2, scheduling and distributing the data according to the flag bit and the data type; in S2, the scheduling process includes the steps of:
s201, when the working mode is on line, a communication module is informed to start;
s202, after the communication module is started, returning to a working mode, and checking whether data need to be sent;
s203, when data need to be sent, sending the data through a main channel;
s204, after the data are successfully transmitted, setting a data transmission success mark, and returning to the working mode;
s205, informing the communication module to be closed in the working mode, and enabling the working mode to be in a dormant state;
s3, initializing the communication module step by step according to the zone bit;
s4, socket processing is carried out step by step according to the flag bits;
s5, short message processing is carried out step by step according to the zone bits;
when the data is processed, each task is performed step by step according to the zone bit by adopting a state machine mode.
2. The water conservancy RTU-based GPRS module communication scheduling method of claim 1, characterized in that: if the communication module is not started, returning to the working mode, restarting the communication module, selecting a standby channel to send data after the data sending through the main channel fails, setting a data sending failure mark after the data sending through the standby channel fails, returning to the working mode, and if the communication module is not closed, returning to the working mode and re-closing the communication module.
3. The water conservancy RTU-based GPRS module communication scheduling method of claim 1, wherein: in S3, the communication module initialization processing includes the steps of:
s301, after receiving the starting operation instruction, the communication module starts the communication module;
s302, after the communication module is started, setting a starting completion mark;
s303, after the communication module receives the operation closing instruction, closing the communication module;
and S304, after the communication module is closed, setting a closing completion mark.
4. The water conservancy RTU-based GPRS module communication scheduling method of claim 3, characterized in that: after the communication module receives the starting operation instruction, if the communication module is not started, the operation of starting the communication module is carried out again; and after the communication module receives the operation closing instruction, if the communication module is not closed, the operation of closing the communication module is carried out again.
5. The water conservancy RTU-based GPRS module communication scheduling method of claim 1, characterized in that: in S4, socket processing includes the following steps:
s401, when Socket connection is started successfully, checking whether data need to be sent;
s402, when checking whether data need to be sent, calling received data for processing to acquire the data;
s403, receiving the data and sending the data through a Socket;
s404, when the data transmission is successful, setting a transmission success mark, returning to S401, when the data transmission is failed, setting a transmission failure mark, and entering the next step;
s405, when the Socket has an error, closing the Socket, waiting for three minutes, and returning to S401; when no error occurs in the Socket, the process returns to S402.
6. The water conservancy RTU-based GPRS module communication scheduling method of claim 5, characterized in that: in S5, the short message processing method includes the following steps:
s501, checking whether a short message needs to be sent;
s502, when whether a short message needs to be sent is checked, the received data is called for processing, and the short message is obtained;
s503, receiving the short message and sending the short message;
s504, when the short message is successfully sent, setting a successful sending mark, and returning to S501; and when the short message is failed to be sent, setting a sending failure mark, and returning to the step S501.
7. The water conservancy RTU-based GPRS module communication scheduling method of claim 1, wherein: when data is transmitted, the method comprises the following steps:
s01, checking whether data need to be sent or not;
s02, when data needs to be actively transmitted, data are prepared to set transmission parameters;
and S03, returning to S01 when the data transmission is finished.
8. The water conservancy RTU-based GPRS module communication scheduling method of claim 1, characterized in that: and when receiving GPRS data, receiving data processing, and when receiving short message data, receiving data processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010023862.1A CN111245931B (en) | 2020-01-09 | 2020-01-09 | GPRS module communication scheduling method based on water conservation RTU |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010023862.1A CN111245931B (en) | 2020-01-09 | 2020-01-09 | GPRS module communication scheduling method based on water conservation RTU |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111245931A CN111245931A (en) | 2020-06-05 |
CN111245931B true CN111245931B (en) | 2022-11-11 |
Family
ID=70872536
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010023862.1A Active CN111245931B (en) | 2020-01-09 | 2020-01-09 | GPRS module communication scheduling method based on water conservation RTU |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111245931B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118170434B (en) * | 2024-05-13 | 2024-09-20 | 杭州炬华科技股份有限公司 | Data clearing method, system and medium for electric energy meter |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5555351A (en) * | 1992-05-08 | 1996-09-10 | Monarch Marking Systems, Inc. | Host communication message manager for a label printing system with data collection capabilities |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101131787A (en) * | 2006-08-24 | 2008-02-27 | 北京燕禹水务科技有限公司 | Real-time hydrology information automatic monitoring and disaster situation alerting system |
CN103200704A (en) * | 2011-12-20 | 2013-07-10 | 常州先进制造技术研究所 | ZigBee network monitoring system combined with general packet radio service (GPRS) |
CN103491267B (en) * | 2013-09-26 | 2015-11-18 | 山东思达特测控设备有限公司 | The method to set up of a kind of intelligent wireless RTU |
CN104200629B (en) * | 2014-09-01 | 2018-05-22 | 中国东方电气集团有限公司 | A kind of software systems based on GPRS monitor terminals |
CN106056876A (en) * | 2016-06-06 | 2016-10-26 | 暨南大学 | Enterprise energy management information acquisition system and method |
CN106534187A (en) * | 2016-12-13 | 2017-03-22 | 广东沅朋网络科技有限公司 | Unified management method and system for multi-type wireless data transmission terminal |
-
2020
- 2020-01-09 CN CN202010023862.1A patent/CN111245931B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5555351A (en) * | 1992-05-08 | 1996-09-10 | Monarch Marking Systems, Inc. | Host communication message manager for a label printing system with data collection capabilities |
Non-Patent Citations (1)
Title |
---|
"31111-f40".《3GPP tsg_ct\wg6_smartcard_ex-t3》.2018,全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN111245931A (en) | 2020-06-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100471180C (en) | Method, device and system for transfer news | |
WO2010000176A1 (en) | Method, system and equipment for maintaining a base station | |
CN110784255A (en) | Beidou user terminal communication resource sharing system | |
CN111245931B (en) | GPRS module communication scheduling method based on water conservation RTU | |
CN115152192B (en) | PCE controlled network reliability | |
CN103490931A (en) | Method and device achieving protocol no-break in no-break service upgrading process | |
WO2016095344A1 (en) | Link switching method and device, and line card | |
CN101540699A (en) | Method and device for realizing remote maintenance of network equipment | |
CN105764038A (en) | Call forwarding control method and system | |
CN109831816B (en) | Method and system for effectively reducing power consumption of NBIOT intelligent door lock | |
US20070104189A1 (en) | Network system and operation method thereof | |
US20220094569A1 (en) | Method and system to selectively flush filtering databases in a major ring of an ethernet ring protection switching network | |
CN101883045B (en) | Method, system and device for combining stacking systems | |
CN101867436B (en) | System and method for realizing minimal satellite data sending functional redundancy | |
CN105808463A (en) | Serial port output method for debugging information in embedded system | |
CN102882720A (en) | Indicating message sending method, indicating message receiving method, equipment and system | |
CN113206720B (en) | Method and device for realizing top-tuning message channel | |
CN102026243B (en) | Method and system for processing user equipment | |
CN114710522A (en) | Android platform-based vehicle-mounted network architecture system and method | |
US20040029527A1 (en) | Power supply control method and device in portable communication device | |
CN101425970B (en) | Method, apparatus and system for implementing remote loop | |
CN112398731A (en) | Method for processing message and first network equipment | |
CN110784365A (en) | Standby device of station control layer and entity device of transformer substation and automatic online method thereof | |
CN214101473U (en) | Wireless network access device and network telephone system | |
CN104427529A (en) | Information processing method and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: 518000 601, Building 5, Software Park, Keji Middle 2nd Road, High-tech Zone, Nanshan District, Shenzhen, Guangdong Province Patentee after: Dongshen Zhishui Technology (Shenzhen) Co.,Ltd. Address before: 518000 Room 601, building 5, software park, kekezhong 2nd Road, Nanshan District, Shenzhen, Guangdong Patentee before: SHENZHEN DONGSHEN ELECTRONIC Co.,Ltd. |
|
CP03 | Change of name, title or address |