Positioning function automated test method, storage medium and terminal device

By obtaining the current latitude and longitude information of the positioning module through system command line commands of the terminal device and comparing it with the boundary range of the target positioning area, the problem of low testing efficiency of GNSS positioning modules in the existing technology is solved, and automated and rapid positioning function testing is realized.

CN122307600APending Publication Date: 2026-06-30ANYSMART TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANYSMART TECH CO LTD
Filing Date
2026-04-02
Publication Date
2026-06-30

Smart Images

  • Figure CN122307600A_ABST
    Figure CN122307600A_ABST
Patent Text Reader

Abstract

This application discloses an automated testing method, storage medium, and terminal device for positioning functions. The automated testing method is applied to a terminal device equipped with a positioning module. The method includes: obtaining the current latitude and longitude information of the positioning module through system command-line instructions of the terminal device; comparing the current location indicated by the current latitude and longitude information with the boundary range of a target positioning area, where the target positioning area is a geographical area determined based on a preset positioning accuracy threshold; and outputting an anomaly log if the current location indicated by the current latitude and longitude information does not fall within the boundary range of the target positioning area, the anomaly log indicating an anomaly attribute of the positioning module. This application avoids relying on manual review of positioning results using map software, and can automatically determine the success or failure of positioning without human intervention, outputting anomaly logs when tests fail, thus improving troubleshooting efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of mobile terminal technology, specifically to an automated testing method for positioning functions, a storage medium, and a terminal device. Background Technology

[0002] Typically, terminal devices have built-in positioning modules with Global Navigation Satellite System (GNSS) positioning capabilities. During routine testing, it's necessary to test the success of GNSS positioning. However, current GNSS positioning testing relies on third-party map software, requiring testers to manually download and view maps to determine the positioning results. This method cannot automate the determination of positioning success and accuracy, leading to low testing efficiency, high costs, and difficulty in covering large-scale, multi-scenario testing. Summary of the Invention

[0003] This application provides an automated testing method, storage medium, and terminal device for positioning functions, aiming to solve the automated testing of positioning functions of positioning modules without human intervention.

[0004] On one hand, this application provides an automated testing method for positioning functions, applied to a terminal device equipped with a positioning module. The automated testing method includes: obtaining the current latitude and longitude information of the positioning module through system command line instructions of the terminal device; comparing the current location indicated by the current latitude and longitude information with the boundary range of a target positioning area; wherein the target positioning area is a geographical area determined based on a preset positioning accuracy threshold; if the current location indicated by the current latitude and longitude information does not fall within the boundary range of the target positioning area, an abnormal log is output; wherein the abnormal log is used to indicate the abnormal attributes of the positioning module.

[0005] Optionally, before comparing the current location indicated by the current latitude and longitude information with the boundary range of the target positioning area, the method further includes: determining a preset maximum longitude, a preset minimum longitude, a preset maximum latitude, and a preset minimum latitude based on the preset positioning accuracy threshold; and determining the boundary range of the target positioning area based on the preset maximum longitude, the preset minimum longitude, the preset maximum latitude, and the preset minimum latitude.

[0006] Optionally, the target positioning area is rectangular in shape; determining the boundary range of the target positioning area based on the preset maximum longitude, the preset minimum longitude, the preset maximum latitude, and the preset minimum latitude includes: determining a first point based on the preset minimum latitude and the preset minimum longitude; determining a second point based on the preset minimum latitude and the preset maximum longitude; determining a third point based on the preset maximum latitude and the preset minimum longitude; determining a fourth point based on the preset maximum latitude and the preset maximum longitude; and determining the boundary range of the rectangular target positioning area using the first point, the second point, the third point, and the fourth point as vertices.

[0007] Optionally, the target positioning area is circular in shape; determining the boundary range of the target positioning area based on the preset maximum longitude, the preset minimum longitude, the preset maximum latitude, and the preset minimum latitude includes: determining a target longitude value based on the average of the preset maximum longitude and the preset minimum longitude; determining a target latitude value based on the average of the preset maximum latitude and the preset minimum latitude; and determining the boundary range of the circular target positioning area with the geographical locations corresponding to the target longitude and the target latitude values ​​as the center and the preset positioning accuracy threshold as the radius.

[0008] Optionally, before obtaining the current latitude and longitude information of the positioning module through the system command line instructions of the terminal device, the method further includes: performing pre-test automated processing on the terminal device; if the pre-test automated processing fails, then outputting the exception log.

[0009] Optionally, the pre-test automated processing for the terminal device includes: checking and uninstalling the existing first test driver related to the positioning module on the terminal device; installing the second test driver for the positioning module; and outputting the exception log if the pre-test automated processing fails, including: outputting the exception log if the second test driver installation fails.

[0010] Optionally, the pre-test automated processing for the terminal device includes: switching the working mode of the positioning module to the standard function mode when the working mode of the positioning module is in full-port debugging mode; if the pre-test automated processing fails, the exception log is output, including: the standard function mode is a user mode that only includes network card and positioning functions; if it is determined that the switching of the working mode of the positioning module to the standard function mode fails, the exception log is output.

[0011] Optionally, the pre-test automated processing for the terminal device includes: checking whether the driver node of the positioning module is loaded normally; if the pre-test automated processing fails, the exception log is output, including: if it is determined that the driver node is not loaded normally, the exception log is output.

[0012] Optionally, the pre-test automated processing for the terminal device includes: disabling the mobile data network and wireless local area network of the terminal device, and clearing the historical location cache information stored in the terminal device; if the pre-test automated processing fails, the exception log is output, including: if it is determined that disabling the mobile data network and wireless local area network of the terminal device has failed, the exception log is output.

[0013] Optionally, obtaining the current latitude and longitude information of the positioning module through the system command line instructions of the terminal device includes: obtaining the current latitude and longitude information of the positioning module through the system command line instructions of the terminal device when the terminal device is in a target state; wherein, the target state includes at least one of the following: the terminal device has no SIM card inserted, the SIM card of the terminal device is locked, the terminal device is woken up from sleep state, the terminal device is woken up from hibernation state, and the terminal device is in flight mode.

[0014] On the other hand, embodiments of this application also provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in any of the automated testing methods for positioning functions provided in embodiments of this application.

[0015] On the other hand, embodiments of this application also provide a computer-readable storage medium storing a computer program or instructions thereon, including a computer program or instructions that, when executed by a processor, implement the steps in any of the automated testing methods for positioning functions provided in embodiments of this application.

[0016] On the other hand, this application embodiment also provides a terminal device equipped with a positioning module. The terminal device includes a memory and a processor. The memory stores computer programs or instructions. When the computer programs or instructions are executed by the processor, the processor performs the steps in any of the automated positioning function testing methods provided in this application embodiment to detect the positioning function of the positioning module.

[0017] This application discloses an automated testing method, storage medium, and terminal device for positioning functions. The automated testing method is applied to a terminal device equipped with a positioning module. The method includes: obtaining the current latitude and longitude information of the positioning module through system command-line instructions of the terminal device; comparing the current location indicated by the current latitude and longitude information with the boundary range of a target positioning area, where the target positioning area is a geographical area determined based on a preset positioning accuracy threshold; and outputting an exception log if the current location indicated by the current latitude and longitude information does not fall within the boundary range of the target positioning area, whereby the exception log indicates an abnormal attribute of the positioning module. The testing method provided in this application has the following advantages compared to related technologies: The current latitude and longitude information of the positioning module can be directly obtained through system command-line commands on the terminal device, without relying on third-party map software or manual intervention to check the positioning results. This effectively avoids data deviations caused by third-party software parsing and eliminates the tedious process of manual operation, improving the efficiency and accuracy of positioning data acquisition. By comparing the current location indicated by the current latitude and longitude information with the boundary range of the target positioning area, the success or failure of the positioning module's positioning can be automatically determined. No manual participation in the entire testing process is required, which can adapt to large-scale, repetitive positioning function testing scenarios, significantly reducing the workload of testers and improving testing efficiency. If the current latitude and longitude information indicates that the current location is within the boundary range of the target positioning area, the positioning module can automatically determine whether the positioning is successful. If the current position does not fall within the boundary range of the target positioning area, an anomaly log will be automatically output, including anomaly attributes such as the anomaly occurrence timestamp and anomaly type. This helps testers quickly pinpoint the time of the anomaly and the core anomaly type, eliminating the need for step-by-step troubleshooting, significantly shortening the troubleshooting cycle and reducing testing and maintenance costs. Since the target positioning area is a geographical region determined based on a preset positioning accuracy threshold, successful positioning can be confirmed by comparing the current latitude and longitude information with the boundary range of this area. This directly verifies that the current positioning accuracy meets the preset positioning accuracy threshold requirements, eliminating the need for additional accuracy detection steps. This simplifies the testing process while ensuring the standardization and reliability of positioning testing. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This application provides a schematic diagram of the architecture of a terminal device. Figure 2 A flowchart illustrating an automated testing method for positioning functions provided in an embodiment of this application; Figure 3 A schematic diagram of a system command line instruction provided in an embodiment of this application; Figure 4 A schematic diagram of a target positioning area provided in an embodiment of this application; Figure 5 A schematic diagram of another target positioning area provided in an embodiment of this application; Figure 6 A schematic diagram illustrating a driver node name provided in an embodiment of this application; Figure 7 This is a flowchart illustrating another automated testing method for positioning functions provided in an embodiment of this application. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] In the following description, specific embodiments of the invention will be illustrated with reference to steps and symbols performed by one or more computers, unless otherwise stated. Therefore, these steps and operations will be referred to several times as being performed by a computer, and computer execution as referred to herein includes operations by a computer processing unit representing electronic signals of data in a structured format. This operation transforms the data or maintains it at a location in the computer's memory system, which can be reconfigured or otherwise alter the operation of the computer in a manner well known to those skilled in the art. The data structure maintained by the data is the physical location of the memory, which has specific characteristics defined by the data format. However, the principles of the invention described above are not intended to be limiting, and those skilled in the art will understand that many of the steps and operations described below can also be implemented in hardware.

[0022] The terms "module" or "unit" as used herein can be considered as software objects executing on the computing system. The various components, modules, engines, and services described herein can be considered as implementations on the computing system. While the apparatus and methods described herein are preferably implemented in software, they can also be implemented in hardware, both of which are within the scope of this invention.

[0023] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when an element is “connected” or “coupled” to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein may include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0024] Figure 1 This is a schematic diagram of the architecture of a terminal device provided in an embodiment of this application. Please refer to [link / reference]. Figure 1 The terminal device 10 may be equipped with a positioning module 100.

[0025] Terminal device 10 can be any type of smart device, including mobile terminals and terminals with relatively fixed locations. For example, terminal device 10 can be a mobile phone, computer, game console, e-reader, wearable device, smart home device, vehicle, IoT device, etc. Specifically, terminal device 10 can be a desktop terminal or a mobile terminal, such as a mobile phone, tablet computer, or laptop computer.

[0026] The terminal device 10 equipped with the positioning module 100 provided in this application embodiment can be a portable computing terminal running a Windows operating system. For example, the terminal device 10 can be a laptop computer with an embedded GNSS positioning module 100, including various forms such as thin and light laptops, gaming laptops, and business laptops, running mainstream desktop operating systems such as Windows 10 / 11. It has a cellular network module, a wireless Fidelity (WiFi) communication module, and a power management module, supporting power / network working state switching such as sleep, hibernation, and airplane mode. It reserves a hardware driver interface and an AT command interaction interface for the positioning module 100, enabling the reading of underlying hardware data and control of hardware status through system command line commands (such as Shell, PowerShell, bash, etc.). For example, the positioning module 100 can receive positioning signals from satellite navigation systems such as Global Positioning System (GPS) / BeiDou / GLONASS, output raw positioning data such as latitude and longitude, and integrate communication functions, supporting multiple working mode switching, etc.

[0027] Figure 2This is a flowchart illustrating an automated testing method for positioning functions provided in an embodiment of this application. Please refer to [link / reference]. Figure 2 This automated testing method for positioning functions can be applied to... Figure 1 The terminal device 10 shown is equipped with a positioning module 100. For example, the testing method can be performed by... Figure 1 The terminal device 10 with positioning module 100 shown executes this. For example... Figure 2 As shown, the automated testing method for the positioning function includes the following steps (steps S210 to S230): Step S210: Obtain the current latitude and longitude information of the positioning module through the system command line instructions of the terminal device.

[0028] Figure 3 Please refer to the schematic diagram of a system command line instruction provided in an embodiment of this application. Figure 3 Executing the aforementioned shell command on the terminal device allows direct reading of the raw latitude and longitude information output by the positioning module, without the need for third-party map software or auxiliary positioning tools, thus avoiding interference from intermediate steps. Specifically, the latitude and longitude information includes the current longitude and latitude values, such as... Figure 3 As shown, the current longitude is 117.11555 and the current latitude is 31.82175. This set of data is the raw positioning data obtained by the positioning module in real time from the analysis of satellite signals. It should be understood that... Figure 3 The system command-line instructions shown are merely specific examples and do not constitute a limitation of this application. In actual use, due to differences in the manufacturers and operating system versions of terminal devices, the adapted system command-line instructions will also differ. Testers can adapt and select the appropriate instructions according to the actual situation to obtain the current latitude and longitude information of the positioning module. The terminal device can determine whether the positioning was successful based on the obtained latitude and longitude information.

[0029] Step S220: Compare the current location indicated by the current latitude and longitude information with the boundary range of the target positioning area; wherein, the target positioning area is a geographical area determined based on a preset positioning accuracy threshold.

[0030] It should be understood that the preset positioning accuracy threshold can be 10m, 8m, 5m, 3m, or 1m, etc., and this application does not limit it. By comparing the current location indicated by the acquired current latitude and longitude information with the boundary range of the target positioning area, it can be determined whether the positioning module has successfully positioned itself. For example, if the preset positioning accuracy threshold is 10m, it means that the current positioning accuracy is 10m, and the error between the acquired current latitude and longitude information and the actual geographical location of the terminal device can be controlled within 10m. If it exceeds this range, it is determined that the positioning has failed. The target positioning area can be a regular geometric shape, such as a rectangle, quadrilateral, circle, ellipse, regular polygon, etc., or it can be an irregular polygon, and this application does not limit it.

[0031] Step S230: If the current location indicated by the current latitude and longitude information does not fall within the boundary range of the target positioning area, then output an anomaly log; wherein, the anomaly log is used to indicate the abnormal attributes of the positioning module.

[0032] If the current location indicated by the latitude and longitude information does not fall within the boundary of the target positioning area, the positioning module is directly determined to have failed. In this case, the corresponding exception type for the positioning module can be simultaneously written to the exception log. This exception type is "module positioning exception," facilitating rapid troubleshooting of positioning function malfunctions. If the current location falls within the boundary of the target positioning area, the positioning module is determined to be functioning normally, and the positioning accuracy meets the preset positioning accuracy threshold. It should be understood that when the positioning module fails to locate, the information written to the exception log can also include a timestamp, specific error messages, and the corresponding steps of the currently executed Python script, among other specific positioning failure information. Exceptions are typically used to indicate the abnormal attributes of the positioning module. This helps testers quickly pinpoint the root cause of problems and improves testing efficiency.

[0033] It should be understood that the testing method provided in this application embodiment can be automated through Python scripts, and can automatically complete the positioning function test of the positioning module without human intervention.

[0034] The testing method provided in this application directly obtains the current latitude and longitude information of the positioning module through system command line instructions on the terminal device. This eliminates the need for third-party map software or manual intervention to view the positioning results, effectively avoiding data deviations caused by third-party software analysis. It also eliminates the tedious manual operation process, improving the efficiency and accuracy of positioning data acquisition. By comparing the current location indicated by the current latitude and longitude information with the boundary range of the target positioning area, the method automatically determines whether the positioning module has successfully positioned itself. This eliminates the need for manual intervention in the entire testing process, making it suitable for large-scale, repetitive positioning function testing scenarios. It significantly reduces the workload of testers and improves testing efficiency. If the current location indicated by the information does not fall within the boundary range of the target positioning area, an anomaly log will be automatically output, including anomaly attributes such as the anomaly occurrence timestamp and anomaly type. This helps testers quickly pinpoint the time node and core anomaly type, eliminating the need for step-by-step troubleshooting, significantly shortening the fault diagnosis cycle and reducing test and maintenance costs. Since the target positioning area is a geographical region determined based on a preset positioning accuracy threshold, successful positioning can be confirmed by comparing the current latitude and longitude information with the boundary range of this area. This directly verifies that the current positioning accuracy meets the preset positioning accuracy threshold requirements, eliminating the need for additional accuracy detection steps. This simplifies the testing process while ensuring the standardization and reliability of positioning tests.

[0035] In some embodiments, prior to step S220 above, the test method further includes the following steps (steps S215 and S216): Step S215: Determine the preset maximum longitude (max_longitude), preset minimum longitude (min_longitude), preset maximum latitude (max_latitude), and preset minimum latitude (min_latitude) based on the preset positioning accuracy threshold; Step S216: Determine the boundary range of the target positioning area based on the preset maximum longitude (max_longitude), preset minimum longitude (min_longitude), preset maximum latitude (max_latitude), and preset minimum latitude (min_latitude).

[0036] In step S215, using the terminal device's actual reference geographical location as the core and combining it with preset positioning accuracy thresholds, the corresponding preset maximum longitude (max_longitude), preset minimum longitude (min_longitude), preset maximum latitude (max_latitude), and preset minimum latitude (min_latitude) can be calculated by expanding in four directions: east, west, north, and south. It should be understood that this set of extreme values ​​are the basic parameters for constructing target positioning areas of different regular shapes according to the needs of the test scenario in step S216, ensuring the matching of the subsequent area range and positioning accuracy.

[0037] Figure 4 Please refer to the schematic diagram of a target positioning area provided in the embodiments of this application. Figure 4 In some embodiments, the target positioning area is rectangular; step S216 above includes the following steps (steps S2161A to S2165A): Step S2161A: Determine the first point S1 based on the preset minimum latitude min_latitude and the preset minimum longitude min_longitude; Step S2162A: Determine the second point S2 based on the preset minimum latitude min_latitude and the preset maximum longitude max_longitude; Step S2163A: Determine the third point S3 based on the preset maximum latitude max_latitude and the preset minimum longitude min_longitude; Step S2164A: Determine the fourth point S4 based on the preset maximum latitude max_latitude and the preset maximum longitude max_longitude; Step S2165A: Using the first point S1, the second point S2, the third point S3, and the fourth point S4 as vertices, determine the boundary range of the rectangular target positioning area Area_target.

[0038] like Figure 4 As shown, points S1 (min_latitude, min_longitude), S2 (min_latitude, max_longitude), S3 (max_latitude, min_longitude), and S4 (max_latitude, max_longitude) are used as the vertices of a quadrilateral, and these points are connected sequentially to form the boundary of a rectangular target positioning area, Area_target. In step S220, the current position indicated by the acquired latitude and longitude information is compared with the boundary of this rectangular area to determine whether the positioning module has successfully located the target.

[0039] Figure 5 For a schematic diagram of another target positioning area provided in the embodiments of this application, please refer to... Figure 5 In some embodiments, the target positioning area is circular in shape; step S216 above includes the following steps (steps S2161B to S2163B): Step S2161B: Determine the target longitude value aver_longitude based on the average of the preset maximum longitude max_longitude and the preset minimum longitude min_longitude; Step S2162B: Determine the target latitude value aver_latitude based on the average of the preset maximum latitude max_latitude and the preset minimum latitude min_latitude; Step S2163B: Using the geographical locations corresponding to the target longitude value aver_longitude and the target latitude value aver_latitude as the center O and the preset positioning accuracy threshold as the radius r, determine the boundary range of the circular target positioning area Area_target.

[0040] like Figure 5 As shown, a circle is drawn with O (aver_latitude, aver_longitude) as the center and a preset positioning accuracy threshold as the radius r. This circular area is the boundary range of the target positioning area Area_target. In step S220 above, the current position indicated by the obtained current latitude and longitude information can be compared with the boundary range of this circular area to determine whether the positioning module has successfully positioned itself.

[0041] As a concrete example, Python automation scripts provide the following location verification method: The `verify_gps_location(min_latitude, max_latitude, min_longitude, max_longitude)` method takes as input parameters the preset maximum longitude (`max_longitude`), preset minimum longitude (`min_longitude`), preset maximum latitude (`max_latitude`), and preset minimum latitude (`min_latitude`). This method first generates a rectangular region based on these four input parameters, and then obtains the current latitude and longitude information of the positioning module (e.g., ...) via shell commands. Figure 3 (As shown in the image) Next, check whether the coordinates corresponding to the latitude and longitude information fall within the boundary of the generated rectangular area. If it falls within the boundary of the rectangular area, it means that the GNSS positioning is successful and the positioning accuracy error is within the preset positioning accuracy threshold (e.g., 10m). If it does not fall within the boundary of the rectangular area, it means that the GNSS positioning has failed. The relevant information can be written to the anomaly log so that testers can quickly locate the root cause of the problem based on the anomaly log.

[0042] In some embodiments, prior to step S210 described above, the test method further includes the following steps (steps S200 and S201): Step S200: Perform pre-test automated processing on the terminal device; Step S201: If the pre-test automated processing fails, an exception log will be output.

[0043] To successfully invoke system command-line commands to obtain the latitude and longitude information of the positioning module and accurately determine whether the positioning module's positioning was successful, it is necessary to ensure in advance that the positioning module's test driver is installed correctly, the working mode switching is normal, the test environment is configured correctly, and the driver node is loaded correctly. This requires comprehensive pre-test processing of the terminal device. These pre-test processes can all be automated using Python scripts without manual intervention. In the event of anomalies such as driver installation failure, abnormal working mode switching, network disabling failure, or abnormal driver node loading, detailed exception logs will be automatically generated. These logs include key information such as timestamps, exception types, error messages, and problem points, enabling testers to quickly locate problems, efficiently troubleshoot faults, and ensure the smooth progress of the testing process.

[0044] In some embodiments, step S200 above includes the following steps: Step S2001: Check and uninstall the existing first test driver related to the positioning module on the terminal device; Step S2002: Install the second test driver for the positioning module.

[0045] Step S201 above includes the following steps: Step S2011: If the second test driver installation fails, output the exception log.

[0046] Existing drivers on the terminal device may not meet the requirements of the current test. Therefore, before normal testing, the existing driver (i.e., the first test driver) can be uninstalled, and then the driver to be tested (i.e., the second test driver) can be installed. If the driver (i.e., the second test driver) installation fails, relevant information such as the exception type and timestamp should be written to the exception log. In this case, the exception type can be defined as a driver installation exception. For example, taking a laptop as the terminal device and a GNSS module as the positioning module, the Python script will call system commands or specific functions (such as the uninstall_install_driver() function). This function will automatically detect and uninstall the existing GNSS-related drivers on the laptop, and then install the latest version of the GNSS driver to be tested. This achieves automated uninstallation and installation of the GNSS driver, ensuring the initialization of the test environment and the correctness of the driver, and avoiding errors and time consumption that may be introduced by manual uninstallation and installation.

[0047] In some embodiments, step S200 above includes the following steps: Step S2003: When the positioning module is in full-port debugging mode, switch the positioning module to standard function mode.

[0048] Step S201 above includes the following steps: Step S2012: The standard function mode is the user mode that only includes network card and positioning functions; if it is determined that the positioning module's working mode fails to switch to the standard function mode, an exception log is output.

[0049] The positioning module operates in two modes: a standard functional mode and a full-port debugging mode. The Mobile Broadband Interface Model (MBIM) is a mobile broadband device interface standard natively supported by Windows 8 and later systems, specifically designed for communication adaptation between mobile modules (such as 4G / 5G / GNSS modules) and the system. Taking a GNSS module as an example, it supports a standard functional mode combining MBIM and GPS, as well as an all-port mode. The standard functional mode means the module only has an MBIM port for module communication and data transmission, and a GPS port for positioning. It has lower power consumption and is the default operating mode for shipped modules. The all-port mode, based on the standard functional mode, supports not only the MBIM and GPS ports, but also an Automatic Terminal (AT) port for sending module-related commands, a Diagnostic Monitor (DM) port for module upgrades and log retrieval, and an NMEA port for reporting positioning information logs. Because the all-port mode displays more ports, the module's power consumption is higher, so it is typically only used during internal debugging and fault location phases.

[0050] To facilitate GNSS function testing, after driver installation, a Python script calls a specific function (such as winGui.switch_mbim_gps_mode()) to automatically switch the GNSS module's operating mode from the possible AllPort mode to MBIM+GPS mode. If the switch fails, relevant information is written to the exception log, including the exception type and timestamp. In this case, the exception type can be defined as a mode switching exception. A standard functional mode is essential for the normal operation of GNSS positioning. This switching procedure ensures that the GNSS function is tested in the correct hardware mode, and the automated script avoids errors and time-consuming manual configuration.

[0051] It should be understood that the prerequisite for performing the above step S2003 to switch the working mode is that the driver of the current terminal device is the latest version. If the latest version of the driver is detected to be installed on the current terminal device, the above steps S2001 and S2002 can be skipped and the working mode switching step can be performed directly. Otherwise, the latest version of the driver needs to be installed first before the working mode switching step can be performed.

[0052] In some embodiments, step S200 above includes the following steps: Step S2004: Check whether the driving node of the positioning module is loaded normally.

[0053] Step S201 above includes the following steps: Step S2013: If it is determined that the driver node has not been loaded normally, output the exception log.

[0054] Before performing the location test, the automated script also checks whether the GPS driver has been loaded correctly using a custom function. If it hasn't loaded, it immediately logs an exception to prevent subsequent tests from being performed incorrectly. The exception log can contain information such as a timestamp and the exception type. In this case, the exception type can be defined as a driver node loading exception. For example, the script calls the custom function get_gps_driver_info('Quectel(R) Location'), passing the name of the GPS driver as a parameter. Figure 6 This is a schematic diagram of a driver node name provided in an embodiment of this application, such as... Figure 6 As shown, the GPS driver is named Quectel(R) Location. This custom function automatically checks whether the GPS driver named "Quectel(R) Location" is loaded normally in the system. If the function returns "True", it means that the driver node is loaded normally; if the function returns "False", the exception log is immediately excluded, and a driver node loading exception is recorded.

[0055] It should be understood that the above step S2004 is performed on the premise that the working mode of the positioning module has been switched to the standard working mode. Otherwise, step S2003 needs to be executed first to complete the working mode switch before step S2004 is executed.

[0056] In some embodiments, step S200 above includes the following steps: Step S2005: Disable the mobile data network and wireless LAN of the terminal device, and clear the historical location cache information stored in the terminal device.

[0057] Step S201 above includes the following steps: Step S2014: If it is determined that disabling the mobile data network and wireless LAN of the terminal device fails, an exception log is output.

[0058] To prevent the use of external network information or historical data for GNSS positioning, the automated script will also automatically disable mobile data networks and Wi-Fi, and clear historical positioning information. This eliminates interference from external network signals and ensures the purity of the test results. If disabling fails, relevant information such as timestamps and exception types will be written to the exception log. In this case, the exception type can be defined as "device network disable exception".

[0059] For example, taking a laptop as the terminal device, the script will automatically execute the programs cancel_automatic_connection.exe and clear_location_history.exe. cancel_automatic_connection.exe disables the laptop's mobile network and Wi-Fi connection to prevent GNSS positioning results from being interfered with by network positioning. clear_location_history.exe clears historical positioning messages in the system, ensuring that the positioning results of this test are real-time and unaffected by old data.

[0060] In this embodiment of the application, by performing pre-test automation processing through the above steps S2001 to S2005, the steps such as driver management, working mode switching, environment configuration and location verification, which originally required manual operation one by one, are all automatically completed by Python scripts, which greatly improves the testing efficiency and accuracy. In the event of a problem, detailed logs can be provided through the above steps S2011 to S2014 to facilitate quick troubleshooting.

[0061] It should be understood that the above-mentioned pre-test automated processing steps can be reasonably selected according to the actual test environment.

[0062] In some embodiments, step S210 above includes the following steps: Step S211: When the terminal device is in the target state, obtain the current latitude and longitude information of the positioning module through the system command line instruction of the terminal device; wherein, the target state includes at least one of the following: the terminal device has no SIM card inserted, the SIM card of the terminal device is locked, the terminal device is woken up from sleep state, the terminal device is woken up from hibernation state, and the terminal device is in flight mode.

[0063] The testing method provided in this application is applicable to various application scenarios. For example, taking a laptop computer as the terminal device and a GNSS module as the positioning module, the SIM card status can be queried using the AT command AT+CPIN?. When no SIM card is inserted into the terminal device, or when the SIM card is locked, the above testing method steps are executed to complete the GNSS function test. When the AT command returns an error (e.g., +CME ERROR: 10), it indicates that no SIM card is inserted into the current terminal device; when the AT command returns a PIN (e.g., +CPIN: SIM PIN), it indicates that the SIM card of the current terminal device is in a locked PIN state.

[0064] When the automated script determines through AT commands that the current scenario is a SIM-less scenario, it can continue to execute subsequent GNSS function tests. This ensures that GNSS function tests can be accurately triggered and executed in specific SIM-less environments, improving the automation and reliability of multi-scenario testing. SIM card initialization is performed by calling AT interface methods and using the commands "AT+CFUN=0" and "AT+CFUN=1" to switch SIM card functionality. Then, by querying the return result of the AT commands, if it is confirmed that the SIM card is in PIN lock mode, subsequent GNSS function tests can continue.

[0065] When conducting GNSS function tests on terminal devices (such as laptops) in "sleep wake-up" or "hibernation wake-up" scenarios, the automated script will wait 1-2 minutes after triggering the terminal device to enter sleep or hibernation mode to ensure that the terminal device is fully in deep sleep or hibernation mode. This is to avoid affecting the accuracy of the test due to background program delays that may prevent the terminal device from fully entering the state. After the terminal device is fully in the state, it will automatically wake up and perform the GNSS function test.

[0066] The above GNSS function test can also be performed when the terminal device is detected to be in flight mode.

[0067] It should be understood that when repeatedly performing tests in various scenarios, at least step S2005 above needs to be repeated to prevent the positioning results from being interfered with by external networks and to ensure that the positioning results of this test are real-time and unaffected by old data.

[0068] The testing method provided in this application can cover a variety of testing scenarios, ensuring the stability of the positioning function of the positioning module under different working conditions.

[0069] As a concrete example, Figure 7 A flowchart illustrating another automated testing method for positioning functions provided in this application embodiment is shown below. Figure 7 As shown, the test method includes the following steps (steps S700 to S706): Step S700: Uninstall the old driver and install the current driver. If the installation fails, throw a driver installation exception and jump to step S706.

[0070] Step S701: Switch MBIM+GPS mode. If the switch fails, throw an MBIM+GPS switching exception and proceed to step S706.

[0071] Step S702: Disable mobile network and Wi-Fi, and clear history information. If disabling mobile network and Wi-Fi fails, proceed to step S706.

[0072] Step S703: Check if the GPS is loaded correctly. If the GPS driver device is not present, throw a GPS loading exception and jump to step S706.

[0073] Step S704: Check if the GPS positioning function is normal. If the GPS positioning is abnormal, proceed to step S706; if the positioning is accurate and the judgment is normal, proceed to step S705.

[0074] Step S705: Test normal.

[0075] Step S706: Test error.

[0076] The testing method provided in this application directly obtains the current latitude and longitude information of the positioning module through system command line instructions of the terminal device, without relying on third-party map software or manual intervention to check the positioning results. This effectively avoids data deviations caused by third-party software parsing and eliminates the tedious process of manual operation, improving the efficiency and accuracy of positioning data acquisition. By comparing the current location indicated by the current latitude and longitude information with the boundary range of the target positioning area, the method can automatically determine whether the positioning module has successfully positioned itself, without requiring manual participation in the entire testing process. This method is suitable for large-scale, repetitive positioning function testing scenarios, significantly reducing the workload of testers and improving testing efficiency. If the current location indicated by the current latitude and longitude information does not fall within the boundary range of the target positioning area, an exception log containing exception attributes such as the exception occurrence timestamp and exception type will be automatically output, helping testers quickly pinpoint the occurrence of the exception. The system automatically identifies key time points and core anomaly types, eliminating the need for step-by-step troubleshooting and significantly shortening the fault diagnosis cycle, thus reducing testing and maintenance costs. Since the target location area is a geographical region determined based on a preset positioning accuracy threshold, successful positioning is confirmed by comparing the current latitude and longitude information with the boundary range of that region. This directly verifies that the current positioning accuracy meets the preset threshold requirements, eliminating the need for additional accuracy detection steps. This simplifies the testing process while ensuring the standardization and reliability of positioning tests. By implementing pre-test automation, steps such as driver management, working mode switching, environment configuration, and positioning verification, which previously required manual operation, are all automatically completed by Python scripts. This greatly improves testing efficiency and accuracy and provides detailed logs when problems occur, facilitating rapid fault diagnosis. Furthermore, the system covers various testing scenarios, ensuring the stability of the positioning module's positioning function under different operating conditions.

[0077] The terminal device 10 is equipped with a positioning module 100, and may also include one or more processors. The processor can support the terminal device 10 in implementing the methods described in the preceding method embodiments. The processor can be a general-purpose processor or a special-purpose processor. For example, the processor can be a central processing unit (CPU). Alternatively, the processor can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0078] The terminal device 10 may also include one or more memories. Computer programs are stored in the memories. The memories may be independent of the processor or integrated into the processor.

[0079] Terminal device 10 may also include a transceiver. The processor can communicate with other devices or chips via the transceiver. For example, the processor can send and receive data with other devices or chips via the transceiver.

[0080] A computer program in memory can be executed by a processor, causing the processor to perform the following steps: The system command line instructions of the terminal device are used to obtain the current latitude and longitude information of the positioning module; the current location indicated by the current latitude and longitude information is compared with the boundary range of the target positioning area; wherein, the target positioning area is a geographical area determined based on a preset positioning accuracy threshold; if the current location indicated by the current latitude and longitude information does not fall within the boundary range of the target positioning area, an abnormal log is output; wherein, the abnormal log is used to indicate the abnormal attributes of the positioning module.

[0081] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0082] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, the computer program being loaded by a processor to execute the steps described in the above-described method embodiments of this application. For example, the computer program, when loaded by a processor, can execute the following steps: The system command line instructions of the terminal device are used to obtain the current latitude and longitude information of the positioning module; the current location indicated by the current latitude and longitude information is compared with the boundary range of the target positioning area; wherein, the target positioning area is a geographical area determined based on a preset positioning accuracy threshold; if the current location indicated by the current latitude and longitude information does not fall within the boundary range of the target positioning area, an abnormal log is output; wherein, the abnormal log is used to indicate the abnormal attributes of the positioning module.

[0083] For details on the implementation of each of the above operations / steps, please refer to the previous examples, which will not be repeated here.

[0084] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0085] Since the computer program stored in the computer-readable storage medium can execute the steps in any of the above method embodiments provided in the embodiments of this application, the beneficial effects that the methods described in any of the above method embodiments can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0086] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a terminal device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the terminal device to perform the methods provided in the various optional implementations of the above embodiments.

[0087] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0088] The above provides a detailed description of an automated testing method, storage medium, and terminal device for positioning function provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An automated testing method for positioning functions, characterized in that, Applied to terminal devices, wherein the terminal devices are equipped with a positioning module; the automated testing method for the positioning function includes: The current latitude and longitude information of the positioning module is obtained through the system command line instructions of the terminal device; Compare the current location indicated by the current latitude and longitude information with the boundary range of the target positioning area; wherein, the target positioning area is a geographical area determined based on a preset positioning accuracy threshold; If the current location indicated by the current latitude and longitude information does not fall within the boundary range of the target positioning area, an anomaly log is output; wherein, the anomaly log is used to indicate the abnormal attributes of the positioning module.

2. The method according to claim 1, characterized in that, Before comparing the current location indicated by the current latitude and longitude information with the boundary range of the target positioning area, the method further includes: Based on the preset positioning accuracy threshold, the preset maximum longitude, preset minimum longitude, preset maximum latitude, and preset minimum latitude are determined; The boundary range of the target positioning area is determined based on the preset maximum longitude, the preset minimum longitude, the preset maximum latitude, and the preset minimum latitude.

3. The method according to claim 2, characterized in that, The target positioning area is rectangular in shape; determining the boundary range of the target positioning area based on the preset maximum longitude, the preset minimum longitude, the preset maximum latitude, and the preset minimum latitude includes: The first point is determined based on the preset minimum latitude and the preset minimum longitude; The second point is determined based on the preset minimum latitude and the preset maximum longitude; The third point is determined based on the preset maximum latitude and the preset minimum longitude; The fourth point is determined based on the preset maximum latitude and the preset maximum longitude; Using the first point, the second point, the third point, and the fourth point as vertices, the boundary range of the rectangular target positioning area is determined.

4. The method according to claim 2, characterized in that, The target positioning area is circular in shape; determining the boundary range of the target positioning area based on the preset maximum longitude, the preset minimum longitude, the preset maximum latitude, and the preset minimum latitude includes: The target longitude value is determined based on the average of the preset maximum longitude and the preset minimum longitude; The target latitude value is determined based on the average of the preset maximum latitude and the preset minimum latitude; Using the geographical locations corresponding to the target longitude and target latitude values ​​as the center and the preset positioning accuracy threshold as the radius, the boundary range of the circular target positioning area is determined.

5. The method according to claim 1, characterized in that, Before obtaining the current latitude and longitude information of the positioning module through the system command line instructions of the terminal device, the method further includes: Perform pre-test automation processing on the terminal device; If the pre-test automated processing fails, the exception log will be output.

6. The method according to claim 5, characterized in that, The pre-test automated processing of the terminal device includes: checking and uninstalling the existing first test driver related to the positioning module on the terminal device; and installing the second test driver of the positioning module. If the pre-test automation process fails, the exception log will be output, including if the second test driver installation fails.

7. The method according to claim 5, characterized in that, The pre-test automated processing of the terminal device includes: when the positioning module is in full-port debugging mode, switching the working mode of the positioning module to standard function mode; wherein, the standard function mode is a user mode that only includes network card and positioning functions; If the pre-test automated processing fails, the exception log will be output, including: if it is determined that the working mode of the positioning module fails to switch to the standard function mode, the exception log will be output.

8. The method according to claim 5, characterized in that, The pre-test automated processing of the terminal device includes: checking whether the driver node of the positioning module is loaded normally; If the pre-test automated processing fails, the exception log will be output, including: if it is determined that the driver node has not been loaded normally, the exception log will be output.

9. The method according to claim 5, characterized in that, The pre-test automated processing of the terminal device includes: disabling the mobile data network and wireless local area network of the terminal device, and clearing the historical location cache information stored in the terminal device; If the pre-test automated processing fails, the exception log is output, including: if it is determined that the mobile data network and wireless LAN of the terminal device have failed to be disabled, the exception log is output.

10. The method according to any one of claims 1 to 9, characterized in that, The step of obtaining the current latitude and longitude information of the positioning module through the system command line instructions of the terminal device includes: When the terminal device is in the target state, the current latitude and longitude information of the positioning module is obtained through the system command line instructions of the terminal device; The target state includes at least one of the following: the terminal device has no SIM card inserted, the SIM card of the terminal device is locked, the terminal device is woken up from sleep mode, the terminal device is woken up from hibernation mode, and the terminal device is in airplane mode.

11. A computer-readable storage medium, characterized in that, It stores computer programs or instructions, which, when executed by a processor, implement the steps in the automated testing method for positioning functions as described in any one of claims 1 to 10.

12. A terminal device, characterized in that, The terminal device is equipped with a positioning module. The terminal device includes a memory and a processor. The memory stores computer programs or instructions. When the computer programs or instructions are executed by the processor, the processor performs the steps in the automated testing method for positioning function according to any one of claims 1 to 10, so as to detect the positioning function of the positioning module.