Transmission method and microprocessor for odor data collected by bionic electronic nose

By using a three-level cache queue method in the data transmission of bionic electronic nose, the problem of easy loss of odor data in the transmission of 4G network and dynamic changes in communication efficiency is solved, and more stable and efficient data transmission is achieved.

CN118612161BActive Publication Date: 2025-03-07NINGXIA NINGDONG TECH VENTURE CAPITAL CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410701017.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2025-03-07
Estimated Expiration
2044-05-31

AI Technical Summary

Technical Problem

Odor data collected by bionic electronic noses are easily lost due to data blockage during the transmission process of 4G network, and the communication efficiency changes dynamically with the user, resulting in insecure data transmission.

Method used

The data transmission method of the third-level cache queue is adopted, and the original data is received through the first cache queue, the data volume is compressed and stored in the second cache queue, and the data is sent according to the conditions of the third cache queue, and the compressed data is finally sent to the cloud server.

Benefits of technology

The data transmission volume is reduced, the loss caused by data blockage is reduced, and the data transmission conditions are dynamically adjusted to adapt to changes in communication efficiency, improving the stability and efficiency of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118612161B_ABST
    Figure CN118612161B_ABST
Patent Text Reader

Abstract

The present invention provides a method and a microprocessor for transmitting odor data collected by a bionic electronic nose, and relates to the field of electronic information and communication technology. The method comprises: determining a three-level cache queue; receiving first odor data collected by a bionic electronic nose and storing them in the first cache queue; compressing the first odor data in the first cache queue, and storing the obtained second odor data in the second cache queue; judging whether the third cache queue meets the first data sending condition; if so, obtaining the second odor data from the second cache queue and sending it to the third cache queue; if not, stopping sending the second odor data to the third cache queue, temporarily storing the second odor data, and sending the temporarily stored second odor data to the third cache queue when the second data sending condition is met; sending the second odor data in the third cache queue to a cloud server. This solution can improve the transmission reliability and efficiency of the odor data collected by the bionic electronic nose.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic information and communication technology, and in particular to a transmission method and a microprocessor for odor data collected by a bionic electronic nose. Background Art

[0002] Bionic electronic nose is an intelligent instrument built on the principle of simulating biological olfaction. It is usually composed of a cross-sensitive sensor array and a suitable pattern recognition algorithm to automatically identify the qualitative or quantitative odor. Moreover, the electronic nose technology has a short response time and a fast detection speed. It can detect some gases that human nose cannot detect, such as poisonous gas or some irritating gas, without complex pre-processing.

[0003] At present, in order to achieve the goal of distinguishing the subtle differences of different complex odors like neurons in biological olfaction, bionic electronic noses usually use a mixed array of a large number of different types of gas sensors to form a bionic electronic nose to obtain rich odor information. For example, a MEMS bionic electronic nose used for odor gas monitoring in an industrial park can collect data from a sensor array consisting of 30 gas sensors, 1 temperature sensor, and 1 humidity sensor, and transmit the collected data to the server to identify complex gases in the park.

[0004] However, the odor data collected from the MEMS bionic electronic nose is text data with a data length of about 1255. If the odor data is directly transmitted through the 4G network, the data volume is too large and it is easy to lose the odor data due to data blocking during the transmission process. Moreover, the 4G communication network is a shared network. The communication efficiency changes with the dynamic changes of users, and the stability of data transmission also changes accordingly. In this process, data caching and waiting, and failed retransmissions greatly affect the execution efficiency of the business. Summary of the invention

[0005] In view of this, in view of the above shortcomings, it is necessary to propose a transmission method and a microprocessor for odor data collected by a bionic electronic nose to improve the transmission reliability and transmission efficiency of the odor data collected by the bionic electronic nose.

[0006] In a first aspect, the present invention provides a method for transmitting odor data collected by a bionic electronic nose, comprising:

[0007] Determine a first cache queue, a second cache queue, and a third cache queue for data cache transmission; wherein the queue lengths configured for the first cache queue and the third cache queue are both much smaller than the queue length configured for the second cache queue;

[0008] receiving first odor data collected by the bionic electronic nose, and storing the first odor data in the first cache queue;

[0009] Compressing the first odor data in the first cache queue according to a preset data structure to obtain second odor data, and storing the second odor data in the second cache queue;

[0010] Determining whether the third cache queue meets a preset first data sending condition;

[0011] If the third cache queue meets the preset first data sending condition, the second smell data is obtained from the second cache queue and sent to the third cache queue; if the third cache queue does not meet the preset first data sending condition, the second cache queue stops sending the second smell data to the third cache queue, temporarily stores the second smell data, and sends the temporarily stored second smell data to the third cache queue when the second cache queue and the third cache queue meet the second data sending condition;

[0012] The second odor data in the third cache queue is sent to the cloud server.

[0013] Preferably, the receiving of the first odor data collected by the bionic electronic nose includes:

[0014] The first odor data is received from the bionic electronic nose once every first time period.

[0015] Preferably, compressing the first smell data in the first cache queue according to a preset data structure to obtain the second smell data includes:

[0016] Converting the first smell data of text data type into first smell data of hexadecimal type;

[0017] determining a target data structure of the second odor data;

[0018] The first odor data is constructed according to the target data structure to obtain the second odor data.

[0019] Preferably, the format of the target data structure includes: frame header + command word + packet type + data length + data type + module ID + byte alignment filler + temperature + humidity + timestamp + odor data content + module data + checksum + frame tail.

[0020] Preferably, the queue length configured for the third cache queue is a third queue length;

[0021] The determining whether the third cache queue meets a preset first data sending condition includes:

[0022] It is determined whether the current queue length of the third cache queue is less than the third queue length.

[0023] Preferably, the queue length configured for the second cache queue is a second queue length; and temporarily storing the second odor data includes:

[0024] If the current queue length of the third cache queue is equal to the third queue length, continue to cache the second odor data in the second cache queue; and,

[0025] When the current queue length of the second cache queue is greater than 80% of the pre-configured second queue length, the second smell data in the second cache queue is taken out and stored in a non-volatile memory.

[0026] Preferably, the second data sending condition includes: the current queue length of the third cache queue is less than the third queue length, and the current queue length of the second cache queue is less than 10% of the second queue length;

[0027] The method of sending the temporarily stored second smell data to the third cache queue when the second cache queue and the third cache queue meet the second data sending condition includes:

[0028] detecting whether second odor data is stored in the non-volatile memory;

[0029] If the non-volatile memory stores second smell data, a preset number of second smell data are read into the second cache queue and sent to the third cache queue; and when the current queue length of the second cache queue is less than 10% of the second queue length again, a preset number of second smell data are read from the non-volatile memory again, and this cycle is repeated until all the second smell data in the non-volatile memory are sent.

[0030] Preferably, the non-volatile memory includes at least one of Flash and TF.

[0031] Preferably, each time the third cache queue successfully sends a piece of data to the cloud server, the corresponding current queue length is reduced by 1.

[0032] In a second aspect, the present invention provides a microprocessor, comprising: a cache queue determination module, an odor data receiving module, a data compression module, a sending condition judgment module, a first sending execution module and a second sending execution module;

[0033] The cache queue determination module is configured to determine a first cache queue, a second cache queue, and a third cache queue for data cache transmission; wherein the queue lengths configured for the first cache queue and the third cache queue are both much smaller than the queue length configured for the second cache queue;

[0034] The odor data receiving module is configured to receive first odor data collected by the bionic electronic nose, and store the first odor data in the first cache queue determined by the cache queue determination module;

[0035] The data compression module is configured to compress the first odor data stored by the odor data receiving module in the first cache queue according to a preset data structure to obtain second odor data, and store the second odor data in the second cache queue;

[0036] The sending condition judgment module is configured to judge whether the third cache queue meets a preset first data sending condition;

[0037] The first sending execution module is configured to obtain the second smell data from the second cache queue and send it to the third cache queue if the sending condition judgment module judges that the third cache queue meets the preset first data sending condition; if the third cache queue does not meet the preset first data sending condition, the second cache queue stops sending the second smell data to the third cache queue, temporarily stores the second smell data, and sends the temporarily stored second smell data to the third cache queue when the second cache queue and the third cache queue meet the second data sending condition;

[0038] The second sending execution module is configured to send the second odor data stored in the third cache queue by the first sending execution module to the cloud server.

[0039] It can be seen from the above technical scheme that in the transmission method and microprocessor of the odor data collected by the bionic electronic nose provided in the embodiment of the present invention, the microprocessor is used to execute the transmission method of the odor data collected by the bionic electronic nose. When transmitting the odor data collected by the bionic electronic nose, three cache queues are first determined, and then the first odor data received from the bionic electronic nose is stored in the first cache queue. Further, the first odor data is stored in the second cache queue after data volume compression processing, and then it is determined whether the third cache queue meets the data transmission conditions, and the corresponding data transmission operation is performed according to the queue conditions of the second cache queue and the third cache queue. Finally, the second odor data from the second cache queue in the third cache queue will be sent to the cloud server, so that the cloud server can perform gas identification according to the uploaded odor data. It can be seen that this scheme receives the original text data collected by the bionic electronic nose through the first cache queue, and then stores it in the second cache queue after data volume compression, and performs subsequent data transmission operations, which greatly reduces the data transmission volume and effectively alleviates the situation of odor data loss caused by data congestion. Moreover, this solution also sets data sending conditions based on the queue conditions of each cache queue, which can adapt to the dynamic changes in communication efficiency with users, greatly improving the stability of data transmission and effectively solving the problem of low data transmission efficiency caused by smelly data cache waiting, failed retransmission, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A flow chart of a method for transmitting odor data collected by a bionic electronic nose provided in an embodiment of the present invention.

[0041] Figure 2 A schematic diagram of a microprocessor provided in accordance with an embodiment of the present invention.

[0042] Figure 3 A schematic diagram of three-level cache transmission of odor data collected by a bionic electronic nose provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0044] like Figure 1 As shown, an embodiment of the present invention provides a method for transmitting odor data collected by a bionic electronic nose, and the method may include the following steps:

[0045] Step 101: determining a first cache queue, a second cache queue, and a third cache queue for data cache transmission; wherein the queue lengths configured for the first cache queue and the third cache queue are much smaller than the queue length configured for the second cache queue;

[0046] Step 102: receiving first odor data collected by the bionic electronic nose, and storing the first odor data in a first cache queue;

[0047] Step 103: compressing the first odor data in the first cache queue according to a preset data structure to obtain second odor data, and storing the second odor data in the second cache queue;

[0048] Step 104: Determine whether the third cache queue meets a preset first data sending condition;

[0049] Step 105: If the third cache queue meets the preset first data sending condition, the second smell data is obtained from the second cache queue and sent to the third cache queue;

[0050] Step 106: If the third cache queue does not meet the preset first data sending condition, the second cache queue stops sending the second smell data to the third cache queue, temporarily stores the second smell data, and sends the temporarily stored second smell data to the third cache queue when the second cache queue and the third cache queue meet the second data sending condition;

[0051] Step 107: Send the second odor data in the third cache queue to the cloud server.

[0052] In this embodiment, the original text data collected by the bionic electronic nose is received through the first cache queue, and then the data volume is compressed and stored in the second cache queue, and the subsequent data transmission operation is performed, which greatly reduces the data transmission volume and effectively alleviates the situation where the smell data is lost due to data congestion. In addition, this solution also sets the data transmission conditions according to the queue conditions of each cache queue, which can adapt to the dynamic changes of communication efficiency with users, greatly improves the stability of data transmission, and effectively solves the problem of low data transmission efficiency caused by smell data cache waiting, failed retransmission, etc.

[0053] For step 101 , a first cache queue, a second cache queue, and a third cache queue for performing data cache transmission are determined.

[0054] In this step, consider configuring a three-level cache queue in the microprocessor, where the first cache queue is used for acquisition data cache, the second cache queue is used for system main data cache, and the third cache queue is used for 4G network data transmission cache. Among them, due to the different functions of each cache queue, the queue length of the first cache queue and the third cache queue can be configured to be much smaller than the queue length of the second cache queue. For example, the queue length of the first cache queue and the third cache queue can both be configured to 5, and the queue length of the second cache queue can be configured to 100.

[0055] In step 102, first odor data collected by the bionic electronic nose is received, and the first odor data is stored in a first cache queue;

[0056] When the microprocessor receives the first odor data from the bionic electronic nose and stores it in the first cache queue, the microprocessor may receive the first odor data from the bionic electronic nose once every first time period, for example, once every 3 seconds.

[0057] In step 103, the first odor data in the first cache queue is compressed according to a preset data structure to obtain second odor data, and the second odor data is stored in the second cache queue;

[0058] The first cache queue stores text data in a certain format collected by the electronic nose. For example, the format of the odor data output by the MEMS bionic electronic nose through the asynchronous communication serial port is as follows:

[0059] Table 1

[0060]

[0061] An example of actual data collected by the electronic nose is:

[0062] {NM1_ID_00000;31.6;41.3;20470000;136433330;20470000;136433330;13643333;25500000; 20470000; 51100000; 2915714; 8804340; 1696666; 5588880; 460804; 1745040; 825918; 955670; 282571; 636690; 216298; 602570; 111183; 482640; 137338; 539000; 80820; 442510; 72414; 429880; 9.6; 9;}

[0063] It can be seen that the data collected from the MEMS bionic electronic nose is text data with a data length of about 1255. If the data is directly transmitted through the 4G network, the data volume is too large and data loss is likely to occur due to data blocking during the transmission process. Therefore, in this embodiment, it is considered to encode and compress the data volume of the first odor data to reduce the data volume.

[0064] In one embodiment, in step 103, when the first smell data in the first cache queue is compressed according to the preset data structure to obtain the second smell data, it can be implemented in the following manner:

[0065] Converting the first smell data of a text data type into the first smell data of a hexadecimal type;

[0066] determining a target data structure of the second odor data;

[0067] The first odor data is constructed according to the target data structure to obtain second odor data.

[0068] In this embodiment, when encoding and compressing the data volume of the first smell data, the text-type first smell data may be first converted into hexadecimal first smell data, and then the target data structure of the second smell data is determined, and finally the hexadecimal first smell data is constructed according to the target data structure to obtain the second smell data.

[0069] Among them, the format of the target data structure can be frame header + command word + packet type + data length + data type + module ID + byte alignment filler + temperature + humidity + timestamp + odor data content + module data + checksum + frame tail.

[0070] For example, when the first smell data of the above text type is constructed into the second smell data according to the format of the target structure, there are:

[0071] {5A 02 00 90 00 30 30 38 36 36 00 00 1C 01 0F 02 83 44 D4 64 3B 01 0000 E1 01 00 00 F4 D8 70 02 B2 CE 21 08 F4 D8 70 02 B2 CE 21 08 F4 D8 70 02 0E24 10 04 F4 D8 70 02 60 F9 18 06 9B 03 68 00 60 19 85 01 64 AA 38 00 A2 F4 E500 45 DE 0C 00 38 E8 3E 00 C8 E2 17 00 28 6A 1D 00 3F 90 07 00 CA D5 0F 00 5FBE 05 00 60 23 0E 00 7C D6 02 00 E4 CB 09 00 7A 70 03 00 C6 A1 0B 00 7A F5 0100 5C 96 08 00 4F B2 01 00 14 4D 08 00 52 00 00 00 08 00 00 00 EA A5}

[0072] in:

[0073] 5A is the frame header, a fixed word;

[0074] 02 is the command word, cmd=2;

[0075] 00 is the packet type;

[0076] 90 is the data length 0x90, which is 144 in decimal;

[0077] 00 is the data type, 0 is normal collection, 1 is standard gas collection;

[0078] 30 30 38 36 36 00 is the FXW module ID, in string format, "00866", with the last 00 being the string stop character;

[0079] 00 is the byte alignment filler;

[0080] 1C 01 is the temperature, the little endian mode should be 0x011C, the decimal is 284, which is magnified ten times, that is, 28.4 degrees Celsius;

[0081] 0F 02 is humidity, the little endian mode should be 0x020F, decimal is 527, magnified ten times, that is, 52.7% relative humidity;

[0082] 83 44 D4 64 is the timestamp, which should be 0x64D44483 in little-endian mode, and 1691632771 in decimal, i.e. UTC time 2023-08-10-01:59:31;

[0083] The odor data content is: {3B 01 00 00 E1 01 00 00 F4 D8 70 02 B2 CE 21 08 F4 D8 70 02 0E 24 10 04 F4 D8 70 02 60 F9 18 06 9B 03 68 0060 19 85 01 64 AA 38 00 A2 F4 E5 00 45 DE 0C 00 38 E8 3E 00 C8 E2 17 00 28 6A1D 00 3F 90 07 00 CA D5 0F 00 5F BE 05 00 60 23 0E 00 7C D6 02 00 E4 CB 09 007A 70 03 00 C6 A1 0B 00 7A F5 01 00 5C 96 08 00 4F B2 01 00 14 4D 08 00 52 0000 00 08 00 00};

[0084] 00 is 32 groups of 4-byte FXW module data, including temperature, humidity, and 30 groups of odor data, all in little-endian mode;

[0085] EA is the checksum, starting from the 5th byte of data and ending at the 148th byte of data;

[0086] A5 is the end of the frame and is a fixed word.

[0087] It can be seen that the total length of the newly constructed second odor data is 150 bytes. Compared with the original data of 1255 bytes collected by the electronic nose, the data volume is only about 12% of the original, and the data transmission volume is greatly reduced.

[0088] For step 104, determine whether the third cache queue meets the preset first data sending condition;

[0089] Next to step 101, in this step, the first data sending condition may be whether the current queue length of the third cache queue is less than the third queue length. For example, it is determined whether the current queue length of the third cache queue is less than the configured queue length 5 of the third cache queue.

[0090] For step 105, if the third cache queue meets the preset first data sending condition, the second smell data is obtained from the second cache queue and sent to the third cache queue;

[0091] Continuing with step 101, in this step, if the third cache queue meets the first data transmission condition, data transmission is performed normally. For example, when the current queue length of the third cache queue is less than 5, the second odor data is obtained from the second cache queue and sent to the third cache queue.

[0092] For step 106, if the third cache queue does not meet the preset first data sending condition, the second cache queue stops sending the second smell data to the third cache queue, and temporarily stores the second smell data, and sends the temporarily stored second smell data to the third cache queue when the second cache queue and the third cache queue meet the second data sending condition;

[0093] Continuing with step 101, in this step, if the third cache queue does not meet the preset first data condition, for example, the current queue length of the third cache queue is equal to 5, the second smell data in the second cache queue is temporarily stored. Specifically, if the current queue length of the third cache queue is equal to the third queue length, the second smell data continues to be cached in the second cache queue; and,

[0094] When the current queue length of the second cache queue is greater than 80% of the pre-configured second queue length, the second smell data in the second cache queue is taken out and stored in the non-volatile memory.

[0095] Further, the second data sending condition may include: the current queue length of the third cache queue is less than the third queue length, and the current queue length of the second cache queue is less than 10% of the second queue length;

[0096] When the second cache queue and the third cache queue meet the second data sending condition, the temporarily stored second smell data is sent to the third cache queue, including:

[0097] detecting whether second odor data is stored in the non-volatile memory;

[0098] If the second smell data is stored in the non-volatile memory, a preset number of second smell data are read into the second cache queue and sent to the third cache queue; and when the current queue length of the second cache queue is less than 10% of the second queue length again, a preset number of second smell data are read from the non-volatile memory again, and this cycle is repeated until all the second smell data in the non-volatile memory are sent.

[0099] Continuing with step 101, in this embodiment, if the current queue length of the third cache queue is equal to 5, the second smell data continues to be cached in the second cache queue. When the data length in the second cache queue is greater than 80, the system considers that a serious abnormality has occurred in the data processing of the third cache queue, and at this time, the data persistence strategy is triggered, that is, the second smell data in the second cache queue is taken out and then stored in a non-volatile memory Flash, TF or other storage device.

[0100] When the 4G network is unobstructed, the data in the third cache queue and the data in the second cache queue are sent one after another. When the current queue length of the second cache queue is less than 10, it is detected whether the second smell data is stored in the non-volatile memory Flash, TF and other devices. If the second smell data is stored, 20 pieces of the second smell data are read into the second cache queue at a time, and then sent to the third cache queue in sequence according to the transmission mechanism. When the current queue length in the second cache queue is less than 10 again, 20 pieces of data are read from the non-volatile memory, and the cycle is repeated until all data is sent.

[0101] For step 107, the second odor data in the third cache queue is sent to the cloud server.

[0102] In this step, the third cache queue is a network data transmission cache, and each time the third cache queue successfully sends out a piece of data, the queue length of the third cache queue decreases by 1. If there is a network failure, that is, when the length of the third cache queue is equal to 5, the second cache queue no longer sends data to the third cache queue.

[0103] like Figure 2 As shown, the present invention also provides a microprocessor, including: a cache queue determination module 201, an odor data receiving module 202, a data compression module 203, a sending condition judgment module 204, a first sending execution module 205 and a second sending execution module 206;

[0104] The cache queue determination module 201 is configured to determine a first cache queue, a second cache queue, and a third cache queue for data cache transmission; wherein the queue lengths configured for the first cache queue and the third cache queue are both much smaller than the queue length configured for the second cache queue;

[0105] The odor data receiving module 202 is configured to receive the first odor data collected by the bionic electronic nose, and store the first odor data in the first cache queue determined by the cache queue determining module 201;

[0106] The data compression module 203 is configured to compress the first odor data stored in the odor data receiving module 202 in the first cache queue according to a preset data structure to obtain second odor data, and store the second odor data in the second cache queue;

[0107] The sending condition determination module 204 is configured to determine whether the third cache queue meets a preset first data sending condition;

[0108] The first sending execution module 205 is configured to obtain the second smell data from the second cache queue and send it to the third cache queue if the sending condition judgment module 204 judges that the third cache queue meets the preset first data sending condition; if the third cache queue does not meet the preset first data sending condition, the second cache queue stops sending the second smell data to the third cache queue, temporarily stores the second smell data, and sends the temporarily stored second smell data to the third cache queue when the second cache queue and the third cache queue meet the second data sending condition;

[0109] The second sending execution module 206 is configured to send the second odor data stored in the third cache queue by the first sending execution module 205 to the cloud server.

[0110] In one embodiment, the odor data receiving module 202 is configured to receive the first odor data from the bionic electronic nose once every first time period.

[0111] In one embodiment, the data compression module 203 is configured to perform the following operations:

[0112] Converting the first smell data of a text data type into the first smell data of a hexadecimal type;

[0113] determining a target data structure of the second odor data;

[0114] The first odor data is constructed according to the target data structure to obtain second odor data.

[0115] In one embodiment, the sending condition determination module 204 is configured to determine whether the current queue length of the third cache queue is less than the third queue length.

[0116] In one embodiment, the first sending execution module 205 is configured to perform the following operations:

[0117] If the current queue length of the third cache queue is equal to the third queue length, then continue to cache the second odor data in the second cache queue; and,

[0118] When the current queue length of the second cache queue is greater than 80% of the pre-configured second queue length, the second smell data in the second cache queue is taken out and stored in the non-volatile memory.

[0119] In one embodiment, the first sending execution module 205 is configured to perform the following operations:

[0120] detecting whether second odor data is stored in the non-volatile memory;

[0121] If the second smell data is stored in the non-volatile memory, a preset number of second smell data are read into the second cache queue and sent to the third cache queue; and when the current queue length of the second cache queue is less than 10% of the second queue length again, a preset number of second smell data are read from the non-volatile memory again, and this cycle is repeated until all the second smell data in the non-volatile memory are sent.

[0122] In addition, if Figure 3 The figure shows the schematic diagram of the three-level cache transmission of the odor data collected by the bionic electronic nose. The IoT terminal for odor data collection and transmission realizes data transmission with the cloud server through the three-level cache transmission mechanism. The MEMS bionic electronic nose transmits the odor data to the ESP32 microprocessor through the asynchronous communication serial port. The ESP32 microprocessor sets a three-level cache queue and sends it to the communication module through the asynchronous communication serial port, and then sends it to the cloud server based on the 4G network, so that the odor database and application server of the cloud server can perform gas identification.

[0123] In summary, the method for transmitting odor data collected by the bionic electronic nose and the microprocessor provided by the present invention have at least the following beneficial effects:

[0124] (1) The data transmission volume is reduced, effectively alleviating the loss of odor data due to data congestion. In addition, the data transmission conditions are set according to the queue conditions of each cache queue, which can adapt to the dynamic changes of communication efficiency with users, greatly improving the stability of data transmission and effectively solving the problem of low data transmission efficiency caused by odor data cache waiting, failed retransmission, etc.;

[0125] (2) By setting up a three-level data cache management mechanism with a clear structure, clear boundaries of each level of data cache, controllable and configurable memory resource occupancy, clear logic, and portability and replicability, the odor gas monitoring system can operate better.

[0126] Since the device embodiments provided by the present invention are based on the same inventive concept as the method embodiments of this specification, the specific contents can be found in the description of the method embodiments of this specification and will not be repeated here.

[0127] The modules or units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. The above disclosure is only the preferred embodiment of the present invention, and of course it cannot be used to limit the scope of the rights of the present invention. Those skilled in the art can understand that all or part of the processes of the above embodiment are implemented, and the equivalent changes made according to the claims of the present invention still fall within the scope of the invention.

Claims

1. A method for transmitting odor data collected by a bionic electronic nose, characterized in that: include: Determine a first cache queue, a second cache queue, and a third cache queue for data cache transmission; wherein the queue lengths configured for the first cache queue and the third cache queue are both much smaller than the queue length configured for the second cache queue; receiving first odor data collected by the bionic electronic nose, and storing the first odor data in the first cache queue; Compressing the first odor data in the first cache queue according to a preset data structure to obtain second odor data, and storing the second odor data in the second cache queue; Determining whether the third cache queue meets a preset first data sending condition; If the third cache queue meets the preset first data sending condition, the second smell data is obtained from the second cache queue and sent to the third cache queue; if the third cache queue does not meet the preset first data sending condition, the second cache queue stops sending the second smell data to the third cache queue, temporarily stores the second smell data, and sends the temporarily stored second smell data to the third cache queue when the second cache queue and the third cache queue meet the second data sending condition; The second odor data in the third cache queue is sent to the cloud server.

2. The method for transmitting odor data collected by a bionic electronic nose according to claim 1, characterized in that: The receiving of first odor data collected by the bionic electronic nose comprises: The first odor data is received from the bionic electronic nose once every first time period.

3. The method for transmitting odor data collected by a bionic electronic nose according to claim 1, characterized in that: The step of compressing the first smell data in the first cache queue according to a preset data structure to obtain the second smell data includes: Converting the first smell data of text data type into first smell data of hexadecimal type; determining a target data structure of the second odor data; The first odor data is constructed according to the target data structure to obtain the second odor data.

4. The method for transmitting odor data collected by a bionic electronic nose according to claim 3, characterized in that: The format of the target data structure includes: frame header + command word + packet type + data length + data type + module ID + byte alignment filler + temperature + humidity + timestamp + odor data content + module data + checksum + frame tail.

5. The method for transmitting odor data collected by a bionic electronic nose according to claim 1, characterized in that: The queue length configured for the third cache queue is the third queue length; The determining whether the third cache queue meets a preset first data sending condition includes: It is determined whether the current queue length of the third cache queue is less than the third queue length.

6. The method for transmitting odor data collected by a bionic electronic nose according to claim 5, characterized in that: The queue length configured for the second cache queue is the second queue length; The temporarily storing the second odor data includes: If the current queue length of the third cache queue is equal to the third queue length, continue to cache the second odor data in the second cache queue; as well as, When the current queue length of the second cache queue is greater than 80% of the pre-configured second queue length, the second smell data in the second cache queue is taken out and stored in a non-volatile memory.

7. The method for transmitting odor data collected by a bionic electronic nose according to claim 6, characterized in that: The second data sending condition includes: the current queue length of the third cache queue is less than the third queue length, and the current queue length of the second cache queue is less than 10% of the second queue length; When the second cache queue and the third cache queue meet the second data sending condition, sending the temporarily stored second smell data to the third cache queue includes: detecting whether second odor data is stored in the non-volatile memory; If the non-volatile memory stores second smell data, a preset number of second smell data are read into the second cache queue and sent to the third cache queue; and when the current queue length of the second cache queue is less than 10% of the second queue length again, a preset number of second smell data are read from the non-volatile memory again, and this cycle is repeated until all the second smell data in the non-volatile memory are sent.

8. The method for transmitting odor data collected by a bionic electronic nose according to claim 6, characterized in that: The non-volatile memory includes at least one of Flash and TF.

9. The method for transmitting odor data collected by a bionic electronic nose according to claim 1, characterized in that: Every time the third cache queue successfully sends a piece of data to the cloud server, the corresponding current queue length is reduced by 1.

10. A microprocessor, characterized in that: include: A cache queue determination module, an odor data receiving module, a data compression module, a sending condition judgment module, a first sending execution module and a second sending execution module; The cache queue determination module is configured to determine a first cache queue, a second cache queue, and a third cache queue for data cache transmission; wherein the queue lengths configured for the first cache queue and the third cache queue are both much smaller than the queue length configured for the second cache queue; The odor data receiving module is configured to receive first odor data collected by the bionic electronic nose, and store the first odor data in the first cache queue determined by the cache queue determination module; The data compression module is configured to compress the first odor data stored by the odor data receiving module in the first cache queue according to a preset data structure to obtain second odor data, and store the second odor data in the second cache queue; The sending condition judgment module is configured to judge whether the third cache queue meets a preset first data sending condition; The first sending execution module is configured to obtain the second smell data from the second cache queue and send it to the third cache queue if the sending condition judgment module judges that the third cache queue meets the preset first data sending condition; if the third cache queue does not meet the preset first data sending condition, the second cache queue stops sending the second smell data to the third cache queue, temporarily stores the second smell data, and sends the temporarily stored second smell data to the third cache queue when the second cache queue and the third cache queue meet the second data sending condition; The second sending execution module is configured to send the second odor data stored in the third cache queue by the first sending execution module to the cloud server.

Citation Information

Patent Citations

  • Image processing method and device and shooting equipment

    CN117750202A

  • Data scheduling method and device

    WO2017186082A1