Summary of the invention
Embodiment of the present invention is designed to provide a kind of detection method, relevant apparatus and storage medium, makes it possible to
The article to be detected held to different types of container carries out accurate detection.
In order to solve the above technical problems, embodiments of the present invention provide a kind of detection method, comprising the following steps: obtain
Take the laser focal of detection device;Obtain the specification information of container;According to the position of laser focal and specification information adjustment container,
So that the laser spot that laser focal determines behind adjustment position is irradiated on article to be detected through container.
Embodiments of the present invention additionally provide a kind of detection device, comprising: first obtain module, second obtain module and
Adjust module;First obtains module, for obtaining the laser focal of detection device;Second obtains module, for obtaining container
Specification information;Module is adjusted, for the position according to laser focal and specification information adjustment container, so that laser behind adjustment position
The laser spot that focal length determines is irradiated on article to be detected through container.
Embodiments of the present invention additionally provide a kind of detection device, comprising: at least one processor;And at least
The memory of one processor communication connection;Wherein, memory is stored with the instruction that can be executed by least one processor, instruction
It is executed by least one processor, so that at least one processor is able to carry out detection method as described above.
Embodiments of the present invention additionally provide a kind of computer readable storage medium, are stored with computer program, calculate
Machine program realizes detection method as described above when being executed by processor.
In terms of existing technologies, the laser focal by obtaining detection device can determine sharp embodiment of the present invention
The specific location of optical focus, and the design parameter information of the available container of specification information by obtaining container, according to laser
Container can be carried out the accurate adjustment of position, make laser by the specific location of focus and the design parameter information of different vessels
The laser spot that focal length determines is irradiated on article to be detected through container, is held to realize for different types of container
Article to be detected can realize accurate detection.
In addition, obtaining the specification information of container, specifically include: obtaining the identification information on container;It is obtained according to identification information
Take specification information, wherein specification information includes the dimension information of container and the material information of container.In the realization, pass through acquisition
Identification information on container, the specification information according to acquired in identification information can be more accurate.
In addition, obtaining specification information according to identification information, specifically include: by reading identification information, obtaining identification information
Included in specification information.In the realization, specification information can be directly acquired by reading identification information, to improve rule
The acquisition speed of lattice information.
In addition, obtaining specification information according to identification information, specifically include: by reading identification information, obtaining identification information
Included in Code Number;Code Number is matched with database, acquisition and specification information corresponding to Code Number,
Wherein, the corresponding relationship of Code Number and specification information is saved in database.It is indirect by reading identification information in the realization
Specification information is obtained, the diversity of specification information acquisition modes is embodied.
In addition, terminal device includes the laser lens for generating laser spot, wherein the laser focal of laser lens is
Fixed value.In the realization, laser spot is generated by laser lens, since the laser focal of laser lens is fixed value,
The position of the laser spot determined by laser focal is exactly known is convenient for according to the realization of the position of laser spot to container position
The accurate adjustment set.
In addition, after the specification information of acquisition container, further includes: determine container according to the material information in specification information
Type, wherein the type of container includes sample sack or sample bottle.In the realization, after the specification information for obtaining container, pass through
Determine the type of container, can according to the type of identified container use with Container Type corresponding to dimension information adjustment hold
The position of device improves the accuracy of container position adjustment to keep adjustment process more targeted.
In addition, however, it is determined that the type of container is sample bottle, then the dimension information of container includes: the diameter and sample of sample bottle
The thickness of bottle;If it is determined that the type of container is sample sack, then the dimension information of container includes not holding sample before sample to be tested
The thickness of bag.
In addition, after determining the type of container according to the material information in specification information, further includes: in the class for determining container
When type is sample sack, measurement holds the overall thickness of the sample sack after sample to be tested.
In addition, being specifically included according to the position of laser focal and specification information adjustment container: according to laser focal and specification
Information determines first distance of the first side apart from laser lens of container, wherein first distance is container apart from laser mirror
The minimum distance of head;Second distance of the second side apart from laser lens of container is determined according to laser focal and specification information,
Wherein, second distance is maximum distance of the container apart from laser lens.
In addition, first distance of the first side apart from laser lens of container is determined according to laser focal and specification information,
It specifically includes: if it is determined that the type of container is sample bottle, then calculating the of sample bottle according to the thickness of sample bottle and laser focal
First distance of the one side apart from laser lens;If it is determined that the type of container be sample sack, then according to the thickness of sample sack and swash
First distance of first side of the light focus away from calculating sample sack apart from laser lens.
In addition, second distance of the second side apart from laser lens of container is determined according to laser focal and specification information,
It specifically includes: if it is determined that the type of container is sample bottle, then according to the diameter of sample bottle, the thickness of sample bottle and laser focal meter
Calculate second distance of the second side of sample bottle apart from laser lens;If it is determined that the type of container is sample sack, then according to sample
The overall thickness of bag, the thickness of sample sack and laser focal calculate second distance of the second side of sample sack apart from laser lens.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention
Each embodiment be explained in detail.However, it will be understood by those skilled in the art that in each embodiment party of the present invention
In formula, in order to make the reader understand this application better, many technical details are proposed.But even if without these technical details
And various changes and modifications based on the following respective embodiments, the application technical solution claimed also may be implemented.
The first embodiment of the present invention is related to a kind of detection method method, which is applied to detection device, should
Detection device, which can be any one, can be realized the electronic equipment of substance detection function, such as optical detection apparatus (spectrometer
Deng).The detailed process of the detection method is as shown in Figure 1, comprising the following steps:
Step 101, the laser focal of detection device is obtained.
Specifically, the detection device in the present embodiment includes the laser lens for generating laser spot, and laser
The laser focal of camera lens is fixed value, and the specific value of laser focal is stored in detection device parameter database, because
This, detection device can obtain laser coke after getting detection open command according to detection open command from parameter database
Away from specific value.For example, the specific value of laser focal can be 3cm in practical applications, certainly, in present embodiment only
It is that citing is illustrated, the specific value of laser focal is not limited in present embodiment.
Wherein, in situation known to laser focal, so that it may the position of laser spot is determined by laser focal, because
In the application embodiment, laser focal it is changeless, so the position of laser spot be it is known that and be it is fixed not
Become.
Step 102, the specification information of container is obtained.
Specifically, by obtaining the identification information on container, specification information is obtained according to identification information, wherein specification
Information includes the dimension information of container and the material information of container.In practical applications, identification information can be near radio
Communicate skill (Near Field Communication, NFC) label or bar code.It is obtained in present embodiment according to identification information
When taking specification information, direct or indirect two kinds of acquisition modes can be used:
The first directly acquires mode, by reading identification information, obtains the specification information for including in identification information, this reality
It applies in mode, specification information is directly contained in identification information, detection device is by directly reading identification information, so that it may obtain
Specification information in identification information.For example, be pasted with NFC label on container, contained in NFC label specification information " diameter:
10 millimeters, thickness: 3 millimeters, material: quartz ", detection device can directly obtain specification by reading the NFC label on container
Information " diameter: 10 millimeters, thickness: 3 millimeters, material: quartz ".
Second of indirect gain mode obtains Code Number included in identification information by reading identification information;It will
Code Number is matched with database, is obtained and specification information corresponding to Code Number, wherein generation is saved in database
The corresponding relationship of code number and specification information.It is Code Number, detection device included in identification information in present embodiment
Code Number included in identification information can only be obtained by reading identification information, and each Code Number represents one kind
Containers size information, detection device can obtain the code by matching the Code Number of acquisition with database indirectly
The corresponding specification information of number.For example, being pasted with NFC label on container, Code Number " 001 " is contained in NFC label,
Detection device obtains the Code Number " 001 " by the NFC label on reading container, and saves code volume in the database
Specification information corresponding to number 001 is " diameter: 10 millimeters, thickness: 3 millimeters, material: quartz ", and Code Number is corresponding to 002
Specification information be " thickness: 0.2 millimeter, material: polyethylene ", detection device by by Code Number " 001 " and database into
Row matching can obtain and specification information corresponding to " 001 " " diameter: 10 millimeters, thickness: 3 millimeters, material: quartz " indirectly.
Step 103, according to the position of laser focal and specification information adjustment container, so that laser focal is true behind adjustment position
Fixed laser spot is irradiated on article to be detected through container.
It wherein, in the present embodiment, can be according to the material in specification information after the specification information for obtaining container
Information determines the type of container, wherein the type of container includes sample sack or sample bottle.For example, detection device is by by material
Information is matched with Container Type list of matches, can obtain the type of container, if the material information in specification information is
Quartz, it is determined that the type of container is sample bottle, if the material information in specification information is polyethylene, it is determined that the class of container
Type is sample sack.It is that the explanation carried out for determining the type of container according to material information may be used also certainly in present embodiment
To determine the type of container in other manners, for example, including photographic device in detection device, container is obtained by camera shooting
Image, by the type for analyze to the image of acquisition determining container.
It should be noted that measurement holds the sample sack after sample to be tested when the type for determining container is sample sack
Overall thickness, sample sack can be clamped by detection device for the overall thickness of sample sack, and measurement is passed through by measuring device
It obtains, it is of course also possible to obtain the image of sample sack by photographic device, and obtains sample by carrying out analysis to the image of acquisition
The overall thickness of product bag.If it is determined that the type of container is sample bottle, then the dimension information of container includes: the diameter and sample of sample bottle
The thickness of bottle;If it is determined that the type of container is sample sack, then the dimension information of container includes not holding sample before sample to be tested
The thickness of bag.
Specifically, in the present embodiment, when according to the position of laser focal and specification information adjustment container, specifically
Be by the way of: according to laser focal and specification information determine the first side of container apart from laser lens first away from
From, wherein first distance is minimum distance of the container apart from laser lens;Container is determined according to laser focal and specification information
Second distance of the second side apart from laser lens, wherein second distance is maximum distance of the container apart from laser lens.
At one in the specific implementation, illustrating the first side distance of sample bottle so that Container Type is sample bottle as an example
The method of determination of second distance of the first distance and second side of laser lens apart from laser lens.It is illustrated in figure 2 sample
The position method of determination schematic diagram of bottle, as shown in the figure using the right side tangent plane of sample bottle as first side, with a left side for sample bottle
Side tangent plane for second side as being illustrated.Determine first distance of the first side apart from laser lens of sample bottle,
Wherein, laser focal f, the diameter of sample bottle are d, sample bottle with a thickness of n, then in the first side of sample bottle apart from laser
The first distance of camera lens are as follows: when f-n, laser spot just passes through sample bottle just, and laser spot can be irradiated to sample to be tested
On, at this point, determining second distance of the second side of sample bottle apart from laser lens are as follows: f+d-n.
At another in the specific implementation, by taking Container Type is sample sack as an example, illustrate the first side of sample sack away from
The method of determination of the second distance of laser lens with a distance from first distance and second side from laser lens.It is illustrated in figure 3 sample
The position method of determination schematic diagram of product bag, as shown in the figure using the right side of sample sack as first side, with the left side of sample sack
Face for second side as being illustrated.Determine first distance of the first side apart from laser lens of sample sack, wherein swash
For light focus away from for f, the overall thickness of sample sack is D, sample sack with a thickness of N, then in the first side of sample sack apart from laser lens
First distance are as follows: when f-N, laser spot just passes through sample sack just, and laser spot can be irradiated in sample to be tested, this
When, determine second distance of the second side apart from laser lens of sample sack are as follows: f+D-N.
Compared with prior art, the detection method that present embodiment provides, the laser focal by obtaining detection device can
To determine the specific location of laser spot, and the design parameter information of the available container of specification information by obtaining container,
According to the design parameter information of the specific location of laser spot and different vessels, container can be carried out to the accurate tune of position
Whole, the laser spot for determining laser focal is irradiated on article to be detected through container, to realize for different types of
The article to be detected that container is held can realize accurate detection.
Second embodiment of the present invention is related to a kind of detection method.The present embodiment is done on the basis of first embodiment
It is further improved, specific improvements are as follows: after determining the position of laser spot, increase and sent out according to the position of laser spot
It penetrates laser and collects spectral information, and testing result is obtained according to spectral information, according to.The process of detection method in the present embodiment
As shown in Figure 4.Specifically, in the present embodiment, including step 201 is to step 204, wherein step 201 to 203 and first real
Step 101 in mode is applied to 103 roughly the same, details are not described herein again, difference is mainly introduced below, not in this embodiment party
The technical detail of detailed description in formula, reference can be made to detection method provided by first embodiment, details are not described herein again.
After step 201 to step 203, step 204 is executed.
Step 204, transmitting laser collects spectral information, and obtains testing result according to spectral information.
Specifically, in the present embodiment, after having adjusted the position of container, detection device emits laser, laser
Just it is irradiated on article to be detected through container, and collects the spectral information in laser irradiation to article to be detected.But at this time
Acquired spectral information not only includes the spectral information of article to be detected, while further including the spectral information of container, and container
Spectral information be interference information for the detection process of substance.Because in specification information including the material information of container, and
It is to save spectral information corresponding to the material of container in the database, by being excluded from spectral information collected by laser
Fall the spectral information of container, so that it may obtain the spectral information of accurately substance to be detected.By inciting somebody to action accurate substance to be detected
Spectral information matched with the spectrum of known substance, accurate detection can be obtained as a result, due to obtaining by Spectral matching
It obtains testing result and is not the emphasis of the application, so no longer being repeated in the application.
Compared with prior art, the detection method that present embodiment provides, the laser focal by obtaining detection device can
To determine the specific location of laser spot, and the design parameter information of the available container of specification information by obtaining container,
According to the design parameter information of the specific location of laser spot and different vessels, container can be carried out to the accurate tune of position
Whole, the laser spot for determining laser focal is irradiated on article to be detected through container, to realize for different types of
The article to be detected that container is held can realize accurate detection.Emit laser and collect spectral information, and by the spectrum of collection
Information excludes the interference of container spectral information, can be further improved the accuracy of testing result.
The step of various methods divide above, be intended merely to describe it is clear, when realization can be merged into a step or
Certain steps are split, multiple steps are decomposed into, as long as including identical logical relation, all in the protection scope of this patent
It is interior;To adding inessential modification in algorithm or in process or introducing inessential design, but its algorithm is not changed
Core design with process is all in the protection scope of the patent.
Third embodiment of the invention is related to a kind of detection device, and specific structure is for example as shown in Figure 5.
As shown in figure 5, detection device includes that the first acquisition module 301, second obtains module 302 and adjustment module 303:
First obtains module 301, for obtaining the laser focal of detection device.
Second obtains module 302, for obtaining the specification information of container.
Module 303 is adjusted, for the position according to laser focal and specification information adjustment container, so that swashing behind adjustment position
Light focus is irradiated on article to be detected away from determining laser spot through container.
It is not difficult to find that present embodiment is Installation practice corresponding with first embodiment, present embodiment can be with
First embodiment is worked in coordination implementation.The relevant technical details mentioned in first embodiment still have in the present embodiment
Effect, in order to reduce repetition, which is not described herein again.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in
In first embodiment.
Four embodiment of the invention is related to a kind of detection device.The embodiment is roughly the same with third embodiment,
Specific structure is as shown in Figure 6.Wherein, it mainly thes improvement is that: the 4th embodiment detection device in the third embodiment
Detection module 304 is increased on the basis of structure.
Wherein, first module 301 is obtained, for obtaining the laser focal of detection device.
Second obtains module 302, for obtaining the specification information of container.
Module 303 is adjusted, for the position according to laser focal and specification information adjustment container, so that swashing behind adjustment position
Light focus is irradiated on article to be detected away from determining laser spot through container.
Detection module 304 collects spectral information for emitting laser, and obtains testing result according to spectral information.
It is not difficult to find that present embodiment is Installation practice corresponding with second embodiment, present embodiment can be with
Second embodiment is worked in coordination implementation.The relevant technical details mentioned in second embodiment still have in the present embodiment
Effect, in order to reduce repetition, which is not described herein again.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in
In second embodiment.
It is noted that each module involved in present embodiment is logic module, and in practical applications, one
A logic unit can be a physical unit, be also possible to a part of a physical unit, can also be with multiple physics lists
The combination of member is realized.In addition, in order to protrude innovative part of the invention, it will not be with solution institute of the present invention in present embodiment
The technical issues of proposition, the less close unit of relationship introduced, but this does not indicate that there is no other single in present embodiment
Member.
Fifth embodiment of the invention is related to a kind of detection device, as shown in fig. 7, comprises at least one processor 501;With
And the memory 502 with the communication connection of at least one processor 501;Wherein, be stored with can be by least one for memory 502
The instruction that device 501 executes is managed, instruction is executed by least one processor 501, so that at least one processor 501 is able to carry out
State the detection method in embodiment.
In the present embodiment, for processor 501 is with central processing unit (Central Processing Unit, CPU), deposit
For reservoir 502 is with readable and writable memory (Random Access Memory, RAM).Processor 501, memory 502 can lead to
It crosses bus or other modes connects, in Fig. 7 for being connected by bus.Memory 502 is used as a kind of non-volatile calculating
Machine readable storage medium storing program for executing can be used for storing non-volatile software program, non-volatile computer executable program and module, such as
Realize that the program of detection method is stored in memory 502 in the embodiment of the present application.Processor 501 is stored in by operation
Non-volatile software program, instruction and module in reservoir 502, at the various function application and data of equipment
Reason, that is, realize above-mentioned detection method.
Memory 502 may include storing program area and storage data area, wherein storing program area can store operation system
Application program required for system, at least one function;It storage data area can the Save option list etc..In addition, memory can wrap
High-speed random access memory is included, can also include nonvolatile memory, for example, at least disk memory, a flash memories
Part or other non-volatile solid state memory parts.In some embodiments, it includes relative to processor 501 that memory 502 is optional
Remotely located memory, these remote memories can pass through network connection to external equipment.The example of above-mentioned network includes
But be not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
One or more program module is stored in memory 502, is executed when by one or more processor 501
When, execute the detection method in above-mentioned any means embodiment.
Method provided by the embodiment of the present application can be performed in the said goods, has the corresponding functional module of execution method and has
Beneficial effect, the not technical detail of detailed description in the present embodiment, reference can be made to method provided by the embodiment of the present application.
The sixth embodiment of the application is related to a kind of computer readable storage medium, in the computer readable storage medium
It is stored with computer program, which can be realized when being executed by processor involved in any means embodiment of the present invention
Detection method.
It will be understood by those skilled in the art that implementing the method for the above embodiments is that can pass through
Program is completed to instruct relevant hardware, which is stored in a storage medium, including some instructions are used so that one
A equipment (can be single-chip microcontroller, chip etc.) or processor (processor) execute each embodiment the method for the application
All or part of the steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey
The medium of sequence code.
It will be understood by those skilled in the art that the respective embodiments described above are to realize specific embodiments of the present invention,
And in practical applications, can to it, various changes can be made in the form and details, without departing from the spirit and scope of the present invention.