A device comprising a first cavity (300) and a second cavity (400), wherein the first cavity (300) and the second cavity (400) are in a flexible connection liquid is stored in the second cavity (400) through motion of the relative position of the first cavity (300) and the second cavity (400). The first cavity (300) and the second cavity (400) have a first position and a second position when the first cavity (300) and the second cavity (400) are in the first position, the relative position of the first cavity (300) and the second cavity (400) is a stationary and immovable device for collecting samples. By using the device and method in the invention, the integrated function for collection and detection of samples can be realized in addition, the collection device also can realize the function for quantitative sample injection.