WO2021109707A1 - Multi-module communication control method and respiratory support device - Google Patents

Multi-module communication control method and respiratory support device Download PDF

Info

Publication number
WO2021109707A1
WO2021109707A1 PCT/CN2020/119262 CN2020119262W WO2021109707A1 WO 2021109707 A1 WO2021109707 A1 WO 2021109707A1 CN 2020119262 W CN2020119262 W CN 2020119262W WO 2021109707 A1 WO2021109707 A1 WO 2021109707A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
serial port
module
dma
memory block
Prior art date
Application number
PCT/CN2020/119262
Other languages
French (fr)
Chinese (zh)
Inventor
戴征
刘择善
Original Assignee
湖南明康中锦医疗科技发展有限公司
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 湖南明康中锦医疗科技发展有限公司 filed Critical 湖南明康中锦医疗科技发展有限公司
Publication of WO2021109707A1 publication Critical patent/WO2021109707A1/en

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61MDEVICES FOR INTRODUCING MEDIA INTO, OR ONTO, THE BODY; DEVICES FOR TRANSDUCING BODY MEDIA OR FOR TAKING MEDIA FROM THE BODY; DEVICES FOR PRODUCING OR ENDING SLEEP OR STUPOR
    • A61M16/00Devices for influencing the respiratory system of patients by gas treatment, e.g. mouth-to-mouth respiration; Tracheal tubes
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H40/00ICT specially adapted for the management or administration of healthcare resources or facilities; ICT specially adapted for the management or operation of medical equipment or devices
    • G16H40/60ICT specially adapted for the management or administration of healthcare resources or facilities; ICT specially adapted for the management or operation of medical equipment or devices for the operation of medical equipment or devices
    • G16H40/67ICT specially adapted for the management or administration of healthcare resources or facilities; ICT specially adapted for the management or operation of medical equipment or devices for the operation of medical equipment or devices for remote operation
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61MDEVICES FOR INTRODUCING MEDIA INTO, OR ONTO, THE BODY; DEVICES FOR TRANSDUCING BODY MEDIA OR FOR TAKING MEDIA FROM THE BODY; DEVICES FOR PRODUCING OR ENDING SLEEP OR STUPOR
    • A61M2205/00General characteristics of the apparatus
    • A61M2205/35Communication
    • A61M2205/3576Communication with non implanted data transmission devices, e.g. using external transmitter or receiver

Definitions

  • the ventilator has the following three communication methods:
  • the traditional ventilator uses a single processor and is controlled by a single processing module. There is no communication between modules in this type of ventilator;
  • Some ventilators have multiple processing modules inside, and the multiple modules communicate with each other by adding dual-port RAM (Random Access Memory) and using shared memory;
  • RAM Random Access Memory
  • S4 start the main control module and the data acquisition module, the data acquisition module starts to collect data, the transceiver buffer starts to receive the data sent by the data acquisition module,
  • the step S4 includes: S41, when the transceiver buffer of the first serial port receives the first frame of data, it generates a data reception signal to notify the DMA controller, and the first CPU receives the signal generated by the DMA controller. , Start data encapsulation detection, and perform CRC check on the first frame of data to determine the correctness of the data and prevent data errors due to interference. If the CRC check is passed and the first frame of data has no errors during transmission, then In the next step, if there is an error in the first frame of data during transmission, it proves that there may be an abnormality in the data acquisition module. The data is discarded and the abnormal count is started. When the abnormal count reaches a certain threshold, the main control module and the data acquisition module Enter the exception handling mode by itself.
  • the step S4 further includes:
  • the step S42 includes:
  • S422 The first CPU obtains data from the first memory block for processing according to the requirements of the breathing algorithm.
  • a timer is provided in the main control module, and the step S6 includes:
  • the step S6 further includes:
  • the main control module can directly obtain data from the sensor device and the action execution device; when the main control module and the data acquisition module When the communication between the data display modules fails, the main control module can directly send the processed data to the display device, the input device and the sound and light alarm device.
  • the present invention encapsulates communication so that each module operates like its own memory when acquiring data from other modules, avoiding complicated communication protocols.
  • data When data is received through each DMA channel, it must be unencapsulated and sent. Encapsulation realizes the efficiency and stability of communication interaction.
  • the data transmission is carried out through the design of the protocol and in accordance with the designed memory data transmission method, so that the data transmitted by the main control module to other peripheral modules is like accessing the memory; and ,
  • the protocol used for data reception and transmission is not complicated, which avoids the time of grouping and unpacking.
  • the correctness and integrity of the data can be guaranteed through the crc validation, making the communication efficient and stable.
  • the present invention is also designed with a backup control.
  • the ventilator can maintain basic breathing support and sound and light alarms to prompt the user to deal with the current abnormality, through the error prevention mechanism and system
  • the above backup control scheme also improves the security of data transmission.
  • the module fails to communicate, the whole system can still maintain the basic operating state of the ventilator to facilitate subsequent processing measures.
  • the present invention introduces communication control algorithm logic into the traditional multi-module ventilator without increasing the hardware cost. Under the condition of the combination of software and hardware, fast data interaction can be realized.
  • the communication can be achieved through DMA+timer. Basically no intervention is required, which improves communication efficiency and enables data to be updated in a timely manner; this method has been used in products currently under development, and overall has the advantages of simple communication control, efficient and stable data transmission, and system security.
  • the present invention packs all the communication methods and data processing methods, so that the communication between two independent modules becomes simple.
  • the design of the upper layer does not need to pay attention to how the bottom communicates, and the data between the two modules is as if they read their own
  • the memory is the same, as long as it is agreed on how the data in the memory block is arranged, the data between the two modules will automatically interact to keep up-to-date, which improves the communication efficiency between the modules.
  • Fig. 1 is a structural block diagram of a multi-module communication control method proposed by an embodiment of the present invention applied to a respiratory support device;
  • the present invention proposes a multi-module communication control method, which is mainly used in respiratory support equipment.
  • the respiratory support equipment is equipped with a main control module and peripheral modules.
  • the peripheral modules include data acquisition modules and data.
  • the display module, the present invention is used to realize the data communication between the main control module and the peripheral module.
  • the multi-module communication method is based on the serial port and combined with the DMA technology (Direct Memory Access).
  • the main control module includes a first CPU, a memory, a DMA controller, a first serial port and a second serial port, and the first serial port and the second serial port have a transceiver buffer.
  • the data acquisition module has a second CPU, the data acquisition module is connected to the main control module through the first serial port, and the data acquisition module is connected with sensor equipment and action execution equipment.
  • the sensor equipment is used to collect the user's inhalation and exhalation pressure and process.
  • Data the action execution device is used to adjust parameters such as the opening of the breathing valve under the control of the main control module.
  • the data display module has a third CPU, the data display module is connected to the main control module through the second serial port, and the data display module is connected with sound and light alarm devices, display devices and input devices.
  • the sound and light alarm devices are used to remind users when the ventilator is abnormal. Handle current abnormalities in a timely manner, and display equipment and input equipment enable customers to intelligently control and monitor the ventilator.
  • S4 start the main control module and the data acquisition module, the main control module starts to collect data, the transceiver buffer starts to receive the data sent by the data acquisition module, and the first DMA channel transmits the data in the transceiver buffer to the first memory block;
  • step S42 the first CPU parses the data in the sending and receiving buffer according to the preset protocol, extracts the memory block code, determines the extracted memory block code, and stores the data in the first memory block code according to the memory block code. Memory block.
  • the first CPU extracts data from the first memory block, processes the data, and stores the processed data in the first memory block and the second memory block.
  • the first serial port has a transceiver buffer
  • the second serial port also has a transceiver buffer, which is independent for each DMA channel.
  • the main control module is equipped with a timer.
  • data can be stored in the first memory block according to the timing trigger request of the timer, and for the transceiver buffer of the second serial port; it can be based on the same timer.
  • Timing triggers the request to store data in the second memory block; another timer can also be used to trigger the storage of data in the second memory block. In this way, the parameter data of the sensor devices, actuator devices, etc.
  • the display device connected to the data display module can obtain all the desired data in time.
  • the data acquisition module has a second CPU
  • the data acquisition module is connected with a sensor device and an action execution device
  • the data display module has a third CPU
  • the data display module is connected with a display device, an input device, and an audible and visual alarm device
  • Both the data acquisition module and the data display module are equivalent to single-chip microcomputer modules with independent processing capabilities.
  • the main control module can also perform backup control.
  • the main control module can directly obtain from the sensor device and the execution device of the action. Data; when the communication between the main control module and the data display module fails, the main control module can directly send the data processed by it to the sound and light alarm device. Therefore, when the current communication method through the DMA channel fails, the respiratory support device can maintain basic respiratory support through backup control, and can also realize the sound and light alarm function.
  • the design of the backup control in this method enables the data acquisition unit to fail when the system uses DMA for data communication. It can obtain the data collected by the sensor device, and can also control the actuators to perform action output and perform basic ventilation functions. It can also directly transmit the communication control signal to the sound and light when the communication between the main control module and the data display module fails.
  • the alarm device performs an audible alarm to remind the user that the current DMA communication has been disconnected, which improves the safety of the ventilator.
  • the first CPU may use the AT91SAM9G45 chip, and the memory may use the samsung k4t51163qq bce7 chip.
  • step S42 includes:
  • the first CPU obtains data for processing; for example, the breathing algorithm requires the current pressure and flow to perform related processing, and the CPU directly reads the data at the corresponding position in the first memory block.
  • step S42 For the communication between the data display module and the main control module, when the data display module wants to obtain data from the second memory block of the main control module, it is obtained in the same way as step S42, that is, it is also obtained through a preset protocol , Extract the memory block attribute code of the data in the transceiver buffer of the second serial port, for example, if the received attribute code is 2, then the first CPU directly copies the above basic data to the second memory block, and the second serial port directly according to the attribute Encoding 2 can obtain the data packet of the entire basic data corresponding to 2 and send these data to a display device for display, which greatly improves the efficiency of data communication.
  • the data acquisition module When the data acquisition module receives data and the data display module sends data, the data must be encapsulated or unsealed according to the designed communication protocol.
  • the protocol is as shown in the figure below.

Landscapes

  • Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Public Health (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Veterinary Medicine (AREA)
  • Hematology (AREA)
  • Anesthesiology (AREA)
  • Animal Behavior & Ethology (AREA)
  • Pulmonology (AREA)
  • Emergency Medicine (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Epidemiology (AREA)
  • Medical Informatics (AREA)
  • Primary Health Care (AREA)
  • Communication Control (AREA)

Abstract

Disclosed in the present invention are a multi-module communication control method and a respiratory support device. The multi-module communication control method is used for realizing data communication between a master control module, and a data acquisition module and a data display module. The master control module comprises a first CPU, a memory, a DMA controller, a first serial port, and a second serial port; the data acquisition module is connected to the first serial port; the data display module is connected to the second serial port; the first serial port and the second serial port have a transceiver buffer. The multi-module communication control method comprises: setting a first memory block and a second memory block in the memory, establishing a first DMA receiving channel and a first DMA sending channel between the data acquisition module and the first memory block, and establishing a second DMA receiving channel and a second DMA sending channel between the second memory block and the data display module, so that data transmission can be completed without participation of the first CPU, thereby improving the speed and efficiency of data communication.

Description

多模块通信控制方法及呼吸支持设备Multi-module communication control method and respiratory support equipment 技术领域Technical field
本发明属于医疗设备技术领域,具体涉及一种多模块通信控制方法及呼吸支持设备。The invention belongs to the technical field of medical equipment, and specifically relates to a multi-module communication control method and respiratory support equipment.
背景技术Background technique
在现代临床医学中,呼吸机作为一项能人工替代自主通气功能的有效手段,已普遍用于各种原因所致的呼吸衰竭、大手术期间的麻醉呼吸管理、呼吸支持治疗和急救复苏中,在现代医学领域占有十分重要的位置。医用呼吸机是一种能够起到预防和治疗呼吸衰竭、减少并发症、挽救及延长病人生命的至关重要的医疗设备。In modern clinical medicine, the ventilator, as an effective means to artificially replace the autonomous ventilation function, has been commonly used in various causes of respiratory failure, anesthesia breathing management during major operations, respiratory support treatment and emergency recovery. It occupies a very important position in the field of modern medicine. Medical ventilator is a vital medical device that can prevent and treat respiratory failure, reduce complications, save and prolong the lives of patients.
目前医用呼吸机的发展面向大屏、智能化发展,在传统的呼吸机上加入高清触摸大屏,引入网络云平台,势必呼吸机内部结构会原来越复杂,引入的显示屏等模块与呼吸机原有的呼吸参数获取模块等进行协作处理,呼吸机内原控制模块承担的任务越来越多,通信数据接口的负担也越来越重,因此也越来越需要一种稳定高效的的通信处理方法。At present, the development of medical ventilators is geared to the development of large screens and intelligence. The traditional ventilators have added high-definition touch screens and introduced network cloud platforms. The internal structure of the ventilators will inevitably become more complex. Some breathing parameter acquisition modules perform collaborative processing. The original control module in the ventilator is taking on more and more tasks, and the burden of the communication data interface is getting heavier. Therefore, there is an increasing need for a stable and efficient communication processing method. .
在现有技术中,呼吸机有以下三种通信方式:In the prior art, the ventilator has the following three communication methods:
A、传统的呼吸机采用单个处理器,通过单一的处理模块进行控制,这种类型的呼吸机内部不存在模块之间的通信;A. The traditional ventilator uses a single processor and is controlled by a single processing module. There is no communication between modules in this type of ventilator;
B、一些呼吸机内部设有多个处理模块,多模块之间通过增加双口RAM(随机存取存储器,Random Access Memory)、利用共享内存的方式进行通信;B. Some ventilators have multiple processing modules inside, and the multiple modules communicate with each other by adding dual-port RAM (Random Access Memory) and using shared memory;
C、一些呼吸机内部设有多个处理模块,多模块之间通过外设串口和spi口等物理接口、利用通信协议方式通信。C. Some ventilators are equipped with multiple processing modules, and the multiple modules communicate with each other through physical interfaces such as peripheral serial ports and spi ports, using communication protocols.
而针对目前的呼吸机向大屏、智能和云互联方式方向发展的趋势,现有的以上三种通信方案至少存在以下缺点:In view of the current trend of ventilators developing towards large screens, intelligence and cloud interconnection, the existing three communication schemes above have at least the following shortcomings:
A方案是单模块方案,对其模块的性能要求高,若涉及多个事务的处理,会增加软硬件的复杂性,系统的稳定性、实时性也会大打折扣,也不利于以后的升级扩展。B方案,虽然通信速度快,但其成本高。C方案,利用传统的通信方式,节约了成本,但相对来说在软件开发上的开销比较大,需要占用较大的系统资源,数据通讯交互的速度也有一定的局限性。Solution A is a single module solution, which requires high performance of its modules. If multiple transactions are involved, it will increase the complexity of software and hardware, and the stability and real-time performance of the system will be greatly reduced, and it is not conducive to future upgrades and expansions. . Scheme B, although the communication speed is fast, but its cost is high. Scheme C uses traditional communication methods to save costs, but relatively speaking, the software development overhead is relatively large, it needs to occupy a large amount of system resources, and the speed of data communication interaction also has certain limitations.
发明内容Summary of the invention
本发明的主要目的是提供一种多模块通信控制方法,旨在解决现有的多模块呼吸支持设备内各模块之间的通信速度慢且占用系统资源多的问题。The main purpose of the present invention is to provide a multi-module communication control method, which aims to solve the problem of slow communication speed between modules in the existing multi-module respiratory support device and occupying a lot of system resources.
为实现上述目的,本发明提出一种多模块通信控制方法,用于实现主控模块与数据采集模块、数据显示模块的数据通讯,所述主控模块包括第一CPU、内存、DMA控制器、第一串口和第二串口,数据采集模块和第一串口连接,数据显示模块和第二串口连接,所述第一串口和第二串口具有收发缓存,In order to achieve the above objective, the present invention proposes a multi-module communication control method for realizing data communication between a main control module, a data acquisition module, and a data display module. The main control module includes a first CPU, a memory, a DMA controller, The first serial port and the second serial port, the data acquisition module is connected to the first serial port, and the data display module is connected to the second serial port. The first serial port and the second serial port have a transceiver buffer,
包括以下步骤:It includes the following steps:
S1,将第一串口和第二串口配置为DMA模式,S1, configure the first serial port and the second serial port to DMA mode,
S2,在内存中开辟第一内存块、第二内存块,S2, open up the first memory block and the second memory block in the memory,
S3,设置第一DMA接收通道的目的地址为第一串口收发缓存地址,设置第一DMA接收通道的源地址为第一串口接收地址,使得第一DMA接收通道能接收数据,S3. Set the destination address of the first DMA receiving channel to the first serial port transceiver buffer address, and set the source address of the first DMA receiving channel to the first serial port receiving address, so that the first DMA receiving channel can receive data,
设置第一DMA发送通道的目的地址为第一串口的发送地址,设置第一DMA发送通道的源地址为第一串口的收发缓存地址,并使得第一DMA发送通道能发送数据,Set the destination address of the first DMA transmission channel to the transmission address of the first serial port, and set the source address of the first DMA transmission channel to the transceiver buffer address of the first serial port, and enable the first DMA transmission channel to send data,
设置第二DMA接收通道的目的地址为第二串口收发缓存地址,设置第二DMA接收通道的源地址为第二串口接收地址,使得第二DMA通道能接收数据,Set the destination address of the second DMA receiving channel to the second serial port transceiver buffer address, and set the source address of the second DMA receiving channel to the second serial port receiving address, so that the second DMA channel can receive data,
设置第二DMA发送通道的目的地址为第二串口的发送地址,设置第二DMA发送通道的源地址为收发缓存地址,使得第二发送DMA通道能发送数据,Set the destination address of the second DMA transmission channel as the transmission address of the second serial port, and set the source address of the second DMA transmission channel as the transceiver buffer address, so that the second transmission DMA channel can send data,
S4,启动主控模块和数据采集模块,数据采集模块开始采集数据,所述收发缓存开始接收所述数据采集模块发来的数据,S4, start the main control module and the data acquisition module, the data acquisition module starts to collect data, the transceiver buffer starts to receive the data sent by the data acquisition module,
第一DMA通道将收发缓存中的数据传输至所述第一内存块中,The first DMA channel transmits the data in the receiving and sending buffer to the first memory block,
S5,第一CPU能够从第一内存块中提取数据,并对这些数据进行处理,将处理完的数据存储至第一内存块和第二内存块中,S5, the first CPU can extract data from the first memory block, process the data, and store the processed data in the first memory block and the second memory block,
S6,当主控模块要向所述数据显示模块发送数据时,DMA控制器将第二内存块中的数据转移到第二串口的收发缓存中,数据显示模块从第二串口的收发缓存中获取数据。S6: When the main control module wants to send data to the data display module, the DMA controller transfers the data in the second memory block to the transceiver buffer of the second serial port, and the data display module obtains it from the transceiver buffer of the second serial port data.
优选地,所述步骤S4包括:S41,第一串口的收发缓存在接收到第一帧数据时,会产生一个数据接收信号通知DMA控制器,第一CPU在接收到DMA控制器产生的信号后,启动数据封装检测,对第一帧数据进行CRC校验,用来判定数据的正确性,防止因干扰产生数据错误,若通过CRC校验,第一帧数据在传输过程中没有出错,则进行下一步骤,若第一帧数据在传输过程中出现错误,则证明数据采集模块可能存在异常,则丢弃该数据,并启动异常计数,当异常计数达到一定阈值时,主控模块及数据采集模块自身进入异常处 理模式。Preferably, the step S4 includes: S41, when the transceiver buffer of the first serial port receives the first frame of data, it generates a data reception signal to notify the DMA controller, and the first CPU receives the signal generated by the DMA controller. , Start data encapsulation detection, and perform CRC check on the first frame of data to determine the correctness of the data and prevent data errors due to interference. If the CRC check is passed and the first frame of data has no errors during transmission, then In the next step, if there is an error in the first frame of data during transmission, it proves that there may be an abnormality in the data acquisition module. The data is discarded and the abnormal count is started. When the abnormal count reaches a certain threshold, the main control module and the data acquisition module Enter the exception handling mode by itself.
优选地,所述步骤S4还包括:Preferably, the step S4 further includes:
S42,在步骤S41之后,第一CPU根据预设的协议对第一串口收发缓存中的数据进行解析,并提取出内存块编码,判断提取出的内存块编码,并按照内存块编码将数据存储至第一内存块。S42: After step S41, the first CPU parses the data in the first serial port transceiver buffer according to the preset protocol, extracts the memory block code, judges the extracted memory block code, and stores the data according to the memory block code To the first memory block.
优选地,所述步骤S42包括:Preferably, the step S42 includes:
S421,根据预设协议,提取第一串口收发缓存中的内存块属性编码,根据内存块属性编码,第一CPU将该段数据直接拷贝至第一内存块中的对应位置;S421: According to the preset protocol, extract the memory block attribute code in the first serial port transceiver buffer, and according to the memory block attribute code, the first CPU directly copies the piece of data to the corresponding position in the first memory block;
S422,第一CPU根据呼吸算法需要,从第一内存块中获取数据进行处理。S422: The first CPU obtains data from the first memory block for processing according to the requirements of the breathing algorithm.
优选地,所述主控模块内设有定时器,所述步骤S6包括:Preferably, a timer is provided in the main control module, and the step S6 includes:
S61,定时器定时产生触发请求信号,DMA控制器根据触发请求信号逐次获取第二内存块中的数据。S61: The timer generates a trigger request signal at regular intervals, and the DMA controller successively acquires the data in the second memory block according to the trigger request signal.
优选地,所述步骤S6还包括:Preferably, the step S6 further includes:
S62,DMA控制器对第二内存块中的数据进行封装后再存储至第二串口的收发缓存中。S62: The DMA controller encapsulates the data in the second memory block and then stores it in the transceiver buffer of the second serial port.
优选地,所述多模块通信控制方法应用于呼吸支持设备中,所述数据采集模块具有第二CPU,所述数据采集模块连接有传感器设备和动作执行设备,所述数据显示模块具有第三CPU,所述数据显示模块连接有显示设备、输入设备和声光报警设备。Preferably, the multi-module communication control method is applied to a respiratory support device, the data acquisition module has a second CPU, the data acquisition module is connected with a sensor device and an action execution device, and the data display module has a third CPU , The data display module is connected with a display device, an input device and an audible and visual alarm device.
优选地,当所述主控模块与所述数据采集模块之间的通讯失败时,所述主控模块可直接从所述传感器设备和动作之执行设备获取数据;当所述主控模块与所述数据显示模块之间的通讯失败时,所述主控模块可直接将其处理所得的数据发送到显示设备、输入设备和声光报警设备。Preferably, when the communication between the main control module and the data collection module fails, the main control module can directly obtain data from the sensor device and the action execution device; when the main control module and the data acquisition module When the communication between the data display modules fails, the main control module can directly send the processed data to the display device, the input device and the sound and light alarm device.
本发明还提出一种呼吸支持设备,包括:主控模块、数据采集模块和数据显示模块的数据通讯,所述主控模块包括第一CPU、内存、DMA控制器、第一串口和第二串口,所述数据采集模块和第一串口连接,所述数据显示模块和第二串口连接,所述第一串口和第二串口具有收发缓存;在所述内存中创建有第一内存块和第二内存块,所述数据采集模块和所述第一内存块之间设置有第一DMA接收通道和第一DMA发送通道,所述数据显示模块和所述第二内存块之间设置有第二DMA接收通道和第二DMA发送通道。The present invention also proposes a breathing support device, including: data communication between a main control module, a data acquisition module, and a data display module. The main control module includes a first CPU, a memory, a DMA controller, a first serial port, and a second serial port. , The data acquisition module is connected to a first serial port, the data display module is connected to a second serial port, the first serial port and the second serial port have a transceiver buffer; in the memory, a first memory block and a second A memory block, a first DMA receiving channel and a first DMA sending channel are arranged between the data acquisition module and the first memory block, and a second DMA is arranged between the data display module and the second memory block The receiving channel and the second DMA sending channel.
与现有技术相比,本发明技术方案的有益效果:Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
一,本发明在呼吸机的传统的通信方式上加入直接内存访问技术,实现了通信交互上的简易性,通过控制器上的直接内存访问技术,可使得各模块无需较多时间关注通信上的控制,配合嵌入式操作系统,可以做到无需干预的高速通信。First, the present invention adds direct memory access technology to the traditional communication mode of the ventilator to realize the simplicity of communication interaction. Through the direct memory access technology on the controller, each module does not need much time to pay attention to the communication problems. Control, with embedded operating system, can achieve high-speed communication without intervention.
二,本发明通过封装通信,使得各模块在获取其他模块的数据时如同操作自己的内存一样,避免了复杂的通信协议,数据在通过各DMA通道进行接收时要进行解封,发送时要进行封装,实现了通信交互上的高效性及稳定性,在通过协议的设计及按照设计内存数据传输方式进行数据传输,使得主控模块对于其他外设模块传输来的数据就像访问内存一样;并且,数据的接收和发送采用的协议不复杂,避免了组包解包的时间,数据在接收时通过crc效验可保证数据的正确性和完整性,使得通信高效稳定。Second, the present invention encapsulates communication so that each module operates like its own memory when acquiring data from other modules, avoiding complicated communication protocols. When data is received through each DMA channel, it must be unencapsulated and sent. Encapsulation realizes the efficiency and stability of communication interaction. The data transmission is carried out through the design of the protocol and in accordance with the designed memory data transmission method, so that the data transmitted by the main control module to other peripheral modules is like accessing the memory; and , The protocol used for data reception and transmission is not complicated, which avoids the time of grouping and unpacking. When the data is received, the correctness and integrity of the data can be guaranteed through the crc validation, making the communication efficient and stable.
三,本发明还设计有备份控制,在当前的通信出现异常错误时,通过备份控制,可以使得呼吸机维持基本的呼吸支持及声光报警来提示用户处理当前的异常,通过防错机制及系统上的备份控制方案,也提高了数据传输的安全性,当模块出现异常无法通信时,整机系统仍可维持呼吸机的基本运行状态,以便于后续的处理措施。Third, the present invention is also designed with a backup control. When an abnormal error occurs in the current communication, through the backup control, the ventilator can maintain basic breathing support and sound and light alarms to prompt the user to deal with the current abnormality, through the error prevention mechanism and system The above backup control scheme also improves the security of data transmission. When the module fails to communicate, the whole system can still maintain the basic operating state of the ventilator to facilitate subsequent processing measures.
四,本发明在不增加硬件成本的基础上,在传统的多模块呼吸机内引入通信控制算法逻辑,在软硬件结合的条件下,实现快速数据交互,通过DMA+定时器的方式,可以让通信基本无需干预,提高了通信效率,也使得数据能够更新及时;本方法已在目前正在开发的产品上使用,整体上具有通信控制简易,数据传输高效稳定,以及系统安全等优点。Fourth, the present invention introduces communication control algorithm logic into the traditional multi-module ventilator without increasing the hardware cost. Under the condition of the combination of software and hardware, fast data interaction can be realized. The communication can be achieved through DMA+timer. Basically no intervention is required, which improves communication efficiency and enables data to be updated in a timely manner; this method has been used in products currently under development, and overall has the advantages of simple communication control, efficient and stable data transmission, and system security.
五,本发明将通信方式及数据处理方式全部打包,让两个独立的模块间的通信变得简单,设计上层不需要关注底部是如何通信的,两模块之间的数据如同各自读取自己的内存一样,只要约定好了内存块中的数据是如何排布的就可以,两个模块间的数据会自动交互,保持最新,提高了各模块之间的通信效率。Fifth, the present invention packs all the communication methods and data processing methods, so that the communication between two independent modules becomes simple. The design of the upper layer does not need to pay attention to how the bottom communicates, and the data between the two modules is as if they read their own The memory is the same, as long as it is agreed on how the data in the memory block is arranged, the data between the two modules will automatically interact to keep up-to-date, which improves the communication efficiency between the modules.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图示出的结构获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, without creative work, other drawings can be obtained based on the structure shown in these drawings.
图1为本发明一实施例提出的多模块通信控制方法应用在呼吸支持设备上的结构框 图;Fig. 1 is a structural block diagram of a multi-module communication control method proposed by an embodiment of the present invention applied to a respiratory support device;
图2为图1提出的多模块通信控制方法的控制原理图一;Fig. 2 is a control principle diagram 1 of the multi-module communication control method proposed in Fig. 1;
图3为图1提出的多模块通信控制方法的控制原理图二;Fig. 3 is the second control principle diagram of the multi-module communication control method proposed in Fig. 1;
图4为图1提出的多模块通信控制方法的步骤流程图。Fig. 4 is a flow chart of the steps of the multi-module communication control method proposed in Fig. 1.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
需要说明,本发明实施例中所有方向性指示(诸如上、下、左、右、前、后……)仅用于解释在某一特定姿态(如附图所示)下各部件之间的相对位置关系、运动情况等,如果该特定姿态发生改变时,则该方向性指示也相应地随之改变。It should be noted that all directional indications (such as up, down, left, right, front, back...) in the embodiments of the present invention are only used to explain the difference between components in a specific posture (as shown in the accompanying drawings). If the relative position relationship, movement situation, etc. change, the directional indication will change accordingly.
另外,在本发明中如涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本发明的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, in the present invention, descriptions involving "first", "second", etc. are only for descriptive purposes, and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.
在本发明中,除非另有明确的规定和限定,术语“连接”、“固定”等应做广义理解,例如,“固定”可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系,除非另有明确的限定。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。In the present invention, unless otherwise clearly specified and limited, the terms "connected", "fixed", etc. should be interpreted broadly. For example, "fixed" can be a fixed connection, a detachable connection, or a whole; It is a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication between two components or the interaction relationship between two components, unless specifically defined otherwise. For those of ordinary skill in the art, the specific meanings of the above-mentioned terms in the present invention can be understood according to specific situations.
另外,本发明各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本发明要求的保护范围之内。In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but they must be based on what can be achieved by a person of ordinary skill in the art. When the combination of technical solutions is contradictory or cannot be achieved, it should be regarded as a combination of such technical solutions. It does not exist, nor does it fall within the scope of protection claimed by the present invention.
本发明提出一种多模块通信控制方法及呼吸支持设备。The present invention provides a multi-module communication control method and respiratory support equipment.
请参照图1至图4,本发明提出一种多模块通信控制方法,主要应用在呼吸支持设备中,呼吸支持设备中设有主控模块和外设模块,外设模块包括数据采集模块和数据显示模块,本发明即是用于实现主控模块与外设模块之间的数据通讯,本多模块通信方法是基于串口并结合DMA技术(Direct Memory Access,直接内存访问)提出。Please refer to Figures 1 to 4, the present invention proposes a multi-module communication control method, which is mainly used in respiratory support equipment. The respiratory support equipment is equipped with a main control module and peripheral modules. The peripheral modules include data acquisition modules and data. The display module, the present invention is used to realize the data communication between the main control module and the peripheral module. The multi-module communication method is based on the serial port and combined with the DMA technology (Direct Memory Access).
主控模块包括第一CPU、内存、DMA控制器、第一串口和第二串口,第一串口和第二串口具有收发缓存。数据采集模块具有第二CPU,数据采集模块通过第一串口连接主控模块,数据采集模块连接有传感器设备和动作执行设备,传感器设备用于采集用户的吸气、呼气的压力和流程等原始数据,动作执行设备用于在主控模块的控制下调节呼吸阀的开度大小等参数。数据显示模块具有第三CPU,数据显示模块通过第二串口连接主控模块,数据显示模块连接有声光报警设备、显示设备和输入设备,声光报警设备用于提醒用户在呼吸机出现异常时及时处理当前的异常,显示设备和输入设备使得客户能对呼吸机进行智能化控制及监控。The main control module includes a first CPU, a memory, a DMA controller, a first serial port and a second serial port, and the first serial port and the second serial port have a transceiver buffer. The data acquisition module has a second CPU, the data acquisition module is connected to the main control module through the first serial port, and the data acquisition module is connected with sensor equipment and action execution equipment. The sensor equipment is used to collect the user's inhalation and exhalation pressure and process. Data, the action execution device is used to adjust parameters such as the opening of the breathing valve under the control of the main control module. The data display module has a third CPU, the data display module is connected to the main control module through the second serial port, and the data display module is connected with sound and light alarm devices, display devices and input devices. The sound and light alarm devices are used to remind users when the ventilator is abnormal. Handle current abnormalities in a timely manner, and display equipment and input equipment enable customers to intelligently control and monitor the ventilator.
本多模块通信控制方法具体包括以下步骤:The multi-module communication control method specifically includes the following steps:
S1,将第一串口和第二串口配置为DMA模式;S1, configure the first serial port and the second serial port to DMA mode;
S2,在内存中开辟第一内存块、第二内存块;S2, open up the first memory block and the second memory block in the memory;
S3,初始化DMA控制器,S3, initialize the DMA controller,
设置第一DMA接收通道的目的地址为第一串口收发缓存地址,设置第一DMA接收通道的源地址为第一串口接收地址,使得第一DMA接收通道能接收数据,Set the destination address of the first DMA receiving channel to the first serial port transceiver buffer address, and set the source address of the first DMA receiving channel to the first serial port receiving address, so that the first DMA receiving channel can receive data,
设置第一DMA发送通道的目的地址为第一串口的发送地址,设置第一DMA发送通道的源地址为第一串口的收发缓存地址,并使得第一DMA发送通道能发送数据,Set the destination address of the first DMA transmission channel to the transmission address of the first serial port, and set the source address of the first DMA transmission channel to the transceiver buffer address of the first serial port, and enable the first DMA transmission channel to send data,
设置第二DMA接收通道的目的地址为第二串口收发缓存地址,设置第二DMA接收通道的源地址为第二串口接收地址,使得第二DMA通道能接收数据,Set the destination address of the second DMA receiving channel to the second serial port transceiver buffer address, and set the source address of the second DMA receiving channel to the second serial port receiving address, so that the second DMA channel can receive data,
设置第二DMA发送通道的目的地址为第二串口的发送地址,设置第二DMA发送通道的源地址为收发缓存地址,使得第二发送DMA通道能发送数据;Set the destination address of the second DMA transmission channel as the transmission address of the second serial port, and set the source address of the second DMA transmission channel as the transceiver buffer address, so that the second transmission DMA channel can send data;
S4,启动主控模块和数据采集模块,主控模块开始采集数据,收发缓存开始接收数据采集模块发来的数据,第一DMA通道将收发缓存中的数据传输至第一内存块中;S4, start the main control module and the data acquisition module, the main control module starts to collect data, the transceiver buffer starts to receive the data sent by the data acquisition module, and the first DMA channel transmits the data in the transceiver buffer to the first memory block;
其中:among them:
S41,收发缓存在接收到第一帧数据时,会产生一个数据接收信号通知DMA控制器,第一CPU在接收到DMA控制器产生的信号后,启动数据封装检测,对第一帧数据进行CRC校验,用来判定数据的正确性,防止因干扰产生数据错误,若通过CRC校验,第一帧数据在传输过程中没有出错,则进行下一步骤,若第一帧数据在传输过程中出现错误,则证明数据采集模块可能存在异常,则丢弃该数据,并启动异常计数,当异常计数达到一定阈值时,主控模块及数据采集模块自身进入异常处理模式;S41. When the transceiver buffer receives the first frame of data, it will generate a data reception signal to notify the DMA controller. After receiving the signal generated by the DMA controller, the first CPU starts data encapsulation detection and performs CRC on the first frame of data. Check is used to determine the correctness of the data and prevent data errors due to interference. If the CRC check is passed and the first frame of data has no errors during the transmission process, proceed to the next step. If the first frame of data is in the transmission process If an error occurs, it proves that the data acquisition module may be abnormal, the data is discarded, and the abnormal count is started. When the abnormal count reaches a certain threshold, the main control module and the data acquisition module themselves enter the abnormal processing mode;
S42,在步骤S41之后,第一CPU根据预设的协议对收发缓存中的数据进行解析,并 提取出内存块编码,判断提取出的内存块编码,并按照内存块编码将数据存储至第一内存块。S42. After step S41, the first CPU parses the data in the sending and receiving buffer according to the preset protocol, extracts the memory block code, determines the extracted memory block code, and stores the data in the first memory block code according to the memory block code. Memory block.
S5,第一CPU从第一内存块中提取数据,并对这些数据进行处理,将处理完的数据存储至第一内存块、第二内存块中,S5. The first CPU extracts data from the first memory block, processes the data, and stores the processed data in the first memory block and the second memory block.
关于第一内存块和第二内存块的设置:传感器设备采集到的是一些模拟量原始数据,数据采集模块在获取到这些数据后,会通过第一CPU进行一些基本的呼吸算法计算,得到压力控制值、流量控制值等基础数据,这些基础数据放置在第一内存块中,这样当与数据采集模块连接的设备需要获取这些基础数据时,可以直接通过第一串口和对应第一DMA通道得到这些数据,而无需通过第一CPU的参与;Regarding the settings of the first memory block and the second memory block: The sensor device collects some analog raw data. After the data acquisition module obtains these data, it will perform some basic breathing algorithm calculations through the first CPU to obtain the pressure Basic data such as control value and flow control value are placed in the first memory block, so that when the device connected to the data acquisition module needs to obtain these basic data, it can be obtained directly through the first serial port and the corresponding first DMA channel These data without the participation of the first CPU;
而由于用户需要,例如处于监测或评估的需求,在数据显示模块要进行显示的数据还包括呼吸频率等其他综合数据,这些要显示的综合数据是第一CPU根据基础数据通过相关的算法进一步计算得到的,并存储在第二内存块中,这样当用户在数据显示模块端想要获取到这些综合数据时,就可以通过第二串口和对应的第二DMA通道得到,也同样无需第一CPU的参与;Due to user needs, such as monitoring or evaluation needs, the data to be displayed in the data display module also includes other comprehensive data such as respiratory rate. These comprehensive data to be displayed are further calculated by the first CPU based on the basic data through related algorithms. It is obtained and stored in the second memory block, so that when the user wants to obtain these comprehensive data on the data display module side, it can be obtained through the second serial port and the corresponding second DMA channel, and the first CPU is also not required. Participation;
因此在本发明中,既实现了数据采集模块和主控模块之间的双向通信,也实现了主控模块和数据显示模块之间的双向通信。Therefore, in the present invention, not only the two-way communication between the data acquisition module and the main control module is realized, but also the two-way communication between the main control module and the data display module is realized.
S6,主控模块内设有定时器,定时器通过时序控制定时产生触发请求信号,时间到,则DMA控制器就根据触发请求信号,逐次按照预设的协议对第一内存块、第二内存块中的数据进行封装后再存储至收发缓存中。S6: There is a timer in the main control module. The timer generates a trigger request signal through timing control. When the time is up, the DMA controller will perform the first memory block and the second memory block according to the preset protocol according to the trigger request signal. The data in the block is encapsulated and then stored in the transceiver buffer.
本发明在传统的串口通信方式上加入DMA技术,DMA是一种无需CPU的参与就可以让外设与系统内存之间进行双向数据传输的硬件机制,使用DMA可以使系统CPU从实际的I/O数据传输过程中摆脱出来,从而大大提高系统的吞吐率。采用DMA方式的数据传输由DMA控制器控制,在传输期间,主控模块的第一CPU可以并发地执行其他任务,当DMA结束后,DMA控制器通过中断通知第一CPU数据传输已经结束,由第一CPU执行相应的中断服务程序进行后续处理。The present invention adds DMA technology to the traditional serial communication mode. DMA is a hardware mechanism that allows two-way data transmission between peripherals and system memory without the participation of the CPU. Using DMA can make the system CPU from the actual I/ O get rid of the data transmission process, thereby greatly improving the throughput rate of the system. The data transmission in the DMA mode is controlled by the DMA controller. During the transmission, the first CPU of the main control module can perform other tasks concurrently. When the DMA ends, the DMA controller informs the first CPU that the data transmission has ended through an interrupt. The first CPU executes the corresponding interrupt service program for subsequent processing.
第一串口具有收发缓存,第二串口也具有收发缓存,收发缓存对于每个DMA通道是独立的。主控模块设有定时器,对于第一串口的收发缓存,可以根据定时器的定时触发请求,向第一内存块中存入数据,对于第二串口的收发缓存;可以根据同一个定时器的定时触发请求,向第二内存块中存入数据;也可以另外采用一个定时器来触发对第二内存块中存入数据。这样对于与数据采集模块连接的传感器设备、执行元件设备等的参数数据可以及时 地传输到第一内存块中,而主控模块通过呼吸算法的得到的各种综合参数也可以及时地更新到第二内存块中,这样与数据显示模块连接的显示设备等就可以及时地获取到所有的想要的数据。The first serial port has a transceiver buffer, and the second serial port also has a transceiver buffer, which is independent for each DMA channel. The main control module is equipped with a timer. For the transceiver buffer of the first serial port, data can be stored in the first memory block according to the timing trigger request of the timer, and for the transceiver buffer of the second serial port; it can be based on the same timer. Timing triggers the request to store data in the second memory block; another timer can also be used to trigger the storage of data in the second memory block. In this way, the parameter data of the sensor devices, actuator devices, etc. connected to the data acquisition module can be transmitted to the first memory block in time, and the various comprehensive parameters obtained by the main control module through the breathing algorithm can also be updated to the first memory block in time. In the second memory block, the display device connected to the data display module can obtain all the desired data in time.
进一步地,数据采集模块具有第二CPU,数据采集模块连接有传感器设备和动作执行设备,所述数据显示模块具有第三CPU,所述数据显示模块连接有显示设备、输入设备和声光报警设备,数据采集模块和数据显示模块都相当于具有独立处理能力的单片机模块。而在本多模块通信控制方法中,主控模块还能进行备份控制,当主控模块与数据采集模块之间的通讯失败时,主控模块可直接从所述传感器设备和动作之执行设备获取数据;当主控模块与数据显示模块之间的通讯失败时,主控模块可直接将其处理所得的数据发送声光报警设备。由此,在当前的通过DMA通道进行通信的方式失败时,通过备份控制,呼吸支持设备还能维持基本的呼吸支持,也还能实现声光报警功能。Further, the data acquisition module has a second CPU, the data acquisition module is connected with a sensor device and an action execution device, the data display module has a third CPU, and the data display module is connected with a display device, an input device, and an audible and visual alarm device , Both the data acquisition module and the data display module are equivalent to single-chip microcomputer modules with independent processing capabilities. In this multi-module communication control method, the main control module can also perform backup control. When the communication between the main control module and the data acquisition module fails, the main control module can directly obtain from the sensor device and the execution device of the action. Data; when the communication between the main control module and the data display module fails, the main control module can directly send the data processed by it to the sound and light alarm device. Therefore, when the current communication method through the DMA channel fails, the respiratory support device can maintain basic respiratory support through backup control, and can also realize the sound and light alarm function.
呼吸机在使用过程中,不能因为数据采集模块与主控模块之间通讯失败就直接停机,而本方法中的备份控制的设计,即使得数据采集单元在系统采用DMA进行数据通信失败时,还能获取传感器设备采集到的数据,还能控制执行元件进行动作输出,进行基本的通气功能,也能在主控模块与数据显示模块之间通讯失败时,可以直接将通信控制信号传输给声光报警设备,进行声音报警,提示用户当前的DMA通信已经断开,提高了呼吸机的安全性。During the use of the ventilator, it cannot be shut down directly because the communication between the data acquisition module and the main control module fails. The design of the backup control in this method enables the data acquisition unit to fail when the system uses DMA for data communication. It can obtain the data collected by the sensor device, and can also control the actuators to perform action output and perform basic ventilation functions. It can also directly transmit the communication control signal to the sound and light when the communication between the main control module and the data display module fails. The alarm device performs an audible alarm to remind the user that the current DMA communication has been disconnected, which improves the safety of the ventilator.
具体在本实施方式中,第一CPU可以采用AT91SAM9G45芯片,内存可以采用samsung k4t51163qq bce7芯片。Specifically, in this embodiment, the first CPU may use the AT91SAM9G45 chip, and the memory may use the samsung k4t51163qq bce7 chip.
进一步地,所述步骤S42包括:Further, the step S42 includes:
S421,根据预设协议,提取接收缓冲中的内存块属性编码;例如收到属性编码为1,那么第一CPU将该段数据直接拷贝至第一内存块中的对应位置。S421. Extract the attribute code of the memory block in the receiving buffer according to the preset protocol; for example, if the received attribute code is 1, then the first CPU directly copies the piece of data to the corresponding position in the first memory block.
S422,第一CPU获取数据进行处理;例如呼吸算法需要当前的压力及流量进行相关的处理,则CPU直接读取第一内存块中对应位置的数据。S422: The first CPU obtains data for processing; for example, the breathing algorithm requires the current pressure and flow to perform related processing, and the CPU directly reads the data at the corresponding position in the first memory block.
而对于数据显示模块和主控模块之间的通信,当通过数据显示模块要从主控模块的第二内存块内获取数据时,是采用与步骤S42同样的方式获取,即也是通过预设协议,在第二串口的收发缓存中提取数据的内存块属性编码,例如收到属性编码为2,那么第一CPU直接将上述基础数据直接拷贝到第二内存块中,而第二串口直接根据属性编码2就可以获取到2对应的整个基础数据的数据包,将这些数据发送到显示设备等进行显示,大大提高了数据通信的效率。For the communication between the data display module and the main control module, when the data display module wants to obtain data from the second memory block of the main control module, it is obtained in the same way as step S42, that is, it is also obtained through a preset protocol , Extract the memory block attribute code of the data in the transceiver buffer of the second serial port, for example, if the received attribute code is 2, then the first CPU directly copies the above basic data to the second memory block, and the second serial port directly according to the attribute Encoding 2 can obtain the data packet of the entire basic data corresponding to 2 and send these data to a display device for display, which greatly improves the efficiency of data communication.
数据采集模块对数据的接收、数据显示模块对数据的发送,都要按照设计的通信协议对数据进行封装或解封,协议如下图所示,When the data acquisition module receives data and the data display module sends data, the data must be encapsulated or unsealed according to the designed communication protocol. The protocol is as shown in the figure below.
Figure PCTCN2020119262-appb-000001
Figure PCTCN2020119262-appb-000001
其中,len为数据包长度,type定义传输的内存块的属性(如1表示传感器采集数据),data内存块数据,checksum为效验,本发明设计的协议主要是定义了内存块的属性编码。数据采集模块和第一内存块之间的数据的接收要按预设协议进行封装,数据的发送要按根据该预设协议进行解封,而第二内存块和数据显示模块之间的数据的接收也要按预设协议进行封装,数据的发送也要根据该预设协议进行解封。通过本协议的设计,将数据按照本协议进行接收和发送,每次传输的都是内存块的数据,通过效验控制数据正确性,收到后覆盖对应内存块数据,即通信双方访问对应数据时都如同访问自身内存中的数据一样,达到模块间共享内存的功能。Among them, len is the length of the data packet, type defines the attributes of the memory block to be transmitted (for example, 1 means sensor collection data), data memory block data, and checksum is validation. The protocol designed in the present invention mainly defines the attribute code of the memory block. The reception of data between the data acquisition module and the first memory block should be encapsulated according to a preset protocol, the transmission of data should be unpacked according to the preset protocol, and the data between the second memory block and the data display module should be unpacked according to the preset protocol. Reception should also be encapsulated according to a preset protocol, and data transmission should also be unencapsulated according to the preset protocol. Through the design of this protocol, the data is received and sent in accordance with this protocol. Each time the data is transmitted in the memory block, the correctness of the data is controlled through the validation, and the corresponding memory block data is overwritten after receiving, that is, when the communication parties access the corresponding data It is the same as accessing data in its own memory to achieve the function of sharing memory between modules.
以上所述仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是在本发明的发明构思下,利用本发明说明书及附图内容所作的等效结构变换,或直接/间接运用在其他相关的技术领域均包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and do not limit the scope of the present invention. Under the inventive concept of the present invention, equivalent structural transformations made by using the contents of the description and drawings of the present invention, or direct/indirect use Other related technical fields are included in the scope of patent protection of the present invention.

Claims (9)

  1. 一种多模块通信控制方法,其特征在于,用于实现主控模块与数据采集模块、数据显示模块的数据通讯,所述主控模块包括第一CPU、内存、DMA控制器、第一串口和第二串口,数据采集模块和第一串口连接,数据显示模块和第二串口连接,所述第一串口和第二串口具有收发缓存,A multi-module communication control method, characterized in that it is used to implement data communication between a main control module, a data acquisition module, and a data display module. The main control module includes a first CPU, a memory, a DMA controller, a first serial port, and a The second serial port, the data acquisition module is connected to the first serial port, the data display module is connected to the second serial port, and the first serial port and the second serial port have transceiver buffers,
    包括以下步骤:It includes the following steps:
    S1,将第一串口和第二串口配置为DMA模式,S1, configure the first serial port and the second serial port to DMA mode,
    S2,在内存中开辟第一内存块、第二内存块,S2, open up the first memory block and the second memory block in the memory,
    S3,设置第一DMA接收通道的目的地址为第一串口收发缓存地址,设置第一DMA接收通道的源地址为第一串口接收地址,使得第一DMA接收通道能接收数据,S3. Set the destination address of the first DMA receiving channel to the first serial port transceiver buffer address, and set the source address of the first DMA receiving channel to the first serial port receiving address, so that the first DMA receiving channel can receive data,
    设置第一DMA发送通道的目的地址为第一串口的发送地址,设置第一DMA发送通道的源地址为第一串口的收发缓存地址,并使得第一DMA发送通道能发送数据,Set the destination address of the first DMA transmission channel to the transmission address of the first serial port, and set the source address of the first DMA transmission channel to the transceiver buffer address of the first serial port, and enable the first DMA transmission channel to send data,
    设置第二DMA接收通道的目的地址为第二串口收发缓存地址,设置第二DMA接收通道的源地址为第二串口接收地址,使得第二DMA通道能接收数据,Set the destination address of the second DMA receiving channel to the second serial port transceiver buffer address, and set the source address of the second DMA receiving channel to the second serial port receiving address, so that the second DMA channel can receive data,
    设置第二DMA发送通道的目的地址为第二串口的发送地址,设置第二DMA发送通道的源地址为收发缓存地址,使得第二发送DMA通道能发送数据,Set the destination address of the second DMA transmission channel as the transmission address of the second serial port, and set the source address of the second DMA transmission channel as the transceiver buffer address, so that the second transmission DMA channel can send data,
    S4,启动主控模块和数据采集模块,数据采集模块开始采集数据,所述收发缓存开始接收所述数据采集模块发来的数据,S4. Start the main control module and the data acquisition module, the data acquisition module starts to collect data, and the transceiver buffer starts to receive the data sent by the data acquisition module.
    第一DMA通道将收发缓存中的数据传输至所述第一内存块中,The first DMA channel transmits the data in the receiving and sending buffer to the first memory block,
    S5,第一CPU能够从第一内存块中提取数据,并对这些数据进行处理,将处理完的数据存储至第一内存块和第二内存块中,S5, the first CPU can extract data from the first memory block, process the data, and store the processed data in the first memory block and the second memory block,
    S6,当主控模块要向所述数据显示模块发送数据时,DMA控制器将第二内存块中的数据转移到第二串口的收发缓存中,数据显示模块从第二串口的收发缓存中获取数据。S6: When the main control module wants to send data to the data display module, the DMA controller transfers the data in the second memory block to the transceiver buffer of the second serial port, and the data display module obtains it from the transceiver buffer of the second serial port data.
  2. 如权利要求1所述的多模块通信控制方法,其特征在于,所述步骤S4包括:S41,第一串口的收发缓存在接收到第一帧数据时,会产生一个数据接收信号通知DMA控制器,第一CPU在接收到DMA控制器产生的信号后,启动数据封装检测,对第一帧数据进行CRC校验,用来判定数据的正确性,防止因干扰产生数据错误,若通过CRC校验,第一帧数据在传输过程中没有出错,则进行下一步骤,若第一帧数据在传输过程中出现错误,则证明数据采集模块可能存在异常,则丢弃该数据,并启动异常计数,当异常计数达到一定阈值时,主控模块及数据采集模块自身进入异常处理模式。The multi-module communication control method according to claim 1, wherein the step S4 comprises: S41, when the transceiver buffer of the first serial port receives the first frame of data, it generates a data reception signal to notify the DMA controller After the first CPU receives the signal generated by the DMA controller, it starts the data encapsulation test and performs a CRC check on the first frame of data to determine the correctness of the data and prevent data errors due to interference. If it passes the CRC check If there is no error in the first frame of data during transmission, proceed to the next step. If an error occurs in the first frame of data during transmission, it proves that there may be an abnormality in the data acquisition module. The data is discarded and the abnormal count is started. When the abnormal count reaches a certain threshold, the main control module and the data acquisition module themselves enter the abnormal processing mode.
  3. 如权利要求2所述的多模块通信控制方法,其特征在于,所述步骤S4还包括:The multi-module communication control method according to claim 2, wherein the step S4 further comprises:
    S42,在步骤S41之后,第一CPU根据预设的协议对第一串口收发缓存中的数据进行解析,并提取出内存块编码,判断提取出的内存块编码,并按照内存块编码将数据存储至第一内存块。S42: After step S41, the first CPU parses the data in the first serial port transceiver buffer according to the preset protocol, extracts the memory block code, judges the extracted memory block code, and stores the data according to the memory block code To the first memory block.
  4. 如权利要求3所述的多模块通信控制方法,其特征在于,所述步骤S42包括:The multi-module communication control method according to claim 3, wherein the step S42 comprises:
    S421,根据预设协议,提取第一串口收发缓存中的内存块属性编码,根据内存块属性编码,第一CPU将该段数据直接拷贝至第一内存块中的对应位置;S421: According to the preset protocol, extract the memory block attribute code in the first serial port transceiver buffer, and according to the memory block attribute code, the first CPU directly copies the piece of data to the corresponding position in the first memory block;
    S422,第一CPU根据呼吸算法需要,从第一内存块中获取数据进行处理。S422: The first CPU obtains data from the first memory block for processing according to the requirements of the breathing algorithm.
  5. 如权利要求4所述的多模块通信控制方法,其特征在于,所述主控模块内设有定时器,所述步骤S6包括:The multi-module communication control method according to claim 4, wherein the main control module is provided with a timer, and the step S6 includes:
    S61,定时器定时产生触发请求信号,DMA控制器根据触发请求信号逐次获取第二内存块中的数据。S61: The timer generates a trigger request signal at regular intervals, and the DMA controller successively acquires the data in the second memory block according to the trigger request signal.
  6. 如权利要求5所述的多模块通信控制方法,其特征在于,所述步骤S6还包括:The multi-module communication control method according to claim 5, wherein said step S6 further comprises:
    S62,DMA控制器对第二内存块中的数据进行封装后再存储至第二串口的收发缓存中。S62: The DMA controller encapsulates the data in the second memory block and then stores it in the transceiver buffer of the second serial port.
  7. 如权利要求6所述的多模块通信控制方法,其特征在于,应用于呼吸支持设备中,所述数据采集模块具有第二CPU,所述数据采集模块连接有传感器设备和动作执行设备,所述数据显示模块具有第三CPU,所述数据显示模块连接有显示设备、输入设备和声光报警设备。The multi-module communication control method according to claim 6, wherein the data acquisition module has a second CPU, and the data acquisition module is connected with a sensor device and an action execution device, and is applied to a respiratory support device. The data display module has a third CPU, and the data display module is connected with a display device, an input device, and a sound and light alarm device.
  8. 如权利要求7所述的多模块通信控制方法,其特征在于,当所述主控模块与所述数据采集模块之间的通讯失败时,所述主控模块可直接从所述传感器设备和动作之执行设备获取数据;当所述主控模块与所述数据显示模块之间的通讯失败时,所述主控模块可直接将其处理所得的数据发送到显示设备、输入设备和声光报警设备。The multi-module communication control method of claim 7, wherein when the communication between the main control module and the data acquisition module fails, the main control module can directly communicate with the sensor device The execution device obtains data; when the communication between the main control module and the data display module fails, the main control module can directly send the processed data to the display device, input device, and sound and light alarm device .
  9. 一种呼吸支持设备,其特征在于,包括:主控模块、数据采集模块和数据显示模块的数据通讯,所述主控模块包括第一CPU、内存、DMA控制器、第一串口和第二串口,所述数据采集模块和第一串口连接,所述数据显示模块和第二串口连接,所述第一串口和第二串口具有收发缓存;在所述内存中创建有第一内存块和第二内存块,所述数据采集模块和所述第一内存块之间设置有第一DMA接收通道和第一DMA发送通道,所述数据显示模块和所述第二内存块之间设置有第二DMA接收通道和第二DMA发送通道。A breathing support device, characterized by comprising: data communication between a main control module, a data acquisition module, and a data display module, the main control module including a first CPU, a memory, a DMA controller, a first serial port, and a second serial port , The data acquisition module is connected to a first serial port, the data display module is connected to a second serial port, the first serial port and the second serial port have a transceiver buffer; a first memory block and a second serial port are created in the memory A memory block, a first DMA receiving channel and a first DMA sending channel are arranged between the data acquisition module and the first memory block, and a second DMA is arranged between the data display module and the second memory block The receiving channel and the second DMA sending channel.
PCT/CN2020/119262 2019-12-02 2020-09-30 Multi-module communication control method and respiratory support device WO2021109707A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911213973.2A CN111110966B (en) 2019-12-02 2019-12-02 Multi-module communication control method and respiratory support equipment
CN201911213973.2 2019-12-02

Publications (1)

Publication Number Publication Date
WO2021109707A1 true WO2021109707A1 (en) 2021-06-10

Family

ID=70496660

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119262 WO2021109707A1 (en) 2019-12-02 2020-09-30 Multi-module communication control method and respiratory support device

Country Status (2)

Country Link
CN (1) CN111110966B (en)
WO (1) WO2021109707A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701284A (en) * 2023-06-26 2023-09-05 北京瑞祺皓迪技术股份有限公司 Method, device, equipment and medium for high-speed synchronization of data among CPUs

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111110966B (en) * 2019-12-02 2022-05-27 湖南明康中锦医疗科技发展有限公司 Multi-module communication control method and respiratory support equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6629164B1 (en) * 1999-11-10 2003-09-30 Digi International Inc. Character counter and match registers in a serial interface
CN102681953A (en) * 2011-03-15 2012-09-19 联芯科技有限公司 Direct memory access device and data receiving method thereof
CN105611295A (en) * 2015-12-23 2016-05-25 中国航天时代电子公司 System and method for implementing video capture, compression and transmission on SOC (System On Chip)
CN106528486A (en) * 2016-11-09 2017-03-22 湖南戈人自动化科技有限公司 Method for exchanging serial port data
CN110059042A (en) * 2019-04-30 2019-07-26 成都启英泰伦科技有限公司 A kind of data DMA transfer method of UART equipment
CN111110966A (en) * 2019-12-02 2020-05-08 湖南明康中锦医疗科技发展有限公司 Multi-module communication control method and respiratory support equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100464318C (en) * 2007-04-27 2009-02-25 北京中星微电子有限公司 DMA controller and transmission method of implementing high efficient DMA transmission
CN101485913B (en) * 2008-12-30 2011-04-13 深圳市普博科技有限公司 Breathing machine inter-plate communication system and method
US10201674B2 (en) * 2014-05-09 2019-02-12 Mallinckrodt Hospital Products IP Limited Systems and methods for intelligent gas source management
US10191871B2 (en) * 2017-06-20 2019-01-29 Infineon Technologies Ag Safe double buffering using DMA safe linked lists
US20190015614A1 (en) * 2017-07-13 2019-01-17 Royal Commission Yanbu Colleges & Institutes Systems, devices, and methodologies to provide protective and personalized ventilation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6629164B1 (en) * 1999-11-10 2003-09-30 Digi International Inc. Character counter and match registers in a serial interface
CN102681953A (en) * 2011-03-15 2012-09-19 联芯科技有限公司 Direct memory access device and data receiving method thereof
CN105611295A (en) * 2015-12-23 2016-05-25 中国航天时代电子公司 System and method for implementing video capture, compression and transmission on SOC (System On Chip)
CN106528486A (en) * 2016-11-09 2017-03-22 湖南戈人自动化科技有限公司 Method for exchanging serial port data
CN110059042A (en) * 2019-04-30 2019-07-26 成都启英泰伦科技有限公司 A kind of data DMA transfer method of UART equipment
CN111110966A (en) * 2019-12-02 2020-05-08 湖南明康中锦医疗科技发展有限公司 Multi-module communication control method and respiratory support equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701284A (en) * 2023-06-26 2023-09-05 北京瑞祺皓迪技术股份有限公司 Method, device, equipment and medium for high-speed synchronization of data among CPUs
CN116701284B (en) * 2023-06-26 2024-02-09 北京瑞祺皓迪技术股份有限公司 Method, device, equipment and medium for high-speed synchronization of data among CPUs

Also Published As

Publication number Publication date
CN111110966B (en) 2022-05-27
CN111110966A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
US11645905B2 (en) Systems and methods for monitoring a patient health network
WO2021109707A1 (en) Multi-module communication control method and respiratory support device
Clarke et al. Interoperable end-to-end remote patient monitoring platform based on IEEE 11073 PHD and ZigBee health care profile
Milan Manani et al. Remote monitoring of automated peritoneal dialysis improves personalization of dialytic prescription and patient’s independence
US20130255681A1 (en) Data collection system and method using parametric-based sampling rates
CN202505352U (en) Mobile phone cloud Internet of things medical system for managing patient having ventilation at home
WO2005114524A2 (en) Personalized remote patient monitoring systems and methods
JP6416112B2 (en) Monitor defibrillator teletherapy server
US9943227B2 (en) Selective data transmission method and system based on central monitoring system
WO2016206334A1 (en) Special group monitoring control system, hospital server, wearable device, and communication system
JP2010518891A (en) Adaptive framework for medical device data distribution in personal health space
JP2003308389A (en) Medical support system, medical support method, computer program, and storage medium for computer program
CN208285434U (en) A kind of injury in traumatic condition of patient logging recorder system
CN106354172A (en) Intelligent temperature control system for special-grade ward of hospital
WO2018219098A1 (en) System and method for managing clinical respiratory therapy information, and storage medium
CN103156578A (en) Intelligentized multi-parameter remote controller used for vital signs of patient in oxygen chamber
CN110838362A (en) Intelligent ward information interaction system and method thereof
CN108992724A (en) Dialysis procedure automatic monitoring warning method and its system
CN203416289U (en) FeNO monitoring and analysis management system based on cloud-plus-client Internet of Things of mobile phone
US11241583B2 (en) Portable defibrillator used for display, hardcopy, and control for other devices
Salvador et al. An implementation of the IEEE medical information bus standard
CN113301122B (en) Medical robot distributed system real-time communication method and device and electronic equipment
WO2023088259A1 (en) Medical device comprising plug-in eit and ventilation medical device integrating eit
Mishra Physiological Variables Interface Design for MIOT Ward
EP4198710A1 (en) Remote view distribution device in a service-oriented device connectivity (sdc) network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20895006

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20895006

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 27/01/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20895006

Country of ref document: EP

Kind code of ref document: A1