CN-122019276-A - Method, device and storage medium for testing angle detection function
Abstract
A testing method, equipment and storage medium for angle detection function relates to the technical field of terminals. The method comprises the steps of obtaining angle data representing an opening and closing angle and obtaining the acquisition time of the angle data, determining the angle data with the largest angle value and the smallest angle change rate as a detection value of the largest opening angle by utilizing the angle data and the acquisition time, comparing the detection value of the largest opening angle with a corresponding real opening and closing angle to determine whether the opening angle detection function of equipment to be tested is normal, and/or determining the angle data with the smallest angle value and the smallest angle change rate as a detection value of the smallest opening angle by utilizing the angle data and the acquisition time, and comparing the detection value of the smallest opening angle with the corresponding real opening and closing angle to determine whether the closing angle detection function is normal. According to the method, a clamp and a fake finger are not needed, so that the hardware cost and the manual debugging and maintenance workload are reduced, and the detection efficiency and the accuracy of the detection result are improved.
Inventors
- HU WEI
Assignees
- 荣耀终端股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20241112
Claims (13)
- 1. A method for testing an angle detection function, characterized in that in the process of controlling the change of the opening and closing angle of a device to be tested, the method comprises the following steps: acquiring angle data representing an opening and closing angle and acquiring acquisition time of the angle data; Determining the angle data with the maximum angle value and the minimum angle change rate as the detection value of the maximum unfolding angle by utilizing the angle data and the acquisition time, and comparing the detection value of the maximum unfolding angle with the corresponding real folding angle to determine whether the unfolding angle detection function of the equipment to be tested is normal or not; and/or, determining the angle data with the minimum angle value and the minimum angle change rate as a detection value of the minimum unfolding angle by utilizing the angle data and the acquisition time, and comparing the detection value of the minimum unfolding angle with the corresponding real folding angle to determine whether the closing angle detection function of the equipment to be tested is normal or not; The angle change rate is the ratio of the difference value between the next angle data of the current angle data and the current angle data to the holding time of the current angle data.
- 2. The detection method according to claim 1, wherein using the angle data and the acquisition time, determining the angle data having the largest angle value and the smallest angle change rate as the detection value of the largest expansion angle, specifically includes: Acquiring a first data set according to angle data acquired in the process from the angle data being greater than or equal to a first preset angle to the angle data being smaller than the first preset angle again; identifying and removing abnormal angle data in the first dataset; And determining the detection value of the maximum unfolding angle by using the residual angle data in the first data set and the acquisition time of the residual angle data.
- 3. The method of detection of claim 2, wherein after acquiring the first data set, the method further comprises: Determining the accumulated number of the abnormal angle data, and determining that the mechanical equipment currently controlling the opening and closing angle change of the equipment to be tested and the unfolding angle detection function of the equipment to be tested are abnormal when the accumulated number of the abnormal angle data is larger than or equal to a first preset number.
- 4. The detection method according to claim 2, wherein the determining the detection value of the maximum expansion angle by using the remaining angle data in the first data set and the collection time of the remaining angle data specifically includes: Determining the maximum n angle data in the residual angle data, wherein n is a positive integer; Determining a hold time for each of the maximum n angle data; determining a first confidence corresponding to the angle data with each holding time being greater than a first holding time threshold and less than a second holding time threshold; determining the angle data with the maximum first confidence as a detection value of the maximum unfolding angle; wherein the greater the angle data, the greater the first confidence level, and the lesser the angle change rate, the greater the first confidence level, when the angle data is the same, when the angle change rate is the same.
- 5. The method according to claim 4, wherein comparing the detected value of the maximum expansion angle with the corresponding actual opening/closing angle to determine whether the expansion angle detection function of the device to be tested is normal, specifically comprises: And determining a difference value between the detection value of the maximum unfolding angle and the first real folding angle, and determining that the unfolding angle detection function of the equipment to be tested is normal when the difference value is within a first error range, or determining that the unfolding angle detection function of the equipment to be tested is abnormal.
- 6. The detection method according to claim 1, wherein the determining, using the angle data and the acquisition time, the angle data having the smallest angle value and the smallest angle change rate as the detection value of the smallest expansion angle specifically includes: acquiring a second data set according to the angle data acquired in the process from the angle data being smaller than or equal to a second preset angle to the angle data being larger than the second preset angle again; Identifying and removing abnormal angle data in the second data set; and determining the detection value of the minimum unfolding angle by using the residual angle data in the second data set and the acquisition time of the residual angle data.
- 7. The method of detecting according to claim 6, wherein after acquiring the second data set, the method further comprises: Determining the accumulated number of the abnormal angle data, and determining that the mechanical equipment currently controlling the opening and closing angle change of the equipment to be tested and the closing angle detection function of the equipment to be tested are abnormal when the accumulated number of the abnormal angle data is larger than or equal to a first preset number.
- 8. The method according to claim 6, wherein determining the detection value of the minimum expansion angle by using the remaining angle data in the second data set and the collection time of the remaining angle data specifically includes: Determining the smallest p angle data in the residual angle data, wherein p is a positive integer; determining a hold time for each of the minimum p angle data; determining a second confidence corresponding to the angle data with each holding time greater than the first holding time threshold and less than the second holding time threshold; determining the angle data with the maximum second confidence as a detection value of the maximum unfolding angle; the smaller the angle data, the greater the second confidence, when the angle change rate is the same, and the smaller the angle change rate, the greater the second confidence, when the angle data is the same.
- 9. The method according to claim 8, wherein comparing the detected value of the minimum unfolding angle with the corresponding real folding angle to determine whether the closing angle detection function of the device to be tested is normal, specifically includes: And determining a difference value between the detection value of the minimum unfolding angle and a second real folding angle, and determining that the closing angle detection function of the equipment to be tested is normal when the difference value is within a second error range, or determining that the closing angle detection function of the equipment to be tested is abnormal.
- 10. The method according to claim 1, wherein after controlling the opening and closing angle of the device to be tested to be maintained at the third true opening and closing angle for the first preset period of time, the method further comprises: determining the angle data with the minimum angle change rate in the first preset time period as a detection value of a target unfolding angle; and comparing the detection value of the target unfolding angle with the third real folding angle to determine whether the angle detection function of the equipment to be tested is normal.
- 11. An electronic device, wherein the network device comprises a processor and a memory; The processor is coupled with the memory; the memory is used for storing computer programs and/or instructions; the processor is configured to execute a computer program and/or instructions stored in the memory to implement the method of testing the angle detection function of any one of claims 1 to 10.
- 12. A computer program product, characterized in that the computer program product comprises a computer program or instructions for performing a test method of the angle detection function of any of claims 1 to 10.
- 13. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program or instructions, which, when run on an electronic device, cause the electronic device to perform the method of testing the angle detection function of any of claims 1 to 10.
Description
Method, device and storage medium for testing angle detection function Technical Field The present application relates to the field of terminal technologies, and in particular, to a method, an apparatus, a storage medium, and a computer program product for testing an angle detection function. Background With the development of technology, foldable electronic devices have been widely used in life. Taking folding electronic equipment as mobile phone equipment as an example, the mobile phone equipment needs to detect the opening and closing angle of the mobile phone equipment so as to realize corresponding functions by matching with a system or an application program, and in order to ensure that the opening and closing angle detected by the mobile phone equipment is consistent with the real opening and closing angle, the opening and closing angle detection function of the mobile phone needs to be detected at present. In the related scheme, the detection mode is that the mechanical structure is used for controlling the electronic equipment to open and close, and when the mechanical structure is used for controlling the electronic equipment to be at a target opening and closing angle, the clamp is used for controlling the fake finger to press the 2 keys of the electronic equipment so as to trigger software of the electronic equipment to detect the opening and closing angle. However, the above detection scheme has the following drawbacks: The method has the advantages that the matched clamp and the matched artificial finger are required to be designed for the electronic equipment, the design complexity is high, the hardware cost is increased, the manual debugging and maintenance workload is increased, the appearance risk of the electronic equipment is damaged, the detection angle is changed due to the fact that the electronic equipment is possibly jittered due to the fact that the key of the electronic equipment is required to be pressed, interference data are generated, misjudgment is caused, and the test time is increased when the pressing action is required to be reserved for the pressing of the key of the artificial finger. Disclosure of Invention In order to solve the problems, the application provides a testing method, equipment, a storage medium and a computer program product for an angle detection function, which do not need to use clamps and fake fingers, so that hardware cost and manual debugging and maintenance workload are reduced, the risk of damaging the appearance of electronic equipment is avoided, the data acquisition time is short, interference data is not introduced, and the detection efficiency and the accuracy of detection results are improved. The application provides a testing method of an angle detection function, which comprises the steps of obtaining angle data representing an opening angle and obtaining acquisition time of the angle data, determining the angle data with the largest angle value and the smallest angle change rate as a detection value of the largest unfolding angle by utilizing the angle data and the acquisition time, comparing the detection value of the largest unfolding angle with a corresponding real opening angle to determine whether the unfolding angle detection function of the equipment to be tested is normal, and/or determining the angle data with the smallest angle value and the smallest angle change rate as a detection value of the smallest unfolding angle by utilizing the angle data and the acquisition time, and comparing the detection value of the smallest unfolding angle with the corresponding real opening angle to determine whether the closing angle detection function of the equipment to be tested is normal, wherein the angle change rate is a ratio between a difference value of next angle data of current angle data and a retention time of the current angle data. By utilizing the scheme, the electronic equipment directly detects the angle data in the process of controlling the opening and closing angle to change, and acquires the acquisition time of the angle data. When the unfolding angle is detected, the angle value is maximum and the angle change rate is minimum, so that the sampled angle data is closest to the maximum unfolding angle of the equipment to be tested in a complete unfolding state, the angle data can be used as the detection value of the maximum unfolding angle, and then the detection value of the maximum unfolding angle and the real opening and closing angle of the unfolding angle detection are compared. The actual opening and closing angle of the expansion angle detection is generally the actual angle value of the device to be tested when the device is fully expanded in the real world, for example, 180 °. For closed angle detection, the minimum angle value and the minimum angle change rate indicate that the sampled angle data is closest to the minimum unfolding angle of the equipment to be tested in the fully closed state, so that the angle da