Disclosure of Invention
In view of the above, embodiments of the present invention are proposed in order to provide a medium detection method and a corresponding medium processing apparatus, electronic device, storage medium that overcome or at least partially solve the above-mentioned problems.
In order to solve the above problem, an embodiment of the present invention discloses a medium detection method applied to a sheet-like medium processing apparatus including a first sensor and a second sensor, the method including:
obtaining a first time taken for the medium to pass the first sensor;
obtaining a second time it takes for the medium to exit the first sensor to a next medium to enter the first sensor;
determining a filtering threshold value according to the first time and the second time;
acquiring a detection signal generated when the medium passes through the second sensor;
processing the detection signal of the medium according to the filtering threshold value.
Optionally, the acquiring a first time taken for the medium to pass through the first sensor includes:
acquiring a first time node when the medium enters the first sensor and a second time node when the medium leaves the first sensor;
calculating the first time the medium took to pass the first sensor according to the first time node and the second time node.
Optionally, the acquiring a second time taken by the medium to leave the first sensor to a next medium to enter the first sensor includes:
acquiring a third time node when the next medium enters the first sensor;
calculating the second time it takes for the medium to leave the first sensor to the next medium to enter the first sensor according to the second time node and the third time node.
Optionally, the determining a filtering threshold according to the first time and the second time includes:
judging whether the first time is less than the second time;
if the first time is less than the second time, taking the first time as the filtering threshold;
and if the first time is greater than or equal to the second time, taking the second time as the filtering threshold.
Optionally, the processing the detection signal of the medium according to the filtering threshold includes:
determining a third time during which the low level signal in the detection signal lasts;
judging whether the third time is smaller than the filtering threshold value;
if the third time is less than the filtering threshold, eliminating the low level signal in the detection signal;
and if the third time is greater than or equal to the filtering threshold value, keeping the low-level signal in the detection signal.
Optionally, the sheet-like medium processing apparatus further includes a counter, and after the processing the detection signal of the medium according to the filtering threshold, the apparatus further includes:
and controlling the counter to count the media according to the processed detection signal.
Optionally, the sheet medium processing device is a cash deposit machine, a cash dispenser, a cash recycling machine, a bill machine or a card receiving and dispatching machine.
The embodiment of the invention discloses a medium processing device, which comprises a first sensor and a second sensor, and comprises:
a first time acquisition module for acquiring a first time taken by the medium to pass through the first sensor;
a second time acquisition module for acquiring a second time taken for the medium to leave the first sensor until a next medium enters the first sensor;
a filtering threshold determining module, configured to determine a filtering threshold according to the first time and the second time;
the detection signal acquisition module is used for acquiring a detection signal generated when the medium passes through the second sensor;
and the detection signal processing module is used for processing the detection signal of the medium according to the filtering threshold value.
Optionally, the first time obtaining module includes:
a first time node acquisition submodule for acquiring a first time node at which the medium enters the first sensor and a second time node at which the medium exits the first sensor;
a first time calculation submodule configured to calculate the first time taken for the medium to pass through the first sensor according to the first time node and the second time node.
Optionally, the second time obtaining module includes:
a second time node obtaining submodule, configured to obtain a third time node when the next medium enters the first sensor;
a second time calculation submodule for calculating the second time taken for the medium to leave the first sensor until the next medium enters the first sensor, based on the second time node and the third time node.
Optionally, the filtering threshold determining module includes:
a first time judgment submodule for judging whether the first time is less than the second time;
a first filtering threshold determining submodule, configured to, if the first time is smaller than the second time, use the first time as the filtering threshold;
and the second filtering threshold value determining submodule is used for taking the second time as the filtering threshold value if the first time is greater than or equal to the second time.
Optionally, the detection signal includes a high level signal and a low level signal, where the high level signal is used to indicate that the second sensor has a medium occlusion, and the low level signal is used to indicate that the second sensor has no medium occlusion, and the detection signal processing module includes:
a third time determination submodule for determining a third time during which the low-level signal in the detection signal continues;
the second time judgment submodule is used for judging whether the third time is smaller than the filtering threshold value;
a signal elimination sub-module, configured to eliminate the low level signal in the detection signal if the third time is less than the filtering threshold;
and the signal retaining submodule is used for retaining the low-level signal in the detection signal if the third time is greater than or equal to the filtering threshold value.
Optionally, the media processing apparatus further includes a counter, and after the detection signal processing module, the media processing apparatus further includes:
and the medium counting module is used for controlling the counter and counting the media according to the processed detection signal.
Optionally, the sheet medium processing device is a cash deposit machine, a cash dispenser, a cash recycling machine, a bill machine or a card receiving and dispatching machine.
The embodiment of the invention discloses electronic equipment, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the steps of the medium detection method are realized.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the medium detection method are realized.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, the first time taken by a medium to pass through a first sensor is acquired, the second time taken by the medium to leave the first sensor to enter a next medium into the first sensor is acquired, a filtering threshold value is determined according to the first time and the second time, a detection signal generated when the medium passes through a second sensor is acquired, and the detection signal of the medium is processed according to the filtering threshold value. In the embodiment of the invention, the filtering threshold value is dynamically adjusted according to the first time and the second time by acquiring the first time spent by the medium passing through the first sensor and the second time spent by the medium leaving the first sensor and the next medium entering the first sensor, so that the filtering effect is maximized, information such as false triggering and abnormal processing caused by holes is eliminated, and the problems of the shutdown rate and inaccurate counting of the movement are reduced.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating a first step of a first embodiment of a medium detection method according to the present invention is shown, where the first step may specifically include the following steps:
step 101, a first time taken for the medium to pass the first sensor is obtained.
Wherein, the medium is a sheet medium, including paper money, card invoices and the like;
the embodiment of the invention is applied to a sheet medium processing device, the sheet medium processing device comprises a cash deposit machine, a cash dispenser, a cash recycling machine, a bill machine or a card receiving and dispatching machine and the like, the sheet medium processing device comprises a first sensor and a second sensor, and the first sensor and the second sensor are photoelectric correlation sensors and can detect whether medium shielding exists in a channel; the medium is driven by the motor at a constant speed in the process of passing through the sheet type medium processing device, and the time spent by the medium for passing through the same distance is the same.
Specifically, in the process that the medium passes through the first sensor, the first time spent by the medium from just entering the first sensor to leaving the first sensor is obtained, the first time is also the time spent by the medium width in the rotation process of the motor, and the width of the medium is determined by the face value of the medium, so the first time spent by the medium with different face values passing through the first sensor is different.
Step 102, a second time taken for the medium to leave the first sensor to a next medium to enter the first sensor is obtained.
Specifically, a second time taken for the medium to just leave the first sensor until the next medium just contacts the first sensor is acquired, the second time also being a time taken for the motor to pass the distance between the medium and the next medium during rotation.
Step 103, determining a filtering threshold according to the first time and the second time.
Specifically, after acquiring a first time taken by the medium from just entering the first sensor to leaving the first sensor and a second time taken by the medium from just leaving the first sensor until a next medium just contacts the first sensor, the filtering threshold value is determined according to the first time and the second time. In practical applications, because the first time and the second time corresponding to each medium are different due to different medium values and different distances between the media, the filtering threshold value needs to be dynamically adjusted according to the type of the medium (for example, the value of the paper money) and the distance between the medium and the next medium.
And 104, acquiring a detection signal generated when the medium passes through the second sensor.
Specifically, the medium passes through the first sensor and then passes through the second sensor, and in the process that the medium passes through the second sensor, the second sensor generates a detection signal according to whether medium shielding exists in the channel or not, wherein the generated detection signal comprises an interference signal caused by the hole.
Step 105, processing the detection signal of the medium according to the filtering threshold value.
Specifically, after the filtering threshold corresponding to the medium is determined according to the first time and the second time and the detection signal generated when the medium passes through the second sensor is obtained, the detection signal can be filtered according to the filtering threshold, so as to filter the interference signal caused by the hole.
In the embodiment of the invention, the first time taken by a medium to pass through a first sensor is acquired, the second time taken by the medium to leave the first sensor to enter a next medium into the first sensor is acquired, a filtering threshold value is determined according to the first time and the second time, a detection signal generated when the medium passes through a second sensor is acquired, and the detection signal of the medium is processed according to the filtering threshold value. In the embodiment of the invention, the filtering threshold value is dynamically adjusted according to the first time and the second time by acquiring the first time spent by the medium passing through the first sensor and the second time spent by the medium leaving the first sensor and the next medium entering the first sensor, so that the filtering effect is maximized, information such as false triggering and abnormal processing caused by holes is eliminated, and the problems of the shutdown rate and inaccurate counting of the movement are reduced.
Referring to fig. 2, a flowchart illustrating steps of a second embodiment of a medium detection method according to the present invention is shown, where the second embodiment of the present invention may specifically include the following steps:
step 201, a first time taken for the medium to pass the first sensor is obtained.
In an embodiment of the present invention, the step 201 includes: acquiring a first time node when the medium enters the first sensor and a second time node when the medium leaves the first sensor; calculating the first time the medium took to pass the first sensor according to the first time node and the second time node. Referring to fig. 3, which is a schematic diagram of a detection signal of a sensor according to the present invention, as can be seen, at the moment when the second sensor detects that there is no medium shielding, a falling edge is triggered to convert a high level signal into a low level signal, and at the moment when the second sensor detects that there is no medium shielding, a rising edge is triggered to convert a low level signal into a high level signal.
The first sensor can detect that medium shielding exists at the moment when a medium enters the first sensor, a signal generated by detection can trigger a rising edge, a time node of the rising edge is a first time node, the first sensor can detect that medium shielding exists and changes into no medium shielding at the moment when the medium leaves the first sensor, the signal generated by detection can trigger a falling edge, and the time node of the falling edge is a second time node.
Specifically, in the process that the medium passes through the first sensor, a first time node when the medium just enters the first sensor and a second time node when the medium just leaves the first sensor are obtained, and the difference value between the first time node and the second time node is calculated to obtain the first time spent by the medium passing through the first sensor.
A second time taken for the medium to leave the first sensor to the next medium to enter the first sensor is obtained, step 202.
In an embodiment of the present invention, the step 202 includes: acquiring a third time node when the next medium enters the first sensor; calculating the second time it takes for the medium to leave the first sensor to the next medium to enter the first sensor according to the second time node and the third time node.
At the moment that the next medium just enters the first sensor, the first sensor detects that medium shielding exists, a signal generated by detection triggers a rising edge, and a time node of the rising edge is a third time node.
Specifically, after a second time node when the medium leaves the first sensor and a third time node when a next medium just enters the first sensor are acquired, a difference between the second time node and the third time node is calculated, and a second time spent by the medium leaving the first sensor until the next medium enters the first sensor is obtained.
Step 203, determining whether the first time is less than the second time.
Specifically, after acquiring a first time taken by the medium from just entering the first sensor to leaving the first sensor and a second time taken by the medium from just leaving the first sensor until a next medium just contacts the first sensor, the first time and the second time are compared, and whether the first time is less than the second time is judged.
Step 204, if the first time is smaller than the second time, the first time is used as the filtering threshold.
Specifically, the first time is compared with the second time, whether the first time is less than the second time is judged, and if the first time is less than the second time, the first time is used as a filtering threshold.
Step 205, if the first time is greater than or equal to the second time, taking the second time as the filtering threshold.
Specifically, the first time is compared with the second time, whether the first time is less than the second time is judged, and if the first time is greater than or equal to the second time, the second time is used as a filtering threshold.
Step 206, acquiring a detection signal generated when the medium passes through the second sensor.
Step 207, processing the detection signal of the medium according to the filtering threshold.
In an embodiment of the present invention, the step 207 includes: determining a third time during which the low level signal in the detection signal lasts; judging whether the third time is smaller than the filtering threshold value; if the third time is less than the filtering threshold, eliminating the low level signal in the detection signal; and if the third time is greater than or equal to the filtering threshold value, keeping the low-level signal in the detection signal.
The detection signals comprise high-level signals and low-level signals, the high-level signals are used for representing that the second sensor has medium shielding, and the low-level signals are used for representing that the second sensor does not have medium shielding.
Specifically, the duration of a low-level signal without medium blocking in the detection signal is determined, that is, the third time is compared with a filtering threshold, whether the third time is smaller than the filtering threshold is judged, if the third time is smaller than the filtering threshold, the low-level signal is generated for detecting a hole by the second sensor, the low-level signal in the detection signal is eliminated, an interference signal caused by the hole is filtered, and if the third time is larger than or equal to the filtering threshold, the requirement is met, and the low-level signal is retained.
In an embodiment of the present invention, the thin sheet-like medium processing apparatus includes a counter, and further includes, after the processing the detection signal of the medium according to the filtering threshold: and controlling the counter to count the media according to the processed detection signal.
Specifically, after the detection signal detected by the second sensor is processed according to the filtering threshold, the media are counted according to the processed detection signal by controlling a counter in the sheet-like media processing device, and for example, if a section of high-level signal exists in the detection signal, it is determined that one media passes through.
In the embodiment of the invention, a first time spent by a medium passing through a first sensor is acquired, a second time spent by the medium leaving the first sensor to a next medium entering the first sensor is acquired, whether the first time is less than the second time is judged, if the first time is less than the second time, the first time is taken as a filtering threshold value, if the first time is greater than or equal to the second time, the second time is taken as the filtering threshold value, a detection signal generated when the medium passes through a second sensor is acquired, and the detection signal of the medium is processed according to the filtering threshold value. In the embodiment of the invention, the first time spent by the medium passing through the first sensor and the second time spent by the medium leaving the first sensor and the next medium entering the first sensor are obtained, the first time and the second time are compared, and the shorter time is selected as the filtering threshold value, so that the filtering of the sensor can be more accurate and effective, the information of false triggering, abnormal processing and the like caused by holes is eliminated, and the problems of the shutdown rate and inaccurate counting of the movement are reduced.
In order for those skilled in the art to better understand the embodiments of the present invention, the embodiments of the present invention are further illustrated by way of an example with reference to fig. 4.
As shown in fig. 4, a total of a pair of trigger times are generated when the medium enters and leaves the first sensor, and the trigger times are set as follows:
t1: trigger time for entry (rising edge) of the medium;
t2: off (falling edge) trigger time for the medium;
the next media entering the first sensor will also generate a trigger time, which is set as follows:
t3: trigger time for next media entry (rising edge);
the width W (first time) of the medium can be acquired by the entry first sensor time T1 and the exit first sensor time T2 of the medium:
W=T2-T1;
the medium distance BD (second time) between the two media is calculated from the departure time T1 of the medium at the first node and the entry time T3 of the next medium at the first node:
BD=T3-T2;
holes may exist in the medium, but the size of the holes never exceeds the width W of the medium and the distance BD between the media, so the filter threshold L of the second sensor is determined according to the width W of the medium and the distance BD between the media, and L satisfies the following condition:
L<W;
L<BD;
the filtering threshold value L to be set to the MCU is obtained by comparing and taking values meeting the two conditions, the L is issued to the MCU through a designed protocol in a main control layer (an upper layer), the MCU carries out filtering according to the set value, and the designed communication protocol is as follows:
table 1 communication protocol table:
table 2 table for parameter description:
by setting the filter threshold L of the MCU, the low level signal (interference signal) generated by the dielectric holes is eliminated at the second sensor.
In the embodiment of the invention, the actual medium running process is to continuously calculate the width (first time) of the medium and the distance (second time) between the media and set different filtering threshold values L, so that the filtering of the sensor can be more accurate and effective, the maximum fault tolerance can be achieved, information such as false triggering and abnormal processing caused by holes is eliminated, and the problems of the shutdown rate and inaccurate counting of the movement are reduced.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 5, a block diagram of a third embodiment of a media processing device according to the present invention is shown, where the media processing device includes a first sensor and a second sensor, and may specifically include the following modules:
a first time acquiring module 501, configured to acquire a first time taken by the medium to pass through the first sensor;
a second time acquisition module 502 for acquiring a second time taken for the medium to leave the first sensor until a next medium enters the first sensor;
a filtering threshold determining module 503, configured to determine a filtering threshold according to the first time and the second time;
a detection signal acquiring module 504, configured to acquire a detection signal generated when the medium passes through the second sensor;
and a detection signal processing module 505, configured to process the detection signal of the medium according to the filtering threshold.
In an embodiment of the present invention, the first time obtaining module 501 includes:
a first time node acquisition submodule for acquiring a first time node at which the medium enters the first sensor and a second time node at which the medium exits the first sensor;
a first time calculation submodule configured to calculate the first time taken for the medium to pass through the first sensor according to the first time node and the second time node.
In an embodiment of the present invention, the second time obtaining module 502 includes:
a second time node obtaining submodule, configured to obtain a third time node when the next medium enters the first sensor;
a second time calculation submodule for calculating the second time taken for the medium to leave the first sensor until the next medium enters the first sensor, based on the second time node and the third time node.
In an embodiment of the present invention, the filtering threshold determining module 503 includes:
a first time judgment submodule for judging whether the first time is less than the second time;
a first filtering threshold determining submodule, configured to, if the first time is smaller than the second time, use the first time as the filtering threshold;
and the second filtering threshold value determining submodule is used for taking the second time as the filtering threshold value if the first time is greater than or equal to the second time.
In an embodiment of the present invention, the detection signal includes a high level signal and a low level signal, the high level signal is used for indicating that the second sensor has a medium occlusion, and the low level signal is used for indicating that the second sensor has no medium occlusion, the detection signal processing module 505 includes:
a third time determination submodule for determining a third time during which the low-level signal in the detection signal continues;
the second time judgment submodule is used for judging whether the third time is smaller than the filtering threshold value;
a signal elimination sub-module, configured to eliminate the low level signal in the detection signal if the third time is less than the filtering threshold;
and the signal retaining submodule is used for retaining the low-level signal in the detection signal if the third time is greater than or equal to the filtering threshold value.
In an embodiment of the present invention, the medium processing apparatus includes a counter, and after the detection signal processing module 505, the medium processing apparatus further includes:
and the medium counting module is used for controlling the counter and counting the media according to the processed detection signal.
In an embodiment of the present invention, the thin sheet medium processing device is a cash deposit machine, a cash dispenser, a cash recycling machine, a bill machine, or a card receiving and dispatching machine.
In the embodiment of the invention, the first time taken by a medium to pass through a first sensor is acquired, the second time taken by the medium to leave the first sensor to enter a next medium into the first sensor is acquired, a filtering threshold value is determined according to the first time and the second time, a detection signal generated when the medium passes through a second sensor is acquired, and the detection signal of the medium is processed according to the filtering threshold value. In the embodiment of the invention, the filtering threshold value is dynamically adjusted according to the first time and the second time by acquiring the first time spent by the medium passing through the first sensor and the second time spent by the medium leaving the first sensor and the next medium entering the first sensor, so that the filtering effect is maximized, information such as false triggering and abnormal processing caused by holes is eliminated, and the problems of the shutdown rate and inaccurate counting of the movement are reduced.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiment of the invention discloses electronic equipment, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the steps of the medium detection method embodiment are realized.
The embodiment of the invention discloses a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the embodiment of the medium detection method are realized.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The media detection method, the media processing device, the electronic device, and the storage medium provided by the present invention are described in detail above, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.