Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Before introducing the substance detection method, apparatus, and storage medium provided by the present disclosure, an application scenario related to various embodiments of the present disclosure will be described first. The application scenario is that the Raman detection equipment is utilized to detect the substance to be detected according to a certain route. The Raman detection equipment is provided with a laser transmitter and a spectrometer sensor.
Fig. 1 is a flowchart of a substance detection method provided according to an exemplary embodiment of the present disclosure, as shown in fig. 1, the method including:
step 101, when the raman detection device starts to emit laser to the substance to be detected and the raman detection device moves according to a preset route, timing is started.
In the example, the detection is performed on the substance to be detected, and the laser emitter of the raman detection device is turned on, and the laser emitter continuously emits light. And then the Raman detection equipment is held by a user in a hand mode, or the Raman detection equipment is carried by mechanical devices such as an unmanned aerial vehicle and a robot to move according to a preset route, and timing is started at the moment. The preset route can be set according to the characteristics of the substance to be detected, such as shape, volume and the like, or can be set by a user according to specific needs, if the information of the substance to be detected is less, the route cannot be determined, and a pre-stored default route can be selected for detection.
And 102, recording current sensor data of the spectrometer sensor when the timing reaches a preset time interval, resetting the spectrometer sensor, and continuing timing.
For example, the data collected in the spectrometer sensor needs to be emptied after each collection is completed, that is, the current sensor data of the spectrometer sensor is stored and then the data in the spectrometer sensor is emptied each time a preset time interval is reached. The preset time interval may be smaller than a general detection duration of the existing detection method, and the general detection duration is 2-3s, so that the preset time interval may be set to 0.5 s. For example, each 0.5s sensor data and corresponding time may be stored as a record In a table, as shown In table 1, or the sensor data may be stored In a LIFO (english: Last In First Out, chinese: Last In First Out) table according to the sequence of the recording time.
TABLE 1
Time of day
|
Sensor data
|
0.5s
|
Sensor data between 0-0.5s
|
1s
|
Sensor data between 0.5s-1s
|
1.5s
|
Sensor data between 1s-1.5s
|
2s
|
Sensor data between 1.5s-2s
|
……
|
…… |
And 103, determining whether a preset data condition is met according to the currently recorded n sensor data.
For example, the preset data conditions can be divided into two categories, namely integration with fixed integration duration and automatic signal-to-noise ratio detection decision according to the raman detection device. If the integration mode with fixed integration duration is adopted, the sensor data in the fixed integration duration can be selected to be superposed, the signal-to-noise ratio detection is carried out on the superposed data, and the preset data condition is met through the signal-to-noise ratio detection. If the automatic signal-to-noise ratio detection and judgment mode is adopted, the latest sensor data can be gradually superposed, the signal-to-noise ratio detection is carried out on the data after each superposition, and the preset data condition is met through the signal-to-noise ratio detection.
And 104, when the data condition is met, identifying the substance according to the n sensor data.
And 105, outputting a substance identification result.
And, performing steps 102 to 105 again.
For example, in step 102, the timing is continued while the sensor data is recorded, and by continuously looping step 102 to step 105, the substance identification result on the preset route can be continuously output, so that compared with a case where the substance identification result in the fixed point detection method is a discrete numerical value, the method in this embodiment can display the substance identification result in the form of a trend curve, a state diagram, a data table, or the like.
It should be noted that, in this embodiment, after the end condition is met or a closing instruction of the user is received, the raman detection device may be controlled to close the laser transmitter, and terminate the detection. Wherein the end condition may be that the preset route has been moved over or that a detected turn-off time is set, based on which it is determined whether to turn off the laser transmitter. And a user can issue a closing instruction to actively close the laser transmitter.
In summary, the present disclosure starts timing when the raman detection device moves and emits laser light according to a prescribed route, records data collected by the spectrometer sensor according to a preset time interval, linearly superimposes the collected data, judges the superimposed data under the condition of an integral duration or a signal-to-noise ratio detection result, detects a substance to be detected when the condition is satisfied, and outputs a substance identification result. Meanwhile, the timing is not interrupted, timing and collection of the next time interval are continued, and a continuous substance identification result on the specified route can be output. The problems of missing measurement and inaccurate measurement which possibly occur in a fixed-point detection method can be avoided, and the method has the effect of improving the accuracy and the output efficiency of substance detection.
Fig. 2 is a flowchart of another substance detecting method according to an exemplary embodiment of the disclosure, where as shown in fig. 2, step 103 includes:
and step 1031, judging whether the number of the n sensor data reaches p. The Raman detection device comprises a Raman detection device, a storage unit and a storage unit, wherein n and p are positive integers, n is the total number of the sensor data recorded currently, p is the number of designated data, the number of the designated data is determined according to the ratio of the fixed integration duration of the Raman detection device to the time interval, and the time interval is smaller than the fixed integration duration.
Step 1032a, when n < p, determines that the data condition is not satisfied.
And step 1032b, acquiring the overlay data of the latest acquired p sensor data when n is larger than or equal to p.
Step 1033, perform snr detection on the superimposed data.
Step 1034, when the superimposed data passes the signal-to-noise ratio detection, it is determined that the data condition is satisfied. And when the superposed data does not pass the signal-to-noise ratio detection, determining that the data condition is not met.
For example, when the raman detection device is a detection device with a fixed integration duration, p may be determined according to a ratio of the fixed integration duration to the time interval, for example, p may be the fixed integration duration divided by the time interval and rounded up, where it is noted that the time interval is smaller than the fixed integration duration. Taking the fixed integration time length as 2s and the time interval as 0.5s as an example, then p is 4, i.e. it is determined whether n reaches 4. And when n is less than 4, determining that the data condition is not met, namely the time range corresponding to the n sensor data does not reach the fixed integration duration, and the Raman detection equipment cannot detect the data. And when n is larger than or equal to 4, linearly overlapping the latest acquired p sensor data to obtain overlapped data. And then, carrying out signal-to-noise ratio detection on the superposed data, wherein the superposed data greatly meets the data condition through the signal-to-noise ratio detection, and the superposed data does not meet the data condition if the superposed data does not pass the signal-to-noise ratio detection. The p sensor data which are collected latest are the p sensor data with the smallest time difference between the recording time and the current time in the n sensor data.
For example, when the current time is 5s, n is 10, the sensor data acquired at 0.5s is the first one, the sensor data acquired at 1s is the second one, and so on to the tenth one, and n ≧ p is satisfied at this time, then the superimposed data is the result of superimposing the latest 4 sensor data (tenth, ninth, eighth, and seventh) of the 10 data. When the next time interval of 5.5s is reached, n is 11, n ≧ p is satisfied, and the superimposed data is the superposition of the eleventh, tenth, ninth, and eighth sensor data.
Fig. 3 is a flowchart of another substance detecting method according to an exemplary embodiment of the disclosure, where as shown in fig. 3, step 103 includes:
and 1035, superposing the m data acquired latest to obtain superposed data. Wherein m and n are positive integers, n is the total number of the sensor data which are recorded currently, and in each time interval, the initial value of m is 1, and m is less than or equal to n.
Step 1036, performing snr detection on the superimposed data.
1037a, when the superimposed data is detected by the signal-to-noise ratio, it is determined that the data condition is satisfied.
1037b, when the superimposed data fails to pass the snr detection, let m be m +1, and determine whether m is greater than n.
1038a, when m > n, determining that the data condition is not satisfied.
1038b, when m is less than or equal to n, judging whether m is greater than mmax,mmaxFor a preset maximum number of allowable stacks, mmaxIs a positive integer.
1039 when m is not more than mmaxThen, step 1035 to step 1036 are executed again, and when m is larger than mmaxWhen the data condition is not satisfied, it is determined.
For example, when the raman detection device is a signal-to-noise ratio detection decision detection device, the newly acquired m data may be selected for superposition. And m is set to be 1, namely, for the first time, the latest one of the n sensor data is taken as the superposed data, namely the sensor data which is just recorded at present, and the signal to noise ratio detection is carried out. If the signal-to-noise ratio detection is passed, determining that the data condition is met, if the signal-to-noise ratio detection is not passed, making m equal to m +1, namely m equal to 2, and if m is less than or equal to n and m is less than or equal to mmaxAnd then the latest two of the n sensor data are superposed to be used as the superposition numberAnd performing signal-to-noise ratio detection according to the nth sensor data and the (n-1) th sensor data. And so on until the detection is carried out by the signal to noise ratio, or m is not satisfied to be less than or equal to n and m is less than or equal to mmaxThe loop is ended. Wherein m ismaxIt may be set by dividing the maximum integration time duration by the time interval and rounding up, or it may be set by the user.
Fig. 4 is a flowchart of another substance detecting method according to an exemplary embodiment of the disclosure, where, as shown in fig. 4, step 104 includes:
step 1041, preprocessing the superimposed data, the preprocessing including: denoising, substrate subtraction and normalization processing.
And 1042, performing substance identification on the preprocessed superposition data by using a Raman identification algorithm.
For example, the preprocessed superimposed data is a raman spectrum that can reflect the characteristics of the substance, and since the raman spectrum information of different substances is fixed and unique, the substance can be identified by analyzing the raman spectrum.
Fig. 5 is a flowchart of yet another substance detection method provided according to an exemplary embodiment of the present disclosure, as shown in fig. 5, the method further includes:
and 106, outputting first prompt information when the variation between the substance identification result and the last output substance detection result exceeds a preset threshold, wherein the first prompt information is used for prompting a user that the variation between the substance detection results of the substance to be detected is abnormal. And/or outputting second prompt information, wherein the second prompt information is used for prompting a user to control the moving speed of the Raman detection device.
For example, if the variation between the substance identification result at the current time and the last output substance detection result is too large, it indicates that the component of the substance to be detected has changed, where the variation may be a change of different substances or a change of the concentration of the same substance, and at this time, a first prompt message may be output to display the change of the substance to be detected to the user. Meanwhile, second prompt information can be output to prompt a user to reduce the speed of moving the Raman detection equipment (or reduce the moving speed of mechanical devices such as an unmanned aerial vehicle or a robot). Since the density of the output substance recognition results becomes large when the moving speed is reduced, the amount of change between the substance detection results output two adjacent times is correspondingly reduced. The preset threshold may be set by a user or may be a default value.
Fig. 6 is a flowchart of yet another substance detection method provided according to an exemplary embodiment of the present disclosure, as shown in fig. 6, the method further includes:
and 107, outputting third prompt information when the data condition is not met, wherein the third prompt information is used for prompting that the sensor data currently acquired by the user does not meet the data condition.
Illustratively, when the data condition is not satisfied, i.e., n is in the method of FIG. 2<p or overlay data not detected by signal-to-noise ratio, or m in the method of FIG. 3>n or m>mmaxUnder the condition, the user can be prompted that the sensor data collected at present cannot obtain an accurate detection result.
In summary, the present disclosure starts timing when the raman detection device moves and emits laser light according to a prescribed route, records data collected by the spectrometer sensor according to a preset time interval, linearly superimposes the collected data, judges the superimposed data under the condition of an integral duration or a signal-to-noise ratio detection result, detects a substance to be detected when the condition is satisfied, and outputs a substance identification result. Meanwhile, the timing is not interrupted, timing and collection of the next time interval are continued, and a continuous substance identification result on the specified route can be output. The problems of missing measurement and inaccurate measurement which possibly occur in a fixed-point detection method can be avoided, and the method has the effect of improving the accuracy and the output efficiency of substance detection.
Fig. 7 is a block diagram of a substance detecting device according to an exemplary embodiment of the present disclosure, and as shown in fig. 7, the device 200 includes:
the timing module 201 is configured to start timing when the raman detection apparatus starts to emit laser to the substance to be detected and the raman detection apparatus moves according to a preset route.
The recording module 202 is configured to record current sensor data of the spectrometer sensor when it is detected that the timing reaches a preset time interval, clear the spectrometer sensor, and continue timing by the timing module.
The judging module 203 is configured to determine whether a preset data condition is met according to the currently recorded n sensor data.
And the identification module 204 is used for identifying substances according to the n sensor data when the data condition is met.
And the output module 205 is used for outputting the substance identification result.
And when the timing is detected to meet the preset time interval, recording the current sensor data of the spectrometer sensor to output a substance identification result.
Optionally, the determining module 203 is configured to:
and judging whether the number of the n sensor data reaches p. The Raman detection device comprises a Raman detection device, a storage unit and a storage unit, wherein n and p are positive integers, n is the total number of the sensor data recorded currently, p is the number of designated data, the number of the designated data is determined according to the ratio of the fixed integration duration of the Raman detection device to the time interval, and the time interval is smaller than the fixed integration duration.
When n < p, it is determined that the data condition is not satisfied.
And when n is larger than or equal to p, acquiring the superposition data of the latest acquired p sensor data.
And carrying out the signal-to-noise ratio detection on the superposed data.
When the superimposed data is detected by the signal-to-noise ratio, it is determined that the data condition is satisfied. And when the superposed data does not pass the signal-to-noise ratio detection, determining that the data condition is not met.
Optionally, the determining module 203 is configured to:
and overlapping the m data which are collected latest to obtain overlapped data. Wherein m and n are positive integers, n is the total number of the sensor data which are recorded currently, and in each time interval, the initial value of m is 1, and m is less than or equal to n.
And carrying out signal-to-noise ratio detection on the superposed data.
When the superimposed data is detected by the signal-to-noise ratio, it is determined that the data condition is satisfied.
And when the superposed data does not pass the signal-to-noise ratio detection, making m equal to m +1, and judging whether m is larger than n.
When m > n, it is determined that the data condition is not satisfied.
When m is less than or equal to n, judging whether m is greater than mmax,mmaxFor a preset maximum number of allowable stacks, mmaxIs a positive integer.
When m is less than or equal to mmaxThen, the step of superposing the m newly acquired data to the step of carrying out signal-to-noise ratio detection on the superposed data is carried out again, and when m is larger than mmaxWhen the data condition is not satisfied, it is determined.
Fig. 8 is a block diagram of another substance detection device provided according to an exemplary embodiment of the present disclosure, and as shown in fig. 8, the identification module 204 includes:
the preprocessing submodule 2041 is configured to perform preprocessing on the superimposed data, where the preprocessing includes: denoising, substrate subtraction and normalization processing.
And the substance identification submodule 2042 is used for identifying the substance from the preprocessed superposition data by using a raman identification algorithm.
Fig. 9 is a block diagram of still another substance detecting device provided according to an exemplary embodiment of the present disclosure, and as shown in fig. 9, the device 200 further includes:
and the prompting module 206 is configured to output first prompting information when a variation between the substance identification result and the last output substance detection result exceeds a preset threshold, where the first prompting information is used to prompt a user that the variation between the substance detection results of the substance to be detected is abnormal. And/or the presence of a gas in the gas,
the prompting module 206 is further configured to output second prompting information, where the second prompting information is used to prompt a user to control a moving speed of the raman detection apparatus.
Optionally, the prompt module 206 is configured to output third prompt information when the data condition is not satisfied, where the third prompt information is used to prompt the user that the sensor data currently acquired does not satisfy the data condition.
The specific description of the functions implemented by the modules has been described in detail in the above method embodiments, and is not repeated here.
In summary, the present disclosure starts timing when the raman detection device moves and emits laser light according to a prescribed route, records data collected by the spectrometer sensor according to a preset time interval, linearly superimposes the collected data, judges the superimposed data under the condition of an integral duration or a signal-to-noise ratio detection result, detects a substance to be detected when the condition is satisfied, and outputs a substance identification result. Meanwhile, the timing is not interrupted, timing and collection of the next time interval are continued, and a continuous substance identification result on the specified route can be output. The problems of missing measurement and inaccurate measurement which possibly occur in a fixed-point detection method can be avoided, and the method has the effect of improving the accuracy and the output efficiency of substance detection.
Fig. 10 is a block diagram illustrating an electronic device 300 in accordance with an example embodiment. As shown in fig. 10, the electronic device 300 may include: a processor 301, a memory 302, a multimedia component 303, an input/output (I/O) interface 304, and a communication component 305.
The processor 301 is configured to control the overall operation of the electronic device 300, so as to complete all or part of the steps in the above-mentioned substance detection method. The memory 302 is used to store various types of data to support operation at the electronic device 300, such as instructions for any application or method operating on the electronic device 300 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and the like. The Memory 302 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 303 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 302 or transmitted through the communication component 305. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 304 provides an interface between the processor 301 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 305 is used for wired or wireless communication between the electronic device 300 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so that the corresponding Communication component 305 may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the electronic Device 300 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described substance detection method.
In another exemplary embodiment, a computer readable storage medium comprising program instructions, such as the memory 302 comprising program instructions, executable by the processor 301 of the electronic device 300 to perform the above-described substance detection method is also provided.
In summary, the present disclosure starts timing when the raman detection device moves and emits laser light according to a prescribed route, records data collected by the spectrometer sensor according to a preset time interval, linearly superimposes the collected data, judges the superimposed data under the condition of an integral duration or a signal-to-noise ratio detection result, detects a substance to be detected when the condition is satisfied, and outputs a substance identification result. Meanwhile, the timing is not interrupted, timing and collection of the next time interval are continued, and a continuous substance identification result on the specified route can be output. The problems of missing measurement and inaccurate measurement which possibly occur in a fixed-point detection method can be avoided, and the method has the effect of improving the accuracy and the output efficiency of substance detection.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.