[go: up one dir, main page]

CN106059876A - Mode switching control method, device and system for unidirectional serial bus network - Google Patents

Mode switching control method, device and system for unidirectional serial bus network Download PDF

Info

Publication number
CN106059876A
CN106059876A CN201610456960.8A CN201610456960A CN106059876A CN 106059876 A CN106059876 A CN 106059876A CN 201610456960 A CN201610456960 A CN 201610456960A CN 106059876 A CN106059876 A CN 106059876A
Authority
CN
China
Prior art keywords
slave node
instruction message
node device
mode switching
switching instruction
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
CN201610456960.8A
Other languages
Chinese (zh)
Other versions
CN106059876B (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.)
Light Scientific And Technical Industry Co Ltd In Chongqing Century
Original Assignee
Light Scientific And Technical Industry Co Ltd In Chongqing Century
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 Light Scientific And Technical Industry Co Ltd In Chongqing Century filed Critical Light Scientific And Technical Industry Co Ltd In Chongqing Century
Priority to CN201610456960.8A priority Critical patent/CN106059876B/en
Publication of CN106059876A publication Critical patent/CN106059876A/en
Application granted granted Critical
Publication of CN106059876B publication Critical patent/CN106059876B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • H04L12/40013Details regarding a bus controller
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides a mode switching control method, a mode switching method, a device and a system for a unidirectional serial bus network. Master node equipment determines a working mode required by slave node equipment, and instructs the slave node equipment by virtue of a first mode switching instruction message or a second mode switching instruction message to switch into the required working mode; the slave node equipment is configured with two types of working modes: a receiving and forwarding working mode and a receiving and transparent transferring working mode; when the working mode is the receiving and forwarding working mode, received service messages are processed, and whether to send the processed service messages or not is judged; and when the working mode is the receiving and transparent transferring working mode, the received service messages are processed, and the service messages are sent at the same time. Thus, in the embodiments of the invention, the slave node equipment can perform switching of the working mode according to instructions from the master node equipment so as to adapt to different types of service requirements.

Description

Mode switching control method, equipment and system for unidirectional serial bus network
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, and a system for controlling mode switching of a unidirectional serial bus network.
Background
At present, the unidirectional serial bus such as RS485 is applied to the networks such as remote industrial control, remote intelligent meter reading and the like; the network is usually connected in a one-way ring network or a one-way ring network is sleeved with the one-way ring network, and specifically includes the following two networking modes: in the first mode, the concentrator directly forms a unidirectional ring network with a plurality of intelligent instruments through a unidirectional serial bus; in the second mode, the concentrator and the collectors form a backbone network through a unidirectional ring network, and each collector forms a unidirectional ring subnet with a plurality of intelligent instruments through a unidirectional serial bus. In the networking mode, because of the one-way limitation of the RS485 one-way serial bus, the collector and the intelligent instrument only support a receiving transparent transmission working mode, the received data message is processed in the receiving transparent transmission working mode, and the data message is transmitted to the sending port, while the receiving transparent transmission working mode is only suitable for sending and responding to the common service message with large data flow and small time delay and is not suitable for sending and responding to the control service message with small data flow and no requirement on time delay; therefore, how to adapt the network constructed by the networking manner to different types of service requirements becomes a technical problem to be solved urgently.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide a method, a device and a system for controlling mode switching in a unidirectional serial bus network, wherein a slave node device switches operating modes according to an instruction of a first mode switching instruction packet or a second mode switching instruction packet sent by a master node device, so as to adapt to different types of service requirements.
To achieve the above and other related objects, embodiments of the present invention provide a mode switching control method for a unidirectional serial bus network, where the unidirectional serial bus network includes a master node device, at least one slave node device; the method comprises the following steps that the master node equipment and at least one slave node equipment form a unidirectional ring network through a unidirectional serial bus, and the method comprises the following steps:
the master node equipment determines the working mode required by the slave node equipment;
when the required working mode is determined to be a receiving and forwarding working mode, sending a first mode switching instruction message, wherein the first mode switching instruction message is used for instructing the slave node equipment to switch the working mode to the receiving and forwarding working mode, and meanwhile, when the slave node equipment is intermediate slave node equipment, forwarding the first mode switching instruction message to the next hop slave node equipment of the slave node equipment; when the slave node device is the last hop slave node device, the first mode switching instruction message is returned to the master node device;
when the required working mode is determined to be a receiving transparent transmission working mode, sending a second mode switching instruction message, wherein the second mode switching instruction message is used for instructing the slave node equipment to switch the working mode to the receiving transparent transmission working mode and judging whether to forward the second mode switching instruction message or not; when the second mode switching instruction message is judged to be forwarded, the next hop slave node device forwards the second mode switching instruction message when the second mode switching instruction message is an intermediate slave node device, and returns the first mode switching instruction message to the master node device when the second mode switching instruction message is a last hop slave node device;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
Preferably, the method further comprises:
the main node equipment receives a returned first mode switching instruction message;
and the master node equipment determines that the working mode of the slave node equipment is switched into a receiving and forwarding working mode according to the returned first mode switching instruction message.
Preferably, the method further comprises:
after determining that the working mode of the slave node equipment is switched to a receiving and forwarding working mode, the master node equipment sends a topology learning instruction message, wherein the topology learning instruction message is used for indicating the slave node equipment to read the number of nodes of the slave node equipment in the topology learning instruction message, the number of the nodes is updated after adding 1 to the number of the nodes, the updated number of the nodes, the self address or the self equipment ID are added into the topology learning instruction message, and when the master node equipment is intermediate slave node equipment, the added topology learning instruction message is forwarded to the next hop slave node equipment of the master node equipment; when the device is the last hop slave node device, returning the added topology learning instruction message to the master node device;
and the master node equipment receives the returned topology learning instruction message, and determines the topology structure of the unidirectional ring network according to the number of nodes in the returned topology learning instruction message and the address or the ID of the slave node equipment.
Preferably, the sending, by the master node device, a topology learning instruction packet includes:
and the main node equipment sends a topology learning instruction message according to a set time interval or a command triggering mode.
The embodiment of the invention also provides a mode switching method of the unidirectional serial bus network, wherein the unidirectional serial bus network comprises the main node equipment and at least one slave node equipment; the method comprises the following steps that the master node equipment and at least one slave node equipment form a unidirectional ring network through a unidirectional serial bus, and the method comprises the following steps:
when the slave node equipment receives a first mode switching instruction message, the working mode is switched to a receiving and forwarding working mode according to the instruction of the first mode switching instruction message, and meanwhile, when the slave node equipment is intermediate slave node equipment, the first mode switching instruction message is forwarded to the next hop slave node equipment of the slave node equipment; when the slave node device is the last hop slave node device, returning the first mode switching instruction message to the master node device;
when receiving a second mode switching instruction message, the slave node equipment switches the working mode to a receiving transparent transmission working mode according to the instruction of the second mode switching instruction message and judges whether to forward the second mode switching instruction message; when the second mode switching instruction message is judged to be forwarded, the next hop slave node device forwards the second mode switching instruction message when the second mode switching instruction message is an intermediate slave node device, and returns the first mode switching instruction message to the master node device when the second mode switching instruction message is a last hop slave node device;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
Preferably, the method further comprises:
after the slave node equipment switches the working mode into a receiving and forwarding working mode, receiving a topology learning instruction message sent by the master node equipment;
the slave node equipment reads the node number of the slave node equipment in the topology learning instruction message, updates the node number after adding 1 to the node number, and adds the updated node number, the self address or the self equipment ID to the topology learning instruction message;
when the slave node equipment is intermediate slave node equipment, the added topology learning instruction message is forwarded to the next hop slave node equipment of the slave node equipment; and when the master node device is the last hop slave node device, returning the added topology learning instruction message to the master node device.
According to the foregoing method, an embodiment of the present invention provides a master node apparatus, which is applied to a master node device in a unidirectional serial bus network including a master node device and at least one slave node device; wherein, the master node equipment forms a unidirectional ring network with at least one slave node equipment through a unidirectional serial bus, and the device comprises: the device comprises a determining module and a sending module; wherein,
the determining module is used for determining the working mode required by the slave node equipment;
the sending module is configured to send a first mode switching instruction message when the determining module determines that the required working mode is the receiving and forwarding working mode, where the first mode switching instruction message is used to instruct the slave node device to switch the working mode to the receiving and forwarding working mode, and meanwhile, when the slave node device is an intermediate slave node device, the sending module forwards the first mode switching instruction message to a next-hop slave node device of the slave node device; when the slave node device is the last hop slave node device, returning the first mode switching instruction message to the master node device;
when the determining module determines that the required working mode is the receiving transparent transmission working mode, sending a second mode switching instruction message, wherein the second mode switching instruction message is used for instructing the slave node equipment to switch the working mode to the receiving transparent transmission working mode and judging whether to forward the second mode switching instruction message or not; when the second mode switching instruction message is judged to be forwarded, the next hop slave node device forwards the second mode switching instruction message when the second mode switching instruction message is an intermediate slave node device, and returns the first mode switching instruction message to the master node device when the second mode switching instruction message is a last hop slave node device;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
Preferably, the apparatus further comprises:
the receiving module is used for receiving the returned first mode switching instruction message;
the determining module is further configured to determine, according to the returned first mode switching instruction packet, that the working mode of the slave node device is switched to a receiving and forwarding working mode.
Preferably, the sending module is further configured to send a topology learning instruction message after the determining module determines that the working mode of the slave node device is switched to the receiving and forwarding working mode, where the topology learning instruction message is used to instruct the slave node device to read the number of nodes of the slave node device in the topology learning instruction message, update the number of nodes after adding 1 to the number of nodes, and add the updated number of nodes, its own address, or its own device ID to the topology learning instruction message; when the device is an intermediate slave node device, the added topology learning instruction message is forwarded to a next hop slave node device of the device, and when the device is a last hop slave node device, the added topology learning instruction message is returned to the master node device;
the determining module is further configured to determine the topology structure of the unidirectional ring network according to the number of nodes in the returned topology learning instruction message and the slave node device address or the ID when the receiving module receives the returned topology learning instruction message.
Preferably, the sending module is further configured to send the topology learning instruction packet according to a set time interval or a command triggering manner.
According to the foregoing method, an embodiment of the present invention provides a slave node apparatus, which is applied to a slave node device in a unidirectional serial bus network including a master node device and at least one slave node device; wherein, the master node equipment forms a unidirectional ring network with at least one slave node equipment through a unidirectional serial bus, and the device comprises: the device comprises a receiving module, a mode switching module and a sending module; wherein,
the receiving module is used for receiving a first mode switching instruction message and a second mode switching instruction message;
the mode switching module is configured to switch a working mode to a receiving and forwarding working mode according to an instruction of a first mode switching instruction packet when the receiving module receives the first mode switching instruction packet, and instruct the sending module to forward the first mode switching instruction packet to a next-hop slave node device when the sending module is an intermediate slave node device; when the slave node device is the last hop slave node device, the sending module is instructed to return the first mode switching instruction message to the master node device;
the mode switching module is further configured to switch the working mode to a receive transparent transmission working mode according to an instruction of the second mode switching instruction message when the receiving module receives the second mode switching instruction message, and determine whether to forward the second mode switching instruction message; when the second mode switching instruction message is judged to be forwarded and the sending module is instructed to forward the second mode switching instruction message to the next hop slave node device when the sending module is an intermediate slave node device, and when the sending module is the last hop slave node device, the sending module is instructed to return the first mode switching instruction message to the master node device;
the sending module is configured to forward the first mode switching instruction packet to a next hop slave node device of the sending module according to an instruction of the mode switching module or return the first mode switching instruction packet to the master node device; according to the instruction of the mode switching module, the second mode switching instruction message is forwarded to the next hop slave node equipment of the second mode switching instruction message or returned to the master node equipment;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
Preferably, the receiving module is further configured to receive a topology learning instruction packet sent by the master node device after the mode switching module switches the working mode to the receiving and forwarding working mode;
the device further comprises:
the updating module is used for reading the number of nodes of slave node equipment in the topology learning instruction message, updating the number of the nodes after adding 1 to the number of the nodes, and adding the updated number of the nodes, the address of the self or the ID of the self equipment to the topology learning instruction message; and when the device is an intermediate slave node device, the sending module is instructed to forward the added topology learning instruction message to the next hop slave node device, and when the device is the last hop slave node device, the sending module is instructed to return the added topology learning instruction message to the master node device.
The sending module is further configured to forward the added topology learning instruction message to the next-hop slave node device according to the instruction of the updating module; or returning the added topology learning instruction message to the main node equipment according to the indication of the updating module.
According to the above method, an embodiment of the present invention further provides a communication system of a unidirectional serial bus network, where the system includes: the system comprises a concentrator, at least one collector and at least one intelligent instrument; the concentrator comprises the main node device, the collector comprises the main node device and the slave node device, and the intelligent instrument comprises the slave node device; the concentrator and at least one collector form a unidirectional ring network through a unidirectional serial bus, and each collector and at least one intelligent instrument form a unidirectional ring sub-network through the unidirectional serial bus.
According to the above method, an embodiment of the present invention further provides a communication system of a unidirectional serial bus network, where the system includes: the concentrator comprises the master node device, and the intelligent instrument comprises the slave node device; the concentrator and at least one intelligent instrument form a unidirectional ring network through a unidirectional serial bus.
In the embodiment of the invention, the unidirectional serial bus network comprises a master node device and at least one slave node device; the master node equipment and at least one slave node equipment form a unidirectional ring network through a unidirectional serial bus; the master node equipment determines a working mode required by the slave node equipment, and when the required working mode is determined to be a receiving and forwarding working mode, the master node equipment sends a first mode switching instruction message, wherein the first mode switching instruction message is used for indicating the slave node equipment to switch the working mode to the receiving and forwarding working mode, and meanwhile, when the master node equipment is intermediate slave node equipment, the master node equipment forwards the first mode switching instruction message to the next hop slave node equipment of the master node equipment; when the slave node device is the last hop slave node device, the first mode switching instruction message is returned to the master node device; when the required working mode is determined to be a receiving transparent transmission working mode, sending a second mode switching instruction message, wherein the second mode switching instruction message is used for instructing the slave node equipment to switch the working mode to the receiving transparent transmission working mode and judging whether to forward the second mode switching instruction message or not; when the second mode switching instruction message is judged to be forwarded, the next hop slave node device forwards the second mode switching instruction message when the second mode switching instruction message is an intermediate slave node device, and returns the first mode switching instruction message to the master node device when the second mode switching instruction message is a last hop slave node device; when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message. In this way, in the embodiment of the present invention, the master node device determines the working mode required by the slave node device, and instructs the slave node device to switch to the required working mode through the first mode switching instruction packet or the second mode switching instruction packet, so that the slave node device can adapt to different types of service requirements.
In the embodiment of the present invention, when receiving a second mode switching instruction packet, the slave node device switches the operating mode to the transparent transmission receiving operating mode according to an instruction of the second mode switching instruction packet, and determines whether to forward the second mode switching instruction packet; when the second mode switching instruction message is judged to be forwarded, the next hop slave node device forwards the second mode switching instruction message when the second mode switching instruction message is a middle hop slave node device, and the first mode switching instruction message is returned to the master node device when the second mode switching instruction message is a last hop slave node device; when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message. Therefore, the slave node device in the embodiment of the invention configures two working modes, and can switch the working modes according to the indication of the master node device so as to adapt to different types of service requirements.
Drawings
FIG. 1 is a flow chart illustrating a mode switching control method of a uni-directional serial bus network according to the present invention;
FIG. 2 is a flow chart illustrating a mode switching method of another uni-directional serial bus network according to the present invention;
FIG. 3 is a schematic diagram illustrating the structure of the main node device according to the present invention;
FIG. 4 is a schematic diagram illustrating a structure of a slave node device according to the present invention;
FIG. 5 is a schematic diagram illustrating a structure of a slave node device according to the present invention;
FIG. 6 is a schematic diagram of the structure of a communication system of the uni-directional serial bus network according to the present invention;
fig. 7 is a schematic structural diagram of a communication system of another unidirectional serial bus network according to the present invention.
Detailed Description
The embodiment of the invention is applied to a unidirectional serial bus network, and the unidirectional serial bus network comprises main node equipment and at least one slave node equipment; the master node device and at least one slave node device form a unidirectional ring network through a unidirectional serial bus, so that the unidirectional serial bus network comprises the unidirectional ring network; in practical application, the master node device can be realized by devices such as a concentrator or a collector, and the slave node device can be realized by devices such as an intelligent instrument, for example, devices such as an intelligent electric meter, an intelligent heat meter, an intelligent water meter and an intelligent gas meter. Based on the network architecture, the mode switching control process of the unidirectional serial bus network provided by the embodiment of the invention is as follows:
the master node equipment determines a working mode required by the slave node equipment, and sends a first mode switching instruction message to the slave node equipment when the required working mode is determined to be a receiving and forwarding working mode;
when the slave node equipment receives a first mode switching instruction message, the working mode is switched to a receiving and forwarding working mode according to the instruction of the first mode switching instruction message, and meanwhile, when the slave node equipment is intermediate slave node equipment, the first mode switching instruction message is forwarded to the next hop slave node equipment of the slave node equipment; when the slave node device is the last hop slave node device, the first mode switching instruction message is returned to the master node device;
the master node receives a returned first mode switching instruction message, and determines that the working mode of the slave node equipment is switched into a receiving and forwarding working mode according to the returned first mode switching instruction message;
when the master node equipment determines that the required working mode is a receiving transparent transmission working mode, sending a second mode switching instruction message to the slave node equipment;
when the slave node equipment receives a second mode switching instruction message, switching the working mode to a receiving transparent transmission working mode according to the instruction of the second mode switching instruction message, and judging whether to forward the second mode switching instruction message or not; when the second mode switching instruction message is judged to be forwarded, the next hop slave node device forwards the second mode switching instruction message when the second mode switching instruction message is an intermediate slave node device, and returns the first mode switching instruction message to the master node device when the second mode switching instruction message is a last hop slave node device;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
Further, in order to implement automatic learning of a network topology structure, the master node device sends a topology learning instruction message according to a set time interval or a command triggering mode after determining that the working mode of the slave node device is switched to a receiving and forwarding working mode;
when receiving the topology learning instruction message, the slave node device reads the number of nodes of the slave node device in the topology learning instruction message, updates the number of nodes after adding 1 to the number of nodes, and adds the updated number of nodes, the address of the slave node device or the ID of the slave node device to the topology learning instruction message; when the device is an intermediate slave node device, the added topology learning instruction message is forwarded to the next hop slave node device; when the master node device is the last hop slave node device, returning the added topology learning instruction message to the master node device;
and the master node equipment receives the returned topology learning instruction message, and determines the topology structure of the unidirectional ring network according to the number of nodes in the returned topology learning instruction message and the address or the ID of the slave node equipment so as to realize the automatic learning of the network topology structure.
In the embodiment of the invention, the master node equipment determines the working mode required by the slave node equipment, and instructs the slave node equipment to switch the working mode according to the required working mode, so that the slave node equipment can adapt to different types of service requirements; after determining that the working mode of the slave node device is switched to a receiving and forwarding working mode, the master node device sends a topology learning instruction message to the slave node device, the slave node device updates the number of nodes in the topology learning instruction message hop by hop, continuously adds the self address or the self device ID to the topology learning instruction message, and the last hop of slave node device returns the topology learning instruction message after the addition is completed to the master node device; and the master node equipment determines the topological structure of the unidirectional ring network according to the node number in the returned topological learning instruction message and the address or the ID of the slave node equipment, so that the automatic learning of the network topological structure is quickly realized, and the change of the network topological structure is sensed.
The invention is described in further detail below with reference to the figures and the embodiments.
As shown in fig. 1, a mode switching control flow of a unidirectional serial bus network according to an embodiment of the present invention is applied to a master node device, and includes:
step S100: the master node device determines the working mode required by the slave node device, and when the required working mode is determined to be a receiving and forwarding working mode, the step S101 is switched to; when the required working mode is determined to be the receiving transparent transmission working mode, the step S102 is switched to;
step S101: sending a first mode switching instruction message, wherein the first mode switching instruction message is used for instructing the slave node equipment to switch the working mode into a receiving and forwarding working mode, and meanwhile, when the slave node equipment is intermediate slave node equipment, the first mode switching instruction message is forwarded to the next hop slave node equipment of the slave node equipment; when the slave node device is the last hop slave node device, the first mode switching instruction message is returned to the master node device, and the processing flow is ended;
step S102: sending a second mode switching instruction message, wherein the second mode switching instruction message is used for instructing the slave node equipment to switch the working mode into a receiving transparent transmission working mode and judging whether to forward the second mode switching instruction message or not; when the second mode switching instruction message is judged to be forwarded, the next hop slave node device forwards the second mode switching instruction message when the second mode switching instruction message is an intermediate slave node device, and the first mode switching instruction message is returned to the master node device when the second mode switching instruction message is a last hop slave node device;
here, when it is determined to forward the second mode switching instruction packet, the forwarding of the second mode switching instruction packet is stopped when it is determined that the forwarding of the second mode switching instruction packet is not required.
When the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
Specifically, when the slave node device works in a receiving and forwarding working mode, analyzing and processing a received service message, and judging whether the service message is sent to the device of the slave node device, if so, processing the service message and stopping forwarding the data message; otherwise, when the slave node device is the intermediate slave node device, the next hop slave node device forwards the service message, and when the slave node device is the last hop slave node device, the service message is returned to the master node device; and when the slave node equipment works in a receiving transparent transmission working mode, analyzing and processing the received service message and simultaneously sending the service message.
Further, the main node equipment receives a returned first mode switching instruction message;
and the master node equipment determines that the working mode of the slave node equipment is switched into a receiving and forwarding working mode according to the returned first mode switching instruction message.
Here, the first mode switching instruction message sent by the master node device carries a source address and a destination address, where the source address and the destination address are both addresses of the master node device itself; or, the first mode switching instruction message carries an active device ID and a destination device ID, where the active device ID and the destination device ID are both device IDs of the master node device itself; since the slave node device works in a transparent transmission receiving working mode before receiving the first mode switching instruction message, when receiving the first mode switching instruction message, the slave node device switches the working mode to a forwarding receiving working mode according to the instruction of the first mode switching instruction message, and meanwhile, the slave node device directly forwards the first mode switching instruction message to the slave node device of the next hop of the slave node device without judging the first mode switching instruction message, and when the slave node device of the last hop returns the first mode switching instruction message to the master node device; therefore, the master node device receives a first mode switching instruction message returned by the slave node device, and determines that the working modes of all slave node devices in the unidirectional ring network are switched to a receiving and forwarding working mode according to the returned first mode switching instruction message.
Further, the master node device starts a timer to time when sending the first mode switching instruction message, and determines that the mode switching response fails if the timer has not received the returned first mode switching instruction message when reaching the set response time, and at this time, may resend the first mode switching instruction message to instruct the slave node device to perform the mode switching again.
Further, the master node device receives a returned second mode switching instruction message;
and the master node equipment determines that the working mode of the slave node equipment is switched into a receiving transparent transmission working mode according to the returned second mode switching instruction message.
Here, the second mode switching instruction message sent by the master node device carries a source address and a destination address, where the source address and the destination address are both addresses of the master node device itself; or, the second mode switching instruction message carries an active device ID and a destination device ID, where the active device ID and the destination device ID are both device IDs of the master node device itself; the slave node device works in a receiving and forwarding working mode before receiving the second mode switching instruction message, so that when the slave node device receives the second mode switching instruction message, the working mode is switched to a receiving transparent transmission working mode according to the instruction of the second mode switching instruction message, the second mode switching instruction message is analyzed, whether the second mode switching instruction message is forwarded or not is judged, and since the destination address analyzed from the second mode switching instruction message is not the address of the slave node device, the slave node device forwards the first mode switching instruction message to the slave node device of the next hop of the slave node device, and when the slave node device of the last hop returns the first mode switching instruction message to the master node device; therefore, the master node device receives a second mode switching instruction message returned by the slave node device, and determines that the working modes of all slave node devices in the unidirectional ring network are switched to a receiving transparent transmission working mode according to the returned second mode switching instruction message.
Further, the master node device starts a timer to time when sending the second mode switching instruction message, and determines that the mode switching response fails if the timer has not received the returned second mode switching instruction message when reaching the set response time, and at this time, may resend the second mode switching instruction message to instruct the slave node device to perform the mode switching again.
Here, the slave node device defaults to work in a receiving transparent transmission working mode so as to adapt to the sending and response of a common service message with large data flow and small time delay; if the forwarding delay time is reduced to improve the forwarding efficiency, the slave node device may switch the working mode to the receiving and forwarding working mode according to the instruction of the first mode switching instruction packet sent by the master node device, so as to adapt to sending and responding of a control service packet with small data traffic and no requirement on time delay, for example, sending and responding of a topology learning instruction packet.
Further, in order to automatically learn and sense the change of the network topology structure, after determining that the working mode of the slave node device is switched to a receiving and forwarding working mode, the master node device sends a topology learning instruction message to the slave node device, where the topology learning instruction message is used to instruct the slave node device to read the number of nodes of the slave node device in the topology learning instruction message, update the number of nodes after adding 1 to the number of nodes, add the updated number of nodes, its own address, or its own device ID to the topology learning instruction message, and when itself is an intermediate slave node device, forward the topology learning instruction message after the addition is completed to its own next hop slave node device; when the device is the last hop slave node device, returning the added topology learning instruction message to the master node device;
and the master node equipment receives the returned topology learning instruction message, and determines the topology structure of the unidirectional ring network according to the number of nodes in the returned topology learning instruction message and the address or the ID of the slave node equipment.
Here, the topology learning instruction packet also belongs to a data packet.
Specifically, the master node device may send the topology learning instruction packet in the following manner:
(1) transmitting according to a set time interval mode
The master node equipment starts a timer to time when sending the topology learning instruction message, and sends the next topology learning instruction message when the timer reaches the set time, that is, the topology learning instruction message can be periodically sent according to the timer timing by adopting the mode, so as to realize the automatic learning and updating of the network topology structure.
(2) Send on command trigger
The specific triggering mode may be that when a user or a remote network monitoring and management device connected to the master node device needs to automatically learn a network topology structure, the master node device is triggered to send a topology learning instruction packet.
Specifically, the topology learning instruction packet carries a source address and a destination address, where the source address and the destination address are both addresses of the master node device itself; or, the topology learning instruction message carries an active device ID and a destination device ID, where the active device ID and the destination device ID are both device IDs of the master node device itself; at this time, the slave node device operates in a receiving and forwarding operating mode, so that the slave node device updates the number of nodes in the topology learning instruction message hop by hop when receiving the topology learning instruction message, continuously adds a self address or a self device ID to the topology learning instruction message, and determines the topology learning instruction message, and since a destination address carried in the topology learning instruction message is not a self address, the slave node device forwards the topology learning instruction message after completing the addition to the next-hop slave node device of the slave node device, and the last-hop slave node device returns the topology learning instruction message after completing the addition to the master node device, where the topology learning instruction message is as shown in table 1:
TABLE 1
The node number of the slave node device in the topology learning instruction message sent by the master node device is zero, the slave node device reads the node number of the slave node device from a certain position in the received topology learning instruction message, adds 1 to the node number and writes back the node number covering the original position, then calculates the position of adding the self address or the self device ID in the topology learning instruction message according to the updated node number, and writes the self address or the self device ID in the calculated position; and under the condition that the source address and the destination address are kept or the source equipment ID and the destination equipment ID are not changed, forwarding the added topology learning instruction message to the next hop slave node equipment of the slave node equipment, and returning the added topology learning instruction message to the master node equipment by the last hop slave node equipment after adding the updated node number and the address or the equipment ID of the slave node equipment to the topology learning instruction message.
It should be noted that: table 1 above is merely an example and is not to be construed as limiting the present invention.
As shown in fig. 2, the mode switching process of the unidirectional serial bus network provided in the embodiment of the present invention is applied to a slave node device, and includes the following specific steps:
step S200: when receiving the first mode switching instruction message, the slave node device proceeds to step S201; when receiving the second mode switching instruction message, the process goes to step S202;
step S201: the slave node equipment switches the working mode into a receiving and forwarding working mode according to the indication of the first mode switching instruction message, and simultaneously forwards the first mode switching instruction message to the next hop slave node equipment when the slave node equipment is the middle slave node equipment; when the slave node device is the last hop slave node device, returning the first mode switching instruction message to the master node device;
here, the first mode switching instruction message sent by the master node device carries a source address and a destination address, where the source address and the destination address are both addresses of the master node device itself; or, the first mode switching instruction message carries an active device ID and a destination device ID, where the active device ID and the destination device ID are both device IDs of the master node device itself; because the slave node device works in the transparent transmission receiving working mode before receiving the first mode switching instruction message, when receiving the first mode switching instruction message, the slave node device switches the working mode to the forwarding receiving working mode according to the instruction of the first mode switching instruction message, meanwhile, the first mode switching instruction message is directly forwarded to the next hop slave node device of the slave node device without judging the first mode switching instruction message, and the first mode switching instruction message is returned to the master node device when the slave node device of the last hop receives the first mode switching instruction message.
Step S202: when the slave node equipment receives a second mode switching instruction message, switching the working mode to a receiving transparent transmission working mode according to the instruction of the second mode switching instruction message, and judging whether to forward the second mode switching instruction message or not; when the second mode switching instruction message is judged to be forwarded, the step S203 is executed; when judging that the second mode switching instruction message does not need to be forwarded, turning to step S204;
step S203: the slave node device forwards the second mode switching instruction message to the next hop slave node device when the slave node device is an intermediate slave node device, and returns the first mode switching instruction message to the master node device when the slave node device is a last hop slave node device, and the processing flow is finished;
step S204: stopping forwarding the second mode switching instruction message, and ending the processing flow;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
Here, the second mode switching instruction message carries a source address and a destination address, where the source address and the destination address are both the own address of the master node device; or, the second mode switching instruction message carries an active device ID and a destination device ID, where the active device ID and the destination device ID are both device IDs of the master node device itself; the slave node device works in a receiving and forwarding working mode before receiving the second mode switching instruction message, so that when receiving the second mode switching instruction message, the slave node device switches the working mode to the receiving and transparent transmission working mode according to the instruction of the second mode switching instruction message, analyzes the second mode switching instruction message, and judges whether to forward the second mode switching instruction message.
Further, in order to realize automatic learning of a network topology structure, after the working mode of the slave node equipment is switched to a receiving and forwarding working mode, receiving a topology learning instruction message sent by the master node equipment;
reading the number of nodes of slave node equipment in the topology learning instruction message, updating the number of nodes after adding 1 to the number of nodes, and adding the updated number of nodes, the self address or the self equipment ID to the topology learning instruction message;
when the self is the intermediate slave node equipment, the added topology learning instruction message is forwarded to the next hop slave node equipment of the self; and when the master node device is the last hop slave node device, returning the added topology learning instruction message to the master node device.
In order to implement the foregoing method, an embodiment of the present invention further provides a master node device and a slave node device, and because the principle of solving the problem of the master node device and the slave node device is similar to that of the method, both the implementation process and the implementation principle of the device can be described with reference to the implementation process and the implementation principle of the foregoing method, and repeated details are not repeated.
Referring to fig. 3, an embodiment of the present invention provides a master node apparatus, which is applied to a master node device in a unidirectional serial bus network including a master node device and at least one slave node device; wherein, the master node equipment forms a unidirectional ring network with at least one slave node equipment through a unidirectional serial bus, the device comprises: a determining module 300 and a sending module 301; wherein,
the determining module 300 is configured to determine a required working mode of the slave node device;
the sending module 301 is configured to send a first mode switching instruction packet when the determining module 300 determines that the required working mode is the receiving and forwarding working mode, where the first mode switching instruction packet is used to instruct the slave node device to switch the working mode to the receiving and forwarding working mode, and meanwhile, when the slave node device is an intermediate slave node device, forward the first mode switching instruction packet to a next-hop slave node device of the slave node device; when the slave node device is the last hop slave node device, returning the first mode switching instruction message to the master node device;
when the determining module 300 determines that the required working mode is the receiving transparent transmission working mode, sending a second mode switching instruction message, where the second mode switching instruction message is used to instruct the slave node device to switch the working mode to the receiving transparent transmission working mode and determine whether to forward the second mode switching instruction message; when the second mode switching instruction message is judged to be forwarded, the next hop slave node device forwards the second mode switching instruction message when the second mode switching instruction message is an intermediate slave node device, and returns the first mode switching instruction message to the master node device when the second mode switching instruction message is a last hop slave node device;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
In a specific implementation, the apparatus further comprises:
a receiving module 302, configured to receive a returned first mode switching instruction packet;
the determining module 300 is further configured to determine, according to the returned first mode switching instruction packet, that the working mode of the slave node device is switched to a receiving and forwarding working mode.
In a specific implementation, the sending module 301 is further configured to send a topology learning instruction message after the determining module 300 determines that the working mode of the slave node device is switched to the receiving and forwarding working mode, where the topology learning instruction message is used to instruct the slave node device to read the number of nodes of the slave node device in the topology learning instruction message, update the number of nodes after adding 1 to the number of nodes, and add the updated number of nodes, the address of the slave node device, or the ID of the slave node device to the topology learning instruction message; when the device is an intermediate slave node device, the added topology learning instruction message is forwarded to a next hop slave node device of the device, and when the device is a last hop slave node device, the added topology learning instruction message is returned to the master node device;
the determining module 300 is further configured to determine the topology structure of the unidirectional ring network according to the number of nodes in the returned topology learning instruction message, the slave node device address or the ID when the receiving module 302 receives the returned topology learning instruction message.
In a specific implementation, the sending module 301 is specifically configured to send the topology learning instruction packet according to a set time interval or a command triggering manner.
The above division manner of the functional modules is only one preferred implementation manner given in the embodiment of the present invention, and the division manner of the functional modules does not limit the present invention. For convenience of description, each part of the above-described apparatus is separately described as being functionally divided into various modules or units. Of course, the functionality of the various modules or units may be implemented in the same one or more pieces of software or hardware in practicing the invention.
Referring to fig. 4, an embodiment of the present invention provides a slave node apparatus, which is applied to a slave node device in a unidirectional serial bus network including a master node device and at least one slave node device; wherein, the master node equipment forms the unidirectional looped netowrk through unidirectional serial bus and at least one slave node equipment, its characterized in that, the device includes: a receiving module 400, a mode switching module 401 and a sending module 402; wherein,
the receiving module 400 is configured to receive a first mode switching instruction message and a second mode switching instruction message;
the mode switching module 401 is configured to switch a working mode to a receiving and forwarding working mode according to an instruction of a first mode switching instruction packet when the receiving module 400 receives the first mode switching instruction packet, and instruct, when the receiving module is an intermediate slave node device, the sending module 402 to forward the first mode switching instruction packet to a next hop slave node device of the receiving module 402; when the slave node device is the last hop slave node device, instructing the sending module 402 to return the first mode switching instruction packet to the master node device;
the mode switching module 401 is further configured to, when the receiving module 400 receives a second mode switching instruction message, switch the working mode to a receive transparent transmission working mode according to an instruction of the second mode switching instruction message, and determine whether to forward the second mode switching instruction message; when the second mode switching instruction message is judged to be forwarded and the sending module 402 is instructed to forward the second mode switching instruction message to the next hop slave node device when the sending module is an intermediate slave node device, and when the sending module 402 is instructed to return the first mode switching instruction message to the master node device when the sending module is a last hop slave node device;
the sending module 402 is configured to forward the first mode switching instruction packet to its next hop slave node device according to the instruction of the mode switching module 401 or return the first mode switching instruction packet to the master node device; according to the instruction of the mode switching module 401, the second mode switching instruction message is forwarded to the next hop slave node device of the second mode switching instruction message or returned to the master node device;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
In a specific implementation, the receiving module 400 is further configured to receive a topology learning instruction message sent by the master node device after the mode switching module 401 switches the working mode to the receiving and forwarding working mode;
the device further comprises:
an updating module 403, configured to read a node number of a slave node device in the topology learning instruction message, add 1 to the node number, update the node number, and add the updated node number, a self address, or a self device ID to the topology learning instruction message; and when the device is an intermediate slave node device, instruct the sending module 402 to forward the added topology learning instruction message to a next hop slave node device of the device, and when the device is a last hop slave node device, instruct the sending module 402 to return the added topology learning instruction message to the master node device.
The sending module 402 is further configured to forward the added topology learning instruction packet to its next-hop slave node device according to the instruction of the updating module 403; or, the topology learning instruction packet after the addition is completed is returned to the master node device according to the instruction of the updating module 403.
The above division manner of the functional modules is only one preferred implementation manner given in the embodiment of the present invention, and the division manner of the functional modules does not limit the present invention. For convenience of description, each part of the above-described apparatus is separately described as being functionally divided into various modules or units. Of course, the functionality of the various modules or units may be implemented in the same one or more pieces of software or hardware in practicing the invention.
Based on the slave node device, an embodiment of the present invention provides a slave node device, where the slave node device includes the slave node device, and a detailed description is provided below for a specific structure of the slave node device with reference to fig. 5:
as shown in fig. 5, the slave node apparatus includes: processor 500, mode controller 501, signal processing controller 502, ingress port 503, egress port 504; an input end of the processor 500 is connected to the input port, and a signal end of the processor 500 is connected to a signal end of the mode controller 501; the input end of the mode controller 501 is connected to the input port 503, the output end of the mode controller 501 is connected to the input end of the signal processing controller 502, and the output end of the signal processing controller 502 is connected to the output port 504.
Here, the communication device of switchable operation mode configures two operation modes: the mode controller 501 switches on a path from its input terminal to its output terminal according to the instruction of the control information sent by the processor 500; when the working mode is switched to the receiving and forwarding working mode, the mode controller 501 disconnects the path from its input end to its output end according to the instruction of the control information sent by the processor 500, and the output end of the processor 500 is connected to the input end of the signal processing controller 501.
In the embodiment of the present invention, two working modes are configured, and when the working mode is a receive-pass-through working mode, a service packet is transmitted to the processor 500 for processing, and meanwhile, the service packet is transmitted to the output port 504 through the mode controller 501 and the signal processing controller 502; when the working mode is a receiving and forwarding working mode, the service message is transmitted to the processor 500 for processing, then the processor 500 judges whether the processed service message is transmitted to the signal processing controller 502, and after the processor 500 transmits the processed service message to the signal processing controller 502, the signal processing controller 502 transmits the processed service message to the output port 504; and the switching of the two working modes can be realized, so that the method and the device are suitable for different types of service requirements.
In practical applications, the signal processing controller 502 includes: the circuit comprises a first resistor, a second resistor, a first power supply, a second power supply and an AND gate logic device; the mode controller 501 is implemented by a bus buffer; the Processor 500 may be implemented by a Central Processing Unit (CPU), a microprocessor Unit (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or an integrated circuit chip.
It should be noted that: since the slave node apparatus includes the slave node device described above, the receiving module 400 may be implemented by an ingress port 503 in the slave node apparatus, the sending module 402 may be implemented by an egress port 504 in the slave node apparatus, and the mode switching module 401 and the updating module 403 may be implemented by the processor 500, the mode controller 501 and the signal processing controller 502 in the slave node apparatus.
In summary, in the embodiment of the present invention, when the working mode is the receiving transparent transmission working mode, the received data packet is processed, and meanwhile, the data packet is transmitted to the output port; when the working mode is a receiving and forwarding working mode, firstly, the received data message is processed, and then whether the processed data message is transmitted to the output port is judged; in addition, the two working modes can be switched according to the indication to adapt to different types of service requirements, for example, in order to adapt to the sending and response of a common service data message with large flow and small time delay, the working mode needs to be switched to a receiving transparent transmission mode; in order to adapt to the transmission and response of the control service data message with small flow and no requirement on time delay, the working mode needs to be switched to a receiving and forwarding mode.
The embodiment of the invention also provides a remote intelligent meter reading system, as shown in fig. 6, the system includes a concentrator 600, at least one collector 601, and at least one intelligent meter 602; the concentrator 600 includes the above-mentioned master node device, the collector 601 includes the above-mentioned master node device and slave node device, and the intelligent meter includes the above-mentioned slave node device; the concentrator 600 forms a unidirectional ring network with at least one collector 601 through a unidirectional serial bus, and each collector 601 forms a unidirectional ring subnet with at least one intelligent instrument 602 through a unidirectional serial bus.
In the system, the concentrator 600 forms a unidirectional ring network with at least one collector 601 through a unidirectional serial bus, each collector 601 forms a unidirectional ring sub-network with at least one intelligent instrument 602 through a unidirectional serial bus, the concentrator 600 serves as a master node device of the unidirectional ring network, the collector 601 serves as a slave node device of the unidirectional ring network and serves as a master node device of the unidirectional ring sub-network formed by the concentrator 600 and the collector, and the intelligent instrument 602 serves as a slave node device of the unidirectional ring sub-network; in the system, the collector 601 and the intelligent instrument 602 are both configured with two working modes, namely a receiving transparent transmission working mode and a receiving forwarding working mode, and the collector 601 and the intelligent instrument 602 work in the receiving transparent transmission working mode by default so as to adapt to the sending and the response of a common service message with large data flow and small time delay; if the forwarding delay time is reduced to improve the forwarding efficiency, the collector 601 may switch the operation mode to the receiving and forwarding operation mode according to the indication of the first mode switching instruction packet sent by the concentrator 600, and the smart meter 602 may also switch the operation mode to the receiving and forwarding operation mode according to the indication of the second mode switching instruction packet sent by the collector 601, so as to adapt to the sending and response of the control service packet with small data traffic and no requirement on time delay, for example, the sending and response of the topology learning instruction packet.
The embodiment of the invention also provides a remote intelligent meter reading system, as shown in fig. 7, the system includes a concentrator 700 and at least one intelligent meter 701; the concentrator comprises the above-mentioned master node device, and the smart meter 700 comprises the above-mentioned slave node device; the concentrator 700 and at least one of the smart meters 701 form a unidirectional ring network through a unidirectional serial bus.
In the system, the concentrator 700 and at least one intelligent instrument 701 form a unidirectional ring network through a unidirectional serial bus, the concentrator 700 serves as a master node device of the unidirectional ring network, and the intelligent instrument 701 serves as a slave node device of the unidirectional ring network; in the system, the intelligent instrument 701 is configured with two working modes of a receiving transparent transmission working mode and a receiving forwarding working mode, and can be switched with each other according to the indication of the concentrator 700, and the intelligent instrument 701 defaults to work in the receiving transparent transmission working mode so as to adapt to the sending and the response of a common service data message with large data flow and small time delay; if the forwarding delay time is reduced to improve the forwarding efficiency, the smart meter 701 may switch the operation mode to the receiving and forwarding operation mode according to the instruction of the first mode switching instruction packet sent by the concentrator 700, so as to adapt to sending and responding of a control service packet with small data traffic and no requirement on time delay, for example, sending and responding of a topology learning instruction packet.
In summary, the present invention provides. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (14)

1. A mode switching control method of a unidirectional serial bus network, the unidirectional serial bus network comprises a master node device and at least one slave node device; the method is characterized in that the master node equipment and at least one slave node equipment form a unidirectional ring network through a unidirectional serial bus, and the method comprises the following steps:
the master node equipment determines the working mode required by the slave node equipment;
when the required working mode is determined to be a receiving and forwarding working mode, sending a first mode switching instruction message, wherein the first mode switching instruction message is used for instructing the slave node equipment to switch the working mode to the receiving and forwarding working mode, and meanwhile, when the slave node equipment is intermediate slave node equipment, forwarding the first mode switching instruction message to the next hop slave node equipment of the slave node equipment; when the slave node device is the last hop slave node device, the first mode switching instruction message is returned to the master node device;
when the required working mode is determined to be a receiving transparent transmission working mode, sending a second mode switching instruction message, wherein the second mode switching instruction message is used for instructing the slave node equipment to switch the working mode to the receiving transparent transmission working mode and judging whether to forward the second mode switching instruction message or not; when the second mode switching instruction message is judged to be forwarded, the next hop slave node device forwards the second mode switching instruction message when the second mode switching instruction message is an intermediate slave node device, and returns the first mode switching instruction message to the master node device when the second mode switching instruction message is a last hop slave node device;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
2. The method of claim 1, further comprising:
the main node equipment receives a returned first mode switching instruction message;
and the master node equipment determines that the working mode of the slave node equipment is switched into a receiving and forwarding working mode according to the returned first mode switching instruction message.
3. The method of claim 2, further comprising:
after determining that the working mode of the slave node equipment is switched to a receiving and forwarding working mode, the master node equipment sends a topology learning instruction message, wherein the topology learning instruction message is used for indicating the slave node equipment to read the number of nodes of the slave node equipment in the topology learning instruction message, the number of the nodes is updated after adding 1 to the number of the nodes, the updated number of the nodes, the self address or the self equipment ID are added into the topology learning instruction message, and when the master node equipment is intermediate slave node equipment, the added topology learning instruction message is forwarded to the next hop slave node equipment of the master node equipment; when the device is the last hop slave node device, returning the added topology learning instruction message to the master node device;
and the master node equipment receives the returned topology learning instruction message, and determines the topology structure of the unidirectional ring network according to the number of nodes in the returned topology learning instruction message and the address or the ID of the slave node equipment.
4. The method of claim 3, wherein the sending, by the master node device, a topology learning instruction message comprises:
and the main node equipment sends a topology learning instruction message according to a set time interval or a command triggering mode.
5. A mode switching method of a unidirectional serial bus network, the unidirectional serial bus network comprises a master node device and at least one slave node device; the method is characterized in that the master node equipment and at least one slave node equipment form a unidirectional ring network through a unidirectional serial bus, and the method comprises the following steps:
when the slave node equipment receives a first mode switching instruction message, the working mode is switched to a receiving and forwarding working mode according to the instruction of the first mode switching instruction message, and meanwhile, when the slave node equipment is intermediate slave node equipment, the first mode switching instruction message is forwarded to the next hop slave node equipment of the slave node equipment; when the slave node device is the last hop slave node device, returning the first mode switching instruction message to the master node device;
when the slave node equipment receives a second mode switching instruction message, switching the working mode to a receiving transparent transmission working mode according to the instruction of the second mode switching instruction message, and judging whether to forward the second mode switching instruction message or not; when the second mode switching instruction message is judged to be forwarded, the second mode switching instruction message is forwarded to the next hop of slave node equipment when the second mode switching instruction message is judged to be forwarded to the middle slave node equipment, and the first mode switching instruction message is returned to the master node equipment when the second mode switching instruction message is judged to be forwarded to the last hop of slave node equipment;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
6. The method of claim 5, further comprising:
after the slave node equipment switches the working mode into a receiving and forwarding working mode, receiving a topology learning instruction message sent by the master node equipment;
the slave node equipment reads the node number of the slave node equipment in the topology learning instruction message, updates the node number after adding 1 to the node number, and adds the updated node number, the self address or the self equipment ID to the topology learning instruction message;
when the slave node equipment is intermediate slave node equipment, the added topology learning instruction message is forwarded to the next hop slave node equipment of the slave node equipment; and when the master node device is the last hop slave node device, returning the added topology learning instruction message to the master node device.
7. A master node device is applied to a master node device in a unidirectional serial bus network comprising the master node device and at least one slave node device; wherein, the master node equipment forms the unidirectional looped netowrk through unidirectional serial bus and at least one slave node equipment, its characterized in that, the device includes: the device comprises a determining module and a sending module; wherein,
the determining module is used for determining the working mode required by the slave node equipment;
the sending module is configured to send a first mode switching instruction message when the determining module determines that the required working mode is the receiving and forwarding working mode, where the first mode switching instruction message is used to instruct the slave node device to switch the working mode to the receiving and forwarding working mode, and meanwhile, when the slave node device is an intermediate slave node device, the sending module forwards the first mode switching instruction message to a next-hop slave node device of the slave node device; when the slave node device is the last hop slave node device, returning the first mode switching instruction message to the master node device;
when the determining module determines that the required working mode is the receiving transparent transmission working mode, sending a second mode switching instruction message, wherein the second mode switching instruction message is used for instructing the slave node equipment to switch the working mode to the receiving transparent transmission working mode and judging whether to forward the second mode switching instruction message or not; when the second mode switching instruction message is judged to be forwarded, the next hop slave node device forwards the second mode switching instruction message when the second mode switching instruction message is an intermediate slave node device, and returns the first mode switching instruction message to the master node device when the second mode switching instruction message is a last hop slave node device;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
8. The apparatus of claim 7, further comprising:
the receiving module is used for receiving the returned first mode switching instruction message;
the determining module is further configured to determine, according to the returned first mode switching instruction packet, that the working mode of the slave node device is switched to a receiving and forwarding working mode.
9. The apparatus according to claim 8, wherein the sending module is further configured to send a topology learning instruction message after the determining module determines that the working mode of the slave node device is switched to a receiving and forwarding working mode, where the topology learning instruction message is used to instruct the slave node device to read the number of nodes of the slave node device in the topology learning instruction message, update the number of nodes after adding 1 to the number of nodes, and add the updated number of nodes, its own address, or its own device ID to the topology learning instruction message; when the device is an intermediate slave node device, the added topology learning instruction message is forwarded to a next hop slave node device of the device, and when the device is a last hop slave node device, the added topology learning instruction message is returned to the master node device;
the determining module is further configured to determine the topology structure of the unidirectional ring network according to the number of nodes in the returned topology learning instruction message and the slave node device address or the ID when the receiving module receives the returned topology learning instruction message.
10. The apparatus according to claim 9, wherein the sending module is further configured to send the topology learning instruction packet according to a set time interval or a command triggering manner.
11. A slave node device is applied to a slave node device in a unidirectional serial bus network comprising a master node device and at least one slave node device; wherein, the master node equipment forms the unidirectional looped netowrk through unidirectional serial bus and at least one slave node equipment, its characterized in that, the device includes: the device comprises a receiving module, a mode switching module and a sending module; wherein,
the receiving module is used for receiving a first mode switching instruction message and a second mode switching instruction message;
the mode switching module is configured to switch a working mode to a receiving and forwarding working mode according to an instruction of a first mode switching instruction packet when the receiving module receives the first mode switching instruction packet, and instruct the sending module to forward the first mode switching instruction packet to a next-hop slave node device when the sending module is an intermediate slave node device; when the slave node device is the last hop slave node device, the sending module is instructed to return the first mode switching instruction message to the master node device;
the mode switching module is further configured to switch the working mode to a receive transparent transmission working mode according to an instruction of the second mode switching instruction message when the receiving module receives the second mode switching instruction message, and determine whether to forward the second mode switching instruction message; when the second mode switching instruction message is judged to be forwarded and the sending module is instructed to forward the second mode switching instruction message to the next hop slave node device when the sending module is an intermediate slave node device, and when the sending module is the last hop slave node device, the sending module is instructed to return the first mode switching instruction message to the master node device;
the sending module is configured to forward the first mode switching instruction packet to a next hop slave node device of the sending module according to an instruction of the mode switching module or return the first mode switching instruction packet to the master node device; according to the instruction of the mode switching module, the second mode switching instruction message is forwarded to the next hop slave node equipment of the second mode switching instruction message or returned to the master node equipment;
when the working mode is a receiving and forwarding working mode, processing the received service message, and judging whether to send the processed service message or not; and when the working mode is a receiving transparent transmission working mode, processing the received service message and simultaneously sending the service message.
12. The apparatus according to claim 11, wherein the receiving module is further configured to receive a topology learning instruction packet sent by the master node device after the mode switching module switches the operating mode to a receiving and forwarding operating mode;
the device further comprises:
the updating module is used for reading the number of nodes of slave node equipment in the topology learning instruction message, updating the number of the nodes after adding 1 to the number of the nodes, and adding the updated number of the nodes, the address of the self or the ID of the self equipment to the topology learning instruction message; and when the device is an intermediate slave node device, the sending module is instructed to forward the added topology learning instruction message to the next hop slave node device, and when the device is the last hop slave node device, the sending module is instructed to return the added topology learning instruction message to the master node device.
The sending module is further configured to forward the added topology learning instruction message to the next-hop slave node device according to the instruction of the updating module; or returning the added topology learning instruction message to the main node equipment according to the indication of the updating module.
13. A communication system for a unidirectional serial bus network, the system comprising: the system comprises a concentrator, at least one collector and at least one intelligent instrument; the concentrator comprises a master node device according to any one of claims 7 to 10, the collector comprises a master node device according to any one of claims 7 to 10 and a slave node device according to claim 11 or 12, and the smart meter comprises a slave node device according to claim 11 or 12; the concentrator and at least one collector form a unidirectional ring network through a unidirectional serial bus, and each collector and at least one intelligent instrument form a unidirectional ring sub-network through the unidirectional serial bus.
14. A communication system for a unidirectional serial bus network, the system comprising: a concentrator comprising a master node arrangement according to any of claims 7 to 10, at least one smart meter comprising a slave node arrangement according to claim 11 or 12; the concentrator and at least one intelligent instrument form a unidirectional ring network through a unidirectional serial bus.
CN201610456960.8A 2016-06-22 2016-06-22 A kind of mode switch control method, equipment and the system of unidirectional serial bus network Expired - Fee Related CN106059876B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610456960.8A CN106059876B (en) 2016-06-22 2016-06-22 A kind of mode switch control method, equipment and the system of unidirectional serial bus network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610456960.8A CN106059876B (en) 2016-06-22 2016-06-22 A kind of mode switch control method, equipment and the system of unidirectional serial bus network

Publications (2)

Publication Number Publication Date
CN106059876A true CN106059876A (en) 2016-10-26
CN106059876B CN106059876B (en) 2018-06-26

Family

ID=57169336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610456960.8A Expired - Fee Related CN106059876B (en) 2016-06-22 2016-06-22 A kind of mode switch control method, equipment and the system of unidirectional serial bus network

Country Status (1)

Country Link
CN (1) CN106059876B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110401732A (en) * 2019-07-29 2019-11-01 江西科然科技有限公司 Battery management system slave addresses distribution method, system, mobile terminal and storage medium
CN113918189A (en) * 2021-09-26 2022-01-11 所托(杭州)汽车智能设备有限公司 Program upgrading method for main ECU and sub-ECUs, main ECU and system
CN115277056A (en) * 2022-06-09 2022-11-01 宁波新胜中压电器有限公司 Method based on flow self-adaptive working mode and encryption and decryption device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
MX2023005606A (en) * 2020-11-13 2023-07-26 Assa Abloy Ab ARRANGEMENTS OF SECURE ELEMENTS IN INTERNET OF THINGS SYSTEMS.

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100182927A1 (en) * 2009-01-20 2010-07-22 Samsung Electronics Co. Ltd. Apparatus and method for transmitting control packet in broadband communication network
US20110299386A1 (en) * 2009-12-01 2011-12-08 Fujitsu Limited Apparatus and method for switching between redundant communication devices
CN102523310A (en) * 2012-01-04 2012-06-27 上海工业自动化仪表研究院 Multifunctional HART (Highway Addressable Remote Transducer) communication interface
US20120201254A1 (en) * 2011-01-14 2012-08-09 Alaxala Networks Corporation Network device and its control method and computer program product
CN104734780A (en) * 2014-12-29 2015-06-24 东莞市启鼎光电科技有限公司 Passive light-splitting RS-485 optical fiber bus local side system
CN104753596A (en) * 2014-12-29 2015-07-01 东莞市启鼎光电科技有限公司 Multi-port terminal of passive beam splitting RS-485 optical fiber bus
CN204480459U (en) * 2015-01-13 2015-07-15 烟台智慧云谷云计算有限公司 A kind of remote automatic meter reading system
CN104881982A (en) * 2015-05-06 2015-09-02 上海应时为节能科技有限公司 Intelligent meter data acquiring system having self-adaptive meter reading strategy and acquiring method of intelligent meter data acquiring system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100182927A1 (en) * 2009-01-20 2010-07-22 Samsung Electronics Co. Ltd. Apparatus and method for transmitting control packet in broadband communication network
US20110299386A1 (en) * 2009-12-01 2011-12-08 Fujitsu Limited Apparatus and method for switching between redundant communication devices
US20120201254A1 (en) * 2011-01-14 2012-08-09 Alaxala Networks Corporation Network device and its control method and computer program product
CN102523310A (en) * 2012-01-04 2012-06-27 上海工业自动化仪表研究院 Multifunctional HART (Highway Addressable Remote Transducer) communication interface
CN104734780A (en) * 2014-12-29 2015-06-24 东莞市启鼎光电科技有限公司 Passive light-splitting RS-485 optical fiber bus local side system
CN104753596A (en) * 2014-12-29 2015-07-01 东莞市启鼎光电科技有限公司 Multi-port terminal of passive beam splitting RS-485 optical fiber bus
CN204480459U (en) * 2015-01-13 2015-07-15 烟台智慧云谷云计算有限公司 A kind of remote automatic meter reading system
CN104881982A (en) * 2015-05-06 2015-09-02 上海应时为节能科技有限公司 Intelligent meter data acquiring system having self-adaptive meter reading strategy and acquiring method of intelligent meter data acquiring system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
NAOYA WADA等: "《Optical packet and circuit integrated ring network with wavelength resources boundary control》", 《IEEE 2014 16TH INTERNATIONAL CONFERENCE ON TRANSPARENT OPTICAL NETWORKS (ICTON)》 *
杨正进: "《基于在EPON的用电信息采集终端设计与实现》", 《中国优秀硕士学位论文全文数据库工程科技Ⅱ辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110401732A (en) * 2019-07-29 2019-11-01 江西科然科技有限公司 Battery management system slave addresses distribution method, system, mobile terminal and storage medium
CN113918189A (en) * 2021-09-26 2022-01-11 所托(杭州)汽车智能设备有限公司 Program upgrading method for main ECU and sub-ECUs, main ECU and system
CN115277056A (en) * 2022-06-09 2022-11-01 宁波新胜中压电器有限公司 Method based on flow self-adaptive working mode and encryption and decryption device
CN115277056B (en) * 2022-06-09 2024-02-20 宁波新胜中压电器有限公司 Method based on flow self-adaptive working mode and encryption and decryption device

Also Published As

Publication number Publication date
CN106059876B (en) 2018-06-26

Similar Documents

Publication Publication Date Title
RU2447508C2 (en) Selective switching-on of field devices in lowvoltage wireless cellular network
TWI641249B (en) Data forwarding method and node equipment for grid network
EP2652905B1 (en) Increased communication opportunities with low-contact nodes in a computer network
ATE409911T1 (en) STATE MIGRATION IN MULTIPLE NIC RDMA DEVICES
CN106059876B (en) A kind of mode switch control method, equipment and the system of unidirectional serial bus network
JP7323031B2 (en) Wireless sensor system and communication control method
CN105959216B (en) A kind of communication means, the apparatus and system of unidirectional serial bus network
CN108029155B (en) mesh network node
WO2017135164A1 (en) Control system, communication method, communication device, and terminal device
CN108322391B (en) Data transmission method based on flow table
CN115550237A (en) A data processing method and related device
JP5868551B2 (en) Wireless communication system and wireless communication method
EP3384695B1 (en) Handling of devices based on group membership
CN105959227B (en) A kind of the topology learning method, apparatus and system of unidirectional serial bus network
CN108494687B (en) Wifi-based multi-path networking communication method and system for electric power information physical system
US10003469B2 (en) Multicast forwarding method and apparatus in transparent interconnection of lots of link network, and routing bridge
JP2016225837A (en) Multi-hop communication system, communication device and communication method
JP6246427B2 (en) Wireless communication device
JP6017993B2 (en) Power management apparatus, communication control apparatus, power management system, and power management method
CN114449457B (en) Data transmission method, node equipment and system based on chain network
RU61447U1 (en) WIRELESS INFORMATION COLLECTION SYSTEM FROM INTEGRATED SENSORS
JP2016158074A (en) Communication system and communication device
JP2014072538A (en) Relay device and network system
Bettencourt A System for Performance Measurement of PicoRadio Network Protocol
JP2014150478A (en) Wireless sensor network system, wireless terminal, and data collection method using wireless sensor network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180626

Termination date: 20210622