CN115665037A - Communication interaction method and system of terminal and master station - Google Patents

Communication interaction method and system of terminal and master station Download PDF

Info

Publication number
CN115665037A
CN115665037A CN202211593056.3A CN202211593056A CN115665037A CN 115665037 A CN115665037 A CN 115665037A CN 202211593056 A CN202211593056 A CN 202211593056A CN 115665037 A CN115665037 A CN 115665037A
Authority
CN
China
Prior art keywords
terminal
terminals
master station
transparent forwarding
same group
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.)
Granted
Application number
CN202211593056.3A
Other languages
Chinese (zh)
Other versions
CN115665037B (en
Inventor
易模
廖珍红
熊海峰
伍成乾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changsha Lihe Micro Intelligent Technology Co ltd
Original Assignee
Changsha Lihe Micro Intelligent Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Changsha Lihe Micro Intelligent Technology Co ltd filed Critical Changsha Lihe Micro Intelligent Technology Co ltd
Priority to CN202211593056.3A priority Critical patent/CN115665037B/en
Publication of CN115665037A publication Critical patent/CN115665037A/en
Application granted granted Critical
Publication of CN115665037B publication Critical patent/CN115665037B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a communication interaction method and a communication interaction system of a terminal and a main station, which comprise the following steps: establishing a routing state table of each terminal according to the groups; the master station updates the routing state table of each terminal in real time and synchronizes with the terminal; the terminal communicates with the terminals in the same group through an MQTT-Broken message bus; the master station selects a terminal with the highest transparent forwarding success rate in the same group of the fault terminals as a forwarding terminal to forward the meter reading request; and the master station recalculates the transparent forwarding success rate according to the transparent forwarding meter reading result and updates the routing state table. The invention can solve the problem of single point failure of terminal communication in the traditional scheme and improve the reliability of the service provided by the master station. The method can reduce invalid retry of the main station, solve the node communication fault of the forwarding terminal and the fault that the uplink communication process of the forwarding terminal does not work, and further improve the reliability of the service provided by the main station.

Description

Communication interaction method and system for terminal and master station
Technical Field
The invention relates to the field of ammeter communication, in particular to a communication interaction method and system of a terminal and a master station.
Background
With the development of the intelligent electric power acquisition industry, the meter reading business is changed from manually acquiring the electric quantity of an electric meter to automatically acquiring electric quantity data by a meter reading terminal. The APP of the meter reading terminal uses a Message bus frame, interaction among the APPs is carried out through a Message bus, message driving supports multiple modes such as IPC (Inter-Process Communication), TCP (transmission control protocol), UDP (user datagram protocol), MQTT (Message queue Telemetry Transport) and the like, only one or more modes can be flexibly tailored according to system resources and an operating environment, and the MQTT mode is generally adopted at present. Based on the message bus architecture, the APP can access the system only by conforming to the message driving specification, and the message framework is as shown in FIG. 1:
data exchange between the APPs is achieved by means of messages. The transmission of the message can support IPC, TCP, UDP or MQTT and other modes. The message interfaces are defined by the service providers (server roles) and the service consumers (client roles) access the corresponding services according to the defined message interfaces. An APP can be a service provider and also can be a user of some services, and has multiple roles of a server and a client. The message exchange model is shown in fig. 2.
Based on the MQTT message bus frame, if the design thought of the traditional terminal is used, the communication connection mode of each terminal and a master station server (hereinafter referred to as a master station) is in a one-to-one relation, only one connection is provided, once a process or a communication link of a certain terminal connected with the master station is abnormal, the terminal cannot perform any message interaction with the master station, and the problem of single-point communication fault exists, so that the whole system cannot respond to the data reading request of a master station user in time, and the reliability of service provision is reduced.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the invention provides a communication interaction method and system of a terminal and a main station, which can solve the problem that the terminal has a communication single-point fault and improve the reliability of service.
According to the first aspect of the invention, the communication interaction method between the terminal and the master station comprises the following steps:
importing terminal files into a master station, grouping the terminals by the master station according to the imported terminal files, and establishing a routing state table of each terminal according to the grouping, wherein the routing state table comprises the group number and the transparent forwarding success rate of each terminal;
the master station updates the routing state table of each terminal in real time according to the meter reading result, synchronizes the updated routing state table with the terminals, and the terminals communicate with the terminals in the same group through an MQTT-Broken message bus;
the master station directly sends a meter reading request to the terminal, if the communication is normal, the terminal is determined to be a normal terminal and receives meter reading data, if the communication is abnormal, the terminal is determined to be a fault terminal, then the terminal with the highest transparent forwarding success rate in the same group of the fault terminal is selected as a forwarding terminal, and the meter reading request is transparently forwarded through an MQTT-Broken message bus of the forwarding terminal;
and after the transparent forwarding meter reading request is finished, the master station recalculates the transparent forwarding success rate according to the transparent forwarding meter reading result and updates the routing state table.
The communication interaction method between the terminal and the master station according to the embodiment of the first aspect of the invention has at least the following beneficial effects:
the embodiment of the invention can select other terminals in the same group to transparently forward the meter reading request by inquiring the routing state table when the process of connecting the terminal with the master station or the communication link is abnormal, thereby solving the problem of single-point failure of terminal communication in the traditional scheme and improving the reliability of service provided by the master station. The master station continuously updates the transparent forwarding success rate in the routing state table according to the transparent forwarding meter reading result, and the master station can preferably select the terminal with high success rate to perform transparent forwarding according to the transparent forwarding success rate, so that invalid retry of the master station is reduced, and the reliability of the master station for providing service is improved again. The same group of terminals forward and communicate with each other through the MQTT-Broken message bus without adopting the communication process of the terminals to forward directly, so that the problem of the node communication fault of the forwarding terminal and the fault of the non-working of the uplink communication process of the forwarding terminal can be solved besides the problem of the traditional communication single-point fault, and the reliability of the service provided by the main station is further improved.
According to some embodiments of the present invention, in the step of grouping the terminals by the master station according to the imported terminal profile, the master station groups the terminals according to the working area or the installation area of the terminals.
According to some embodiments of the present invention, the step of synchronizing the updated routing state table with the terminal, wherein the terminal communicates with the terminals in the same group through the MQTT-broker message bus, includes:
when the master station judges that the terminal is in an idle state and the routing state table of the terminal changes, the master station issues the routing state table to the terminal;
the terminal receives and updates the routing state table issued by the master station, the terminals in the same group in the routing state table are screened according to the transparent forwarding success rate, the terminals in the same group N before the transparent forwarding success rate are used as a first set, and the other terminals in the same group are used as a second set;
and the terminal establishes communication connection with the same group of terminals in the first set through the MQTT-Broken message bus.
According to some embodiments of the present invention, the specific steps of establishing communication connection between the terminal and the same group of terminals in the first set through the MQTT-broker message bus are as follows:
the terminal ergodically detects whether the same group of terminals which are not connected currently belong to the first set, if so, the terminal tries to establish connection with an MQTT-Broken message bus of the terminal;
if the terminal can not establish connection with the MQTT-Broken message bus of the same group of terminals in the first set, the terminal selects the terminal with the highest transparent forwarding success rate from the second set, puts the terminal into the first set and establishes connection with the MQTT-Broken message bus of the terminal;
the terminal traverses and checks whether the currently connected terminal belongs to the first set, if not, the terminal disconnects the MQTT-Broken message bus connection with the terminal.
According to some embodiments of the present invention, the master station directly sends a meter reading request to the terminal, if the communication is normal, the master station determines that the terminal is a normal terminal and receives meter reading data, and if the communication is abnormal, the master station determines that the terminal is a faulty terminal, where the conditions for determining that the communication of the terminal is abnormal are as follows: the terminal does not return data after exceeding the time T and the overtime times are more than M times.
According to some embodiments of the present invention, the specific steps of selecting a terminal with the highest transparent forwarding success rate in the same group of the failed terminals as a forwarding terminal, and then transparently forwarding the meter reading request through the MQTT-broker message bus of the forwarding terminal are as follows:
the master station inquires a routing state table of the fault terminal, and arranges the same group of terminals in the routing state table in a descending order according to the transparent forwarding success rate to form a transparent forwarding queue;
converting a meter reading request message to be sent into a transparent forwarding request message, selecting and sending the same group of terminals with the highest transparent forwarding success rate, if the request is successful, carrying out the next step, if the request is failed, removing the same group of terminals from a transparent forwarding queue, and reselecting the same group of terminals with the highest transparent forwarding success rate in the transparent forwarding queue to send;
and the same group of terminals receives the transparent forwarding request message, forwards the message to the fault terminal through the MQTT-Broken message bus, and sends the transparent forwarding reply message replied by the fault terminal to the master station.
According to some embodiments of the invention, the specific steps of recalculating the transparent forwarding success rate and updating the routing state table by the master station according to the meter reading result are as follows:
establishing an incremental learning model according to the complexity of the message;
and the host inputs the meter reading result into the incremental learning model, and the incremental learning model recalculates the transparent forwarding success rate according to the meter reading result and updates the routing state table.
According to some embodiments of the present invention, the specific steps of establishing the incremental learning model according to the complexity of the packet are:
determining an operation type calculation factor according to the operation type of the message;
determining a content type calculation factor according to the content type of the message;
calculating a comprehensive calculation factor of the message according to the operation type calculation factor, the content type calculation factor, the number of the measuring points read by the message and the communication channel type of the ammeter;
calculating the complexity according to the comprehensive calculation factor, the initial complexity and the reading time of the message;
and repeating the steps, and establishing an incremental learning model according to the complexity of different messages.
According to some embodiments of the invention, the specific steps of recalculating the transparent forwarding success rate and updating the routing state table by the incremental learning model according to the meter reading result are as follows:
calculating a time consumption expected value E (x) of successful meter reading according to the time consumption and complexity of all successful meter reading requests:
Figure 944470DEST_PATH_IMAGE001
wherein x is the number of transparent forwarding reading times, T1, T2 and T3 \8230, x is 823030, tx is the time consumption of successful reading request by transparent forwarding, and U1, U2 and U3 \8230, x is the complexity of the corresponding message;
calculating the total time T of all reading requests according to the time consumption expected value E (x) of successful meter reading:
T=y*E(x)
wherein, y is the total number of meter reading;
calculating a transparent forwarding success rate S;
Figure 184958DEST_PATH_IMAGE002
and updating the routing state table according to the calculated transparent forwarding success rate S.
The communication interaction system of the terminal and the master station for operating the method comprises the master station and a plurality of terminals.
The communication interaction system of the terminal and the master station according to the embodiment of the second aspect of the invention has at least the following beneficial effects:
the embodiment of the invention can select other terminals in the same group to transparently forward the meter reading request by inquiring the routing state table when the process of connecting the terminal with the master station or the communication link is abnormal, thereby solving the problem of single-point failure of terminal communication in the traditional scheme and improving the reliability of service provided by the master station. The master station continuously updates the transparent forwarding success rate in the routing state table according to the transparent forwarding meter reading result, and the master station can preferably select the terminal with high success rate to perform transparent forwarding according to the transparent forwarding success rate, so that invalid retry of the master station is reduced, and the reliability of the master station for providing service is improved again. The messages are forwarded and communicated with each other through the MQTT-Broken message bus between the terminals in the same group, the communication process of the terminals is not adopted for direct forwarding, the traditional communication single-point fault is solved, the node communication fault of the forwarding terminal and the fault that the uplink communication process of the forwarding terminal does not work can be solved, and the reliability of the service provided by the main station is further improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The invention is further described with reference to the following figures and examples, in which:
fig. 1 is a schematic diagram of a message bus framework of a conventional terminal APP;
fig. 2 is a schematic diagram of a message exchange model of a terminal APP in the prior art;
FIG. 3 is a flowchart illustrating communication interaction between a terminal and a master station according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a process of sending data from a primary station to a terminal via a synchronous routing status table according to an embodiment of the present invention;
fig. 5 is a structure diagram of MQTT connection between terminals in the embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, it should be understood that the orientation or positional relationship referred to, for example, the upper, lower, etc., is indicated based on the orientation or positional relationship shown in the drawings, and is only for convenience of description and simplification of description, but does not indicate or imply that the device or element referred to must have a specific orientation, be constructed in a specific orientation, and be operated, and thus should not be construed as limiting the present invention.
In the description of the present invention, a plurality means two or more. If the first and second are described for the purpose of distinguishing technical features, they are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, unless otherwise specifically limited, terms such as set, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention by combining the specific contents of the technical solutions.
Referring to fig. 3, a communication interaction method between a terminal and a master station includes the following steps:
s100, importing a terminal file into a master station, and establishing a routing state table of each terminal by the master station according to the imported terminal file, wherein the routing state table comprises a group, an idle state and a transparent forwarding success rate of each terminal;
the terminal profile includes an installation area, a communication address, a communication number, a task profile, and the like of each terminal. The main station firstly groups all imported terminal files 1, 2 and 3 \8230, wherein \8230nand n are grouped according to the respective working areas or installation positions, the grouping of the working areas refers to grouping the terminals installed in the same cell or factory building, the installation positions refer to grouping the terminals with closer installation positions, in the embodiment, the working areas are taken as grouping conditions, and the terminals in the same working area are grouped into the same group, which is shown in reference table 1:
Figure 479805DEST_PATH_IMAGE003
table 1 grouping situation table of terminals
For all terminals in the same group, for example, terminals 1, 2, \8230: \8230kin group a, a routing state table is respectively established, and the routing state table includes the intra-group number, idle state and transparent forwarding success rate of each terminal, taking terminal 1 as an example, as shown in table 2:
Figure 96731DEST_PATH_IMAGE004
table 2 routing state table for terminal 1 in group a
It should be noted that the initial states of all other terminals in the same group in the routing state table of this embodiment are reading idle, and the transparent forwarding success rates are all 80%, that is, the priorities selected for transparent forwarding of the message are equal, and of course, the transparent forwarding success rates may also be set as other initial values according to actual situations.
S200, the master station updates the routing state table of each terminal in real time according to the meter reading state, synchronizes the updated routing state table with the terminal, and the terminal is communicated with the terminals in the same group through an MQTT-Broken message bus;
it should be noted that the main station updating the routing state table of each terminal in real time according to the meter reading state means that, on one hand, the idle state of the terminal is updated according to the meter reading task, and on the other hand, the transparent forwarding success rate is updated according to the meter reading result.
The master station sends the updated routing state table to the terminal for synchronization when the terminal communication is idle as much as possible, so as to avoid interfering with a normal meter reading task, as shown in fig. 4, the master station synchronizes the updated routing state table with the terminal, and the terminal communicates with the terminals in the same group through an MQTT-broker message bus in the following specific steps:
s210, when the master station judges that the terminal is in an idle state and the routing state table of the terminal changes, the master station issues the routing state table to the terminal;
specifically, when the master station finishes the reading task of the terminal, the master station judges whether the terminal is idle or not after reading, if so, the next step is carried out, and if not, the reading is finished in advance;
the master station inquires whether the routing state table of the terminal is changed, if so, the next step is carried out, and if not, the process is ended in advance;
s220, the terminal receives and updates the routing state table issued by the master station, the same group of terminals in the routing state table are screened according to the transparent forwarding success rate, the same group of terminals N before the transparent forwarding success rate are used as a first set, and the other same group of terminals are used as a second set;
specifically, in this embodiment, after receiving data sent by the master station, the terminals perform descending order on records in the routing state table according to the transparent forwarding success rate, and select the top 10 terminals to form a first set, and the remaining terminals are used as a second set, it should be understood that in this embodiment, N is 10, and may also be set to other values, if there are fewer terminals in the same group, the second set may be empty, the first set is used as a priority for transparent forwarding, and the second set is used as an alternative for the first set.
S230, the terminal establishes communication connection with the same group of terminals in the first set through the MQTT-Broken message bus.
It should be noted that, in this embodiment, the MQTT-broker message bus communication is adopted between the terminals, the communication mode is a wireless network, and the connection structure between the terminals is shown in fig. 5, which is specifically expressed as follows:
1) The message processing process of each terminal establishes communication connection by connecting MQTT-Broken message buses of a plurality of other terminals;
2) The message transmitted transparently on the MQTT-Broken message bus of the terminal or the MQTT-Broken message bus of other terminals can be processed by the message processing process of the terminal;
3) All the main station communication processes connected with the terminal can receive the request transmitted by the transparent forwarding main station for the terminal;
4) The network path of the terminal receiving the request of the master station has various routes, so that the problem of single point of failure of communication with the master station is solved.
Specifically, in this embodiment, the step S230 includes the following specific steps:
s231, the terminal traverses and detects whether the same group of terminals which are not connected currently belong to a first set, if the same group of terminals belong to the first set, the terminal tries to establish connection with the MQTT-Broken message bus of the same group of terminals, and if the same group of terminals do not belong to the first set, the terminal does not act, and the purpose of the step is to ensure that the terminal can be connected with the MQTT-Broken message bus of the terminals in the first set;
s232, if the terminal cannot establish connection with the MQTT-Broken message bus of the same group of terminals in the first set, the terminal selects the terminal with the highest transparent forwarding success rate from the second set, puts the terminal into the first set, establishes connection with the MQTT-Broken message bus of the terminal, and takes the second set as an alternative of the first set to ensure that the terminal can be connected with a sufficient number of the same group of terminals and ensure the reliability of transparent forwarding;
s233, the terminal checks through traversing whether the terminal currently connected belongs to the first set, if not, the terminal disconnects the MQTT-Broken message bus of the terminal, namely the terminal is only connected with the MQTT-Broken message bus of the terminal in the first set, thereby avoiding the influence on the self-operation performance caused by excessive number of the connected terminals.
S300, the master station directly sends a meter reading request to the terminal, if the communication with the terminal is normal, the master station is determined as a normal terminal and receives meter reading data fed back by the terminal, if the communication with the terminal is abnormal, the master station is determined as a fault terminal, the master station inquires a routing state table, selects the terminal with the highest transparent forwarding success rate in the same group of the fault terminal as a forwarding terminal, and then transparently forwards the meter reading request through an MQTT-Broken message bus of the forwarding terminal;
it should be noted that the specific conditions for the master station to determine the terminal communication abnormality are as follows: when the terminal exceeds the time T and does not return data, and the overtime times are more than M, the user can set the specific values of the overtime time and the overtime times according to actual needs. For example, the timeout time is set to 30S and the number of times of timeout is set to 3.
Specifically, the main station inquires a routing state table, selects a terminal with the highest transparent forwarding success rate in the same group of the fault terminal as a forwarding terminal, and then transparently forwards the meter reading request through an MQTT-Broken message bus of the forwarding terminal, and the specific steps are as follows:
s301, setting the fault terminal as T, the master station inquires meter reading idle records in the routing state table of the fault terminal P, and arranges the same group of terminals in the routing state table in a descending order according to the transparent forwarding success rate to form a transparent forwarding queue Q, for example: p1, P2, P3 \8230, 8230and Pk;
s302, encapsulating meter reading request messages needing to be sent into transparent forwarding request messages, selecting and sending the same group of terminals with the highest transparent forwarding success rate, if the request is successful, carrying out the next step, if the request is failed, removing the same group of terminals from a transparent forwarding queue, and reselecting the same group of terminals with the highest transparent forwarding success rate in the transparent forwarding queue to send;
illustratively, the master station sends a transparent forwarding request message to the terminal P1, if the request fails, removes the terminal P1 from the transparent forwarding queue Q, selects the next terminal P2 to send the transparent forwarding request message, traverses 5 times, can configure other parameters until the selected terminal Px successfully reads, and if the terminal Pk is traversed and the reading is still not successful, directly ends the reading.
And S303, after receiving the transparent forwarding request message, the terminals in the same group forward to the fault terminal through the MQTT-Broken message bus, and after receiving the transparent forwarding reply message replied by the fault terminal, the terminals in the same group forward to the master station.
Illustratively, after receiving the message, the terminal Px analyzes the data to find that the message is the message which is transparently forwarded to the terminal, and immediately forwards the message to the terminal P through the MQTT-broker message bus without any other processing; after the message received by the terminal P is processed, the reading result is packaged into a transparent forwarding reply message which is sent back to the terminal P; and after receiving the message, the terminal Px sends the message back to the master station.
And S400, after the transparent forwarding meter reading request is finished, the master station recalculates the transparent forwarding success rate according to the transparent forwarding meter reading result and updates the routing state table.
It should be noted that, in step S400, the specific steps of the master station recalculating the transparent forwarding success rate according to the meter reading result and updating the routing state table are as follows:
s410, establishing an incremental learning model according to the complexity of the message; because the processing complexity of the reading messages of different types is different, the transparent forwarding success rates of the messages with different complexities are different, the complexity of the messages is comprehensively determined by the protocol and the length of the messages, the value distribution of the complexity is probably between 0.5 and 2, and the more complex messages have larger complexity values.
Specifically, the step of establishing the incremental learning model according to the complexity of the message is as follows:
s411, determining an operation type calculation factor according to the operation type of the message;
illustratively, the operation types of the message are generally divided into a fixed copy mode and a random copy mode, and in this embodiment, a calculation factor R1=0.7 of the copy mode is set; a calculation factor R2=1.3 of the following transcription;
s412, determining a content type calculation factor according to the content type of the message;
illustratively, the content types of the message are generally divided into three types, i.e., get, set, and Action, and in this embodiment, a calculation factor L1=0.8 for Get, a calculation factor L2=1.0 for Set, and a calculation factor L3=1.2 for Action are Set;
s413, calculating a comprehensive calculation factor of the message according to the operation type calculation factor, the content type calculation factor, the number of the measurement points read by the message and the communication channel type of the ammeter;
illustratively, the number of the measurement points for reading the message is determined according to the actual number of the measurement points on site, and the number of the measurement points for reading the message is set to be K, for example, the number of the measurement points under a certain terminal is 3, and then K =3; in this embodiment, the types of the communication channel of the electricity meter are divided into RS485, HPLC and terminal, because part of the terminals can also be used as electricity meters to collect electric energy data, the calculation factor of RS485 is set as M1=1.25, the calculation factor of HPLC is set as M2=1.75, and the calculation factor of terminal M3=1.0.
The comprehensive calculation factor C of the message is expressed as
Figure 918056DEST_PATH_IMAGE005
Then its initial complexity is U 0 = C / S 0 ,S 0 The initial value of the transparent forwarding success rate is 1 in this embodiment.
Suppose the variance of the nth transcription time is sigma n
The message complexity U read for the nth time n The calculation method of (c) is as follows:
U n = U n-1 / S n-1 * (σ nn-1 )
therefore, the larger the fluctuation is, the larger the complexity is, and the success rate rule in the multi-factor complex meter reading environment can be more accurately reflected by calculating the complexity of the message.
S414, calculating the complexity according to the comprehensive calculation factor, the initial complexity and the reading time of the message;
and S415, repeating the steps, and establishing an incremental learning model according to the complexity of different messages.
And S420, inputting the meter reading result into the incremental learning model by the host, recalculating the transparent forwarding success rate by the incremental learning model according to the meter reading result, and updating the routing state table.
Specifically, if the total number of meter reading is y and the number of successful meter reading is x, the specific step in step S420 is:
s421, calculating the time-consuming expected value E (x) of successful meter reading according to the time consumption and the complexity of all the successful meter reading requests:
Figure 454080DEST_PATH_IMAGE001
wherein x is the number of transparent forwarding reading times, T1, T2 and T3 \8230 \ 8230, tx is the time consumption of transparent forwarding successful reading request, U1, U2 and U3 \8230 \ 8230, and Ux is the complexity of the corresponding message;
calculating the total time T of all reading requests according to the time-consuming expected value E (x) of successful meter reading:
T=y*E(x)
wherein, y is the total number of meter reading;
calculating a transparent forwarding success rate S;
Figure 439484DEST_PATH_IMAGE002
it should be noted that, if the calculated transparent forwarding success rate S is greater than 100%, the value of S is corrected to 100%, and then the routing state table is updated according to the calculated transparent forwarding success rate S.
According to the invention, when the process of the terminal connecting with the master station or a communication link is abnormal, the master station can select other most suitable terminals in the same area to transparently forward the request message by inquiring the routing state table, so that the problem of single-point failure of terminal communication in the traditional scheme is solved, and the reliability of the master station for providing service is improved;
in addition, the routing state table is a data structure established based on a machine increment learning model, and can accurately estimate the latest transparent forwarding message success rate of the terminal by establishing a mathematical model through a reading result, so that the master station can determine the priority of the forwarding terminal through the transparent forwarding message success rate, thereby reducing the invalid retry of the master station and improving the reliability of the service provided by the master station again.
The messages are forwarded and communicated with each other through the MQTT-Broken message bus between the terminals in the same group, the communication process of the terminals is not adopted for direct forwarding, the traditional communication single-point fault is solved, the node communication fault of the forwarding terminal and the fault that the uplink communication process of the forwarding terminal does not work can be solved, and the reliability of the service provided by the main station is further improved.
The invention also relates to a communication interaction system of the terminals and the main station, which comprises the main station and a plurality of terminals, wherein the main station and the terminals realize communication interaction through the method of the embodiment.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (10)

1. A communication interaction method of a terminal and a main station is characterized by comprising the following steps:
leading in terminal files to a master station, grouping the terminals by the master station according to the led-in terminal files, and establishing a routing state table of each terminal according to the grouping, wherein the routing state table comprises the group number and the transparent forwarding success rate of each terminal;
the master station updates the routing state table of each terminal in real time according to the meter reading result, synchronizes the updated routing state table with the terminals, and the terminals communicate with the terminals in the same group through an MQTT-Broken message bus;
the master station directly sends a meter reading request to the terminal, if the communication is normal, the terminal is determined to be a normal terminal and receives meter reading data, if the communication is abnormal, the terminal is determined to be a fault terminal, then the terminal with the highest transparent forwarding success rate in the same group of the fault terminal is selected as a forwarding terminal, and the meter reading request is transparently forwarded through an MQTT-Broken message bus of the forwarding terminal;
and after the transparent forwarding meter reading request is finished, the master station recalculates the transparent forwarding success rate according to the transparent forwarding meter reading result and updates the routing state table.
2. The method of claim 1, wherein the method comprises: and in the step of grouping the terminals by the master station according to the imported terminal files, the master station groups the terminals according to the working areas or the installation areas of the terminals.
3. The method of claim 1, wherein the method comprises: the specific steps of synchronizing the updated routing state table with the terminal and enabling the terminal to communicate with the terminals in the same group through the MQTT-Broken message bus are as follows:
the master station sends a routing state table to the terminal when judging that the terminal is in an idle state and the routing state table of the terminal changes;
the terminal receives and updates a routing state table issued by a master station, the terminals in the same group in the routing state table are screened according to the transparent forwarding success rate, the terminals in the same group N before the transparent forwarding success rate are used as a first set, and the other terminals in the same group are used as a second set;
and the terminal establishes communication connection with the same group of terminals in the first set through the MQTT-Broken message bus.
4. The method of claim 3, wherein the method comprises: the specific steps of establishing communication connection between the terminal and the same group of terminals in the first set through the MQTT-Broken message bus are as follows:
the terminal ergodically detects whether the same group of terminals which are not connected currently belong to the first set, if so, the terminal tries to establish connection with an MQTT-Broken message bus of the terminal;
if the terminal can not establish connection with the MQTT-Broken message bus of the same group of terminals in the first set, the terminal selects the terminal with the highest transparent forwarding success rate from the second set, puts the terminal into the first set and establishes connection with the MQTT-Broken message bus of the terminal;
the terminal traverses and checks whether the currently connected terminal belongs to the first set, if not, the terminal disconnects the MQTT-Broken message bus connection with the terminal.
5. The method of claim 1, wherein the method comprises: the master station directly sends a meter reading request to the terminal, if the communication is normal, the terminal is determined to be a normal terminal and receives meter reading data, and if the communication is abnormal, the terminal is determined to be a fault terminal, and the master station judges that the condition of the terminal communication abnormality is as follows: the terminal does not return data after exceeding the time T and the overtime times are more than M times.
6. The method of claim 1, wherein the method comprises: the specific steps of selecting the terminal with the highest transparent forwarding success rate in the same group of the fault terminal as the forwarding terminal, and then transparently forwarding the meter reading request through the MQTT-Broken message bus of the forwarding terminal are as follows:
the master station inquires a routing state table of the fault terminal, and arranges the same group of terminals in the routing state table in a descending order according to the transparent forwarding success rate to form a transparent forwarding queue;
converting a meter reading request message to be sent into a transparent forwarding request message, selecting the same group of terminals with the highest transparent forwarding success rate and sending the same group of terminals, if the request is successful, carrying out the next step, if the request is failed, removing the same group of terminals from a transparent forwarding queue, and reselecting the same group of terminals with the highest transparent forwarding success rate in the transparent forwarding queue to send the same group of terminals;
and the same group of terminals receives the transparent forwarding request message, forwards the message to the fault terminal through the MQTT-Broken message bus, and sends the transparent forwarding reply message replied by the fault terminal to the master station.
7. The method of claim 1, wherein the method comprises: the main station recalculates the transparent forwarding success rate according to the meter reading result and updates the routing state table, and the specific steps are as follows:
establishing an incremental learning model according to the complexity of the message;
and the host inputs the meter reading result into the incremental learning model, and the incremental learning model recalculates the transparent forwarding success rate according to the meter reading result and updates the routing state table.
8. The method of claim 7, wherein: the specific steps of establishing the incremental learning model according to the complexity of the message are as follows:
determining an operation type calculation factor according to the operation type of the message;
determining a content type calculation factor according to the content type of the message;
calculating a comprehensive calculation factor of the message according to the operation type calculation factor, the content type calculation factor, the number of the measuring points read by the message and the communication channel type of the ammeter;
calculating the complexity according to the comprehensive calculation factor, the initial complexity and the reading time of the message;
and repeating the steps, and establishing an incremental learning model according to the complexity of different messages.
9. The method of claim 7, wherein the method comprises: the specific steps of recalculating the transparent forwarding success rate and updating the routing state table by the incremental learning model according to the meter reading result are as follows:
calculating a time consumption expected value E (x) of successful meter reading according to the time consumption and the complexity of all the successful meter reading requests:
Figure DEST_PATH_IMAGE002
wherein x is the number of transparent forwarding reading times, T1, T2 and T3 \8230 \ 8230, tx is the time consumption of transparent forwarding successful reading request, U1, U2 and U3 \8230 \ 8230, and Ux is the complexity of the corresponding message;
calculating the total time T of all reading requests according to the time consumption expected value E (x) of successful meter reading:
T=y*E(x)
wherein, y is the total number of meter reading;
calculating a transparent forwarding success rate S;
Figure DEST_PATH_IMAGE004
and updating the routing state table according to the calculated transparent forwarding success rate S.
10. A communication interaction system of terminals and a master station for operating the method of any one of claims 1 to 9, characterized in that it comprises a master station and a plurality of terminals.
CN202211593056.3A 2022-12-13 2022-12-13 Communication interaction method and system for terminal and master station Active CN115665037B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211593056.3A CN115665037B (en) 2022-12-13 2022-12-13 Communication interaction method and system for terminal and master station

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211593056.3A CN115665037B (en) 2022-12-13 2022-12-13 Communication interaction method and system for terminal and master station

Publications (2)

Publication Number Publication Date
CN115665037A true CN115665037A (en) 2023-01-31
CN115665037B CN115665037B (en) 2023-03-14

Family

ID=85018109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211593056.3A Active CN115665037B (en) 2022-12-13 2022-12-13 Communication interaction method and system for terminal and master station

Country Status (1)

Country Link
CN (1) CN115665037B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116249077A (en) * 2023-02-27 2023-06-09 北京云智软通信息技术有限公司 Method and device for acquiring communication routing state of working group member

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105282249A (en) * 2015-10-30 2016-01-27 国网新疆电力公司电力科学研究院 Device and method for remotely issuing electric energy meter parameters and control commands based on transparent collection tasks
CN105577736A (en) * 2014-11-07 2016-05-11 华为技术有限公司 Power line carrier communication terminal control device, system and method
CN110602726A (en) * 2019-08-16 2019-12-20 苏宁智能终端有限公司 Method and system for testing automatic distribution network of intelligent equipment
US20200136429A1 (en) * 2018-10-29 2020-04-30 Conectric, Llc Systems and methods for a wireless sensor network
JP6944074B1 (en) * 2021-01-08 2021-10-06 ソフトバンク株式会社 Communication devices, communication device control methods, communication device control programs, and communication systems
US20210385174A1 (en) * 2019-12-10 2021-12-09 Enn Digital Energy Technology Co., Ltd Internet of things data transmission method and system
CN114329267A (en) * 2021-12-14 2022-04-12 上海能誉科技股份有限公司 Method and device for processing acquired data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577736A (en) * 2014-11-07 2016-05-11 华为技术有限公司 Power line carrier communication terminal control device, system and method
CN105282249A (en) * 2015-10-30 2016-01-27 国网新疆电力公司电力科学研究院 Device and method for remotely issuing electric energy meter parameters and control commands based on transparent collection tasks
US20200136429A1 (en) * 2018-10-29 2020-04-30 Conectric, Llc Systems and methods for a wireless sensor network
CN110602726A (en) * 2019-08-16 2019-12-20 苏宁智能终端有限公司 Method and system for testing automatic distribution network of intelligent equipment
US20210385174A1 (en) * 2019-12-10 2021-12-09 Enn Digital Energy Technology Co., Ltd Internet of things data transmission method and system
JP6944074B1 (en) * 2021-01-08 2021-10-06 ソフトバンク株式会社 Communication devices, communication device control methods, communication device control programs, and communication systems
CN114329267A (en) * 2021-12-14 2022-04-12 上海能誉科技股份有限公司 Method and device for processing acquired data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116249077A (en) * 2023-02-27 2023-06-09 北京云智软通信息技术有限公司 Method and device for acquiring communication routing state of working group member
CN116249077B (en) * 2023-02-27 2023-10-20 北京云智软通信息技术有限公司 Method and device for acquiring communication routing state of working group member

Also Published As

Publication number Publication date
CN115665037B (en) 2023-03-14

Similar Documents

Publication Publication Date Title
KR102613089B1 (en) Internet of Things data transmission method and system
CN101454763B (en) Gateway for data transfer between serial buses
EP0160263A2 (en) Distributed control of alias name usage in networks
CN109995675B (en) Self-adaptive industrial Ethernet gateway system and method based on software definition
EP2081336B1 (en) Business message transmission method, system and apparatus
JPH03250946A (en) Communication device
CN115665037B (en) Communication interaction method and system for terminal and master station
CN103098527B (en) Radio communication device, wireless communication system
JP2806466B2 (en) Data transmission control method
CN113746733A (en) Table item synchronization method, gateway equipment, networking system and storage medium
CN114401284A (en) Real-time data acquisition and transmission system and method for fixed pollution source treatment working condition
EP2472793A1 (en) Method, device and system for transmitting e1 bidirectional looped network data
US10254127B2 (en) Method for remotely reading electric meters
CN1487706B (en) Method, system and control process for enterprise to communicate timely
CN112104442B (en) Message reply method of electric power acquisition terminal
WO2020238764A1 (en) Time sequence management method, device and system
CN112363963A (en) Data transmission method and device based on Powerlink bus
CN103580780A (en) Data transmission method and device
CN110784365A (en) Standby device of station control layer and entity device of transformer substation and automatic online method thereof
CN112462647B (en) Radio station network control system and method
JPWO2020115816A1 (en) Terminal equipment, communication system and communication method
CN118282859A (en) Message processing method, device and system
CN115955487A (en) CTC station multi-terminal synchronous login method and system
CN112819405A (en) Intelligent logistics information management method and system based on cloud server
JP3062904B2 (en) Data transmission method for distributed computer system

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