Automatic test method and device for map operation response, equipment and medium
By indexing map tiles and simulating map operation data, the problem of not being able to quickly locate target tiles after map operation is solved, and accurate testing and efficient loading of map operation response are achieved.
Patent Information
- Application Number
- CN202411683851.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-18
AI Technical Summary
After the user displaces, rotates or zooms the map, the target tiles cannot be positioned quickly, resulting in the loading efficiency of the visual interface being affected.
By indexing the map tiles, the current tile series number of the map display area is obtained, and the map operation data is simulated to calculate the target tile series number, and then the actual tile series number is checked to determine the test results of the map operation response.
It realizes the accurate calculation of target tiles for any initial location and any map operations in different map resources, and improves the accuracy of test results, the rationality of the test framework, and the maintainability of the test code.
Smart Images

Figure CN119645842A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of Internet technology, and specifically relates to an automated testing method, device, equipment and medium for map operation response. Background Art
[0002] A tile map is a type of map that divides the map into many small squares (tiles) for organization and presentation. These tiles are like small pieces of a puzzle, which together form a complete map picture.
[0003] Normally, if you need to view a portion of the map, you only need to load the corresponding tile instead of the entire huge map data, which greatly reduces the amount of data transmission and improves the loading speed. For computer graphics processing, it is more efficient to process small tiles during the rendering process, reducing the use of memory and computing resources. However, this method often has the problem that after the user moves, rotates or scales the map, it is impossible to quickly locate the tile to be displayed, which seriously affects the loading efficiency of the visual interface.
[0004] Therefore, how to quickly locate the target tile and detect whether the positioning is accurate after operating the map is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0005] The embodiments of the present application provide an automated testing method, apparatus, device and medium for map operation response, the purpose of which is to accurately calculate the target tile and check it with the actual tile for any initial position and any map operation in different map resources by indexing the map tiles, which is beneficial to improving the accuracy of the test results, the rationality of the test framework design and the maintainability of the test code.
[0006] In a first aspect, this embodiment provides an automated testing method for map operation response, the method comprising:
[0007] Obtaining the current tile serial number of the map display area; wherein the tile serial number is an index relationship pre-established based on the tile map position and the serial number;
[0008] Simulate the operation data of the map and obtain the actual tile serial number after the operation;
[0009] Solving the operation data, and determining the target tile serial number according to the solution result;
[0010] A test result of the map operation response is determined according to a comparison result between the actual tile serial number and the target tile serial number.
[0011] Furthermore, the current tile serial number of the map display area is obtained, including:
[0012] Get the display information of the map;
[0013] Determining the longitude and latitude of the map and the current zoom level according to the displayed information;
[0014] Converting the longitude and latitude of the map into Mercator coordinates;
[0015] Calculate the horizontal index and the vertical index of each tile at the current zoom level according to the Mercator coordinates and the current zoom level;
[0016] The current tile series number of the map is determined according to the horizontal index and the vertical index.
[0017] Further, converting the longitude and latitude of the map into Mercator coordinates includes:
[0018] Substitute the longitude and latitude of the map into the following formula to obtain the corresponding Mercator coordinates (x, y):
[0019] x = λR;
[0020]
[0021] Among them, λ is the longitude of the tile, is the latitude of the tile, and R is the radius of the earth.
[0022] Furthermore, the operation data of the map is simulated, including:
[0023] Use the pyautogui.click(x, y) and pyautogui.scroll(z) functions in the selenium plug-in to simulate the movement, rotation or scaling of the map and obtain the corresponding operation data.
[0024] Further, the operation data includes a distance parameter, a rotation parameter, and a scaling parameter; determining the target tile serial number according to the solution result includes:
[0025] Determine the position of the map after the operation according to the distance parameter and the step size information of the tile;
[0026] Determining the zoom level and viewing angle information after the operation according to the rotation parameter and the zoom parameter;
[0027] Determining the visual field of the map after the operation according to the position of the map after the operation, the zoom level after the operation, and the visual angle information;
[0028] The tile serial number is indexed and matched according to the field of view and the zoom level after the operation to obtain the target tile serial number.
[0029] Further, the tile serial number is indexed and matched according to the field of view and the zoom level after the operation to obtain the target tile serial number, including
[0030] Determining the coordinates of a first boundary point and a second boundary point of the field of view according to the zoom level after the operation;
[0031] Determine an index range according to the first boundary point coordinates and the second boundary point coordinates;
[0032] Index matching is performed on the index range according to the vertical index and the horizontal index respectively to obtain the target tile serial number of the field of view range.
[0033] Furthermore, after obtaining the target tile serial number, the method further includes:
[0034] Acquire the longitude and latitude data corresponding to the target tile serial number according to the zoom level after the operation;
[0035] Identify whether the latitude and longitude data is within the field of view, and if so, determine that the target tile serial number verification is successful;
[0036] If it is not within the field of view, it is determined that the target tile serial number verification fails, and the target tile serial number that fails the verification is deleted.
[0037] In a second aspect, this embodiment provides an automated testing device for map operation response, the device comprising:
[0038] A current tile serial number acquisition module is used to acquire the current tile serial number of the map display area; wherein the tile serial number is an index relationship established in advance based on the tile map position and the serial number;
[0039] The actual tile serial number acquisition module is used to simulate the operation data of the map and obtain the actual tile serial number after the operation;
[0040] A target tile serial number determination module, used to solve the operation data and determine the target tile serial number according to the solution result;
[0041] The test result determination module is used to determine the test result of the map operation response according to the comparison result between the actual tile serial number and the target tile serial number.
[0042] Furthermore, the current tile serial number acquisition module is specifically used to:
[0043] Get the display information of the map;
[0044] Determining the longitude and latitude of the map and the current zoom level according to the displayed information;
[0045] Converting the longitude and latitude of the map into Mercator coordinates;
[0046] Calculate the horizontal index and the vertical index of each tile at the current zoom level according to the Mercator coordinates and the current zoom level;
[0047] The current tile series number of the map is determined according to the horizontal index and the vertical index.
[0048] Furthermore, the current tile serial number acquisition module is specifically used to:
[0049] Substitute the longitude and latitude of the map into the following formula to obtain the corresponding Mercator coordinates (x, y):
[0050] x = λR;
[0051]
[0052] Among them, λ is the longitude of the tile, is the latitude of the tile, and R is the radius of the earth.
[0053] Furthermore, the target tile serial number determination module is specifically used to:
[0054] Use the pyautogui.click(x, y) and pyautogui.scroll(z) functions in the selenium plug-in to simulate the movement, rotation or scaling of the map and obtain the corresponding operation data.
[0055] Furthermore, the operation data includes a distance parameter, a rotation parameter, and a scaling parameter; the target tile serial number determination module is specifically used to:
[0056] Determine the position of the map after the operation according to the distance parameter and the step size information of the tile;
[0057] Determining the zoom level and viewing angle information after the operation according to the rotation parameter and the zoom parameter;
[0058] Determining the visual field of the map after the operation according to the position of the map after the operation, the zoom level after the operation, and the visual angle information;
[0059] The tile serial number is indexed and matched according to the field of view and the zoom level after the operation to obtain the target tile serial number.
[0060] Furthermore, the target tile serial number determination module is specifically used to:
[0061] Determining the coordinates of a first boundary point and a second boundary point of the field of view according to the zoom level after the operation;
[0062] Determine an index range according to the first boundary point coordinates and the second boundary point coordinates;
[0063] Index matching is performed on the index range according to the vertical index and the horizontal index respectively to obtain the target tile serial number of the field of view range.
[0064] Furthermore, the target tile serial number determination module is specifically used to:
[0065] Acquire the longitude and latitude data corresponding to the target tile serial number according to the zoom level after the operation;
[0066] Identify whether the latitude and longitude data is within the field of view, and if so, determine that the target tile serial number verification is successful;
[0067] If it is not within the field of view, it is determined that the target tile serial number verification fails, and the target tile serial number that fails the verification is deleted.
[0068] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0069] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0070] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0071] In an embodiment of the present application, the current tile serial number of the map display area is obtained; wherein the tile serial number is an index relationship pre-established based on the tile map position and the serial number; the operation data on the map is simulated to obtain the actual tile serial number after the operation; the operation data is solved, and the target tile serial number is determined according to the solution result; and the test result of the map operation response is determined according to the comparison result between the actual tile serial number and the target tile serial number. Through the above-mentioned method of automated testing of map operation response, the target tile can be accurately calculated and checked with the actual tile for any initial position and any map operation in different map resources by indexing the map tile, which is conducive to improving the accuracy of the test results, the rationality of the test framework design, and the maintainability of the test code. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 It is a flowchart of an automated testing method for map operation response provided in Example 1 of the present application;
[0073] Figure 2 is a comparison diagram before and after the tile map operation provided in the first embodiment of the present application;
[0074] Figure 3 It is a flowchart of an automated testing method for map operation response provided in Embodiment 2 of the present application;
[0075] Figure 4 It is a structural schematic diagram of an automated testing device for map operation response provided in Embodiment 3 of the present application;
[0076] Figure 5 It is a schematic diagram of the structure of the electronic device provided in Example 4 of the present application. DETAILED DESCRIPTION
[0077] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0078] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0079] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0080] In conjunction with the accompanying drawings, the following describes in detail a method, device, equipment and medium for automatically testing map operation responses provided by an embodiment of the present application through specific embodiments and application scenarios.
[0081] Embodiment 1
[0082] Figure 1 It is a flowchart of an automated testing method for map operation response provided in Example 1 of the present application.
[0083] like Figure 1 As shown, the specific steps include:
[0084] S101, obtaining a current tile serial number of a map display area; wherein the tile serial number is an index relationship established in advance based on a tile map position and a serial number;
[0085] The application scenario of this solution may be a scenario of detecting the predicted target tile serial number.
[0086] Based on the above scenario, it can be understood that the execution subject of this scenario can be a server for detecting whether the target tile serial number is accurate, such as a computer or software component that provides services in a network environment, etc., and no excessive limitations are made here.
[0087] The map display area may be a portion of a map that can be displayed on a mobile terminal, such as a mobile phone, a tablet computer, or a display screen of a PC (Personal Computer).
[0088] A tile map can be a world map divided into many small squares according to a certain size, for example, 256×256 pixels, where each small square is a tile.
[0089] The serial number can be an index relationship established according to the correspondence between each tile in the tile map and the longitude and latitude of the map to describe the position coordinates of the tile in the current map. The tile serial number includes a horizontal index and a vertical index, which are used to describe the horizontal position coordinates and vertical position coordinates of the current tile in the map respectively.
[0090] The current tile serial number of the map display area can be obtained by obtaining the longitude and latitude data of each tile in the current map, establishing an algorithm according to a preset serial number, and converting the longitude and latitude data of each tile into a corresponding tile serial number.
[0091] S102, simulating the operation data of the map to obtain the actual tile serial number after the operation;
[0092] The method of simulating the operation data of the map can be to simulate the mouse operations that the user may perform, such as clicking, dragging, and turning the scroll wheel, to simulate the operations such as moving, rotating, and zooming the map, and record the operation data such as the displacement, rotation angle, and zoom ratio of the map.
[0093] The actual tile serial number after the operation can be obtained by, after the map is operated, obtaining the serial numbers of all tiles in the map display area after the operation from the map application as the actual tile serial number.
[0094] S103, solving the operation data, and determining the target tile serial number according to the solving result;
[0095] The method for solving the operation data is to analyze the operation data and determine the center position of the map display area after the map operation based on the center position of the map display area before the map operation and the displacement, rotation angle and zoom ratio of the map when the map is operated.
[0096] The method of determining the target tile serial number based on the solution result can be that after obtaining the center position of the map display area after the map operation, the display range of the map display area after the operation is obtained according to the rotation angle and zoom ratio of the map, and all tile serial numbers contained in the display range are extracted, and the tile serial number is used as the target tile serial number.
[0097] S104: Determine a test result of a map operation response according to a comparison result between the actual tile serial number and the target tile serial number.
[0098] The test result of the map operation response can be determined by comparing the target tile serial number calculated based on the operation data with the actual tile serial number of the map display area after the operation, and identifying whether the target tile serial number is completely consistent with the actual tile serial number. If they are consistent, it is determined that the target tile serial number is calculated correctly; if they are inconsistent, it is determined that the target tile serial number is calculated incorrectly.
[0099] On this basis, preferably, the target tile serial numbers that are inconsistent with the actual tile serial numbers can also be extracted and counted, and the ratio of the number of target tile serial numbers that are inconsistent with the actual tile serial numbers to the number of all target tile serial numbers can be calculated, and the calculation result can be used as the estimated error rate. It can be understood that an error rate threshold value is set in advance. When the current estimated error rate exceeds the error rate threshold value, it is determined that the target tile serial number is incorrectly calculated; when the current estimated error rate is less than or equal to the error rate threshold value, it is determined that the target tile serial number is correctly calculated.
[0100] For example, Figure 2 is a comparison diagram of the tile map before and after the operation provided in the first embodiment of the present application. Figure 2 As shown in the figure, it can be seen from the buildings and roads in the map that after the user moves and rotates the map with the mouse, the display area of the tile map will change, and the orientation of the map will change from due north to due west. At the same time, after the user zooms in on the map before the operation with the scroll wheel, the scale of the map will also change from 1:500000 to 1:600000. Therefore, the map tiles in the display area before and after the operation will also change accordingly.
[0101] Based on the above solution, optionally, the current tile serial number of the map display area is obtained, including:
[0102] Get the display information of the map;
[0103] Determining the longitude and latitude of the map and the current zoom level according to the displayed information;
[0104] Converting the longitude and latitude of the map into Mercator coordinates;
[0105] Calculate the horizontal index and the vertical index of each tile at the current zoom level according to the Mercator coordinates and the current zoom level;
[0106] The current tile series number of the map is determined according to the horizontal index and the vertical index.
[0107] The display information of the map may include the longitude range and latitude range of the display area of the current map, the tiles of the display area, and the zoom level of the map.
[0108] Longitude can refer to the horizontal coordinate of the Earth's spherical coordinate system. Specifically, it is the number of degrees east or west of a point on the Earth from a north-south line called the prime meridian.
[0109] Latitude can refer to the linear angle formed by the line connecting a certain point with the center of the earth and the equatorial plane of the earth. Geodetic latitude refers to the angle between the ground normal of a certain place and the equatorial plane. Astronomical latitude refers to the angle between the direction of the plumb line of that place and the equatorial plane.
[0110] Mercator coordinates can be a rectangular coordinate system established in the Mercator projection, in which each position has a unique Mercator coordinate. Among them, the Mercator projection can be a conformal cylindrical projection. In the Mercator projection, it is assumed that the earth is surrounded by a cylinder, the axis of the cylinder coincides with the earth's rotation axis, and then the longitude and latitude lines on the earth are projected onto the surface of the cylinder. The equator is tangent to the cylindrical surface, and the poles are located on the axis of the cylinder. Under this projection, the longitude and latitude lines appear as perpendicular straight lines on the map.
[0111] The zoom level may be a zoom level divided according to the scale of the map distance and the actual distance. For example, zoom levels 1 and 2 correspond to scales of 1:1000000 and 1:500000, respectively.
[0112] The way to obtain the display information of the map may be that the server obtains the current display information from the map application system, and the map application system extracts the display information of the current display area and sends it to the server.
[0113] The method of determining the longitude and latitude of the map and the current zoom level can be that the server receives information from the map application system, interprets the received content, and extracts the longitude and latitude range of the current display area and the current zoom level.
[0114] The method of converting the longitude and latitude of the map into Mercator coordinates is to bring the longitude and latitude range of the current display area into a preset coordinate conversion algorithm to obtain the corresponding Mercator coordinate range. It can be understood that in order to facilitate the conversion of Mercator coordinates, the longitude and latitude of the northwest corner and the longitude and latitude of the southeast corner of the current display area can be obtained and converted into Mercator coordinates. At this time, in the coordinates of the two points in the northwest corner and the southeast corner of the display area, the span between the horizontal coordinates is the corresponding longitude range, and the span between the vertical coordinates is the corresponding latitude range.
[0115] The horizontal index and vertical index of each tile at the current zoom level can be calculated by multiplying the horizontal coordinates and vertical coordinates of the two points at the northwest corner and the southeast corner of the display area in the Mercator coordinates by the power of 2 of the zoom level to obtain the index range in the horizontal direction and the index range in the vertical direction.
[0116] The current tile serial number of the map can be determined by traversing the index range of the horizontal index from small to large, and in each horizontal index, obtaining the serial number of each tile in order from small to large according to the vertical index range, and then after completing the traversal, the current tile serial number can be obtained.
[0117] The advantage of this setting is that the tile serial number can be set by converting the Mercator coordinates, which is beneficial for accurately obtaining the map tiles to be displayed according to the serial number when locating the tiles in the display area later.
[0118] Based on the above solution, optionally, converting the longitude and latitude of the map into Mercator coordinates includes:
[0119] Substitute the longitude and latitude of the map into the following formula to obtain the corresponding Mercator coordinates (x, y):
[0120] x = λR;
[0121]
[0122] Among them, λ is the longitude of the tile, is the latitude of the tile, and R is the radius of the earth.
[0123] For each tile, its Mercator coordinates in the map can be obtained by the above formula, and the horizontal index and vertical index of the tile can be obtained by the following formula:
[0124] X=x*2 zoom ;
[0125] Y=y*2 zoom ;
[0126] Where X is the horizontal index of the tile, x is the abscissa in Mercator coordinates, zoom is the current zoom level, Y is the vertical index of the tile, and y is the ordinate in Mercator coordinates.
[0127] Then the tile serial number can be obtained as {X, Y, zoom}.
[0128] The advantage of this setting is that the Mercator coordinates corresponding to the longitude and latitude can be obtained according to the formula, and then the serial number of each tile can be determined, which is conducive to accurately calculating the tiles in the display area after operating the map.
[0129] Based on the above solution, optionally, simulate the operation data of the map, including:
[0130] Use the pyautogui.click(x, y) and pyautogui.scroll(z) functions in the selenium plug-in to simulate the movement, rotation or scaling of the map and obtain the corresponding operation data.
[0131] Selenium plugin is a widely used library for simulating browser operation. It is a tool for testing web applications. Selenium tests run directly in the browser and can simulate the way real users operate the browser.
[0132] pyautogui.click(x, y) can be a function used to simulate a mouse click, where (x, y) is the position of the mouse click. By simulating the mouse click operation, the map can be dragged and rotated, thereby realizing the simulation function of the map operation.
[0133] pyautogui.scroll(z) can be a function used to simulate scrolling the mouse wheel, where (z) is the moving distance of the mouse wheel. By simulating the operation of scrolling the mouse wheel, higher zoom levels of animated images can be achieved, thereby realizing the simulation function of map operations.
[0134] The corresponding operation data can be obtained by running a selenium plug-in to simulate the movement, rotation or scaling of the map, and recording the displacement parameters, rotation angle parameters and zoom level parameters randomly generated in each operation to generate the corresponding operation data.
[0135] The advantage of this setting is that the plug-in can be used to simulate the operation of the map, thereby reducing the workload of testers, speeding up the process of automated testing, and improving testing efficiency.
[0136] This solution provides a program code for calculating the target tile serial number for reference: createLabelData()
[0137] const bounds this.map.getBounds();
[0138] conatzoom=Math.floor(this.map.get2oom())
[0139] const titlecount=Math.pow(2,zoom);
[0140] const lngSetp:360 / titlecount;
[0141] ' / const minlat=-85.05112878:
[0142] "conat maxLat=85.05112878,
[0143] / / Calculate tile information by longitude and latitude to ensure that only tiles within the visible range are drawn
[0144]
[0145]
[0146]
[0147] In an embodiment of the present application, the current tile serial number of the map display area is obtained; wherein the tile serial number is an index relationship pre-established based on the tile map position and the serial number; the operation data on the map is simulated to obtain the actual tile serial number after the operation; the operation data is solved, and the target tile serial number is determined according to the solution result; and the test result of the map operation response is determined according to the comparison result between the actual tile serial number and the target tile serial number. Through the above-mentioned method of automated testing of map operation response, the target tile can be accurately calculated and checked with the actual tile for any initial position and any map operation in different map resources by indexing the map tile, which is conducive to improving the accuracy of the test results, the rationality of the test framework design, and the maintainability of the test code.
[0148] Embodiment 2
[0149] Figure 3 This is a flow chart of an automated test method for map operation response provided in the second embodiment of the present application. This solution makes a better improvement on the above embodiment, specifically, the operation data includes distance parameters, rotation parameters and zoom parameters; the target tile serial number is determined according to the solution result, including: determining the position of the map after the operation according to the distance parameter and the step size information of the tile; determining the zoom level and viewing angle information after the operation according to the rotation parameter and the zoom parameter; determining the field of view of the map after the operation according to the position of the map after the operation, the zoom level and viewing angle information after the operation; and index matching the tile serial number according to the field of view and the zoom level after the operation to obtain the target tile serial number.
[0150] like Figure 3 As shown, specifically including the following:
[0151] S301, obtaining the current tile serial number of the map display area; wherein the tile serial number is an index relationship pre-established based on the tile map position and the serial number;
[0152] S302, simulating the operation data of the map to obtain the actual tile serial number after the operation;
[0153] S303, the operation data includes a distance parameter, a rotation parameter, and a scaling parameter; according to the distance parameter and the step size information of the tile, the position of the map after the operation is determined;
[0154] The distance parameter can be the distance dragged with the mouse in the operation data, indicating the displacement of the map before and after the operation.
[0155] The step information can be the span of longitude and latitude corresponding to the length and width of the tile.
[0156] The method for determining the position of the map after the operation can be to obtain the coordinates of the center position of the map display area before the map operation is performed based on the operation data, move the coordinates of the center position according to the distance parameter, and obtain the coordinates of the center position of the map display area after the operation, and determine the map position that appears in the display area after the tile map operation based on the step information of the tile and the distance from the center position after the operation to the edge of the display area.
[0157] S304, determining a zoom level and viewing angle information after the operation according to the rotation parameter and the zoom parameter;
[0158] The rotation parameter may be the angle of change of the viewing angle when operating the map.
[0159] The zoom parameter may be the zoom degree corresponding to the scroll distance of the mouse wheel in the map operation.
[0160] The method for determining the zoom level and viewing angle information after the operation may be to determine the viewing angle information after the operation based on the sum of the viewing angle before the operation and the rotation parameter. For example, the viewing angle of the map before the operation is due north, and the rotation parameter is to rotate 90° clockwise, then the viewing angle information after the map operation is due west; the zoom parameter is rounded down, and the corresponding zoom level is determined based on the rounding result. For example, the zoom level of the map before the operation is level 1, and the zoom parameter is to enlarge the map by 3.5 times, then the zoom level of the map after the operation is level 3.
[0161] S305, determining the visual field of the map after the operation according to the position of the map after the operation, the zoom level after the operation, and the viewing angle information;
[0162] The method for determining the field of view of the map after the operation is to scale the map position after the operation according to the zoom level after the operation, adjust the map orientation of the zoom result according to the viewing angle information, obtain the field of view of the map after the operation, and obtain the boundary longitude and latitude of the field of view.
[0163] S306, performing index matching on the tile serial number according to the field of view and the zoom level after the operation to obtain the target tile serial number;
[0164] The target tile serial number can be obtained by calculating the tile index range corresponding to the current field of view according to the latitude and longitude range in the field of view and the zoom level after the operation, and obtaining all tile serial numbers in the tile index range as the target tile serial number.
[0165] S307: Determine a test result of a map operation response according to a comparison result between the actual tile serial number and the target tile serial number.
[0166] The advantage of this setting of the scheme is that the field of view of the map after the operation can be determined according to the solution results, and the target tile serial number within the field of view can be extracted, which is conducive to providing a data basis for subsequent detection and calculation of whether the serial number is accurate.
[0167] Based on the above solution, optionally, the tile serial number is indexed and matched according to the field of view and the zoom level after the operation to obtain the target tile serial number, including
[0168] Determining the coordinates of a first boundary point and a second boundary point of the field of view according to the zoom level after the operation;
[0169] Determine an index range according to the first boundary point coordinates and the second boundary point coordinates;
[0170] Index matching is performed on the index range according to the vertical index and the horizontal index respectively to obtain the target tile serial number of the field of view range.
[0171] The coordinates of the first boundary point can be the tile serial number of the northwest corner of the field of view.
[0172] The coordinates of the second boundary point can be the tile serial number of the southeast corner of the field of view.
[0173] The coordinates of the first boundary point and the second boundary point can be determined by obtaining the longitude and latitude values of the northwest corner and the southeast corner of the field of view, respectively substituting them into a preset serial number conversion formula, and calculating the tile serial number corresponding to the longitude and latitude values. It can be understood that the zoom level in the serial number conversion formula has been changed to the zoom level after the operation.
[0174] The index range may be determined by taking the horizontal coordinate from the horizontal coordinate of the first boundary point coordinate to the horizontal coordinate of the second boundary point coordinate as the horizontal index range, and taking the vertical coordinate from the vertical coordinate of the second boundary point coordinate to the vertical coordinate of the first boundary point coordinate as the vertical index range.
[0175] The target tile serial number of the field of view can be obtained by traversing the field of view in the index range of the horizontal index from small to large, and in each horizontal index, obtaining the serial number of each tile in order from small to large according to the vertical index range, and then after completing the traversal, the target tile serial number can be obtained.
[0176] The advantage of this setting of the scheme is that the index range corresponding to the field of view can be determined according to the boundary points, and then the target tile serial number can be quickly obtained by traversal, which is conducive to improving the efficiency of automated testing.
[0177] Based on the above solution, optionally, after obtaining the target tile serial number, the method further includes:
[0178] Acquire the longitude and latitude data corresponding to the target tile serial number according to the zoom level after the operation;
[0179] Identify whether the latitude and longitude data is within the field of view, and if so, determine that the target tile serial number verification is successful;
[0180] If it is not within the field of view, it is determined that the target tile serial number verification fails, and the target tile serial number that fails the verification is deleted.
[0181] The method of obtaining the longitude and latitude data corresponding to the target tile serial number can be to substitute the target tile serial number and the zoom level after the map operation into the following formula to obtain the corresponding longitude and latitude data:
[0182]
[0183]
[0184]
[0185] Among them, λ is the longitude corresponding to the target tile sequence number, μ is the latitude corresponding to the target tile sequence number, a is the horizontal index of the target tile sequence number, b is the vertical index of the target tile sequence number, z is the zoom level after the map is operated, and n is the intermediate value.
[0186] The method for identifying whether the longitude and latitude data are within the field of view may be to compare the longitude data of the target tile with the longitude range of the field of view, and to compare the latitude data of the target tile with the latitude range of the field of view. If the longitude data of the target tile is within the longitude range of the field of view, and the latitude data of the target tile is within the latitude range of the field of view, then it is determined that the verification of the target tile serial number is successful, and the target tile serial number can be used as the final calculation result; if the longitude data of the target tile is not within the longitude range of the field of view, or the latitude data of the target tile is not within the latitude range of the field of view, then it is determined that the verification of the target tile serial number has failed, and the target tile serial number is deleted from the final calculation result.
[0187] The advantage of this setting is that the latitude and longitude data corresponding to the target serial number can be used to verify the map tiles within the calculated field of view, which is conducive to improving the accuracy of the calculated results and avoiding the distortion problem of coordinate conversion that affects the accuracy of the calculated results.
[0188] Embodiment 3
[0189] Figure 4 It is a structural diagram of the automated testing device for map operation response provided in Example 3 of the present application.
[0190] like Figure 4 As shown, specifically including the following:
[0191] The current tile serial number acquisition module 401 is used to acquire the current tile serial number of the map display area; wherein the tile serial number is an index relationship established in advance based on the tile map position and the serial number;
[0192] The actual tile serial number acquisition module 402 is used to simulate the operation data of the map and obtain the actual tile serial number after the operation;
[0193] A target tile serial number determination module 403 is used to solve the operation data and determine the target tile serial number according to the solution result;
[0194] The test result determination module 404 is used to determine the test result of the map operation response according to the comparison result between the actual tile serial number and the target tile serial number.
[0195] Optionally, the current tile serial number acquisition module 401 is specifically used to:
[0196] Get the display information of the map;
[0197] Determining the longitude and latitude of the map and the current zoom level according to the displayed information;
[0198] Converting the longitude and latitude of the map into Mercator coordinates;
[0199] Calculate the horizontal index and the vertical index of each tile at the current zoom level according to the Mercator coordinates and the current zoom level;
[0200] The current tile series number of the map is determined according to the horizontal index and the vertical index.
[0201] Optionally, the current tile serial number acquisition module 401 is specifically used to:
[0202] Substitute the longitude and latitude of the map into the following formula to obtain the corresponding Mercator coordinates (x, y):
[0203] x = λR;
[0204]
[0205] Among them, λ is the longitude of the tile, is the latitude of the tile, and R is the radius of the earth.
[0206] Optionally, the actual tile serial number acquisition module 402 is specifically configured to:
[0207] Use the pyautogui.click(x, y) and pyautogui.scroll(z) functions in the selenium plug-in to simulate the movement, rotation or scaling of the map and obtain the corresponding operation data.
[0208] Optionally, the operation data includes a distance parameter, a rotation parameter, and a scaling parameter; the target tile serial number determination module 403 is specifically used to:
[0209] Determine the position of the map after the operation according to the distance parameter and the step size information of the tile;
[0210] Determining the zoom level and viewing angle information after the operation according to the rotation parameter and the zoom parameter;
[0211] Determining the visual field of the map after the operation according to the position of the map after the operation, the zoom level after the operation, and the visual angle information;
[0212] The tile serial number is indexed and matched according to the field of view and the zoom level after the operation to obtain the target tile serial number.
[0213] Optionally, the target tile serial number determination module 403 is specifically configured to:
[0214] Determining the coordinates of a first boundary point and a second boundary point of the field of view according to the zoom level after the operation;
[0215] Determine an index range according to the first boundary point coordinates and the second boundary point coordinates;
[0216] Index matching is performed on the index range according to the vertical index and the horizontal index respectively to obtain the target tile serial number of the field of view range.
[0217] Optionally, the target tile serial number determination module 403 is specifically configured to:
[0218] Acquire the longitude and latitude data corresponding to the target tile serial number according to the zoom level after the operation;
[0219] Identify whether the latitude and longitude data is within the field of view, and if so, determine that the target tile serial number verification is successful;
[0220] If it is not within the field of view, it is determined that the target tile serial number verification fails, and the target tile serial number that fails the verification is deleted.
[0221] In the embodiment of the present application, the current tile serial number acquisition module 401 is used to obtain the current tile serial number of the map display area; wherein the tile serial number is an index relationship established in advance based on the tile map position and the serial number; the actual tile serial number acquisition module 402 is used to simulate the operation data of the map to obtain the actual tile serial number after the operation; the target tile serial number determination module 403 is used to solve the operation data and determine the target tile serial number according to the solution result; the test result determination module 404 is used to determine the test result of the map operation response according to the comparison result between the actual tile serial number and the target tile serial number. Through the above-mentioned automatic test device for map operation response, the target tile can be accurately calculated and checked with the actual tile for any initial position and any map operation in different map resources by indexing the map tile, which is conducive to improving the accuracy of the test result, the rationality of the test framework design and the maintainability of the test code.
[0222] An automated test device for map operation response in an embodiment of the present application may be a device, or a component, integrated circuit, or chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0223] In the embodiment of the present application, a device for automated testing of a map operation response may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0224] The device for automated testing of map operation responses provided in the embodiment of the present application can implement the various processes implemented in the above-mentioned method embodiments, and will not be described again here to avoid repetition.
[0225] Embodiment 4
[0226] like Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, and a program or instruction stored in the memory 502 and executable on the processor 501. When the program or instruction is executed by the processor 501, each process of the above-mentioned method embodiment for automated testing of map operation response is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0227] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0228] Embodiment 5
[0229] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned method embodiment for automated testing of map operation responses is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0230] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0231] Embodiment 6
[0232] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment for automated testing of map operation responses, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0233] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0234] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0235] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0236] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0237] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. An automated testing method for map operation response, characterized in that: The method comprises: Obtaining the current tile serial number of the map display area; wherein the tile serial number is an index relationship pre-established based on the tile map position and the serial number; Simulate the operation data of the map and obtain the actual tile serial number after the operation; Solving the operation data, and determining the target tile serial number according to the solution result; A test result of the map operation response is determined according to a comparison result between the actual tile serial number and the target tile serial number.
2. The automated test method for map operation response according to claim 1, characterized in that: Get the current tile serial number of the map display area, including: Get the display information of the map; Determining the longitude and latitude of the map and the current zoom level according to the displayed information; Converting the longitude and latitude of the map into Mercator coordinates; Calculate the horizontal index and the vertical index of each tile at the current zoom level according to the Mercator coordinates and the current zoom level; The current tile series number of the map is determined according to the horizontal index and the vertical index.
3. The automated test method for map operation response according to claim 2, characterized in that: Convert the latitude and longitude of the map to Mercator coordinates, including: Substitute the longitude and latitude of the map into the following formula to obtain the corresponding Mercator coordinates (x, y): x = λR; Among them, λ is the longitude of the tile, is the latitude of the tile, and R is the radius of the earth.
4. The automated test method for map operation response according to claim 1, characterized in that: Simulate the operation data of the map, including: Use the pyautogui.click(x, y) and pyautogui.scroll(z) functions in the selenium plug-in to simulate the movement, rotation or scaling of the map and obtain the corresponding operation data.
5. The automated test method for map operation response according to claim 1, characterized in that: The operation data includes distance parameters, rotation parameters and scaling parameters; Determine the target tile serial number based on the solution result, including: Determine the position of the map after the operation according to the distance parameter and the step size information of the tile; Determining the zoom level and viewing angle information after the operation according to the rotation parameter and the zoom parameter; Determining the visual field of the map after the operation according to the position of the map after the operation, the zoom level after the operation, and the visual angle information; The tile serial number is indexed and matched according to the field of view and the zoom level after the operation to obtain the target tile serial number.
6. The automated test method for map operation response according to claim 5, characterized in that: The tile serial number is indexed and matched according to the field of view and the zoom level after the operation to obtain the target tile serial number, including Determining the coordinates of a first boundary point and a second boundary point of the field of view according to the zoom level after the operation; Determine an index range according to the first boundary point coordinates and the second boundary point coordinates; Index matching is performed on the index range according to the vertical index and the horizontal index respectively to obtain the target tile serial number of the field of view range.
7. The automated test method for map operation response according to claim 5, characterized in that: After obtaining the target tile serial number, the method further includes: Acquire the longitude and latitude data corresponding to the target tile serial number according to the zoom level after the operation; Identify whether the latitude and longitude data is within the field of view, and if so, determine that the target tile serial number verification is successful; If it is not within the field of view, it is determined that the target tile serial number verification fails, and the target tile serial number that fails the verification is deleted.
8. An automated test device for map operation response, characterized in that: The device comprises: A current tile serial number acquisition module is used to acquire the current tile serial number of the map display area; wherein the tile serial number is an index relationship established in advance based on the tile map position and the serial number; The actual tile serial number acquisition module is used to simulate the operation data of the map and obtain the actual tile serial number after the operation; A target tile serial number determination module, used to solve the operation data and determine the target tile serial number according to the solution result; The test result determination module is used to determine the test result of the map operation response according to the comparison result between the actual tile serial number and the target tile serial number.
9. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the steps of an automated testing method for map operation response as described in any one of claims 1 to 7 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the automated testing method for map operation response according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
High-fidelity terrain surface interpolation method and system for large-scale point cloud data
CN121280658A
High fidelity terrain surface interpolation method and system for large scale point cloud data
CN121280658B