CN113111016A - Single channel device communication middleware - Google Patents

Single channel device communication middleware Download PDF

Info

Publication number
CN113111016A
CN113111016A CN202110417741.XA CN202110417741A CN113111016A CN 113111016 A CN113111016 A CN 113111016A CN 202110417741 A CN202110417741 A CN 202110417741A CN 113111016 A CN113111016 A CN 113111016A
Authority
CN
China
Prior art keywords
message
communication
user
equipment
middleware
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
CN202110417741.XA
Other languages
Chinese (zh)
Other versions
CN113111016B (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.)
Nanjing Yihui Information Technology Co ltd
Original Assignee
Nanjing Yihui 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 Nanjing Yihui Information Technology Co ltd filed Critical Nanjing Yihui Information Technology Co ltd
Priority to CN202110417741.XA priority Critical patent/CN113111016B/en
Publication of CN113111016A publication Critical patent/CN113111016A/en
Application granted granted Critical
Publication of CN113111016B publication Critical patent/CN113111016B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4081Live connection to bus, e.g. hot-plugging
    • 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/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • G06F9/4413Plug-and-play [PnP]
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a single-channel equipment communication middleware, which forms a communication channel between application and equipment drivers, manages equipment of the same type and supports a plurality of users to use; when a user service or application opens the virtual equipment of the communication middleware, setting a concerned message mask and used communication equipment; the communication middleware operates corresponding communication equipment according to parameters transmitted by user service or application and establishes a dedicated message receiving and transmitting queue of the service or application; when the communication equipment receives the data, checking whether the message is in accordance with the message mask concerned by the user, if so, sending the message to the user, and thus, sequentially sending the message to each user; when the user sends a message, if the local loop is opened, the sent message can also be received by other users who use the same device in the same system and are concerned about the message, and then the sent message is sent out by the device. The invention avoids the shortage of hardware resources, and ensures the real-time performance of message transmission while supporting a plurality of service accesses.

Description

Single channel device communication middleware
Technical Field
The invention relates to the technical field of embedded communication, in particular to communication middleware of single-channel equipment.
Background
In recent years, with the continuous development of electronic technology, the integration of modern electronic equipment systems has entered a new era, the modular highly Integrated (IME) system integration era. The electronic system with complicated components of the reconfigurable universal modules is beneficial to improving the usability of the system, increasing the success rate of the system, and greatly reducing the volume/quality/power consumption and the life cycle cost of the system. The traditional single-channel communication equipment is applied to complex electronic systems, such as can and uart, the input and output of a single channel of the traditional single-channel communication equipment can not meet complex requirements more and more, can not support simultaneous input and output of a plurality of services, can only be solved by increasing the number of the equipment, and hardware cost and more unreliable factors are increased.
At present, the single channel communication device is used in the following way: character device: support input and output of a single service or application; a network device: such as can equipment, joined to the network equipment can be shared by multi-user services or applications;
both of these approaches have their own drawbacks and deficiencies: character device: only single service or application use is supported, and under the condition that task migration of a highly integrated electronic system and hardware resources of single-channel communication equipment are limited, simultaneous use of a plurality of services cannot be met; a network device: although multiple devices can be supported, the timeliness and real-time performance of messages are not guaranteed after passing through a network protocol stack, and for devices in the embedded field, the use of the network protocol stack is not supported due to the shortage of certain hardware resources.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, the technical problem to be solved by the present invention is to provide a single channel device communication middleware, which is added to a single operating device to solve the communication problem of using a single channel communication device simultaneously by multiple services or applications.
In order to achieve the above object, the present invention provides a single-channel device communication middleware, which forms a communication channel between an application and a device driver, so as to manage the same type of devices and support the use of multiple users; when a user service or application opens the virtual equipment of the communication middleware, setting a concerned message mask and used communication equipment; the communication middleware operates corresponding communication equipment according to parameters transmitted by user service or application and establishes a dedicated message receiving and transmitting queue of the service or application; when the communication equipment receives the data, checking whether the message is in accordance with the message mask concerned by the user, if so, sending the message to the user, and sending the message to each user in turn in the manner; when the user sends a message, if the local loop is opened, the sent message can also be received by other users who use the same device in the same system and are concerned about the message, and then the sent message is sent out by the device.
Preferably, the communication middleware exists in the device driver in the form of a virtual device and is hot-pluggable.
Preferably, the communication middleware performs two-stage message filtering on the communication message.
Preferably, the communication middleware performs centralized management and use on the same type of communication equipment, and the application layer can reuse the drive communication interface to perform a series of operations.
Preferably, the number of the communication devices corresponding to the device driver is one, the number of the applications is multiple, and data channels between the multiple applications are isolated from each other.
Preferably, the communication middleware supports four operations of a user service or application: virtual device on, virtual device off, send message, and receive message.
Preferably, the operation of opening the virtual device specifically includes: when the virtual device of the user operation communication middleware is opened, checking whether the communication device exists in the system, if so, continuing the subsequent operation, and the communication middleware creates an exclusive message queue and a message mask for the user, joins the message queue set of the communication device, and merges the message mask and the global mask of the device; when the communication device is operated by a user for the first time, a transceiving task for the communication device is created to process transceiving matters of the communication device.
Preferably, the operation of closing the virtual device specifically includes: when the virtual device of the communication middleware operated by a user is closed, the communication middleware deletes the exclusive message queue and the message mask in the message queue set of the corresponding communication device, and if the deleted message queue is the last message queue in the message queue set, the communication middleware informs the receiving and sending task of the corresponding communication device to close the device and quit.
Preferably, the operation of sending the message specifically includes: when the sending task detects that a new message is sent by a user, receiving the message; if the local loop is opened, the new message is forwarded to the receiving task, then the message is sent to the communication equipment, sent out by the communication equipment, and then the new message is continuously waited for.
Preferably, the operation of receiving the message specifically includes:
when the receiving task detects that a new message is received, confirming a source of the received message, if the local loopback is opened and the message is forwarded, receiving, and if the communication equipment has the new message, receiving the equipment message;
obtaining the matching of the new message and the global mask of the equipment, if the matching is unsuccessful, continuing to wait for the new message, otherwise, continuing the next operation;
searching an effective message queue in a message queue set of the equipment, matching a message mask corresponding to the message queue by using the new message, forwarding the message queue to the corresponding message queue if the matching is successful, receiving the message by user service or application, searching a next effective message queue in the message queue set after the matching is unsuccessful or the transmission is completed, sequentially matching and transmitting until the message queue set is traversed, and continuously waiting for the arrival of the next new message.
The invention has the beneficial effects that:
1. the method supports a plurality of users to use the same communication equipment, and ensures that the users do not interfere with each other;
2. resource competition of equipment in a large system is reduced;
3. the hardware cost is reduced, and the uncertainty caused by hardware upgrading is reduced; the shortage of hardware resources is avoided, and the real-time performance of message transmission is ensured while supporting a plurality of service accesses;
4. the problem that the same equipment is used in the process of task migration in the IMA system is solved;
5. the same type of equipment can be managed in a centralized way, so that the complexity of user program codes is reduced;
6. the communication middleware supports hot plug, replacement, upgrade and addition of interface equipment, does not need to restart the system, and increases the reliability of the system.
The conception, the specific structure and the technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, the features and the effects of the present invention.
Drawings
FIG. 1 is a software architecture diagram of the present invention.
FIG. 2 is a flow chart of the user open operation software of the present invention.
FIG. 3 is a flow chart of the user shutdown software of the present invention.
FIG. 4 is a flow chart of the send task software in the communication middleware of the present invention.
FIG. 5 is a flow chart of the receive task software in the communication middleware of the present invention.
Detailed Description
As shown in fig. 1, the present invention provides a single-channel device communication middleware, where the communication middleware forms a communication channel between an application and a device driver, so as to manage the same type of device and support multiple users to use, and as shown in the figure, the device driver corresponds to one communication device, the application is multiple, and the data channels between multiple applications are isolated from each other; when a user service or application opens the virtual equipment of the communication middleware, setting a concerned message mask and used communication equipment; the communication middleware operates corresponding communication equipment according to parameters transmitted by user service or application and establishes a dedicated message receiving and transmitting queue of the service or application; when the communication equipment receives the data, checking whether the message is in accordance with the message mask concerned by the user, if so, sending the message to the user, and sending the message to each user in turn in the manner; when the user sends the message, if the local loop is opened, the sent message can also be received by other users who use the same device in the same system and are concerned about the message, and then the message is sent out by the communication device.
The communication middleware carries out two-stage message filtering on communication messages, the communication middleware carries out centralized management and use on the same type of communication equipment, and the application layer multiplexes a driving communication interface to carry out a series of operations.
Meanwhile, the communication middleware exists in the device driver in the form of a virtual device, and can be hot-plugged, and the embedded system driver hot-plugging support principle is as follows:
this function is implemented based on the hot plug function of the SylixOS because in existing other embedded systems, none of the kernel threads in the kernel are used to detect changes in the interface of the industrial bus, and the driver part code must run under the kernel thread.
The principle that the SylixOS system supports hot-plugging is as follows:
1. a thread specially detecting the bus state is arranged in the kernel state;
2. after detecting the change of the bus state, the bus equipment type can be read;
3. after reading the device type, calling a driver corresponding to the system in a kernel mode, and creating the current device on the system;
4. completing the device driving, wherein the kernel hot-plug thread can send a module insertion signal to the concerned application process;
5. after the application process receives the module insertion signal, the inserted module can be used, and hot plug use of the equipment is completed.
The principle that the SylixOS system supports hot-plugging is as follows:
1. when the application program of the driver is used, a plug-pull event of the driver is registered when the application program is powered on;
2. when the sub-module is unplugged, the kernel hot plug thread can sense the sub-module through the detection bus pin;
3. when the module is sensed to be pulled away, the kernel hot plug thread sends a module pulling event signal to the registered application thread;
4. and the application thread receives the module pulling signal and then closes the use of the sub-module, thereby completing the hot-plug isolation of the equipment.
As shown in fig. 2-5, the communication middleware supports four operations of a user service or application: virtual device on, virtual device off, send message, and receive message.
As shown in fig. 2, the flow chart of the software for opening operation by the user specifically includes: when the virtual device of the user operation communication middleware is opened, checking whether the communication device exists in the system, if so, continuing the subsequent operation, and the communication middleware creates an exclusive message queue and a message mask for the user, joins the message queue set of the communication device, and merges the message mask and the global mask of the device; when the communication device is operated by a user for the first time, a transceiving task for the communication device is created to process transceiving matters of the communication device.
As shown in fig. 3, the software flow chart for the user shutdown operation is specifically that: when the virtual device of the communication middleware operated by a user is closed, the communication middleware deletes the exclusive message queue and the message mask in the message queue set of the corresponding communication device, and if the deleted message queue is the last message queue in the message queue set, the communication middleware informs the receiving and sending task of the corresponding communication device to close the device and quit.
Fig. 4 shows a flow chart of task sending software in the communication middleware, and the operation of sending a message specifically includes: when the sending task detects that a new message is sent by a user, receiving the message; if the local loop is opened, the new message is forwarded to the receiving task, then the message is sent to the communication equipment, sent out by the equipment, and then the new message is continuously waited for.
The flow chart of the software for receiving tasks in the communication middleware is shown in FIG. 5: the operation of receiving the message specifically comprises:
when the receiving task detects that a new message is received, confirming a source of the received message, if the local loopback is opened and the message is forwarded, receiving, and if the communication equipment has the new message, receiving the equipment message;
obtaining the matching of the new message and the global mask of the equipment, if the matching is unsuccessful, continuing to wait for the new message, otherwise, continuing the next operation;
searching an effective message queue in a message queue set of the equipment, matching a message mask corresponding to the message queue by using the new message, forwarding the message queue to the corresponding message queue if the matching is successful, receiving the message by user service or application, searching a next effective message queue in the message queue set after the matching is unsuccessful or the transmission is completed, sequentially matching and transmitting until the message queue set is traversed, and continuously waiting for the arrival of the next new message.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

Claims (10)

1. Single channel equipment communication middleware, its characterized in that: the communication middleware forms a communication channel between the application and the equipment driver, so as to manage the same type of equipment and support a plurality of users to use; when a user service or application opens a virtual device of a communication middleware, setting a concerned message mask and a used communication device thereof, operating the corresponding communication device by the communication middleware according to parameters transmitted by the user service or application, and establishing a dedicated message receiving and transmitting queue of the service or application; when the communication equipment receives the data, checking whether the message is in accordance with the message mask concerned by the user, if so, sending the message to the user, and sending the message to each user in turn in the manner; when the user sends a message, if the local loop is opened, the sent message can also be received by other users who use the same device in the same system and are concerned about the message, and then the sent message is sent out by the device.
2. The single channel device communication middleware of claim 1, wherein: the communication middleware exists in the device driver in the form of a virtual device and can be hot-plugged.
3. The single channel device communication middleware of claim 1, wherein: the communication middleware performs two-stage message filtering on the communication message.
4. The single channel device communication middleware of claim 1, wherein: the communication middleware is used for centralized management and use of the same type of communication equipment, and the application layer can reuse the drive communication interface to carry out a series of operations.
5. The single channel device communication middleware of claim 1, wherein: the device driver comprises one corresponding communication device, the application comprises a plurality of applications, and data channels among the applications are isolated from each other.
6. The single channel device communication middleware of claim 1, wherein: the communication middleware supports four operations of user service or application: virtual device on, virtual device off, send message, and receive message.
7. The single channel device communication middleware of claim 6, wherein the virtual device is turned on by: when the virtual device of the user operation communication middleware is opened, checking whether the communication device exists in the system, if so, continuing the subsequent operation, and the communication middleware creates an exclusive message queue and a message mask for the user, joins the message queue set of the communication device, and merges the message mask and the global mask of the communication device; when the communication device is operated by a user for the first time, a transceiving task for the communication device is created to process transceiving matters of the communication device.
8. The single channel device communication middleware of claim 6, wherein the virtual device shutdown is specifically: when the virtual device of the communication middleware operated by a user is closed, the communication middleware deletes the exclusive message queue and the message mask in the message queue set of the corresponding communication device, and if the deleted message queue is the last message queue in the message queue set, the communication middleware informs the receiving and sending task of the corresponding communication device to close the device and quit.
9. The single channel device communication middleware of claim 6, wherein the operation of sending messages is specifically: when the sending task detects that a new message is sent by a user, receiving the message; if the local loop is opened, the new message is forwarded to the receiving task, then the message is sent to the communication equipment, sent out by the communication equipment, and then the new message is continuously waited for.
10. The single channel device communication middleware of claim 6, wherein the operation of receiving messages is specifically:
when the receiving task detects that a new message is received, the source of the received message is confirmed, if the local loopback is opened and the message is forwarded, the message is received, and if the communication equipment has the new message, the message of the communication equipment is received;
obtaining the matching of the new message and the global mask of the equipment, if the matching is unsuccessful, continuing to wait for the new message, otherwise, continuing the next operation;
searching an effective message queue in a message queue set of the equipment, matching a message mask corresponding to the message queue by using the new message, forwarding the message queue to the corresponding message queue if the matching is successful, receiving the message by user service or application, searching a next effective message queue in the message queue set after the matching is unsuccessful or the transmission is completed, sequentially matching and transmitting until the message queue set is traversed, and continuously waiting for the arrival of the next new message.
CN202110417741.XA 2021-04-19 2021-04-19 Single channel equipment communication middleware Active CN113111016B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110417741.XA CN113111016B (en) 2021-04-19 2021-04-19 Single channel equipment communication middleware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110417741.XA CN113111016B (en) 2021-04-19 2021-04-19 Single channel equipment communication middleware

Publications (2)

Publication Number Publication Date
CN113111016A true CN113111016A (en) 2021-07-13
CN113111016B CN113111016B (en) 2024-06-11

Family

ID=76718312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110417741.XA Active CN113111016B (en) 2021-04-19 2021-04-19 Single channel equipment communication middleware

Country Status (1)

Country Link
CN (1) CN113111016B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050180455A1 (en) * 2004-02-02 2005-08-18 Vladimir Startsev Apparatus and method for multiplexing communication signals
CN101969475A (en) * 2010-11-15 2011-02-09 张军 Business data controllable distribution and fusion application system based on cloud computing
WO2017209854A1 (en) * 2016-05-31 2017-12-07 Brocade Communications Systems, Inc. Hot-plug hardware and software implementation
CN109918148A (en) * 2019-02-21 2019-06-21 上海伊巢网络科技有限公司 The component dynamic pluggable system of Internet of things middleware
CN110851116A (en) * 2018-08-20 2020-02-28 北京航天长峰科技工业集团有限公司 Embedded system message interaction middleware
CN111416736A (en) * 2020-03-12 2020-07-14 北京星网锐捷网络技术有限公司 Configuration management method and device of network equipment, computing equipment and storage medium
CN111694789A (en) * 2020-04-22 2020-09-22 西安电子科技大学 Embedded reconfigurable heterogeneous determination method, system, storage medium and processor
CN111835565A (en) * 2020-07-06 2020-10-27 重庆金美通信有限责任公司 Communication network optimization method, device and system based on digital twin

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050180455A1 (en) * 2004-02-02 2005-08-18 Vladimir Startsev Apparatus and method for multiplexing communication signals
CN101969475A (en) * 2010-11-15 2011-02-09 张军 Business data controllable distribution and fusion application system based on cloud computing
WO2017209854A1 (en) * 2016-05-31 2017-12-07 Brocade Communications Systems, Inc. Hot-plug hardware and software implementation
CN108139924A (en) * 2016-05-31 2018-06-08 博科通讯系统有限公司 Hot plug hardware and Software implementations
CN110851116A (en) * 2018-08-20 2020-02-28 北京航天长峰科技工业集团有限公司 Embedded system message interaction middleware
CN109918148A (en) * 2019-02-21 2019-06-21 上海伊巢网络科技有限公司 The component dynamic pluggable system of Internet of things middleware
CN111416736A (en) * 2020-03-12 2020-07-14 北京星网锐捷网络技术有限公司 Configuration management method and device of network equipment, computing equipment and storage medium
CN111694789A (en) * 2020-04-22 2020-09-22 西安电子科技大学 Embedded reconfigurable heterogeneous determination method, system, storage medium and processor
CN111835565A (en) * 2020-07-06 2020-10-27 重庆金美通信有限责任公司 Communication network optimization method, device and system based on digital twin

Also Published As

Publication number Publication date
CN113111016B (en) 2024-06-11

Similar Documents

Publication Publication Date Title
CN101403981B (en) Management method and system for mobile phone application program running state
CN1331065C (en) Method and apparatus for power mode transition in a multi-theread processor
US20100049881A1 (en) Universal serial bus (usb) remote wakeup
CN106095064B (en) A kind of mobile terminal forbids applying the method and system of the specific broadcast of reception
CN114153783B (en) Method, system, computer device and storage medium for implementing multi-core communication mechanism
CN115794313A (en) Virtual machine debugging method, system, electronic equipment and storage medium
CN111881044A (en) Automatic matching test case system according to configuration file
CN101252733B (en) Communicating method and communicating circuit between mobile terminal and modules
CN113111016A (en) Single channel device communication middleware
WO2023051315A1 (en) Application control method and apparatus, electronic device, and storage medium
CN113564865A (en) Remote control method and device for washing machine, electronic equipment and storage medium
CN108337285B (en) Communication system and communication method
CN100386751C (en) USB device automatic initialization method and device
CN110515662A (en) Long-range control method, system, equipment and the readable storage medium storing program for executing of dual-system device
CN110362314A (en) Information processing method and device, computer-readable medium, electronic equipment
CN102594729B (en) Intermodule communication method and intermodule communication system
CN101908025A (en) Serial use-right control device and method
CN116627495A (en) Information interaction method, system, device, equipment and medium
CN110798242B (en) Circuit, multichannel device and multichannel short message sending method
CN111447270A (en) Data forwarding middleware for Internet of things
CN100368979C (en) Device for implementing POS machine parallel interface data receiving and output for printing and method for use thereof
CN114327466B (en) Method and system for realizing message decoupling between vehicle-mounted APP modules
CN108446131B (en) ATM firmware upgrading method, device, equipment and storage medium
CN114936098B (en) Data transfer method, device, back-end equipment and storage medium
US7295837B2 (en) Telecommunication module having a system-data processor for performing at least one telecommunication activity

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant