Disclosure of Invention
In order to improve the test efficiency of the instrument code wheel, the application provides a method and a system for testing rotation of the instrument code wheel.
In a first aspect, the present application provides a method for testing rotation of an instrument code wheel, which adopts the following technical scheme:
the instrument code wheel rotation test method comprises the following steps: acquiring digital area data corresponding to each number on a character wheel, wherein the character wheel comprises 10 digits such as 0-9 digits; testing all single digits of the instrument code disc based on the digital area data; calling a corresponding target number; testing the target digital region data corresponding to the target digital based on the forward rotation of the control character wheel; controlling the character wheel to reversely rotate based on the target digital area data after the test is finished, and performing a secondary test on the target digital area data; the method comprises the steps of sequentially testing target test numbers on an instrument code wheel, and controlling the character wheel to reversely rotate to perform secondary test, wherein the target test numbers are multiples of ten; if all the tests pass, the test is completed.
By adopting the technical scheme, in the process of full-bit code detection of the instrument code wheel, the digital area corresponding to the number to be tested is firstly determined, 10 numbers are arranged on each character wheel, all single digits displayed on the instrument code wheel are tested, in the process of testing, the target number is firstly determined, then the system can control the character wheel to rotate forward, at the moment, the data of the target digital area corresponding to the target number needs to be comprehensively tested, along with the forward rotation of the character wheel, after the data of the target digital area is tested, the system controls the character wheel to rotate reversely, and in the same way, the data of the target digital area is tested, after the forward rotation and the reverse rotation of the target number displayed on the instrument code wheel are all tested one by one, and the system also carries out forward rotation and reverse rotation tests, wherein the target test number is all a multiple of ten, and after the target test number displayed on the instrument code wheel passes all the tests, the test is completed; through the process, in the test process of the instrument code disc, only the numbers such as the single digits, the multiples of ten and the like displayed by the instrument code disc are tested, so that the test times of the whole instrument code disc full-bit code can be reduced, and the test efficiency is improved; in addition, in the process of testing the digital data, the digital region data is tested by controlling the forward rotation and the reverse rotation of the character wheel, and the accuracy of the test result can be further improved.
Optionally, in the process of testing all the single digits of the instrument code disc based on the digital area data, the following steps are further performed:
dividing the region corresponding to the digital region data into 3 regions, and acquiring upper region data, middle region data and lower region data corresponding to each digital, wherein the numbers of 0-9 on each character wheel are subjected to region division;
and testing the upper region data, the middle region data and the lower region data corresponding to each number in sequence, and if the upper region data, the middle region data and the lower region data pass the test, completing the corresponding number test.
By adopting the technical scheme, the digital region corresponding to each digit is divided into the upper region data, the middle region data and the lower region data, then the upper region data, the middle region data and the lower region data are sequentially tested, and one digit test is determined to pass through the three region tests, so that the accuracy of the test result of each digit can be ensured.
Optionally, in the process of testing the upper region data, the middle region data and the lower region data corresponding to each number, the following steps are further performed:
the character wheel is controlled to rotate n times in the digital area data corresponding to each number, wherein n is more than or equal to 3 times;
calling a corresponding target number;
simultaneously testing upper region data, middle region data and lower region data corresponding to the target number based on each rotation of the character wheel, wherein if the upper region data, the middle region data and the lower region data are tested, the standard is 1, and if the upper region data, the middle region data and the lower region data are not tested, the standard is marked as 0;
and after the character wheel is controlled to rotate n times, if all the upper region data, the middle region data and the lower region data are marked as 1, the corresponding digital test is passed.
Through adopting above-mentioned technical scheme, in the in-process of carrying out the test to last regional data, regional data and regional data down, when the control word wheel rotates once, can not guarantee at this moment that last regional data, regional data and regional data down all can be tested, thereby carry out many times to last regional data, regional data and regional data down through the control word wheel multitime and test to mention the test success rate of every regional.
Optionally, if all of the upper region data, the middle region data and the lower region data are not marked as 1, the value corresponding to n is increased.
Through adopting above-mentioned technical scheme, after the control character wheel rotates n times, if go up regional data, regional data and lower regional data still appear marking to 0's condition, instruct that certain region does not go to this moment, it is less to instruct the angle of every turn character wheel rotation through increasing the number of times of rotating the character wheel this moment to the number of times of testing increases, can improve the test success rate of every region equally.
Optionally, in the process of controlling the reverse rotation of the character wheel based on the target digital area data after the test, the following steps are further performed:
acquiring angle data corresponding to the rotation of the character wheel based on the data of the digital region of the start test target;
and comparing the angle data with an angle threshold value, and controlling the character wheel to start to reversely rotate if the angle data is larger than the angle threshold value.
Through adopting above-mentioned technical scheme, at the character wheel rotation in-process, the angle area that every digit occupy is certain, through carrying out the comparison with angle data and threshold value data, can in time accurate control reverse rotation to avoid the character wheel to rotate less and excessively, reduce the influence to test efficiency.
Optionally, the testing process is performed on the integer decimal number, the integer hundred number and the integer thousand number on the code disc of the instrument in sequence, wherein the target testing number is the integer decimal number of the double digits, the integer hundred number of the three digits, the integer thousand number of the four digits and the integer thousand number of the five digits.
By adopting the technical scheme, the whole tens of digits, the whole hundreds of digits, the whole thousands of digits and the whole tens of thousands of digits are tested, and the test of the other part of digits displayed by the instrument code disc, such as 350, 360 and the like, is omitted in the middle, so that the test workload can be further reduced, and the improvement of the test efficiency is facilitated.
Optionally, in the process of testing the target digital area data corresponding to the target number based on the forward rotation of the control word wheel, the following steps are performed:
acquiring digital test priorities corresponding to all numbers 0-9, wherein the priorities corresponding to the smaller numbers are higher;
and testing the digital area data corresponding to all the single digits in sequence according to the digital testing priority.
Through adopting above-mentioned technical scheme, in the testing process is carried out to the digit, through testing the digital region that all individual digits correspond in proper order according to digit test priority, the orderly control character wheel of system rotates this moment, need not to control the character wheel and jumps to reduce the character wheel pivoted time in the testing process, improve efficiency of software testing.
In a second aspect, the present application provides an instrument code wheel rotation test system, comprising:
the digital region acquisition module is used for acquiring digital region data corresponding to each number on the character wheel, wherein the character wheel comprises 10 digits such as 0-9 digits;
the single digit testing module is used for testing all single digits of the instrument code disc based on the digit area data;
the target number calling module is used for calling the corresponding target number;
the forward test module is used for testing the target digital region data corresponding to the target number based on the forward rotation of the control character wheel;
the reverse test module is used for controlling the character wheel to reversely rotate based on the test of the target digital area data and carrying out secondary test on the target digital area data;
the test module is used for sequentially testing target test numbers on the instrument code wheel, and controlling the character wheel to reversely rotate for secondary test, wherein the target test numbers are multiples of ten;
if all the tests pass, the test is completed.
By adopting the technical scheme, in the process of full-bit code detection of the instrument code wheel, the digital area corresponding to the number to be tested is firstly determined, 10 numbers are arranged on each character wheel, the single-digit test module firstly tests all single digits displayed on the instrument code wheel, in the process of testing, the target digit retrieval module firstly determines the target digits, then the system can control the character wheel to rotate positively, the forward test module needs to comprehensively test the target digital area data corresponding to the target digits, the system controls the character wheel to rotate reversely along with the forward rotation of the character wheel after the test of the target digital area data is finished, the reverse test module tests the target digital area data, and the test module needs to test the target test digits displayed on the instrument code wheel one by one after the forward rotation and the reverse rotation of the target digits on the instrument code wheel are finished, and also carries out forward rotation and reverse rotation tests, wherein the target test digits are all ten times, and the test is completed after the target test digits displayed on the instrument code wheel pass all the test; through the process, in the test process of the instrument code disc, only the numbers such as the single digits, the multiples of ten and the like displayed by the instrument code disc are tested, so that the test times of the whole instrument code disc full-bit code can be reduced, and the test efficiency is improved; in addition, in the process of testing the digital data, the digital region data is tested by controlling the forward rotation and the reverse rotation of the character wheel, and the accuracy of the test result can be further improved.
In a third aspect, the present application provides a computer readable storage medium storing a computer program capable of being loaded by a processor and performing a method according to any one of the instrument code wheel rotation test methods.
In a fourth aspect, the present application provides an intelligent terminal, including a memory and a processor, where the memory stores a computer program that can be loaded by the processor and execute any one of the methods, such as the method 7 for testing rotation of an instrument code wheel.
In summary, the present application includes at least one of the following beneficial technical effects:
1. in the test process of the instrument code disc, only the numbers such as the unit number and the multiple of ten displayed by the instrument code disc are tested, so that the test times of the whole instrument code disc full-bit code can be reduced, and the test efficiency is improved; in addition, in the process of testing the digital data, the digital region data is tested by controlling the forward rotation and the reverse rotation of the character wheel, and the accuracy of the test result can be further improved.
2. At this time, the increase of the number of times of the character wheel rotation indicates that the angle of each character wheel rotation is smaller, and the increase of the number of times of the test, the success rate of the test of each area can be improved as well.
3. By comparing the angle data with the threshold data, reverse rotation can be timely and accurately controlled, so that few revolutions and over revolutions of the character wheel are avoided, and the influence on the testing efficiency is reduced.
Detailed Description
The terminology used in the following embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. It should also be understood that the term "and/or" as used in this application is intended to encompass any or all possible combinations of one or more of the listed items.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
The present application is described in further detail below.
In a first aspect, an embodiment of the present application discloses a method for testing rotation of an instrument code wheel, referring to fig. 1, including the following steps:
s1, acquiring digital area data corresponding to each number on a character wheel;
the character wheels comprise 10 digits such as 0-9 digits, the number of the possibly adopted character wheels is different in different purposes of the instrument code disc, and each character wheel is identical.
S2, testing all single digits of the instrument code disc based on the digital area data;
in the process of testing all single digits, the system firstly controls the word wheel to rotate positively, meanwhile, the system can acquire the digital testing priority corresponding to all digits from 0 to 9, wherein the smaller the digits are, the higher the corresponding priority is, namely, the highest priority of the digits 0 is in the process of testing the digits from 0 to 9, the lowest priority of the digits 9 is, then the digital area data corresponding to all single digits are tested in sequence according to the digital testing priority, namely, in the process of testing, the test is started from the digits 0, and finally the test is carried out on the digits 9; the digital areas corresponding to all the single digits are tested in sequence according to the digital test priority, at the moment, the system orderly controls the character wheel to rotate, the character wheel is not required to jump across the digits, and the reciprocating rotation time of the character wheel can be reduced in the test process, so that the test efficiency is improved.
In the process of testing the digital region where the unit digits are located, in order to improve the accuracy of the test result, referring to fig. 2, the following steps are further performed:
s21, dividing the region corresponding to the digital region data into 3 regions, and acquiring upper region data, middle region data and lower region data corresponding to each digital region;
wherein, the numbers of 0-9 on each character wheel are divided into areas.
S22, sequentially testing the upper region data, the middle region data and the lower region data corresponding to each number, and if the upper region data, the middle region data and the lower region data pass the test, completing the corresponding number test.
The upper region data, the middle region data and the lower region data are tested in sequence, and the passing of one digital test is determined through three region tests, so that the accuracy of the test result of each digital can be improved.
In addition, the specific process steps for testing the upper region data, the middle region data and the lower region data are as follows:
s221, controlling the character wheel to rotate n times in the digital area data corresponding to each number;
in an ideal state, the upper area data, the middle area data and the lower area data corresponding to each digital area data are averaged for 12 degrees, but in the current production process, the angles occupied by the upper area data, the middle area data and the lower area data deviate, the angle of each rotation can be ensured to be smaller than 12 degrees when n is larger than 3, and after the character wheel rotates, the area of the same area can be tested again.
S222, calling the corresponding target number;
the target number is assumed to be 1, and at this time, the upper region data, the middle region data, and the lower region data corresponding to the number 1 are required to be tested.
And S223, simultaneously testing the upper region data, the middle region data and the lower region data corresponding to the target number based on each rotation of the character wheel, wherein if the target number is tested, the standard is 1, and if the target number is not tested, the standard is marked as 0.
S224, after the character wheel is controlled to rotate n times, if all the upper region data, the middle region data and the lower region data are marked as 1, the upper region data, the middle region data and the lower region data corresponding to the number 1 can be tested, and the upper region data, the middle region data and the lower region data corresponding to the number 2 can be tested; the character wheel is controlled to rotate for multiple times, so that multiple times of testing is carried out on the upper region data, the middle region data and the lower region data, and the testing success rate of each region is improved.
S225, if the upper area data, the middle area data and the lower area data are not all marked as 1, at this time, the test result of the middle area data is assumed to be no 1, which indicates that the test of the middle area data with the number of 1 fails, on the one hand, the test of the water meter may be different in the full bit code, on the other hand, the angle area occupied by the middle area data corresponding to the number of 1 may be smaller, and in order to reduce the situation that the test fails due to the reason, the system increases the number corresponding to n.
Specific examples are: assuming that n is set to 8, it is explained that when the digital region data of the number 1 is tested, the character wheel rotates 8 times and 4.5 degrees each time, so that the number of times of testing the region data of the number 1 is increased, the range of each test is reduced, and the success rate of testing the region data of the number 1 is increased; if the test is passed or the test fails, the problem of the character wheel of the water meter can be judged.
S3, calling the corresponding target number;
before the test starts, the number on the code disc of the instrument needs to be determined as the target number for the test.
S4, testing the target digital region data corresponding to the target number based on the forward rotation of the control character wheel;
in the process of forward rotation of the character wheel, the upper region data, the middle region data and the lower region data corresponding to the target digital region data need to be detected sequentially.
S5, controlling the character wheel to reversely rotate based on the target digital area data after the test is completed, and performing a secondary test on the target digital area data;
the system controls the character wheel to reversely rotate, at the moment, lower area data, middle area data and upper area data corresponding to the target digital area data are sequentially detected, after the three area data are marked as 1, the detection of the target digital is determined to be finished, and then the next target digital is determined according to the digital test priority.
During this time, in order to be able to precisely control the counter-rotation in time, with reference to fig. 3, the system also performs the following steps:
s51, acquiring angle data corresponding to the rotation of the character wheel based on the data of the digital region of the start test target;
after the system starts to test the target digital area data, the system starts to record the rotating angle of the character wheel.
S52, comparing the angle data with an angle threshold value, and controlling the character wheel to start to reversely rotate if the angle data is larger than the angle threshold value;
when the angle threshold is selected, the angle occupied by each digital region data on the character wheel needs to be considered, in the embodiment of the application, 10 numbers are arranged on the character wheel, the angle occupied by the digital region data corresponding to each number is 36 degrees, and at the moment, when the angle threshold is selected, the angle threshold needs to be larger than 36 degrees, so that all target digital region data are detected when forward rotation is ensured.
S6, testing target test numbers on the instrument code disc in sequence, and controlling the character wheel to reversely rotate for secondary test;
the target test numbers are the multiple of ten and are tested one by one through the digital test priority, and the target test numbers are the whole decimal number of the double digits, the whole hundred number of the triple digits, the whole thousand number of the quadruple digits and the whole ten thousand number of the quintupling digits, for example, for the whole decimal number of the double digits, 10, 20, & gt90, the whole hundred number of the triple digits is 100, 200, & gt900, the whole thousand number of the quadruple digits is 1000, 2000, & gt9000, the whole ten thousand number of the quintupling digits is 10000, 20000, & gt90000, and for the value range of the target test numbers, the target test numbers are required to be determined according to the number of corresponding word wheels on an instrument code disc, namely, a plurality of word wheels, and the target test numbers can take a plurality of the very big digits; in the process of testing the number at this time, after the digital area data corresponding to the number 10 is tested, the system can control the character wheel display 20 of the instrument code disc, and then test the digital area data corresponding to the number 20.
The test of the whole tens of digits, the whole hundreds of digits, the whole thousands of digits and the whole tens of thousands of digits is carried out, and the test of the other part of digits displayed by the instrument code disc, such as 350, 360 and the like, is omitted in the middle, so that the test workload can be further reduced, and the improvement of the test efficiency is facilitated.
And S7, if all the tests pass, finishing the test.
The implementation principle of the instrument code wheel rotation test method in the embodiment of the application is as follows: the system firstly acquires the digital area data corresponding to each of 10 digits on the character wheel, then tests all the single digits of the instrument code disc based on the digital area data, and tests one by one from 0 to 9 according to the set digital test priority, but in the test process, the digital area data is required to pass the test for the upper area data, the middle area data and the lower area data in advance, so that the passing of the digital test is determined only by passing the test for the upper area data, the middle area data and the lower area data.
In the test process, the system firstly controls the character wheel to rotate forward, at the moment, controls the character wheel to rotate n times in the digital area data corresponding to each number, then invokes the corresponding target number, and tests the upper area data, the middle area data and the lower area data corresponding to the target number simultaneously based on each rotation of the character wheel, if the test is completed, the standard is 1, if the test is not completed, the standard is marked as 0, and if the test is completed, the upper area data, the middle area data and the lower area data are marked as 1, the upper area data, the middle area data and the lower area data corresponding to the number 1 are proved to pass through the test, and the upper area data, the middle area data and the lower area data corresponding to the test number 2 can be tested; if the upper region data, the middle region data and the lower region data are not marked as 1, at the moment, the test result of the middle region data is assumed to be 1, which indicates that the test of the middle region data of the number 1 fails, on one hand, the test of the full bit code of the water meter may be different, on the other hand, the system increases the number corresponding to n in order to reduce the situation that the test fails due to the reason because the angle area occupied by the middle region data corresponding to the number 1 is smaller; the character wheel is controlled to rotate for multiple times, so that multiple times of testing is carried out on the upper region data, the middle region data and the lower region data, and the testing success rate of each region is improved.
And then the system tests the target digital region data corresponding to the target number based on the forward rotation of the control word wheel, the specific test process refers to the previous, the reverse rotation of the control word wheel is controlled based on the target digital region data after the test is finished, and the secondary test is carried out on the target digital region data, so that the secondary detection of the target number is realized after the system starts to test the target digital region data in time and accurately, the system starts to record the rotating angle of the word wheel, compares the angle data with an angle threshold value, and controls the word wheel to start to reversely rotate if the angle data is larger than the angle threshold value.
After the number test of the unit number is finished, the system sequentially tests the target test number on the instrument code disc, and controls the character wheel to reversely rotate to perform secondary test, and after the target test number on the instrument code disc passes the secondary test, the system tests.
In summary, in the testing process of the instrument code board, only the numbers such as the single digit, the multiple of ten and the like displayed by the instrument code board are tested, so that the testing times of the whole instrument code board full-bit code can be reduced, and the testing efficiency is improved; in addition, in the process of testing the digital data, the digital region data is tested by controlling the forward rotation and the reverse rotation of the character wheel, and the accuracy of the test result can be further improved.
In a second aspect, an embodiment of the present application discloses an instrument code wheel rotation test system, referring to fig. 4, including:
the digital region acquisition module is used for acquiring digital region data corresponding to each number on the character wheel, wherein the character wheel comprises 10 digits such as 0-9 digits;
the single digit testing module is used for testing all single digits of the instrument code disc based on the digit area data;
the target number calling module is used for calling the corresponding target number;
the forward test module is used for testing the target digital region data corresponding to the target number based on the forward rotation of the control character wheel;
the reverse test module is used for controlling the character wheel to reversely rotate based on the test of the target digital area data and carrying out secondary test on the target digital area data;
the test module is used for sequentially testing target test numbers on the instrument code wheel, and controlling the character wheel to reversely rotate for secondary test, wherein the target test numbers are multiples of ten; the method comprises the steps of carrying out a first treatment on the surface of the
If all the tests pass, the test is completed.
The implementation principle of the instrument code wheel rotation test system in the embodiment of the application is as follows: in the process of full-bit code detection of an instrument code disc, a digital area corresponding to a number to be tested is firstly determined, 10 numbers are arranged on each character wheel, a single-digit test module is used for testing all single digits displayed on the instrument code disc, in the process of testing, a target digit calling module is used for firstly determining target digits, then a system can control the character wheel to rotate forward, at the moment, the forward test module is used for comprehensively testing target digital area data corresponding to the target digits, along with the forward rotation of the character wheel, after the target digital area data are tested, the system is used for controlling the character wheel to rotate reversely, and similarly, a reverse test module is used for testing the target digital area data, after the forward rotation and the reverse rotation of the target digits on the instrument code disc are all tested, the test module is used for testing the target test digits displayed on the instrument code disc one by one, and the forward rotation and the reverse rotation test are also carried out, wherein the target test digits are all multiples of ten, and after the target test digits displayed on the instrument code disc are all tested, the test is completed; through the process, in the test process of the instrument code disc, only the numbers such as the single digits, the multiples of ten and the like displayed by the instrument code disc are tested, so that the test times of the whole instrument code disc full-bit code can be reduced, and the test efficiency is improved; in addition, in the process of testing the digital data, the digital region data is tested by controlling the forward rotation and the reverse rotation of the character wheel, and the accuracy of the test result can be further improved.
In a third aspect, the present application provides a computer readable storage medium storing a computer program capable of being loaded by a processor and performing a method according to any one of the instrument code wheel rotation test methods.
In a fourth aspect, the present application provides an intelligent terminal, including a memory and a processor, where the memory stores a computer program that can be loaded by the processor and execute any one of the methods, such as the method 7 for testing rotation of an instrument code wheel.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
As used in the above embodiments, the term "when …" may be interpreted to mean "if …" or "after …" or "in response to determination …" or "in response to testing …" depending on the context. Similarly, the phrase "at the time of determination …" or "if tested (stated condition or event)" may be interpreted to mean "if determined …" or "in response to determination …" or "at the time of testing (stated condition or event)" or "in response to testing (stated condition or event)" depending on the context.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.