Virtual drive test method and device, electronic equipment and storage medium
By obtaining map images and longitude and latitude ranges from map software, identifying small pixels of target color and background color, and determining road boundaries and wireless signal coverage strength, the problem of virtual road testing of high-speed rail and railways is solved, and the efficiency of virtual road testing is improved.
Patent Information
- Application Number
- CN202410711932.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-03
AI Technical Summary
The existing virtual drive test system is difficult to effectively conduct virtual drive tests of high-speed rail and railways, especially when there are many and nameless roads in urban centers, resulting in heavy workload and low efficiency.
By obtaining the map picture and longitude and latitude range of the road to be measured from the map software, identifying small pixels with different target colors and background colors to form an original point set, determining multi-point objects and obtaining road boundaries, and obtaining measurement report data to determine wireless signals. Coverage intensity, and displays road segment color based on coverage intensity.
It achieves accurate virtual drive test boundary determination for roads such as high-speed rail and railways, improves virtual drive test efficiency, and avoids the need for manual marking and reliance on road names to obtain boundaries.
Smart Images

Figure CN118612686A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a virtual drive test method, device, electronic device and storage medium. Background Art
[0002] Road coverage of high-speed rail and railways is one of the scenarios that need to be focused on during wireless network planning and optimization. Operators have changed from the traditional manual network testing method to the virtual road testing method to understand the wireless network coverage of the road. A very important step in the virtual road testing method is to collect MR data covering the road to be tested from the MR (Measurement Report) data of the entire network, which requires the formation of accurate road boundary areas.
[0003] The current virtual road test system needs to obtain road data from three parties or rely on manually drawing the boundaries of each road on the map. Map software can provide road data such as highways and subways through API (Application Programming Interface). For example, when you enter the name of a road in the search box of the map software, the situation of the road will be displayed on the map.
[0004] However, the map software does not directly provide the road data of high-speed rail and railway. When the names of high-speed rail and railway are entered in the search box of the map software in the same way, the road conditions will not be displayed on the map, and the virtual road test of high-speed rail and railway cannot be completed. In addition, there are many road names in the city center, and some even have no road names. If you want to call the map software API to obtain the data of all these roads, the workload is relatively large, and the efficiency of virtual road test is low. Summary of the invention
[0005] The embodiments of the present application provide a virtual drive test method, device, electronic device and storage medium, which are helpful to realize virtual drive test of high-speed railways and railways, and can improve the efficiency of virtual drive test.
[0006] In order to solve the above problems, in a first aspect, an embodiment of the present application provides a virtual drive test method, including:
[0007] Obtain a map image of a target area where the road to be tested is located from a map software, and obtain a latitude and longitude range corresponding to the map image, wherein the road to be tested is a target color and is different from the background color in the map image;
[0008] According to the target color and the longitude and latitude range, an original point set corresponding to the road to be measured is obtained from the map image, wherein the original point set includes pixel points corresponding to the road to be measured and longitude and latitude information corresponding to each pixel point;
[0009] Acquire a plurality of multi-point objects from the original point set, and determine the road boundary of the road section corresponding to each of the multi-point objects;
[0010] For each of the road sections, according to the road boundary of the road section, obtaining measurement report MR data within the road section, and determining the wireless signal coverage strength of the road section according to the MR data;
[0011] The display color of the road section is determined according to the wireless signal coverage strength, and the road section is displayed in the map with the display color.
[0012] In a second aspect, an embodiment of the present application provides a virtual drive test device, including:
[0013] A map image acquisition module is used to acquire a map image of a target area where the road to be tested is located from a map software, and to acquire a latitude and longitude range corresponding to the map image, wherein the road to be tested is in a target color and is different from the background color in the map image;
[0014] An original point set acquisition module, used to acquire an original point set corresponding to the road to be tested from the map image according to the target color and the longitude and latitude range, wherein the original point set includes pixel points corresponding to the road to be tested and longitude and latitude information corresponding to each pixel point;
[0015] A road boundary determination module, used to obtain a plurality of multi-point objects from the original point set, and determine the road boundary of the road section corresponding to each of the multi-point objects;
[0016] A signal strength determination module, configured to obtain, for each of the road sections, measurement report MR data within the road section according to the road boundary of the road section, and determine the wireless signal coverage strength of the road section according to the MR data;
[0017] The road test result display module is used to determine the display color of the road section according to the wireless signal coverage strength, and display the road section in the map with the display color.
[0018] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the virtual road test method described in the embodiment of the present application when executing the computer program.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the virtual drive test method disclosed in the embodiment of the present application.
[0020] The virtual road test method, device, electronic device and storage medium provided in the embodiments of the present application obtain a map image of a target area where a road to be tested is located from a map software, and obtain the latitude and longitude range corresponding to the map image. In the map image, the road to be tested is a target color and different from the background color. According to the target color and the longitude and latitude range, an original point set corresponding to the road to be tested is obtained from the map image, a plurality of multi-point objects are obtained from the original point set, and a road boundary of a section corresponding to each multi-point object is determined. For each section, MR data within the section is obtained according to the road boundary, and the wireless signal coverage strength of the section is determined according to the MR data. The display color of the section is determined according to the wireless signal coverage strength, and each section is displayed in the map with the display color. The road boundary of each section of the road to be tested can be accurately determined by processing the map image, so that the road boundary of railways, high-speed railways, urban roads, etc. can be obtained by processing the map image, thereby realizing virtual road testing of high-speed railways and railways, and there is no need to manually mark the road boundary, and there is no need to obtain the boundary of each road based on the road name, which can improve the efficiency of virtual road testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0022] Figure 1 is a flow chart of a virtual drive test method provided in an embodiment of the present application;
[0023] Figure 2 It is a schematic diagram of displaying the extracted pixel points of the road to be tested on a map in an embodiment of the present application;
[0024] Figure 3 is a flow chart of obtaining multiple multi-point objects from an original point set in an embodiment of the present application;
[0025] Figure 4a is a schematic diagram of a dot set obtained in an embodiment of the present application;
[0026] Figure 4b is a schematic diagram of another set of points obtained with the closest point as the center of the circle in an embodiment of the present application;
[0027] Figure 4c This is an example diagram of a road boundary obtained by buffer processing in an embodiment of the present application;
[0028] Figure 5 is a flowchart of determining a road boundary based on an original point set in an embodiment of the present application;
[0029] Figure 6 is a flow chart of a virtual drive test method provided in an embodiment of the present application;
[0030] Figure 7 This is an example diagram in which the initial center point is not inside the road section in the embodiment of the present application;
[0031] Figure 8 is a flow chart of a virtual drive test method provided in an embodiment of the present application;
[0032] Fig. 9 is a structural schematic diagram of a virtual drive test device provided in an embodiment of the present application;
[0033] Fig.10 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0035] Figure 1 is a flow chart of a virtual drive test method provided in an embodiment of the present application, such as Figure 1 As shown, the method includes: step 110 to step 150.
[0036] Step 110, obtaining a map image of the target area where the road to be tested is located from the map software, and obtaining the latitude and longitude range corresponding to the map image, wherein the road to be tested is in the target color and is different from the background color.
[0037] The map software is an application program that provides map services. The road to be tested is a road of a specific road type that needs to be tested by virtual road testing, such as a railway, a high-speed railway, or a city road.
[0038] Based on the personalized map setting function provided by the map software, the display color of the road to be tested can be set in the map software, that is, the road to be tested can be set to the target color, and other map elements can be used as the background, and the color of the background is obviously different from the target color of the road to be tested, for example, the target color is white and the background color is black.
[0039] Based on the above settings, the map software displays the map page of the target area according to the above settings, converts the part of the map displayed in the map page into a picture format, obtains the map picture of the road to be tested in the target area, and obtains the longitude and latitude range of the part of the map displayed in the map page based on the map page to obtain the longitude and latitude range corresponding to the map picture.
[0040] In one embodiment of the present application, obtaining a map image of a target area where a road to be tested is located from a map software, and obtaining the longitude and latitude range corresponding to the map image, includes: obtaining a style file set in the map software, the style text including: displaying only the road to be tested, displaying the road to be tested in the target color, and displaying the background in the color of the background; applying the style file to the HTML page code corresponding to the target area in the map software, and displaying the target map of the target area in the style in the style file; converting the target map into the map image, and obtaining the longitude and latitude range corresponding to the target map through a boundary acquisition method.
[0041] Various map software currently supports the "Personalized Map" setting function. Based on this function, you can set the map software to only display the roads to be tested, and set the target color of the roads to be tested and the background color. Taking Baidu Map API as an example, you can set the map background to black in Baidu Map API-Console-Featured Service Platform-Personalized Settings, and only display the roads to be tested (such as high-speed rail lines). Other roads and elements are not displayed. In this way, the color of the road to be tested is white, and the color of the background is black, and the color display of the two is obviously different. After the setting is completed, a style file in JSON format is obtained, which can be downloaded and exported. In the style file in JSON format, the style setting of only displaying the roads to be tested is specified.
[0042] Apply the style file to the HTML page code, and display a target map with only the road to be tested (high-speed rail route) through a Map instance on the HTML page. In the HTML page code, the map software displays the target map of the target area in the style of the style file. The map can be converted into a map image (such as a jpg format image) using html2canvas, and the boundary acquisition method (getBounds() method) of the map software API is used to obtain the latitude and longitude coordinates of the upper left corner and the lower right corner of the current target map, that is, to obtain the latitude and longitude range corresponding to the target map, and save the latitude and longitude coordinates of the upper left corner and the lower right corner to the file name of the map image file, so as to facilitate the subsequent acquisition of the latitude and longitude range for processing.
[0043] Among them, getBounds() is a method in the Leaflet map framework, which is used to obtain the latitude and longitude boundaries of the map view. This method returns a boundary object containing all the latitude and longitude coordinates within the current view range of the map. This boundary object is usually used to determine the display range of the map, such as when adding markers to the map or performing other map operations, to ensure that these elements or operations are performed within the correct range. html2canvas is a JavaScript plug-in that can convert HTML elements on a web page into Canvas objects, so that web page screenshots can be output as images or PDF files. The principle is to traverse the DOM tree, convert each HTML element into a Canvas object, and stack them together to form a complete image or PDF file.
[0044] By obtaining the set style file in the map software, applying the style file to the HTML page code corresponding to the target area in the map software, displaying the target map of the target area with the style in the style file, converting the target map into a map image, and obtaining the longitude and latitude range corresponding to the target map through the boundary acquisition method, the road to be tested and the background can be distinguished and displayed in the map image, which is convenient for subsequent processing of each pixel and extraction of the boundary of the road to be tested.
[0045] Step 120, according to the target color and the longitude and latitude range, obtain the original point set corresponding to the road to be tested from the map image, the original point set including the pixel points corresponding to the road to be tested and the longitude and latitude information corresponding to each pixel point.
[0046] Pixel points with the target color are identified from the map image, and the longitude and latitude information corresponding to the pixel point can be determined based on the position of the pixel point in the map image and the longitude and latitude range corresponding to the map image. The pixel points with the target color and the longitude and latitude information constitute the original point set of the road to be tested.
[0047] In one embodiment of the present application, the original point set corresponding to the road to be tested is obtained from the map image according to the target color and the longitude and latitude range, including: opening the image file of the map image through the Python image processing library, and determining the longitude and latitude information of each pixel in the map image according to the longitude and latitude range; filtering out pixel points with the target color from the map image through the Python image processing library, and using the filtered pixel points and the longitude and latitude information corresponding to each pixel point as the original point set.
[0048] Among them, Python Image Library (PIL) is one of the standard libraries for image processing in Python programming language. It provides rich functions and tools, which can be used for opening, saving, processing, editing and other operations of images; it can open and save image files in various formats, such as JPEG, PNG, BMP, GIF, etc.; it can perform various common processing operations on images, such as resizing, cropping, rotating, flipping, filter effects, etc.; it can directly access and manipulate the pixel data of images, and perform pixel-level processing and modification.
[0049] When the latitude and longitude range of the map image (the latitude and longitude coordinates of the upper left corner and the latitude and longitude coordinates of the lower right corner) is recorded through the file name of the map image, the latitude and longitude range of the map image can be extracted from the file name of the map image, and the image file of the map image is opened using the Python image processing library. According to the latitude and longitude coordinates of the upper left corner and the latitude and longitude coordinates of the lower right corner of the map image, the image width and image height (in pixels) of the map image, the latitude and longitude coordinates of each pixel point (i.e., the latitude and longitude information) can be calculated. The color of each pixel point in the map image is identified through the Python image processing library, and the pixel points with the target color are screened out from the map image. The screened pixel points and the corresponding latitude and longitude information constitute the original point set of the road to be tested. Exemplarily, in a map image, the target color is white and the background color is black. The color of each pixel is identified through the Python image processing library, and the map image is converted into the HSV format (in the HSV color space, the hue (H) of white is 0 degrees, the saturation (S) is 0, and the brightness (V) is 100%; the value range of black is generally H: 0-360, S: 0-100, V: 0-20). The H value can be 0, the S value can be 0, and the V value can be greater than the brightness threshold (such as 20%) for screening. The pixel points of the road to be tested (such as high-speed rail or railway lines) in the map image and the longitude and latitude coordinates of these pixel points can be screened out.
[0050] Among them, HSV is a way to describe color, which decomposes color into three elements: hue, saturation, and value. Hue indicates the type or type of color, which is the position of the color on the circle, and the value range is 0° to 360°. 0° and 360° represent red, 120° represents green, 240° represents blue, and so on. Hue can describe whether the color is red, green, blue, or other colors. Saturation indicates the purity or vividness of the color, which is the intensity or concentration of the color. When the saturation is 0, the color is gray and has no obvious color; when the saturation is 1, the color is the brightest and purest. Value: Indicates the lightness and darkness of the color, which is the brightness of the color. When the brightness is 0, the color is black; when the brightness is 1, the color is the brightest. The advantage of the HSV color model is that by adjusting the three elements of hue, saturation, and brightness, the change and expression of color can be controlled more intuitively, which is more in line with human perception of color. The HSV color model is more consistent with the way humans perceive color than the RGB color model, so it is often used in image processing and computer vision.
[0051] The Python image processing library can be used to easily operate on each pixel in the map image, thereby extracting the pixel with the target color and the longitude and latitude information of each pixel, providing a data basis for determining the road boundary.
[0052] In one embodiment of the present application, filtering out pixels whose color is the target color from the map image through the Python image processing library includes: sampling pixels to be identified from all pixels in the map image at a preset sampling rate; and filtering out pixels whose color is the target color from the pixels to be identified through the Python image processing library.
[0053] In the map image, the road to be tested looks very thin, but if it is enlarged to the pixel level, the width of a road to be tested is actually composed of many pixels. Therefore, the pixels in the map image can be sampled according to the preset sampling rate to obtain the pixels to be identified, and the colors of the pixels to be identified can be identified and extracted through the Python image processing library to extract the pixels with the target color. Among them, the preset sampling rate can be set based on the resolution of the map image and the width of the road to be tested. For example, the preset sampling rate can be sampling every 2 pixels or 3 pixels.
[0054] After extracting the pixel points of the road to be tested, the extracted pixel points can be displayed on the map, such as Figure 2 As shown, there are many pixels, which can be extracted after sampling.
[0055] By sampling the pixel points of the map image according to a preset sampling rate and then identifying and extracting the pixel points of the road to be tested, the amount of calculation can be reduced and the efficiency of virtual road testing can be improved.
[0056] Step 130: Acquire a plurality of multi-point objects from the original point set, and determine the road boundary of the road section corresponding to each of the multi-point objects.
[0057] Among them, the MultiPoint object is an ordered collection of points.
[0058] According to the latitude and longitude information of each pixel point in the original point set, the pixel points within a certain range can be regarded as a multi-point object, and the boundary acquisition processing can be performed on each multi-point object to obtain the road boundary of the road section corresponding to each multi-point object. The road boundary can be represented in the form of a polygonal boundary.
[0059] Figure 3 is a flowchart of obtaining multiple multi-point objects from an original point set in an embodiment of the present application, such as Figure 3 As shown, the step of acquiring a plurality of multi-point objects from the original point set includes steps 131 to 135:
[0060] Step 131, randomly select a pixel point from the original point set, obtain the pixel points within a circle with the selected pixel point as the center and a preset distance as the radius from the original point set, and obtain a point set.
[0061] During initialization, an empty road point set can be defined. In the original point set of the road to be tested, any point is selected as the center of the circle, and a circle is drawn with a preset distance (e.g., 50 meters) as the radius. The points whose latitude and longitude information in the original point set is within the circle can be circled to obtain a point set. Figure 4a is a schematic diagram of the dot set obtained in the embodiment of the present application, such as Figure 4a As shown, this point set (i.e., all points within the circle) is composed of multiple points.
[0062] Step 132, deleting the circle point set from the original point set, and adding the circle point set as a multi-point object to the empty road point set.
[0063] The points in this circle point set are deleted from the original point set, and at the same time, these points in the circle point set are formed into a multi-point object and added to the road point set. At this time, there is one multi-point object in the road point set.
[0064] Step 133, determining the pixel point with the shortest distance from each pixel point in the road point set from the original point set, and obtaining the pixel points within a circle with the pixel point as the center and a preset distance as the radius from the original point set to obtain a new point set.
[0065] Calculate the pixel point in the original point set that is closest to the current road point set, use this closest point as the new center, draw a circle with a preset distance as the radius, and get another new point set. Figure 4b is a schematic diagram of another set of points obtained with the nearest point as the center in an embodiment of the present application, such as Figure 4b As shown, a circle is drawn with the pixel point closest to the road point set as the center and the preset distance as the radius to obtain a new point set.
[0066] Step 134, deleting the new point set from the original point set, and adding the new point set as a multi-point object to the road point set.
[0067] Delete the new point set from the original point set, and form a multipoint object with the pixels in the new point set, and add the multipoint object to the road point set. After processing the two point sets, there are 2 MultiPoint objects in the road point set.
[0068] Step 135, determining whether the original point set is empty.
[0069] If the original point set is not empty, loop through steps 133 to 135, and loop through the above operations of obtaining a new point set from the original point set, deleting the new point set from the original point set, and adding the new point set as a multi-point object to the road point set until the original point set is empty. If the original point set is empty, terminate the processing to obtain a plurality of the multi-point objects in the road point set.
[0070] It should be noted that the embodiment of the present application only uses the method of drawing a circle as an example to illustrate the process of obtaining a multi-point object, and is not intended to be limiting. Those skilled in the art can understand that the multi-point object can also be obtained in other ways, for example, by using a square.
[0071] It should be noted that at the edge of the map image, there may be too few pixels in the dot set (for example, less than 50). This dot set can be directly deleted from the original point set without adding it to the road point set. When the road point set is empty, it is impossible to calculate the point in the original point set closest to the current road point set (i.e., during initial processing). You can choose any point from the original point set as the center of the circle.
[0072] By obtaining a point set with a determined pixel point as the center and a preset distance as the radius, and then obtaining a multi-point object, all points on the road to be tested can be accurately obtained, thereby improving the accuracy of road boundary determination.
[0073] In one embodiment of the present application, determining the road boundary of the road section corresponding to each of the multi-point objects includes: for each of the multi-point objects, performing buffer processing on the multi-point objects respectively to obtain one or more polygons, and determining the boundaries of the one or more polygons as the road boundary of the road section corresponding to the multi-point object.
[0074] By performing buffer processing on each multi-point object in the road point set, one or more polygons can be obtained. The boundaries of the one or more polygons are the road boundaries of the road section corresponding to the multi-point object, such as Figure 4c As shown. Buffer is commonly used in spatial analysis and spatial query in Geographic Information System (GIS). It is used to expand or shrink the boundaries of geometric objects within a given distance. It is a buffer process for geometric objects. Based on the original geometric objects, a new geometric object is generated. The new geometric object is the union of the areas where the distance from all points of the original geometric object to the original geometric object does not exceed the specified distance. For example, for MultiPoint objects, a Buffer operation will generate a polygon object, which is the union of all points of the original multipoint object to the buffer at the specified distance.
[0075] When performing the Buffer operation to form a polygon, there is a parameter called the radius of the buffer zone, also known as the distance of the buffer zone. By adjusting this parameter, the width of the road boundary can be controlled, and the flexible setting of the road boundary to be tested can be achieved.
[0076] Figure 5 is a flowchart of determining the road boundary based on the original point set in an embodiment of the present application, such as Figure 5As shown, when determining the road boundary, an empty road point set is defined, and a pixel point is selected from the original point set as the center of the circle; when the number of pixel points in the original point set is greater than 0, a circle is drawn with a preset distance as the radius to obtain a circle point set; the circle point set is deleted from the original point set; it is determined whether the number of pixel points in the circle point set is greater than a number threshold (for example, it can be 50); when the number of pixel points in the circle point set is greater than the number threshold, the circle point set is added to the road point set, and then it is determined whether the original point set is empty; when the number of pixel points in the circle point set is not greater than the number threshold, it is determined whether the road point set is empty; if the road If the point set is empty, select any point from the original point set as the new center, and then perform the operation of determining whether the number of pixels in the original point set is greater than 0; if the road point set is not empty, perform the operation of determining whether the original point set is empty; if the original point set is not empty, calculate the closest point in the original point set to the road point set, use the closest point as the new center, and then perform the operation of determining whether the number of pixels in the original point set is greater than 0; if the original point set is empty or the number of pixels in the original point set is not greater than 0, perform Buffer processing on each multi-point object in the road point set to obtain the road boundary of the road section.
[0077] Step 140 , for each of the road sections, according to the road boundary of the road section, obtain MR data within the road section, and determine the wireless signal coverage strength of the road section according to the MR data.
[0078] After determining the road boundary of each road section, convert the longitude and latitude information into WGS84 format. Collect the MR (Measurement Report) coverage data within each road boundary (polygon boundary), and average the RSRP (Reference Signal Receiving Power) in the MR data to obtain the wireless signal coverage strength of each road section (polygon area).
[0079] Step 150, determining a display color of the road section according to the wireless signal coverage strength, and displaying the road section in the map with the display color.
[0080] The correspondence between the wireless signal coverage strength and the display color can be preset. After determining the wireless signal coverage strength of each road section, the display color of each road section can be determined based on the wireless signal coverage strength of each road section and the preset correspondence, and each road section can be displayed in the map with the display color of each road section, so as to realize the virtual road test of the road to be tested.
[0081] Among them, virtual road testing uses wireless network MR and XDR big data to analyze data and obtain multi-dimensional (coverage, interference, overlap, etc.) indicators of roads, replacing traditional manual road testing and building depth testing, greatly reducing the labor cost and time cost of network optimization data collection. And because MR collects mobile phone signal data of online users, it reduces the human intervention and unreasonable sampling factors that may occur in manual testing.
[0082] The virtual road test method provided by the embodiment of the present application obtains a map image of a target area where a road to be tested is located from a map software, and obtains the latitude and longitude range corresponding to the map image. In the map image, the road to be tested is a target color and is different from the background color. According to the target color and the longitude and latitude range, an original point set corresponding to the road to be tested is obtained from the map image, a plurality of multi-point objects are obtained from the original point set, and a road boundary of a section corresponding to each multi-point object is determined. For each section, MR data within the section is obtained according to the road boundary, and the wireless signal coverage strength of the section is determined according to the MR data. The display color of the section is determined according to the wireless signal coverage strength, and each section is displayed in the map with the display color. The road boundaries of each section of the road to be tested can be accurately determined by processing the map image, so that the road boundaries of railways, high-speed railways, urban roads, etc. can be obtained by processing the map image, thereby realizing virtual road testing of high-speed railways and railways, and there is no need to manually mark the road boundaries, nor is there any need to obtain the boundaries of each road based on the road name, which can improve the efficiency of virtual road testing.
[0083] Figure 6 is a flow chart of a virtual drive test method provided in an embodiment of the present application, such as Figure 6 As shown, the method includes: steps 610 to 660.
[0084] Step 610, obtaining a map image of the target area where the road to be tested is located from the map software, and obtaining the latitude and longitude range corresponding to the map image, wherein the road to be tested is in the target color and is different from the background color.
[0085] Step 620, according to the target color and the longitude and latitude range, obtain the original point set corresponding to the road to be tested from the map image, the original point set including the pixel points corresponding to the road to be tested and the longitude and latitude information corresponding to each pixel point.
[0086] Step 630: Acquire multiple multi-point objects from the original point set, and determine the road boundary of the road segment corresponding to each of the multi-point objects.
[0087] Step 640: Determine the target center point of each of the road sections according to the longitude and latitude information corresponding to each pixel point on the road boundary and the longitude and latitude information corresponding to each pixel point in the multi-point object.
[0088] During the virtual road test, when displaying the coverage of each road section (area within the polygon boundary) on the map, it is not desirable to fill the entire polygon, but rather to display the coverage effect by dotting on the road, as in traditional road test software. To this end, after obtaining the road boundary (polygon boundary) of each road section through the dot set, the longitude and latitude information of each pixel point on the road boundary can be averaged to obtain a center point, and then the target center point of the road section can be determined based on the center point and the longitude and latitude information corresponding to each pixel point in the multi-point object. Exemplarily, the center point obtained by averaging the longitude and latitude information of each pixel point on the road boundary can be directly used as the target center point.
[0089] In one embodiment of the present application, the target center point of each road section is determined according to the longitude and latitude information corresponding to each pixel point on the road boundary and the longitude and latitude information corresponding to each pixel point in the multi-point object, including: determining the initial center point of the road section according to the longitude and latitude information corresponding to each pixel point on the road boundary; determining the pixel point with the smallest distance from the initial center point as the target center point according to the longitude and latitude information corresponding to each pixel point in the multi-point object.
[0090] The latitude and longitude information (latitude and longitude coordinates) of each pixel point on the road boundary of each road section are averaged to obtain the coordinates of a center point, which is the initial center point of the road section. In the curved part of the road to be tested, the initial center point may not necessarily be on the road (that is, the initial center point of a road section is not within the polygon corresponding to the road section), such as Figure 7 To avoid this situation, the distance between each pixel and the initial center point can be calculated based on the latitude and longitude information corresponding to each pixel in the multi-point object, and the pixel with the smallest distance from the initial center point can be determined, and the pixel is used as the target center point. Since the pixels in the multi-point object (dot set) must be on the road to be tested, it can be ensured that the target center points displayed on the map must be on the road to be tested.
[0091] Step 650: for each of the road sections, according to the road boundary of the road section, obtain the measurement report MR data within the road section, and determine the wireless signal coverage strength of the road section according to the MR data.
[0092] Step 660, determining the display color of the road section according to the wireless signal coverage strength, and displaying the target center point corresponding to the road section in the map with the display color.
[0093] After determining the display color of each road segment, it can be displayed in the form of dotting on the map, that is, the target center point corresponding to each road segment is displayed as the display color corresponding to that road segment in the map. Draw the target center points of these different display colors on the map and display all the center points along the road to be measured, and a display effect almost consistent with the actual road test can be obtained.
[0094] Exemplarily, the display color of the target center point of each road segment (polygon) is set according to the wireless signal coverage intensity, and the setting rules are as follows: dark green (RSRP > -75), green (-85 < RSRP <= -75), blue (-95 < RSRP <= -85), yellow (-105 < RSRP <= -95), pink (-110 < RSRP <= -105), red (RSRP <= -110), where RSRP represents the wireless signal coverage intensity.
[0095] The virtual road test method provided by the embodiments of the present application determines the target center point of the road segment by according to the longitude and latitude information corresponding to each pixel point on the road boundary and the longitude and latitude information corresponding to each pixel point in the multi-point object. Therefore, when displaying the result of the virtual road test, only the target center point of the road segment needs to be displayed in the display color corresponding to the road segment, which further improves the efficiency of the virtual road test.
[0096] Figure 8 is a flowchart of a virtual road test method provided by the embodiments of the present application. As Figure 8 shown, the method includes: step 810 to step 860.
[0097] Step 810, divide the area where the road to be measured is located into multiple map blocks, and set the map center point of the HTML page of each map block according to the center point of each map block to obtain multiple HTML files, where each map block serves as the target area respectively.
[0098] The route of the road to be measured may be very long, such as a high-speed railway route or a railway route. An HTML page can only display a part of the route map, and it is not certain which longitude and latitude the high-speed railway route passes through. At this time, the area where the road to be measured is located (such as the whole province or the whole city) can be divided into multiple small map blocks. Based on personalized settings, each map block only displays the road to be measured, and other elements are all backgrounds. Based on a map with a certain zoom ratio, different map center points are set for each HTML page, so that each HTML page can display different map blocks, and each HTML page corresponds to an HTML file. Each map block serves as a target area for subsequent processing.
[0099] The only difference between the HTML pages is the center point of the map. These HTML files can be generated in batches using simple programming.
[0100] Step 820, running the multiple HTML files in sequence in the map software, and obtaining the map images of the HTML pages corresponding to the running HTML files, obtaining the map images of the road to be tested in the target area corresponding to each map block, and obtaining the longitude and latitude range corresponding to each map image.
[0101] When the route of the road to be tested is long, many HTML pages will be generated (generally, the number of HTML pages in a province will exceed 1,000). A function of automatically saving as a picture can be added to the HTML code, so that the map software can automatically save as a map picture when displaying the map blocks corresponding to each HTML file in the set style file.
[0102] For example, a batch execution file can be written to automatically run these HTML files. Based on the directory where the HTML files are saved, the program can automatically read the HTML files in the directory (such as the d:\html directory), read two HTML files each time with the browser, and automatically close the browser after waiting for 30 seconds each time, so that the image files of all map images can be generated in batches.
[0103] Step 830, according to the target color and the longitude and latitude range, obtain the original point set corresponding to the road to be tested from the map image, the original point set including the pixel points corresponding to the road to be tested and the longitude and latitude information corresponding to each pixel point.
[0104] By performing the processing from step 830 to step 860 on each map image obtained in batches, the result of the virtual road test of the entire road to be tested can be obtained.
[0105] Step 840: Acquire multiple multi-point objects from the original point set, and determine the road boundary of the road segment corresponding to each of the multi-point objects.
[0106] Step 850: For each of the road sections, according to the road boundary of the road section, obtain the measurement report MR data within the road section, and determine the wireless signal coverage strength of the road section according to the MR data.
[0107] Step 860, determining a display color of the road section according to the wireless signal coverage strength, and displaying the road section in the map with the display color.
[0108] The virtual road test method provided in the embodiment of the present application can divide the area where the road to be tested is located into multiple map blocks when the route of the road to be tested is long, and set the map center point of the HTML page of each map block according to the center point of each map block to obtain multiple HTML files. The multiple HTML files are run in sequence in the map software to obtain map images of the HTML pages corresponding to the running HTML files, and map images of the road to be tested in the target area corresponding to each map block are obtained, thereby realizing batch acquisition of map images of the road to be tested in different target areas during virtual road testing, which can further improve the efficiency of virtual road testing.
[0109] In the embodiment of the present application, there is no need to draw lines or boundaries manually, and the boundaries of the high-speed rail and railway waiting to be tested roads in the entire province or city can be automatically generated; the distance between the target center points is approximately equal to the radius of the circle. To adjust the distance between the target center points, just change the radius of the circle when drawing the circle; the width of the formed road boundary can also be adjusted freely, and the distance of the buffer zone can be set when setting the buffer; it is no longer restricted by road names, and there is no need to know the names of the high-speed rail or railway routes in a province to obtain the boundaries of the high-speed rail or railway waiting to be tested roads, so that virtual road testing can be achieved; in the roads in the city center, when there are many road names and some even have no road names, you only need to set the personalized map to display only urban roads, and then identify and generate polygons of urban roads one by one.
[0110] Fig. 9 is a schematic diagram of the structure of a virtual drive test device provided in an embodiment of the present application, such as Fig. 9 As shown, the device comprises:
[0111] A map image acquisition module 910 is used to acquire a map image of a target area where the road to be tested is located from a map software, and to acquire a latitude and longitude range corresponding to the map image, wherein the road to be tested is in a target color and is different from the background color in the map image;
[0112] The original point set acquisition module 920 is used to acquire the original point set corresponding to the road to be tested from the map image according to the target color and the longitude and latitude range, wherein the original point set includes the pixel points corresponding to the road to be tested and the longitude and latitude information corresponding to each pixel point;
[0113] A road boundary determination module 930 is used to obtain a plurality of multi-point objects from the original point set, and determine the road boundary of the road section corresponding to each of the multi-point objects;
[0114] A signal strength determination module 940 is used to obtain, for each of the road sections, measurement report MR data within the road section according to the road boundary of the road section, and determine the wireless signal coverage strength of the road section according to the MR data;
[0115] The drive test result display module 950 is used to determine the display color of the road section according to the wireless signal coverage strength, and display the road section in the map with the display color.
[0116] Optionally, the device further comprises:
[0117] A road section center point determination module, used for determining a target center point of each road section according to the longitude and latitude information corresponding to each pixel point on the road boundary and the longitude and latitude information corresponding to each pixel point in the multi-point object before displaying the road section in the map with the display color;
[0118] The drive test result display module includes:
[0119] The drive test result display unit is used to display the target center point corresponding to the road section in the map with the display color.
[0120] Optionally, the road section center point determination module is specifically used for:
[0121] Determining the initial center point of the road section according to the latitude and longitude information corresponding to each pixel point on the road boundary;
[0122] According to the longitude and latitude information corresponding to each pixel point in the multi-point object, the pixel point with the shortest distance from the initial center point is determined as the target center point.
[0123] Optionally, the map image acquisition module includes:
[0124] A style file acquisition unit, used for acquiring a style file set in the map software, wherein the style text includes: displaying only the road to be tested, displaying the road to be tested in the target color, and displaying the background in the background color;
[0125] A target map display unit, used to apply the style file to the HTML page code corresponding to the target area in the map software, and display the target map of the target area in the style of the style file;
[0126] A map image acquisition unit is used to convert the target map into the map image and acquire the longitude and latitude range corresponding to the target map through a boundary acquisition method.
[0127] Optionally, the original point set acquisition module includes:
[0128] A pixel longitude and latitude determination unit, used to open the image file of the map image through the Python image processing library, and determine the longitude and latitude information of each pixel in the map image according to the longitude and latitude range;
[0129] The original point set acquisition unit is used to filter out pixel points with the target color from the map image through the Python image processing library, and use the filtered pixel points and the longitude and latitude information corresponding to each pixel point as the original point set.
[0130] Optionally, the original point set acquisition unit is specifically used to:
[0131] Sampling the pixels to be identified from all the pixels in the map image according to a preset sampling rate;
[0132] The Python image processing library is used to filter out pixel points whose color is the target color from the pixel points to be identified.
[0133] Optionally, the road boundary determination module includes a multi-point object acquisition unit, and the multi-point object acquisition unit is used to:
[0134] Selecting a pixel point from the original point set, obtaining pixel points within a circle with the selected pixel point as the center and a preset distance as the radius from the original point set, to obtain a circle point set;
[0135] Deleting the circle point set from the original point set, and adding the circle point set as a multi-point object to the empty road point set;
[0136] Determine from the original point set the pixel point with the shortest distance from each pixel point in the road point set, and obtain from the original point set the pixel points within a circle with the pixel point as the center and a preset distance as the radius, to obtain a new circle point set;
[0137] Deleting the new point set from the original point set, and adding the new point set as a multi-point object to the road point set;
[0138] The above operations of obtaining a new point set from the original point set, deleting the new point set from the original point set, and adding the new point set as a multi-point object to the road point set are performed cyclically until the original point set is empty, thereby obtaining a plurality of the multi-point objects in the road point set.
[0139] Optionally, the road boundary determination module includes:
[0140] The road boundary determination unit is used to perform buffer processing on each of the multi-point objects to obtain one or more polygons, and determine the boundaries of the one or more polygons as the road boundaries of the road section corresponding to the multi-point object.
[0141] Optionally, the device further comprises:
[0142] The map division module is used to divide the area where the road to be tested is located into multiple map blocks before obtaining the map image of the target area where the road to be tested is located from the map software, and set the map center point of the HTML page of each map block according to the center point of each map block to obtain multiple HTML files, wherein each map block is used as the target area.
[0143] Optionally, the map image acquisition module includes:
[0144] The map image acquisition unit is used to run the multiple HTML files in sequence in the map software, and obtain the map images of the HTML pages corresponding to the running HTML files, so as to obtain the map images of the road to be tested in the target area corresponding to each map block.
[0145] The virtual drive test device provided in the embodiment of the present application is used to implement each step of the virtual drive test method described in the embodiment of the present application. The specific implementation of each module of the device can be found in the corresponding steps and will not be repeated here.
[0146] The virtual road test device provided by the embodiment of the present application obtains a map image of a target area where a road to be tested is located from a map software, and obtains a latitude and longitude range corresponding to the map image. In the map image, the road to be tested is a target color and is different from the background color. According to the target color and the latitude and longitude range, an original point set corresponding to the road to be tested is obtained from the map image, a plurality of multi-point objects are obtained from the original point set, and a road boundary of a section corresponding to each multi-point object is determined. For each section, MR data within the section is obtained according to the road boundary, and a wireless signal coverage strength of the section is determined according to the MR data. A display color of the section is determined according to the wireless signal coverage strength, and each section is displayed in the map with the display color. The road boundaries of each section of the road to be tested can be accurately determined by processing the map image, so that the road boundaries of railways, high-speed railways, urban roads, etc. can be obtained by processing the map image, thereby realizing virtual road testing of high-speed railways and railways, and there is no need to manually mark the road boundaries, and there is no need to obtain the boundaries of each road based on the road name, which can improve the efficiency of virtual road testing.
[0147] Fig.10 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Fig.10As shown, the electronic device 1000 may include one or more processors 1010 and one or more memories 1020 connected to the processor 1010. The electronic device 1000 may also include an input interface 1030 and an output interface 1040 for communicating with another device or system. The program code executed by the processor 1010 may be stored in the memory 1020.
[0148] The processor 1010 in the electronic device 1000 calls the program code stored in the memory 1020 to execute the virtual drive test method in the above embodiment.
[0149] The embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the virtual drive test method described in the embodiment of the present application are implemented.
[0150] The embodiment of the present application further provides a computer program product, which, when executed by a processor, implements the steps of the virtual drive testing method as described in the embodiment of the present application.
[0151] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0152] The above is a detailed introduction to a virtual road test method, device, electronic device and storage medium provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for a person skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
Claims
1. A virtual drive test method, characterized in that: include: Obtain a map image of a target area where the road to be tested is located from a map software, and obtain a latitude and longitude range corresponding to the map image, wherein the road to be tested is a target color and is different from the background color in the map image; According to the target color and the longitude and latitude range, an original point set corresponding to the road to be measured is obtained from the map image, wherein the original point set includes pixel points corresponding to the road to be measured and longitude and latitude information corresponding to each pixel point; Acquire a plurality of multi-point objects from the original point set, and determine the road boundary of the road section corresponding to each of the multi-point objects; For each of the road sections, according to the road boundary of the road section, obtaining measurement report MR data within the road section, and determining the wireless signal coverage strength of the road section according to the MR data; The display color of the road section is determined according to the wireless signal coverage strength, and the road section is displayed in the map with the display color.
2. The method according to claim 1, characterized in that Before displaying the road segment in the map with the display color, the method further includes: Determine the target center point of each road section according to the longitude and latitude information corresponding to each pixel point on the road boundary and the longitude and latitude information corresponding to each pixel point in the multi-point object; The displaying of the road section in the map with the display color includes: The target center point corresponding to the road section is displayed in the map in the display color.
3. The method according to claim 2, characterized in that Determining the target center point of each road section according to the longitude and latitude information corresponding to each pixel point on the road boundary and the longitude and latitude information corresponding to each pixel point in the multi-point object includes: Determining the initial center point of the road section according to the latitude and longitude information corresponding to each pixel point on the road boundary; According to the longitude and latitude information corresponding to each pixel point in the multi-point object, the pixel point with the shortest distance from the initial center point is determined as the target center point.
4. The method according to any one of claims 1 to 3, characterized in that: The step of obtaining a map image of a target area where the road to be tested is located from a map software, and obtaining the latitude and longitude range corresponding to the map image, includes: Obtaining a set style file in the map software, wherein the style text includes: displaying only the road to be tested, displaying the road to be tested in the target color, and displaying the background in the background color; Applying the style file to the HTML page code corresponding to the target area in the map software, and displaying the target map of the target area in the style of the style file; The target map is converted into the map image, and the longitude and latitude range corresponding to the target map is obtained through a boundary acquisition method.
5. The method according to any one of claims 1 to 3, characterized in that: The step of acquiring an original point set corresponding to the road to be tested from the map image according to the target color and the latitude and longitude range includes: Open the image file of the map image through the Python image processing library, and determine the longitude and latitude information of each pixel in the map image according to the longitude and latitude range; The Python image processing library is used to filter out pixel points with the target color from the map image, and the filtered pixel points and the longitude and latitude information corresponding to each pixel point are used as the original point set.
6. The method according to claim 5, characterized in that The step of filtering out pixels having the target color from the map image by using the Python image processing library includes: Sampling the pixels to be identified from all the pixels in the map image according to a preset sampling rate; The Python image processing library is used to filter out pixel points whose color is the target color from the pixel points to be identified.
7. The method according to any one of claims 1 to 3, characterized in that: The acquiring a plurality of multi-point objects from the original point set comprises: Selecting a pixel point from the original point set, obtaining pixel points within a circle with the selected pixel point as the center and a preset distance as the radius from the original point set, to obtain a circle point set; Deleting the circle point set from the original point set, and adding the circle point set as a multi-point object to the empty road point set; Determine from the original point set the pixel point with the shortest distance from each pixel point in the road point set, and obtain from the original point set the pixel points within a circle with the pixel point as the center and a preset distance as the radius, to obtain a new circle point set; Deleting the new point set from the original point set, and adding the new point set as a multi-point object to the road point set; The above operations of obtaining a new point set from the original point set, deleting the new point set from the original point set, and adding the new point set as a multi-point object to the road point set are performed cyclically until the original point set is empty, thereby obtaining a plurality of the multi-point objects in the road point set.
8. The method according to any one of claims 1 to 3, characterized in that: The determining of the road boundary of the road section corresponding to each of the multi-point objects comprises: For each of the multi-point objects, buffer processing is performed on the multi-point objects to obtain one or more polygons, and the boundaries of the one or more polygons are determined as the road boundaries of the road section corresponding to the multi-point object.
9. The method according to any one of claims 1 to 3, characterized in that: Before obtaining the map image of the target area where the road to be tested is located from the map software, the method further includes: The area where the road to be tested is located is divided into a plurality of map blocks, and the map center point of the HTML page of each map block is set according to the center point of each map block to obtain a plurality of HTML files, wherein each map block is respectively used as the target area.
10. The method according to claim 9, characterized in that The step of obtaining a map image of a target area where the road to be tested is located from a map software includes: The plurality of HTML files are sequentially run in the map software, and map images of HTML pages corresponding to the running HTML files are obtained to obtain map images of the road to be tested in the target area corresponding to each map block.
11. A virtual drive test device, characterized in that: include: A map image acquisition module is used to acquire a map image of a target area where the road to be tested is located from a map software, and to acquire a latitude and longitude range corresponding to the map image, wherein the road to be tested is in a target color and is different from the background color in the map image; An original point set acquisition module, used to acquire an original point set corresponding to the road to be tested from the map image according to the target color and the longitude and latitude range, wherein the original point set includes pixel points corresponding to the road to be tested and longitude and latitude information corresponding to each pixel point; A road boundary determination module, used to obtain a plurality of multi-point objects from the original point set, and determine the road boundary of the road section corresponding to each of the multi-point objects; A signal strength determination module, configured to obtain, for each of the road sections, measurement report MR data within the road section according to the road boundary of the road section, and determine the wireless signal coverage strength of the road section according to the MR data; The road test result display module is used to determine the display color of the road section according to the wireless signal coverage strength, and display the road section in the map with the display color.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the virtual drive test method according to any one of claims 1 to 10 is implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the virtual drive test method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Map area determination method and device, equipment and storage medium
CN111275730A
Traffic map rendering method, device, terminal equipment, server and system
CN111586108A
Image processing method and device, computer equipment and storage medium
CN114419338A
Road coverage evaluation method and device, server and medium
CN115835261A
Mining area road real-time detection method based on semantic map
CN116164771A
