CN111371869A - Multi-channel communication monitoring method based on intelligent multi-channel gateway - Google Patents

Multi-channel communication monitoring method based on intelligent multi-channel gateway Download PDF

Info

Publication number
CN111371869A
CN111371869A CN202010122172.1A CN202010122172A CN111371869A CN 111371869 A CN111371869 A CN 111371869A CN 202010122172 A CN202010122172 A CN 202010122172A CN 111371869 A CN111371869 A CN 111371869A
Authority
CN
China
Prior art keywords
entering
channel
gateway
descriptor
path
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.)
Pending
Application number
CN202010122172.1A
Other languages
Chinese (zh)
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.)
Shanxi Kunbo Times Information Technology Co ltd
Original Assignee
Shanxi Kunbo Times Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanxi Kunbo Times Information Technology Co ltd filed Critical Shanxi Kunbo Times Information Technology Co ltd
Priority to CN202010122172.1A priority Critical patent/CN111371869A/en
Publication of CN111371869A publication Critical patent/CN111371869A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Abstract

The invention discloses a multipath communication monitoring method based on an intelligent multipath gateway, which initializes each path of communication of the intelligent multipath gateway and saves a descriptor of each path of communication; creating a descriptor set; newly building a thread and initializing the thread; initializing a descriptor set; adding the descriptor of each road channel to a descriptor set; a congestion monitoring descriptor; testing whether each path of communication is readable; and reading and processing the data. The multi-channel communication monitoring method based on the intelligent multi-channel gateway simplifies the flow of receiving external interface data and reduces the expenditure of system resources; the interaction efficiency of the system and the external interface is improved, and the problem that the intelligent gateway cannot timely receive and process the external interface data is effectively solved.

Description

Multi-channel communication monitoring method based on intelligent multi-channel gateway
Technical Field
The invention relates to the technical field of Internet of things, in particular to a multi-channel communication monitoring method based on an intelligent multi-channel gateway.
Background
The intelligent gateway is a new network device generated after the rise of the internet of things in recent years. Different from the router gateway in the internet era, besides the internet of things, the router gateway is also required to be compatible with various internet of things protocols and establish a network with interconnected devices. However, unlike the conventional router-like gateway, it also faces more protocol conversions and cannot completely rely on the internet (cloud) to implement various scene functions, because the internet of things needs to drive many local devices, and the delay requirement on the network is more strict. The intelligent gateway is provided with external interfaces such as a plurality of RS232 serial ports, an RS485 serial port, an RS422 serial port, a CAN port, a DI/DO port, a network port, an AI port and an IO port. When reading external interface data, the conventional method is to open a thread for each external interface and perform blocking data reading, the process is shown in fig. 1, the system switches between each thread in a polling manner, time overhead of a CPU is increased, and an intelligent gateway cannot timely receive and process the external interface data, which is an important problem to be solved by the intelligent gateway.
Disclosure of Invention
In order to solve the defects and shortcomings of the prior art, the multi-channel communication monitoring method based on the intelligent multi-channel gateway is provided, so that the interaction efficiency of a system and an external interface is improved, and the problem that the intelligent gateway cannot timely receive and process external interface data is effectively solved.
The invention provides a multi-channel communication monitoring method based on an intelligent multi-channel gateway, which comprises the following steps:
step 1, initializing each path of communication of the intelligent multi-path gateway, if the initialization is successful, storing a descriptor of each path of communication of the intelligent multi-path gateway, and entering step 2, otherwise, entering step 10;
step 2, establishing a descriptor set and initializing the descriptor set; if the descriptor set is created and initialized successfully, entering step 3, otherwise, entering step 10;
step 3, a thread is newly built and initialized; if the thread is created and initialized successfully, entering step 4, otherwise, entering step 10;
step 4, initializing the descriptor set in the step 2, and entering the step 5;
step 5, adding the descriptor of each channel of the initialized intelligent multi-channel gateway into a descriptor set in sequence, and entering step 6;
step 6, monitoring descriptors of each path of channels in a blocking mode, entering step 7 if normal data return exists, and otherwise, repeatedly executing step 10;
step 7, sequentially testing whether each channel is readable, if the data of the channel is readable, entering step 8, otherwise, entering step 9;
step 8, reading the data of the channel which can be read by the data in the step 7, calling a data processing function for processing, and entering the step 9 after the processing is finished;
step 9, judging whether all the current channels finish the reading and processing of the data, if so, entering step 4, otherwise, entering step 7;
and step 10, ending the software process and reporting the abnormal operation of the software.
The invention has the beneficial effects that:
compared with the prior art, the multi-channel communication monitoring method based on the intelligent multi-channel gateway simplifies the flow of receiving external interface data and reduces the expenditure of system resources; the interaction efficiency of the system and the external interface is improved, and the problem that the intelligent gateway cannot timely receive and process the external interface data is effectively solved.
Drawings
The following detailed description of embodiments of the invention is provided in conjunction with the appended drawings, in which:
FIG. 1 is a flow chart of a conventional multi-channel communication monitoring software;
FIG. 2 is a software flow diagram of the present invention.
Detailed Description
As shown in fig. 1 and fig. 2, the present invention provides a multipath communication monitoring method based on an intelligent multipath gateway, which comprises the following specific steps:
step 1, calling a system interface open () to open each path of RS232 and RS422 serial ports of the intelligent multi-path gateway, and calling a tcsetattr () function to set parameters such as baud rate, data bits, check bits and stop bits of each path of serial ports; calling a system interface open () function to open each path of CAN port, and setting the working mode, frame data type, baud rate, shielding code and check code of each path of CAN port; calling a system interface to initialize each network port; setting a port number of each path of network communication; initializing each path of DI/DO port, AI port and IO port; if all external interfaces are initialized successfully, storing the descriptor of each external interface, and entering the step 2, otherwise, entering the step 10;
step 2, calling a system interface function FD _ set () to create a descriptor set, and calling a function FD _ ZERO () to initialize the descriptor set; if the descriptor set is created and initialized successfully, entering step 3, otherwise, entering step 10;
step 3, calling a function pthread _ create () to create a thread and initializing; if the thread is newly built and initialized successfully, entering step 4, otherwise, entering step 10;
step 4, calling a function FD _ ZERO () to initialize a descriptor set, and entering step 5;
step 5, calling a function FD _ SET () to sequentially add the descriptor of each path of initialized channel into a descriptor SET, and entering step 6;
step 6, calling a blocking function select () to monitor the communication of each channel in the descriptor set, if any channel has data, entering step 7, otherwise, repeatedly executing step 10;
step 7, calling a function FD _ ISSET () to sequentially test whether each path of channel has readable data, if so, entering a step 8, otherwise, entering a step 9;
step 8, calling a function read () to read the data of the channel, calling a data processing function for processing, and entering step 9 after the processing is finished;
step 9, judging whether all the current channels finish the reading and processing of the data, if so, entering step 4, otherwise, entering step 7;
and step 10, ending the software process and reporting the abnormal operation of the software.
The above embodiments are not limited to the technical solutions of the embodiments themselves, and the embodiments may be combined with each other into a new embodiment. The above embodiments are only for illustrating the technical solutions of the present invention and are not limited thereto, and any modification or equivalent replacement without departing from the spirit and scope of the present invention should be covered within the technical solutions of the present invention.

Claims (1)

1. A multipath communication monitoring method based on an intelligent multipath gateway is characterized in that: the method comprises the following steps:
step 1, initializing each path of communication of the intelligent multi-path gateway, if the initialization is successful, storing a descriptor of each path of communication of the intelligent multi-path gateway, and entering step 2, otherwise, entering step 10;
step 2, establishing a descriptor set and initializing the descriptor set; if the descriptor set is created and initialized successfully, entering step 3, otherwise, entering step 10;
step 3, a thread is newly built and initialized; if the thread is created and initialized successfully, entering step 4, otherwise, entering step 10;
step 4, initializing the descriptor set in the step 2, and entering the step 5;
step 5, adding the descriptor of each channel of the initialized intelligent multi-channel gateway into a descriptor set in sequence, and entering step 6;
step 6, monitoring descriptors of each path of channels in a blocking mode, entering step 7 if normal data return exists, and otherwise, repeatedly executing step 10;
step 7, sequentially testing whether each channel is readable, if the data of the channel is readable, entering step 8, otherwise, entering step 9;
step 8, reading the data of the channel which can be read by the data in the step 7, calling a data processing function for processing, and entering the step 9 after the processing is finished;
step 9, judging whether all the current channels finish the reading and processing of the data, if so, entering step 4, otherwise, entering step 7;
and step 10, ending the software process and reporting the abnormal operation of the software.
CN202010122172.1A 2020-02-26 2020-02-26 Multi-channel communication monitoring method based on intelligent multi-channel gateway Pending CN111371869A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010122172.1A CN111371869A (en) 2020-02-26 2020-02-26 Multi-channel communication monitoring method based on intelligent multi-channel gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010122172.1A CN111371869A (en) 2020-02-26 2020-02-26 Multi-channel communication monitoring method based on intelligent multi-channel gateway

Publications (1)

Publication Number Publication Date
CN111371869A true CN111371869A (en) 2020-07-03

Family

ID=71210107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010122172.1A Pending CN111371869A (en) 2020-02-26 2020-02-26 Multi-channel communication monitoring method based on intelligent multi-channel gateway

Country Status (1)

Country Link
CN (1) CN111371869A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116165352A (en) * 2023-04-23 2023-05-26 河北华清环境科技集团股份有限公司 Quality control system of flue gas on-line monitor

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020052935A1 (en) * 1998-08-17 2002-05-02 Frank V. Paxhia System and method for an administration server
CN1975680A (en) * 2006-11-27 2007-06-06 浙江大学 Method for realizing interprocess asynchronous communication based on Java
CN103200249A (en) * 2013-03-26 2013-07-10 大连理工大学 Method for achieving Internet of things intelligent data gateway system
US20130318042A1 (en) * 2012-05-24 2013-11-28 Microsoft Corporation Techniques to automatically manage file descriptors
CN104363168A (en) * 2014-12-05 2015-02-18 中国北车集团大连机车研究所有限公司 Locomotive mounted general data communication gateway
CN104427644A (en) * 2013-08-30 2015-03-18 武汉智麟信息技术有限公司 Zigbee-based gateway for Internet of Things
CN106708762A (en) * 2015-11-18 2017-05-24 厦门雅迅网络股份有限公司 Unified management system and method for serial devices in LINUX
CN106878459A (en) * 2017-03-24 2017-06-20 深圳安邦科技有限公司 The intelligent networking gateway implementation method and its equipment of a kind of self adaptation
CN108319438A (en) * 2017-01-16 2018-07-24 北京视联动力国际信息技术有限公司 A kind of method and apparatus of audio data collecting
CN108933716A (en) * 2018-06-20 2018-12-04 山东大学 Cloud interactive gateway, communication means and smart home system based on OpenWrt

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020052935A1 (en) * 1998-08-17 2002-05-02 Frank V. Paxhia System and method for an administration server
CN1975680A (en) * 2006-11-27 2007-06-06 浙江大学 Method for realizing interprocess asynchronous communication based on Java
US20130318042A1 (en) * 2012-05-24 2013-11-28 Microsoft Corporation Techniques to automatically manage file descriptors
CN103200249A (en) * 2013-03-26 2013-07-10 大连理工大学 Method for achieving Internet of things intelligent data gateway system
CN104427644A (en) * 2013-08-30 2015-03-18 武汉智麟信息技术有限公司 Zigbee-based gateway for Internet of Things
CN104363168A (en) * 2014-12-05 2015-02-18 中国北车集团大连机车研究所有限公司 Locomotive mounted general data communication gateway
CN106708762A (en) * 2015-11-18 2017-05-24 厦门雅迅网络股份有限公司 Unified management system and method for serial devices in LINUX
CN108319438A (en) * 2017-01-16 2018-07-24 北京视联动力国际信息技术有限公司 A kind of method and apparatus of audio data collecting
CN106878459A (en) * 2017-03-24 2017-06-20 深圳安邦科技有限公司 The intelligent networking gateway implementation method and its equipment of a kind of self adaptation
CN108933716A (en) * 2018-06-20 2018-12-04 山东大学 Cloud interactive gateway, communication means and smart home system based on OpenWrt

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116165352A (en) * 2023-04-23 2023-05-26 河北华清环境科技集团股份有限公司 Quality control system of flue gas on-line monitor

Similar Documents

Publication Publication Date Title
CN107911237B (en) DPDK-based rapid detection method for data packets in user space
CN109309599B (en) Method for realizing high-concurrency communication of Internet of things equipment based on street lamp hardware platform
US20150131445A1 (en) Similarity matching method and related device and communication system
US20170063651A1 (en) Centralized troubleshooting tool in distributed virtual network
US10333797B2 (en) Centralized troubleshooting tool in distributed virtual network
WO2024021495A1 (en) Method and apparatus for identifying flooding attack in cloud platform, and device and storage medium
CN100466556C (en) Network device management method and system
CN113852644A (en) Deterministic network equipment identification and authentication device and method
CN111371869A (en) Multi-channel communication monitoring method based on intelligent multi-channel gateway
CN109587255B (en) Method, system and storage medium for constructing service dependency graph
Setiawan et al. 6LoWPAN performance analysis of IoT software-defined-network-based using mininet-Io
CN112437028A (en) Method and system for expanding multiple network ports of embedded system
GB2532053A (en) NC-SI port controller
CN109474540A (en) A kind of method and device identifying OPC flow
CN112039746A (en) Industrial control network system
US20170060665A1 (en) Centralized troubleshooting tool in distributed virtual network
CN116723058B (en) Network attack detection and protection method and device
CN110365551B (en) Network information acquisition method, device, equipment and medium
CN110958590B (en) Heterogeneous equipment integrated system based on multi-protocol edge computing gateway
CN115033407B (en) System and method for collecting and identifying flow suitable for cloud computing
CN108306757B (en) Programmable data plane virtual layer construction method and storage medium
CN111880769B (en) Abstract description method suitable for Internet of things application system interface and application thereof
CN112486706B (en) Internet of things local equipment linkage method based on MQTT message driving mechanism
CN114979058A (en) CAN multi-mailbox multiplexing processing method and system
CN111106977B (en) Data stream detection method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200703

RJ01 Rejection of invention patent application after publication