CN117827971A - Data sharing system and method based on multitasking, equipment and storage medium - Google Patents

Data sharing system and method based on multitasking, equipment and storage medium Download PDF

Info

Publication number
CN117827971A
CN117827971A CN202311863407.2A CN202311863407A CN117827971A CN 117827971 A CN117827971 A CN 117827971A CN 202311863407 A CN202311863407 A CN 202311863407A CN 117827971 A CN117827971 A CN 117827971A
Authority
CN
China
Prior art keywords
data
buffer
sub
computer
oscillation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311863407.2A
Other languages
Chinese (zh)
Inventor
谢永平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Meimeimeichuangyi Medical Technology Co ltd
Original Assignee
Shenzhen Meimeimeichuangyi Medical 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 Shenzhen Meimeimeichuangyi Medical Technology Co ltd filed Critical Shenzhen Meimeimeichuangyi Medical Technology Co ltd
Priority to CN202311863407.2A priority Critical patent/CN117827971A/en
Publication of CN117827971A publication Critical patent/CN117827971A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0002Serial port, e.g. RS232C

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)

Abstract

The embodiment of the application provides a data sharing system, a data sharing method, data sharing equipment and a data sharing storage medium based on multitasking, and belongs to the technical field of serial port communication. The method is applied to a pulse oscillation device, and comprises the following steps: the lower computer collects initial measurement data of a subject through the pressure sensor and the flow sensor, and writes the initial measurement data into a first sub-buffer zone of a preset annular buffer zone; if an uploading data acquisition command sent by the upper computer is received, the lower computer inquires target oscillation data from the first sub-buffer area, and the target oscillation data is sent to the upper computer through a preset serial port; the upper computer detects and obtains target resistance state data according to the target oscillation data; the upper computer stores the target resistance state data into the second sub-buffer, and feeds back the target resistance state data to the lower computer through a preset serial port. According to the method and the device, stability and efficiency of data processing can be guaranteed under the environment of multitasking operation, and accuracy of data processing is improved.

Description

Data sharing system and method based on multitasking, equipment and storage medium
Technical Field
The present disclosure relates to the field of serial communications technologies, and in particular, to a system, a method, an apparatus, and a storage medium for sharing data based on multiple tasks.
Background
Pulse oscillations (Impulse Oscillometry, IOS) detect a non-invasive, non-force dependent technique for measuring respiratory system mechanical properties such as airway resistance. In practice, pulse oscillation detection may provide an assessment of various respiratory parameters for assisting a physician in assessing a patient's lung function condition and monitoring disease progression and treatment outcome. Currently, an IOS device is usually a multi-module software system formed by an upper computer and a lower computer, that is, the lower computer receives data and then directly transmits the data to the upper computer, and the upper computer processes the data after receiving the data. However, when the environment of multitasking based on a real-time operating system is involved, the conventional IOS device is easy to cause abnormality in task switching when a plurality of tasks simultaneously perform read-write processing on data, thereby reducing the efficiency and accuracy of data processing. Therefore, how to provide a data sharing method based on multitasking, which can ensure the stability and efficiency of data processing and improve the accuracy of data processing under the environment of multitasking operation, becomes a technical problem to be solved.
Disclosure of Invention
The main purpose of the embodiments of the present application is to provide a data sharing system, a method, a device, and a storage medium based on multitasking, which can ensure stability and efficiency of data processing and improve accuracy of data processing in a multitasking environment.
In order to achieve the above objective, a first aspect of the embodiments of the present application provides a data sharing system based on multiple tasks, which is applied to a pulse oscillation device, where the data sharing system includes a lower computer and an upper computer, and the lower computer and the upper computer are connected through a preset serial port communication, and specifically includes:
the lower computer collects initial measurement data of a subject through a pressure sensor and a flow sensor, and writes the initial measurement data into a preset annular buffer zone; the annular buffer zone comprises a first sub-buffer zone and a second sub-buffer zone, and the first sub-buffer zone is used for storing the initial measurement data;
if an uploading acquisition data command sent by the upper computer is received, the lower computer performs data query on the first sub-buffer area according to the uploading acquisition data command to obtain target oscillation data, and sends the target oscillation data to the upper computer through the preset serial port;
The upper computer detects the resistance state according to the received target oscillation data to obtain target resistance state data;
and the upper computer stores the target resistance state data into the second sub-buffer, and feeds the target resistance state data back to the lower computer through the preset serial port.
To achieve the above object, a second aspect of the embodiments of the present application provides a data sharing method based on multiplexing, which is applied to the data sharing system described in the first aspect, and the method includes:
the lower computer collects initial measurement data of a subject through the pressure sensor and the flow sensor, and writes the initial measurement data into a preset annular buffer zone; the annular buffer zone comprises a first sub-buffer zone and a second sub-buffer zone, and the first sub-buffer zone is used for storing the initial measurement data;
if an uploading acquisition data command sent by an upper computer is received, the lower computer performs data query on the first sub-buffer area according to the uploading acquisition data command to obtain target oscillation data, and sends the target oscillation data to the upper computer through a preset serial port;
the upper computer detects the resistance state according to the received target oscillation data to obtain target resistance state data;
And the upper computer stores the target resistance state data into the second sub-buffer, and feeds the target resistance state data back to the lower computer through the preset serial port.
In some embodiments, the lower computer collects initial measurement data of the subject through the pressure sensor and the flow sensor, comprising:
the upper computer sends a starting instruction to the air passage blocking valve, and the starting instruction is used for indicating the opening of the air passage blocking valve between the user breathing port and the pulse oscillation equipment;
the upper computer sends an acquisition instruction to the lower computer, the acquisition instruction is used for indicating the lower computer to acquire data of test gas according to a preset acquisition period through the pressure sensor and the flow sensor, initial measurement data are obtained, the initial measurement data are sent to the lower computer, and the pressure sensor and the flow sensor are respectively in communication connection with the lower computer.
In some embodiments, the lower computer performs data query on the first sub-buffer according to the data uploading command to obtain target oscillation data, including:
performing instruction analysis on the uploading acquisition data command to obtain an instruction time stamp;
Acquiring a buffer area reading pointer of the first sub-buffer area;
and reading the data of the first sub-buffer according to the buffer reading pointer and the instruction time stamp to obtain the target oscillation data.
In some embodiments, the sending the target oscillation data to the upper computer through a preset serial port includes:
determining the number of uploaded data according to the preset acquisition period and the preset processing period, wherein the preset processing period refers to the period of processing the data by the upper computer;
performing data packaging on the target oscillation data according to the number of the uploaded data to obtain a target data packet;
and sending the target data packet to the upper computer through the preset serial port.
In some embodiments, the writing the initial measurement data into a preset ring buffer includes:
acquiring a buffer write pointer of the first sub-buffer;
and the lower computer writes the received initial measurement data into the first sub-buffer according to the buffer write pointer, and updates the buffer write pointer according to the written position of the initial measurement data in the first sub-buffer.
In some embodiments, the lower computer writes the received initial measurement data to the first sub-buffer according to the buffer write pointer, including:
if the buffer write pointer points to a buffer area end interval of the first sub-buffer, historical oscillation data is obtained from the first sub-buffer, wherein the historical oscillation data refers to oscillation data with the largest time interval with the initial measurement data in the first sub-buffer;
deleting the history oscillation data from the first sub-buffer, and updating the first sub-buffer and the buffer write pointer;
and the lower computer writes the received initial measurement data into the updated first sub-buffer according to the updated buffer write pointer.
In some embodiments, the upper computer performs state detection according to the received target oscillation data to obtain target resistance state data, including:
the upper computer calculates airway resistance according to the received target oscillation data to obtain target resistance data;
and the upper computer detects the resistance state of the target resistance data according to a preset resistance threshold value to obtain the target resistance state data.
To achieve the above object, a third aspect of the embodiments of the present application proposes an electronic device, including:
at least one memory;
at least one processor;
at least one computer program;
the at least one computer program is stored in the at least one memory, and the at least one processor executes the at least one computer program to implement the method of the second aspect described above.
To achieve the above object, a fourth aspect of the embodiments of the present application proposes a storage medium that is a computer-readable storage medium storing a computer program for causing a computer to execute the method described in the above second aspect.
In order to avoid abnormal task switching when a plurality of tasks read and write data simultaneously, a lower computer collects initial measurement data of a subject through a pressure sensor and a flow sensor and writes the initial measurement data into a preset annular buffer zone. The ring buffer includes a first sub-buffer for storing initial measurement data and a second sub-buffer. And if an uploading acquisition data command sent by the upper computer is received, the lower computer performs data query from the first sub-buffer area according to the uploading acquisition data command to obtain target oscillation data, and sends the target oscillation data to the upper computer through a preset serial port. And then, the upper computer detects the resistance state according to the received target oscillation data to obtain target resistance state data. The upper computer stores the target resistance state data into the second sub-buffer, and feeds back the target resistance state data to the lower computer through a preset serial port. According to the method and the device, stability and efficiency of data processing can be guaranteed under the environment of multitasking operation, and accuracy of data processing is improved.
Drawings
FIG. 1 is a schematic diagram of a data sharing system based on multiple tasks according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for sharing data based on multiple tasks according to an embodiment of the present application;
fig. 3 is a specific flowchart of step S210 in fig. 2;
fig. 4 is another specific flowchart of step S210 in fig. 2;
FIG. 5 is a schematic diagram of the first sub-buffer of FIG. 4;
fig. 6 is a specific flowchart of step S420 in fig. 4;
fig. 7 is a specific flowchart of step S220 in fig. 2;
fig. 8 is a schematic diagram of a control command when an upper computer and a lower computer provided in an embodiment of the present application perform serial port communication;
fig. 9 is another specific flowchart of step S220 in fig. 2;
fig. 10 is a schematic diagram of performing common-frequency processing on data of an upper computer and a lower computer according to an embodiment of the present application;
fig. 11 is a specific flowchart of step S230 in fig. 2;
FIG. 12 is a schematic flow chart of a data sharing system based on multiple tasks according to an embodiment of the present application in practical applications;
fig. 13 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It should be noted that although functional block division is performed in a device diagram and a logic sequence is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
Pulse oscillations (Impulse Oscillometry, IOS) detect a non-invasive, non-force dependent technique for measuring respiratory system mechanical properties such as airway resistance. In practice, pulse oscillation detection may provide an assessment of various respiratory parameters for assisting a physician in assessing a patient's lung function condition and monitoring disease progression and treatment outcome. Currently, an IOS device is usually a multi-module software system formed by an upper computer and a lower computer, that is, the lower computer receives data and then directly transmits the data to the upper computer, and the upper computer processes the data after receiving the data. However, when the environment of multitasking based on a real-time operating system is involved, the conventional IOS device is easy to cause abnormality in task switching when a plurality of tasks simultaneously perform read-write processing on data, thereby reducing the efficiency and accuracy of data processing. Therefore, how to provide a data sharing method based on multitasking, which can ensure the stability and efficiency of data processing and improve the accuracy of data processing under the environment of multitasking operation, becomes a technical problem to be solved.
Based on the above, the embodiments of the present application provide a system, a method, an apparatus, and a storage medium for data sharing based on multitasking, which can ensure stability and efficiency of data processing and improve accuracy of data processing in a multitasking environment.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a data sharing system based on multiplexing according to an embodiment of the present application. The data sharing system 110 of the present application is applied to a respiratory diagnosis device, and specifically includes a lower computer 111 and an upper computer 112. The lower computer 111 and the upper computer 112 are connected through a preset serial port.
It should be noted that the respiratory diagnostic apparatus of the present application further includes a gas path blocking valve 113 (i.e., a blocking valve of the IOS gas path) and a target sensor group 114. The air path blocking valve 113 refers to a device for controlling and scheduling a motor control task of the lower computer 111. The gas path blocking valve 113 may be a reversing valve, a mode adjusting valve, or the like. The air path blocking valve 113 is in communication connection with the lower computer 111, and can transmit control commands with the lower computer through a communication protocol (such as serial communication).
The target sensor group 114 refers to a device for acquiring an oscillation signal or oscillation data. The target sensor group 114 may receive the data acquisition signal from the lower computer 111 and output the acquired initial measurement data to the lower computer 111, so as to transmit the initial measurement data to the upper computer 112 or other related components through a preset serial port. The target sensor group 114 is in communication connection with the lower computer 111, and can perform data interaction and acquisition command transmission with the lower computer through a communication protocol. The set of target sensors may include a pressure sensor and a flow sensor.
The lower computer 111 refers to a microprocessor in the IOS component. In practical products, the upper computer is responsible for interface interaction running of upper computer software, which may be a general-purpose computer, and then is connected with each functional module, such as a lung dispersion functional module, an aerosol excitation system (Aerosol Provocation System, APS), an IOS, plethysmography and the like, and each module has a respective microprocessor (corresponding to the lower computer). The lower computer of the IOS is in communication with a pulse oscillation IOS device in the respiratory diagnostic device. The lower computer 111 may also be connected to the upper computer 112 through a preset serial port for data interaction and communication with the upper computer 112.
By way of example, in a multitasking environment, the lower computer 111 may include a data transmission task, a data acquisition task, a motor control task, and other tasks, which are not particularly limited herein. For example, when the motor control task rotates the air path blocking valve 113 (e.g., a reversing valve) into a pulse oscillation (IOS) detection mode, it means that the air path blocking valve between the user's breathing port and the pulse oscillation device is opened, so that the test gas output from the user's breathing port is transmitted to the pulse oscillation device. At this time, the pulse oscillation device may acquire and output oscillation data through the target sensor group 114, that is, the pressure sensor in the target sensor group acquires oscillation pressure values, and the flow sensor acquires flow values.
It should be noted that, the upper computer 112 refers to a computer or a terminal device in the system, and generally has better processing capability and a user interface. The upper computer 112 may be connected to the lower computer 111 through a preset serial port for data interaction and communication with the lower computer. The upper computer 112 may send a control command to the lower computer 111, receive the collected data of the lower computer, and perform operations such as data processing, analysis, and display. In the environment of multitasking, the lower computer 111 may include a waveform drawing task, a data processing task, a data transmitting task, and other tasks, etc., which are not particularly limited herein.
It should be noted that the data sharing system based on multitasking in the present application is a multi-module multitasking software system composed of upper and lower computers.
It should be noted that, the multitasking-based data sharing system according to the embodiment of the present application is used to implement the multitasking-based data sharing method according to the following embodiment, and the application of the multitasking-based data sharing system according to the embodiment of the present application corresponds to the multitasking-based data sharing method according to the following embodiment, and the specific processing procedure is referred to the multitasking-based data sharing method according to the following embodiment and will not be described herein.
In one embodiment, referring to fig. 2, fig. 2 is a flowchart of a data sharing method based on multiplexing according to an embodiment of the present application. The method is applied to a pulse oscillation apparatus provided with the data sharing system 110 of fig. 1, and the method in fig. 2 may specifically include, but is not limited to, steps S210 to S240.
Step S210, the lower computer collects initial measurement data of a subject through a pressure sensor and a flow sensor, and writes the initial measurement data into a preset annular buffer area; the annular buffer zone comprises a first sub-buffer zone and a second sub-buffer zone, and the first sub-buffer zone is used for storing initial measurement data;
step S220, if an uploading data acquisition command sent by the upper computer is received, the lower computer performs data query from the first sub-buffer area according to the uploading data acquisition command to obtain target oscillation data, and sends the target oscillation data to the upper computer through a preset serial port;
step S230, the upper computer detects the resistance state according to the received target oscillation data to obtain target resistance state data;
in step S240, the upper computer stores the target resistance state data in the second sub-buffer, and feeds back the target resistance state data to the lower computer through the preset serial port.
In step S210 of some embodiments, in order to ensure that a plurality of tasks do not interfere with each other, a ring buffer is preset as a common area, and data in the ring buffer does not need to be processed in real time, so that a situation that task switching abnormality occurs in real time processing of a plurality of tasks simultaneously is avoided. In the ring buffer, a plurality of tasks do not interfere with each other, and each task can share data stored in the ring buffer. It should be noted that the ring buffer of the present application includes a first sub-buffer and a second sub-buffer, where the first sub-buffer is used for storing initial measurement data. Therefore, the lower computer writes the received initial measurement data into a preset annular buffer zone, the annular buffer zone can accumulate the data first, and when the data processing task is in an operation state, the data processing task is processed uniformly, so that the software processing efficiency is improved, the problem of data overflow can be avoided, and the data processing capacity of the software system is improved.
It should be noted that the present application proposes a data sharing method for synchronously storing oscillating pressure and flow data mechanisms. The oscillation pressure value and the flow value are obtained through the oscillation pressure sensor and the flow sensor, and the upper computer needs to oscillate the pressure value and the flow value corresponding to the oscillation pressure value at the same time. Therefore, the proposed mechanism for synchronously storing oscillation pressure and flow data can combine the oscillation pressure value and the flow value at the same time into a new data, namely, the initial measurement data is written into the first sub-buffer, and the data is processed as a whole in the later process. The oscillation pressure value and the flow value at the same moment can be subjected to data acquisition according to an internal timer of the target sensor group.
It should be noted that, the present application can detect and determine the abnormal situation of the oscillation data, and trigger a corresponding alarm or early warning mechanism. Thus, potential faults or abnormal conditions can be found and processed in time, and the reliability and safety of the equipment are improved.
Referring to fig. 3, fig. 3 is a specific flowchart of step S210 provided in the embodiment of the present application. In some embodiments of the present application, step S210 may specifically include, but is not limited to, step S310 and step S320, which are described in detail below in conjunction with fig. 3.
Step S310, the upper computer sends a starting instruction to the air passage blocking valve, wherein the starting instruction is used for indicating the opening of the air passage blocking valve between the user breathing port and the pulse oscillation equipment;
and step S320, the upper computer sends an acquisition instruction to the lower computer, the acquisition instruction is used for instructing the lower computer to acquire data of the test gas according to the preset acquisition period through the pressure sensor and the flow sensor, initial measurement data are obtained, the initial measurement data are sent to the lower computer, and the pressure sensor and the flow sensor are respectively in communication connection with the lower computer.
In step S310 of some embodiments, the oscillation detection mode refers to an operation mode in which the gas path blocking valve is used to detect and analyze oscillation data. In other words, the air path blocking valve is in the oscillation detection mode after being opened. The pulse oscillation device has an oscillation sounder (e.g. a loudspeaker) which can emit air waves of a specific frequency into the air path, which can be breathed into the lungs and out by the user. Because the frequency of these airwaves (typically 5Hz-25Hz, 5Hz apart) is different from the frequency of the human respiratory wave (typically 0.5 Hz). The pressure and flow data of the air wave with specific frequency after passing through the respiratory system of the human body can be extracted according to the data monitored by the pressure sensor and the flow sensor and by adopting Fourier transformation. And then based on these data, the respiratory resistance (i.e., airway resistance) of the human body is calculated.
When the gas circuit blocking valve is determined to be in the oscillation detection mode, the data acquisition state of the target sensor group is set at the same time. The data acquisition state comprises a starting state and a non-starting state. The starting state refers to a state that the target sensor group can acquire real-time data. The non-starting state refers to a state that the current target sensor group cannot collect real-time data. Because when the data collected by the target sensor group is more, the data collection state can be firstly not set to be the non-starting state. If the real-time performance of data acquisition and data processing by the upper computer and the lower computer is realized, the data acquisition state can be set to be a starting state, and the acquired initial measurement data is uploaded to the lower computer in real time, so that the upper computer carries out real-time processing, and the accuracy of a detection result is improved.
It should be noted that, in the oscillation detection mode, the system controls the target sensor group to collect and record the characteristics and changes of the oscillation data, so as to perform subsequent analysis and processing. The target sensor group is used for collecting oscillation data from mechanical equipment, structures or other vibration sources, and can be an electric signal converted by the sensor. The target sensor group comprises an oscillation pressure sensor and a flow sensor, so when the motor control task rotates the gas circuit blocking valve to a pulse oscillation detection mode, the oscillation pressure sensor and the flow sensor start to output initial measurement data (namely, the oscillation pressure value acquired by the oscillation pressure sensor and the flow value acquired by the flow sensor) to the lower computer.
In step S320 of some embodiments, the preset acquisition period refers to a time period during which the lower computer acquires the initial measurement data uploaded by the target sensor group. The preset acquisition period can be flexibly set according to actual needs, such as 1 millisecond, 2 milliseconds, etc., and is not particularly limited herein. For example, the preset acquisition period is 1 millisecond, at this time, if the data acquisition state is the starting state, the target sensor group acquires initial measurement data once every 1 millisecond, and the acquired initial measurement data is uploaded to the lower computer in real time, so that the upper computer performs real-time processing to improve the accuracy of the detection result.
It should be noted that, for the respiratory diagnosis apparatus of the present application, it is currently applicable to a large-scale pulmonary function machine, in which the pulmonary function machine communicates (the user breathing port and the pulse oscillation apparatus) different air paths. Different gas paths are communicated with different detection devices, such as a lung ventilation test device, a lung dispersion test device and the like. When the IOS is measured, the upper computer issues an instruction to instruct a valve (namely an air passage blocking valve) between the breathing port of the user and the IOS to be opened, and sends an instruction to a singlechip (lower computer) of the IOS to instruct data collected by the pressure sensor and the flow sensor to be collected, and then the data is uploaded to calculate the breathing resistance.
The embodiment has the advantage that the data acquisition state of the target sensor group can be accurately set after the gas circuit blocking valve is determined to be in the oscillation detection mode. Therefore, data acquisition failure or errors caused by setting errors can be avoided, and the accuracy and reliability of data acquisition are improved. After the data acquisition state is determined to be the starting state, the target sensor group can acquire data according to a preset acquisition period. In this way, the frequency and interval of data acquisition can be ensured to be fixed, and uncertainty and instability of data acquisition time are avoided.
Referring to fig. 4, fig. 4 is another specific flowchart of step S210 provided in the embodiment of the present application. In some embodiments of the present application, step S210 specifically includes, but is not limited to, step S410 and step S420, which are described in detail below in conjunction with fig. 4.
Step S410, a buffer write pointer of a first sub-buffer is obtained;
in step S420, the lower computer writes the received initial measurement data into the first sub-buffer according to the buffer write pointer, and updates the buffer write pointer according to the position of the written initial measurement data in the first sub-buffer.
In steps S410 to S420 of some embodiments, the buffer write pointer refers to a pointer used for performing a data write operation in the ring buffer. Since the oscillation data needs to be stored in the ring buffer, the upper computer invokes the data from the ring buffer to be transmitted to the target device or system. Thus, the buffer write pointer is used to indicate the location in the ring buffer where a write operation is currently being performed. When the lower computer writes the received initial measurement data into the first sub-buffer according to the buffer write pointer, the buffer write pointer continuously moves forward to indicate the next position where the data can be written. And updating the buffer write pointer in accordance with the location of the currently written initial measurement data in the first sub-buffer.
According to the embodiment of the application, the annular buffer area is arranged in a cyclic storage mode, so that the space of the buffer area can be fully utilized, and overflow or waste of data is avoided. Meanwhile, efficient data read-write operation can be realized through cyclic storage, and the data transmission efficiency is improved. During a data write operation, the system or application checks the location of the buffer write pointer to ensure that the data write operation does not go beyond the buffer. Meanwhile, the system or the application program can judge whether the buffer area is full according to the position of the write pointer of the buffer area so as to avoid data loss or write errors.
In the ring buffer, the data is stored in a loop. The ring buffer is a circular queue data structure. The ring buffer may store data in a circular array of buffers of fixed size. The ring buffer of the present application includes a first sub-buffer for storing initial measurement data and a second sub-buffer. The first sub-buffer consists of an array of fixed size and two pointers. The two pointers are a buffer write pointer and a buffer read pointer. The buffer read pointer indicates the next data location to be read and the buffer write pointer indicates the next data location to be written.
For example, referring to fig. 5, fig. 5 shows a schematic diagram of reading and writing of the first sub-buffer. If the first sub-buffer consists of an array space where 10 bytes can be stored and two pointers (buffer write pointer and buffer read pointer) are fixed. The index of the 10 bytes of memory is marked sequentially 1 to 10, and both the initial buffer write pointer and the buffer read pointer point to the location where the memory index is 1. If 3 bytes are written into the first sub-buffer, then the buffer write pointer points to the location with the memory space number 4, and the buffer read pointer remains at the location with the memory space number 1. After that, if 7 bytes are written into the first sub-buffer again and 1 byte is read out, then the buffer read pointer at this time is still at the location of the storage space reference numeral 2. Since the way the data of the circular buffer is stored is a circular one, if the write pointer moves to the end of the buffer, it will wrap around to the beginning of the buffer, continuing to write data from scratch. Thus, after 7 bytes are written again, the buffer write pointer now points to the location of memory space index 2.
Referring to fig. 6, fig. 6 is a specific flowchart of step S420 provided in the embodiment of the present application. In some embodiments of the present application, step S420 specifically includes, but is not limited to, steps S610 to S630, which are described in detail below in conjunction with fig. 6.
Step S610, if the buffer write pointer points to the buffer end section of the first sub-buffer, historical oscillation data is obtained from the first sub-buffer, wherein the historical oscillation data is oscillation data with the largest time interval with the initial measurement data in the first sub-buffer;
step S620, deleting the history oscillation data from the first sub-buffer, and updating the first sub-buffer and the buffer write pointer;
in step S630, the lower computer writes the received initial measurement data into the updated first sub-buffer according to the updated buffer write pointer.
In steps S610 to S630 of some embodiments, the buffer end interval refers to the storage space at the end of the buffer. If the buffer write pointer points to the buffer end interval of the first sub-buffer, the history oscillation data is obtained from the first sub-buffer, and the history oscillation data is the data written in the first storage space of the first sub-buffer. Thus, the historical oscillation data refers to the oscillation data in the first sub-buffer that has the largest time interval from the initial measurement data. Since the way the data is stored in the circular buffer is a circular one, if the write pointer moves to the end of the buffer, it will wrap around to the beginning of the buffer, continuing to write data from scratch to achieve circular storage of the data. That is, the history oscillation data is deleted from the first sub-buffer, and the oscillation data after the history oscillation data is moved to the position of the history oscillation data, updating the first sub-buffer and the buffer write pointer. As shown in fig. 5, the initial buffer write pointer and the buffer read pointer both point to locations with memory space numbered 1. If 11 bytes are written into the first sub-buffer, then when writing the 10 th byte into the first sub-buffer, since the buffer write pointer points to the buffer end section of the first sub-buffer (i.e. the storage space at the end of the first sub-buffer), the history oscillation data (i.e. the data stored in the storage space at the head of the first sub-buffer) is obtained from the first sub-buffer. The history oscillation data is deleted from the first sub-buffer and the buffer write pointer are updated. And the lower computer writes the received initial measurement data into the updated first sub-buffer according to the updated buffer write pointer. Thus, the last buffer write pointer is at the location of memory space index 2.
It should be noted that, if the data is already stored in the storage space pointed by the buffer write pointer, the stored oscillation data is deleted or emptied to store new oscillation data, so that the real-time performance of the subsequent airway resistance measurement is improved, and the accuracy of the measurement result is further improved.
It should be noted that, the present application proposes a highly optimized and interface-based data sharing method, and, with reference to fig. 5, the use of the ring buffer in the present application is based on interface invocation, and may be packaged into a data processing library. Meanwhile, the bottom layer operation logic is not required to be clear, and the space required by the annular buffer area is only required to be defined according to the data quantity. Then, the write-in interface function is called respectively to write the collected oscillation data into the annular buffer area, and the data is read out into the data processing program through the read-out interface function. Thus, in pulse oscillation (IOS) detection of airway resistance, it is necessary to constantly acquire target oscillation data (such as oscillation pressure data and flow data). Thus, the initial measurement data (e.g., oscillation pressure data and flow data) at this time is continuously written into the first sub-buffer as a formation data stream. When the first sub-buffer is filled with data, the previous data will be overwritten, and the data held in the first sub-buffer is always the latest initial measurement data (such as oscillation pressure value and flow value).
In step S230 of some embodiments, the command for uploading the collected data refers to a command that the upper computer sends to the lower computer to obtain real-time oscillation data. The preset serial port is a transmission mode for the upper computer and the lower computer to perform data interaction. The target oscillation data refers to the oscillation data meeting the transmission requirement in the first sub-buffer. Therefore, if the uploading data acquisition command sent by the upper computer is received, the lower computer performs data query on the first sub-buffer area according to the uploading data acquisition command to obtain target oscillation data, and sends the target oscillation data to the upper computer through a preset serial port.
Referring to fig. 7, fig. 7 is a specific flowchart of step S220 provided in the embodiment of the present application. In some embodiments of the present application, the lower computer performs the data query from the first sub-buffer according to the data uploading command in step S220 to obtain the target oscillation data, which specifically includes, but is not limited to, steps S710 to S730, and the following three steps are described in detail with reference to fig. 7.
Step S710, carrying out instruction analysis on the data uploading command to obtain an instruction time stamp;
step S720, obtaining a buffer reading pointer of a first sub-buffer;
Step S730, performing data reading on the first sub-buffer according to the buffer reading pointer and the instruction timestamp to obtain the target oscillation data.
In step S710 of some embodiments, in order to ensure that the host computer can obtain the oscillation data collected in real time, an instruction analysis is performed on the data uploading command sent by the host computer, so as to obtain an instruction timestamp. The instruction time stamp at this time refers to the time when the instruction is issued, and is used for determining the time point of data acquisition so as to ensure the implementation of the acquired target oscillation data.
In step S720 and step S730 of some embodiments, the buffer read pointer is a pointer indicating the position of the data to be read next. And performing data reading operation on the first sub-buffer according to the information of the buffer reading pointer and the instruction time stamp acquired before. By reading the data after the specified time stamp, the system can obtain the target oscillation data with stronger real-time performance.
It should be noted that the present application provides a method for a serial communication mechanism based on a control command table response, where when an upper computer and a lower computer perform control interaction, there are multiple interaction commands. The annular buffer zone further comprises a third sub-buffer zone, and the third sub-buffer zone is used for storing a control command table when the upper computer and the lower computer carry out serial port communication. As shown in fig. 8, the commands in the control command table corresponding to the upper computer include commands of software and hardware version numbers of the lower computer, commands of sending heartbeat packets by the upper computer, data acquisition control commands, speaker control commands, and the like. The commands in the control command table corresponding to the lower computer comprise commands of software and hardware version numbers of the upper computer, commands of sending heartbeat packets by the lower computer, data acquisition control commands, data uploading acquisition commands and the like. Therefore, when the upper computer needs the lower computer to upload or stop uploading the target oscillation data (such as oscillation pressure data and flow data), the corresponding control command is issued, and the lower computer uploads or stops uploading the target oscillation data (such as oscillation pressure data and flow data) according to the received control data. Thus, the control interaction of the upper computer and the lower computer is realized. The same is true of the execution logic of other control instructions, and will not be described in detail herein.
Referring to fig. 9, fig. 9 is another specific flowchart of step S220 provided in the embodiment of the present application. In some embodiments of the present application, in step S220, the target oscillation data is sent to the host computer through a preset serial port, which specifically includes, but is not limited to, steps S910 to S930, and the following description will describe in detail with reference to fig. 9.
Step S910, determining the number of uploaded data according to a preset acquisition period and a preset processing period, wherein the preset processing period is the period of processing data by an upper computer;
step S920, data packaging is carried out on the target oscillation data according to the number of the uploaded data to obtain a target data packet;
in step S930, the target data packet is sent to the host computer through a preset serial port.
In step S910 of some embodiments, in order to ensure that the data collection and the data processing of the upper computer and the lower computer are in the same period, and effectively improve the transmission speed of the data received and sent by the upper computer and the lower computer, the application may perform data transmission by means of group data transmission (Di rect Memory Access, DMA). Wherein during DMA transfer, data may be transferred in groups. For example, during a DMA transfer, consecutive data may be transferred together without requiring separate transfer of each data block. This approach can increase the efficiency and speed of data transfer and reduce interrupts and CPU overhead during transfer. Specifically, the number of uploaded data is determined according to a preset acquisition period and a preset processing period, wherein the preset processing period refers to a period of processing data by an upper computer. The preset processing period can be flexibly set according to actual needs, such as 20 ms, 30 ms, etc., which are not particularly limited herein. The number of uploaded data refers to the number of a set of oscillation data uploaded to the host computer. For example, the preset acquisition period corresponding to the lower computer is 1 millisecond, the preset processing period of the upper computer is 20 milliseconds, and then the number of uploaded data is preset processing period/preset acquisition period=20/1=20. Therefore, in order to ensure that the data acquisition and the data processing of the upper computer and the lower computer are in the same period, 20 groups of acquired target oscillation data (such as oscillation pressure and flow data) can be stored in the universal annular buffer zone, and the lower computer can upload the data to the upper computer after acquiring 20 times of data.
In step S920 and step S930 of some embodiments, the target data packet refers to a set of target oscillation data uploaded to the host computer. In order to effectively improve the transmission speed of the upper computer and the lower computer for receiving and sending data, the target oscillation data is subjected to data packaging according to the number of the uploaded data, and a target data packet is obtained. And sending the target data packet to the upper computer through a preset serial port.
The advantage of the above embodiment is that, because the upper computer and the lower computer both transmit and receive data through the mechanism of transmitting and receiving the ring buffer, when the serial port is preset to receive the pilot data, the data received by the serial port can be stored in the receiving universal ring buffer through the DMA. When the serial port needs to send data, the data of the sending ring buffer can be transmitted to the serial port through DMA. Therefore, the transmission speed of the upper computer and the lower computer for receiving and transmitting data can be improved.
For example, as shown in fig. 10, the preset acquisition period corresponding to the lower computer is 1 ms, and the preset processing period (i.e., the data processing period) of the upper computer is 20 ms, so that the number of uploaded data is preset processing period/preset acquisition period=20/1=20. Therefore, in order to ensure that the data acquisition and the data processing of the upper computer and the lower computer are in the same period, 20 groups of acquired target oscillation data (such as oscillation pressure and flow data) can be stored in a general annular buffer zone, and the lower computer can upload the data to the upper computer after acquiring 20 times of data, so that the same-frequency processing of the data is ensured.
In step S230 of some embodiments, after receiving the target oscillation data, the upper computer performs a data processing task, that is, performs resistance state detection according to the target oscillation data, to obtain target resistance state data. The target resistance state data is used to determine whether the current airway resistance is abnormal.
Referring to fig. 11, fig. 11 is a specific flowchart of step S230 provided in the embodiment of the present application. In some embodiments of the present application, step S230 specifically includes, but is not limited to, steps S1110 to S1120, which are described in detail below in conjunction with fig. 11.
Step S1110, the upper computer calculates airway resistance according to the received target oscillation data to obtain target resistance data;
in step S1120, the upper computer detects the resistance state of the target resistance data according to the preset resistance threshold value, so as to obtain the target resistance state data.
In step S1110 of some embodiments, the upper computer performs airway resistance calculation according to the received target oscillation data (such as the oscillation pressure value and the flow value), to obtain target resistance data. The target resistance data is used to represent the real-time magnitude of airway resistance of the test subject.
It should be noted that, after the upper computer receives the target oscillation data, the upper computer also draws the target oscillation data (such as the oscillation pressure value and the flow value) acquired in real time into a waveform, so as to assist medical staff to quickly infer the health status of the detecting staff. Therefore, the product function of the IOS pulse detection equipment can be better embodied by displaying the target oscillation data through the interface.
In step S1120 of some embodiments, the upper computer performs resistance state detection on the target resistance data according to a preset resistance threshold value, so as to obtain target resistance state data. Wherein the target resistance state data includes a normal state and an abnormal state. Because airway resistance values are ranging, exceeding the range is considered an abnormality in airway resistance values. Therefore, the normal state refers to a state in which the target resistance data is within a range corresponding to the preset resistance threshold value, and the abnormal state refers to a state in which the target resistance data is not within a range corresponding to the preset resistance threshold value, that is, exceeds or is smaller than the range corresponding to the preset resistance threshold value. The preset resistance threshold value can be flexibly set according to actual needs, and is not particularly limited herein.
In step S240 of some embodiments, the ring buffer of the present application may store and record a plurality of information, including target resistance state data, initial measurement data, control commands, and the like, obtained by detecting the target oscillation data by the upper computer. Therefore, after the target resistance state data is obtained, the upper computer stores the target resistance state data into the second sub-buffer, and feeds back the target resistance state data to the lower computer through the preset serial port.
Exemplary, as shown in fig. 12, fig. 12 shows a schematic flow chart of the data sharing system based on the multitasking in practical application. Firstly, initializing a data sharing system based on multitasking; to configure the desired system parameters and environmental parameters. The multi-tasks of the upper computer and the lower computer are created, and comprise a data acquisition task, a serial communication task, a software state task and the like. And monitoring a sign of the reversing valve (namely the gas circuit blocking valve) under a software state task, and adjusting a data acquisition sign when the motor control task rotates the reversing valve (namely the gas circuit blocking valve) to a pulse oscillation detection mode. And then, controlling the data acquisition task to start according to the data acquisition mark, acquiring an oscillation pressure value by the oscillation pressure sensor, and acquiring a flow value by the flow sensor. And synchronously storing the initial measurement data formed by the oscillation pressure value and the flow value, and storing the initial measurement data into the annular buffer zone. When the serial port communication task receives a command of uploading and collecting data of the upper computer, the data sharing system based on the application performs data sharing of the upper computer and the lower computer, and stores data such as states obtained by processing of the upper computer into the annular buffer zone.
It should be noted that the multitasking of the present application may be performed synchronously, and there is no specific limitation on the sequence.
The data sharing system and the data sharing method based on the multitasking can rapidly transmit the oscillation pressure value and the flow value acquired by the lower computer to the upper computer for processing, and rapidly transmit the detection state value of the upper computer to the lower computer. The universal annular buffer zone comprises at least two groups, one group is used for storing initial measurement data such as an oscillation pressure value uploaded to the upper computer and a flow value corresponding to the oscillation pressure value, the other group is used for storing state value data (namely target resistance state data) issued to the lower computer by the upper computer, and the size of the universal annular buffer zone is set according to the data quantity. Therefore, the method and the device can improve the real-time performance of airway resistance measurement, and further improve the accuracy of measurement results. In addition, the memory overhead of the software system can be reduced, the data sharing method is high in universality and portability, and the instantaneity and the accuracy of detecting the airway resistance of the pulse oscillation (IOS) detection equipment can be effectively improved.
The embodiment of the application also provides electronic equipment, which comprises: at least one memory, at least one processor, at least one computer program stored in the at least one memory, the at least one processor executing the at least one computer program to implement the multitasking based data sharing method of any of the above embodiments. The electronic equipment can be any intelligent terminal including a tablet personal computer, a vehicle-mounted computer and the like.
Referring to fig. 13, fig. 13 illustrates a hardware structure of an electronic device according to another embodiment, the electronic device includes:
the processor 1310 may be implemented by a general purpose central processing unit (Central Processing Unit, CPU), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing related programs to implement the technical solutions provided in the embodiments of the present application;
the Memory 1320 may be implemented in the form of a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a random access Memory (Random Access Memory, RAM). Memory 1320 may store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present disclosure are implemented in software or firmware, relevant program codes are stored in memory 1320 and invoked by processor 1310 to perform the multitasking based data sharing method of the embodiments of the present disclosure;
an input/output interface 1330 for implementing information input and output;
communication interface 1340, configured to implement communication interaction between the present device and other devices, where communication may be implemented through a wired manner (e.g., USB, network cable, etc.), or may be implemented through a wireless manner (e.g., mobile network, WIFI, bluetooth, etc.);
Bus 1350 for transferring information between components of the device (e.g., processor 1310, memory 1320, input/output interface 1330, and communication interface 1340);
wherein processor 1310, memory 1320, input/output interface 1330, and communication interface 1340 implement a communication connection between each other within the device via bus 1350.
The present application also provides a storage medium, which is a computer readable storage medium storing a computer program for causing a computer to execute the multi-task based data sharing method of any one of the above embodiments.
The memory, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiments described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application, and as those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
It will be appreciated by those skilled in the art that the technical solutions shown in the figures do not constitute limitations of the embodiments of the present application, and may include more or fewer steps than shown, or may combine certain steps, or different steps.
The above described apparatus embodiments are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the present application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in this application, "at least one" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the above-described division of units is merely a logical function division, and there may be another division manner in actual implementation, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including multiple instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing a program.
Preferred embodiments of the present application are described above with reference to the accompanying drawings, and thus do not limit the scope of the claims of the embodiments of the present application. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and spirit of the embodiments of the present application shall fall within the scope of the claims of the embodiments of the present application.

Claims (10)

1. The utility model provides a data sharing system based on multitasking, is applied to pulse oscillation equipment, its characterized in that, data sharing system includes lower computer and host computer, the lower computer with the host computer is through predetermining serial communication connection, specifically includes:
the lower computer collects initial measurement data of a subject through a pressure sensor and a flow sensor, and writes the initial measurement data into a preset annular buffer zone; the annular buffer zone comprises a first sub-buffer zone and a second sub-buffer zone, and the first sub-buffer zone is used for storing the initial measurement data;
if an uploading acquisition data command sent by the upper computer is received, the lower computer performs data query on the first sub-buffer area according to the uploading acquisition data command to obtain target oscillation data, and sends the target oscillation data to the upper computer through the preset serial port;
the upper computer detects the resistance state according to the received target oscillation data to obtain target resistance state data;
and the upper computer stores the target resistance state data into the second sub-buffer, and feeds the target resistance state data back to the lower computer through the preset serial port.
2. A method of data sharing based on multiplexing, applied to the data sharing system of claim 1, the method comprising:
the lower computer collects initial measurement data of a subject through the pressure sensor and the flow sensor, and writes the initial measurement data into a preset annular buffer zone; the annular buffer zone comprises a first sub-buffer zone and a second sub-buffer zone, and the first sub-buffer zone is used for storing the initial measurement data;
if an uploading acquisition data command sent by an upper computer is received, the lower computer performs data query on the first sub-buffer area according to the uploading acquisition data command to obtain target oscillation data, and sends the target oscillation data to the upper computer through a preset serial port;
the upper computer detects the resistance state according to the received target oscillation data to obtain target resistance state data;
and the upper computer stores the target resistance state data into the second sub-buffer, and feeds the target resistance state data back to the lower computer through the preset serial port.
3. The method of claim 2, wherein the lower computer collects initial measurement data of the subject via the pressure sensor and the flow sensor, comprising:
The upper computer sends a starting instruction to the air passage blocking valve, and the starting instruction is used for indicating the opening of the air passage blocking valve between the user breathing port and the pulse oscillation equipment;
the upper computer sends an acquisition instruction to the lower computer, the acquisition instruction is used for indicating the lower computer to acquire data of test gas according to a preset acquisition period through the pressure sensor and the flow sensor, initial measurement data are obtained, the initial measurement data are sent to the lower computer, and the pressure sensor and the flow sensor are respectively in communication connection with the lower computer.
4. The method of claim 3, wherein the lower computer performs data query on the first sub-buffer according to the upload data command to obtain target oscillation data, including:
performing instruction analysis on the uploading acquisition data command to obtain an instruction time stamp;
acquiring a buffer area reading pointer of the first sub-buffer area;
and reading the data of the first sub-buffer according to the buffer reading pointer and the instruction time stamp to obtain the target oscillation data.
5. The method of claim 3, wherein the sending the target oscillation data to the host computer through a preset serial port comprises:
Determining the number of uploaded data according to the preset acquisition period and the preset processing period, wherein the preset processing period refers to the period of processing the data by the upper computer;
performing data packaging on the target oscillation data according to the number of the uploaded data to obtain a target data packet;
and sending the target data packet to the upper computer through the preset serial port.
6. The method of claim 2, wherein writing the initial measurement data into a pre-set ring buffer comprises:
acquiring a buffer write pointer of the first sub-buffer;
and the lower computer writes the received initial measurement data into the first sub-buffer according to the buffer write pointer, and updates the buffer write pointer according to the written position of the initial measurement data in the first sub-buffer.
7. The method of claim 6, wherein the lower computer writing the received initial measurement data to the first sub-buffer according to the buffer write pointer, comprising:
if the buffer write pointer points to a buffer area end interval of the first sub-buffer, historical oscillation data is obtained from the first sub-buffer, wherein the historical oscillation data refers to oscillation data with the largest time interval with the initial measurement data in the first sub-buffer;
Deleting the history oscillation data from the first sub-buffer, and updating the first sub-buffer and the buffer write pointer;
and the lower computer writes the received initial measurement data into the updated first sub-buffer according to the updated buffer write pointer.
8. The method of claim 2, wherein the upper computer performs resistance state detection according to the received target oscillation data to obtain target resistance state data, and the method comprises:
the upper computer calculates airway resistance according to the received target oscillation data to obtain target resistance data;
and the upper computer detects the resistance state of the target resistance data according to a preset resistance threshold value to obtain the target resistance state data.
9. An electronic device, comprising:
at least one memory;
at least one processor;
at least one computer program;
the at least one computer program is stored in the at least one memory, the at least one processor executing the at least one computer program to implement:
the method of any one of claims 2 to 8.
10. A storage medium that is a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for causing a computer to execute:
the method of any one of claims 2 to 8.
CN202311863407.2A 2023-12-29 2023-12-29 Data sharing system and method based on multitasking, equipment and storage medium Pending CN117827971A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311863407.2A CN117827971A (en) 2023-12-29 2023-12-29 Data sharing system and method based on multitasking, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311863407.2A CN117827971A (en) 2023-12-29 2023-12-29 Data sharing system and method based on multitasking, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117827971A true CN117827971A (en) 2024-04-05

Family

ID=90520413

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311863407.2A Pending CN117827971A (en) 2023-12-29 2023-12-29 Data sharing system and method based on multitasking, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117827971A (en)

Similar Documents

Publication Publication Date Title
US20140323883A1 (en) Remote health monitoring system
EP2889790A1 (en) Vital information measuring device, processing system, vital information processing method, and program
WO2015028918A1 (en) Fishing and sailing activity detection
US20220130548A1 (en) Electrocardiogram display apparatus, method for displaying electrocardiogram, and storage medium storing program
US10922302B2 (en) Data time stamps
CN110402102B (en) Biological information recording apparatus, system, and storage medium
JP2008048382A (en) Diabetes mellitus management apparatus for detecting analytes, and method for transmitting data selectively
US10098328B2 (en) Method of monitoring the physical condition and/or suitability of animal feed of ruminant animals
US20220071522A1 (en) Measurement apparatus
US9697468B2 (en) Collection and analysis of vital signs
CN117827971A (en) Data sharing system and method based on multitasking, equipment and storage medium
WO2018128057A1 (en) Blood pressure measurement device, system, method and program
US8694085B2 (en) Collection and analysis of vital signs
US20210398053A1 (en) Work content analyzing apparatus, work content analyzing method, program, and sensor
US20230207114A1 (en) Biological information analysis system, non-transitory computer readable medium and biological information analysis method
CN105229630B (en) One-touch transacter
JP6732147B1 (en) Communication device and data collection system
US20230027278A1 (en) Livestock heart rate measurement with bolus sensor
EP2727523A2 (en) Electronic device, method of extracting data and program
US10936398B2 (en) Method of dynamically saving metadata in a process of operating a medical system, medical system and computer program product
Horoba et al. Ensuring the real time signal transmission using GSM/Internet technology for remote fetal monitoring
CN113812930A (en) Monitoring data processing method, monitoring device and computer readable storage medium
CN115585824A (en) Method, device, equipment and medium for measuring walking distance in walking test
CN112883912A (en) FPGA-based sensor test driving signal waveform display method and device
CN113890664A (en) Method for synchronizing data in body area network, detection terminal and computer readable storage medium

Legal Events

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