Android-based Atlas Drawing Method, System, Device and Medium
By obtaining and processing sensor signals in the Android system and using graphics drawing library files to draw graphs, the problem of lack of graph controls in the Android system is solved, and intuitive graph display and rapid analysis are achieved.
Patent Information
- Application Number
- CN202210137877.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-02-15
AI Technical Summary
The lack of graph controls in the existing Android system, resulting in poor graph display results, especially on mobile devices, which cannot fully display sample point data, which increases the difficulty of on-site analysis.
By obtaining the original time domain sampling signal of the sensor, converting it into fixed-length sampling points, filtering and calculating the sequence number array, drawing the graph using the graphics drawing library file of the Android system, and customizing the coordinate system using the SurfaceView view to achieve intuitive display of the graph.
Intuitive and distinctive graph drawing is realized on Android smart mobile devices, reducing data display latency, supporting synchronous updates, and suitable for fast on-site analysis.
Smart Images

Figure CN114549678B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of graph drawing technology, and in particular to an Android-based graph drawing method, system, device, and medium. Background Art
[0002] Maps are a form of image processing used to better understand and detect objects. For example, flight maps are a very effective way to analyze and identify particle discharge phenomena during ultrasonic testing. The ultrasonic sensor collects the ultrasonic signal of the object being tested, which is then transmitted to the signal processing unit. This data is processed and then output as a corresponding type of map. Existing signal processing units are all handled by PCs, connected to the ultrasonic sensor via a data cable. After receiving the relevant sampled data, they process and draw flight maps to provide to inspection personnel for fault diagnosis.
[0003] Drawing maps on the PC is limited by the drawing controls, and the display effect of the maps is not very good. It is also limited by the drawing environment. For example, during on-site inspections, it is not convenient to carry a notebook, and it is not convenient to conduct high-density inspections in multiple areas.
[0004] The Android system provides a dedicated graphics drawing library with more customization options, which can quickly and efficiently build maps with better display effects; Android smartphones are small in size, easy to operate and edit, and easy to use and carry, and can upload and synchronize data with WiFi or mobile networks.
[0005] However, directly using the Android system for graph drawing usually has the following problems:
[0006] The existing Android system does not provide a corresponding graph control. Ultrasound data can only be displayed directly at the sampling point. Furthermore, due to the limited screen size of mobile devices, the displayed sampling point data cannot be fully displayed on one screen. This method is not intuitive for field users and increases the difficulty of data analysis. Summary of the Invention
[0007] In view of the above-mentioned deficiencies in the prior art, the present invention provides an Android-based map drawing method, system, device and medium.
[0008] According to one aspect of the present invention, a method for drawing a graph based on Android is provided, comprising:
[0009] Obtaining an original time-domain sampling signal from a sensor, and converting the original time-domain sampling signal into fixed-length sampling points;
[0010] According to the set sampling threshold, the fixed-length sampling point array is filtered to obtain the filtered sampling point array and the sequence number array corresponding to the sampling points;
[0011] Processing the sequence number array corresponding to the sampling points to obtain an interval array of the sampling points;
[0012] The sampling point array and the interval array are sent to a graphics drawing library file of an Android system, and a graph is drawn using the graphics drawing library file.
[0013] Preferably, the sampling duration of the original time domain sampling signal is 1 second.
[0014] Preferably, converting the original time domain sampling signal into fixed-length sampling points includes:
[0015] The original time domain sampling signal is converted into a plurality of data sampling point arrays with the same interval duration.
[0016] Preferably, filtering the fixed-length sampling point array according to the set sampling threshold to obtain the filtered sampling point array and the sequence number array corresponding to the sampling points includes:
[0017] According to the set sampling threshold, the sampling point data is filtered once to obtain the processed standard data point array. The array length is set according to the actual processing interface;
[0018] While filtering, the serial numbers of the corresponding sampling point data that meet the sampling threshold are recorded and placed in the serial number array.
[0019] Preferably, the sequence number array corresponding to the sampling points is processed to obtain an interval array of the sampling points, including:
[0020] Process the sequence number array, starting from the second digit, subtract the previous digit from the next digit to obtain the interval of the current sampling point;
[0021] The first digit interval is set to 0 by default to obtain the interval array of sampling points.
[0022] Preferably, the lengths of the sampling point array and the interval array are consistent, wherein the sampling point array corresponds to the Y-axis of the spectrum, and the interval array corresponds to the X-axis of the spectrum.
[0023] Preferably, the step of sending the sampling point array and the interval array to a graphics drawing library file of an Android system and drawing a graph using the graphics drawing library file comprises:
[0024] The graphics drawing library file is a graphics library file; the graphics library file draws a graph through the Canvas class; wherein:
[0025] Customize the SufaceView view;
[0026] In the SufaceView view, the maximum value in the sampling point array is taken out, and the Y-axis coordinate corresponding to the point in the spectrum is obtained through the formula (sampling point value / maximum value)×y-axis distance; the X-axis coordinate in the spectrum is obtained through the formula (interval / 80)×x-axis distance.
[0027] Preferably, the method further comprises:
[0028] The drawn map is displayed on the screen of a smart mobile terminal running the Android system.
[0029] According to another aspect of the present invention, there is provided an Android-based map drawing system, comprising:
[0030] A signal acquisition module, which acquires the original time domain sampling signal from the sensor and converts the original time domain sampling signal into fixed-length sampling points;
[0031] A sampling point filtering module, which filters a fixed-length sampling point array according to a set sampling threshold, and obtains a filtered sampling point array and a sequence number array corresponding to the sampling points;
[0032] an interval calculation module, which processes the sequence number array corresponding to the sampling points to obtain an interval array of the sampling points;
[0033] The atlas drawing module is based on the graphics drawing library file of the Android system, and sends the sampling point array and the interval array to the graphics drawing library file of the Android system, and draws the atlas through the graphics drawing library file.
[0034] According to a third aspect of the present invention, a smart mobile device running an Android system is provided, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor can be used to execute any of the above-described methods or to run the above-described system when executing the program.
[0035] According to a fourth aspect of the present invention, a readable storage medium is provided, on which a program is stored. When the program is executed by a processor, it can be used to execute any of the above-mentioned methods, or run the above-mentioned system.
[0036] Due to the adoption of the above technical solution, the present invention has at least one of the following beneficial effects compared with the prior art:
[0037] The Android-based map drawing method, system, device and medium provided by the present invention realize the data conversion and processing of the time domain signals collected by the sensor when using a smart mobile device with an Android system as a sensor signal processing unit, and draw it into an intuitive and distinctive map for detection personnel to quickly conduct on-site analysis.
[0038] The Android-based mapping method, system, device, and medium provided by the present invention facilitate sensor data transmission without the need to carry too many devices. Data can be directly transmitted through an Android smart mobile device for data processing and mapping.
[0039] The Android-based atlas drawing method, system, device, and medium provided by the present invention have good atlas drawing effects, more obvious eigenvalues, and low sampling and data display delay rates.
[0040] The Android-based map drawing method, system, device and medium provided by the present invention are suitable for data preprocessing and map drawing of any sensor, and are particularly suitable for drawing flight maps.
[0041] The Android-based map drawing method, system, device and medium provided by the present invention convert one-dimensional data into two-dimensional data through directional processing of sampling points, and then convert it into a customized flight map that can intuitively reflect the changes in the state of ultrasonic data, helping on-site personnel to quickly locate the equipment being tested. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:
[0043] Figure 1 This is a workflow diagram of an Android-based graph drawing method in one embodiment of the present invention.
[0044] Figure 2 The figure is a workflow diagram of a graph drawing method based on Android in a specific application example of the present invention.
[0045] Figure 3 Schematic diagram of the components of an Android-based map drawing system in one embodiment of the present invention. DETAILED DESCRIPTION
[0046] The following is a detailed description of an embodiment of the present invention. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process. It should be noted that those skilled in the art may make various modifications and improvements without departing from the scope of the present invention, and these modifications and improvements fall within the scope of protection of the present invention.
[0047] Figure 1 A workflow diagram of an Android-based graph drawing method provided in one embodiment of the present invention.
[0048] like Figure 1 As shown, the Android-based map drawing method provided in this embodiment may include the following steps:
[0049] S100, obtaining the original time domain sampling signal of the sensor and converting the original time domain sampling signal into fixed-length sampling points;
[0050] S200, filtering a fixed-length sampling point array according to a set sampling threshold to obtain a filtered sampling point array and a sequence number array corresponding to the sampling points;
[0051] S300, processing the sequence number array corresponding to the sampling points to obtain an interval array of the sampling points;
[0052] S400: Send the sampling point array and the interval array to the graphics drawing library file of the Android system, and draw a graph through the graphics drawing library file.
[0053] In S100 of this embodiment, as a preferred embodiment, converting the original time domain sampling signal into fixed-length sampling points may include the following steps:
[0054] Convert the original time domain sampling signal into an array of multiple data sampling points with the same interval duration.
[0055] In a specific application example, the sampling duration of the original time-domain sampling signal is 1 second.
[0056] In a specific application example, the original time domain sampling signal is converted into an array of 3000 data sampling points with the same interval duration.
[0057] In S200 of this embodiment, as a preferred embodiment, filtering a fixed-length sampling point array according to a set sampling threshold to obtain a filtered sampling point array and a sequence number array corresponding to the sampling points may include the following steps:
[0058] S201, based on the set sampling threshold, the sampling point data is filtered to obtain a processed standard data point array, the array length is set according to the actual processing interface;
[0059] S202: While filtering, record the serial numbers of the corresponding sampling point data that meet the sampling threshold and place them in a serial number array.
[0060] In a specific application example of S202 of this embodiment, the original sampling point array before filtering is of fixed length (e.g.,
[3000] , corresponding to a sequence number range of 0-2999). The filtering threshold can range from [0, 80], with a value selected from this range based on the on-site sampling environment. Before filtering, two arrays are defined: a1 (the sampling point array) and a2 (the sampling point sequence number array). The original sampling array is traversed and compared with the threshold. Sampling points equal to or greater than the threshold are retained and placed in array a1. The original array sequence number corresponding to each point is recorded in array a2.
[0061] In S300 of this embodiment, as a preferred embodiment, processing the sequence number array corresponding to the sampling points to obtain the interval array of the sampling points may include the following steps:
[0062] S301, processing the sequence number array, starting from the second digit, using the last digit to subtract the previous digit to obtain the interval of the current sampling point;
[0063] S302, the first digit interval is recorded as 0 by default, and an interval array of sampling points is obtained.
[0064] In a preferred embodiment of this embodiment, the lengths of the sampling point array and the interval array are consistent, wherein the sampling point array corresponds to the Y axis of the spectrum and the interval array corresponds to the X axis of the spectrum.
[0065] In S400 of this embodiment, as a preferred embodiment, the sampling point array and the interval array are sent to the graphics drawing library file of the Android system, and the graph is drawn by the graphics drawing library file, which may include the following steps:
[0066] The graphics drawing library file is the graphics library file; the graphics library file draws the graph through the Canvas class; among them:
[0067] S401, customize the SufaceView view;
[0068] S402. In the SufaceView view, take out the maximum value in the sampling point array, and use the formula (sampling point value / maximum value)×y-axis distance to obtain the Y-axis coordinate corresponding to the point in the spectrum; use the formula (interval / 80)×x-axis distance to obtain the X-axis coordinate in the spectrum.
[0069] In a preferred embodiment of this embodiment, the method may further include the following steps:
[0070] S500, the drawn map is displayed on the screen of a smart mobile terminal running the Android system.
[0071] The technical solution provided by the above embodiment of the present invention is further described below with reference to a specific application example.
[0072] like Figure 2 FIG. 1 is a flowchart of a method for drawing a map based on Android according to a specific application example of the present invention. The method for drawing a map based on Android according to the above embodiment of the present invention is used to draw a flight map.
[0073] The Android-based flight chart drawing method in this specific application example includes the following steps:
[0074] The Android system receives the raw, one-second time-domain sampling signal from the ultrasonic sensor and converts it into fixed-length sampling points. Based on a set sampling threshold, the fixed-length sampling point array is filtered to obtain a filtered sampling point array and an array of sampling point sequence numbers. The array of sampling point sequence numbers is then processed to obtain an array of sampling point intervals. After data preprocessing, the data is fed into the map drawing process, which uses the Android graphics library to draw a flight map on Canvas and display it on the phone screen.
[0075] The Android-based flight chart drawing method in this specific application example mainly includes the following two parts:
[0076] Data processing: The original time-domain signal acquired by ultrasound has a duration of 1 second and is converted into an array of 3000 data sampling points with the same interval duration. Based on the set sampling point threshold, the sampling point data is filtered once to obtain a processed standard data point array. The array length is set according to the actual processing interface. During the filtering process, the serial numbers corresponding to the sampling points that meet the threshold are recorded and placed in the serial number array. The serial number array is processed, starting from the second digit, and the next digit is subtracted from the previous digit to obtain the current sampling point interval. The first digit interval is defaulted to 0, and the final sampling point interval array is obtained.
[0077] Chart drawing: After data processing, the sampling point array and the interval array will be obtained. The length of these two arrays is the same. The sampling point array corresponds to the Y-axis of the flight chart, and the interval array corresponds to the X-axis of the flight chart. Chart drawing uses the relevant APIs of the graphic library that comes with the Android system to draw, and customizes the SufaceView view to implement the code logic of the flight chart internally. Y-axis: Take the maximum value in the sampling point array and use the formula (sampling point value / maximum value)*y-axis distance to get the Y-axis coordinate corresponding to the midpoint of the flight chart; X-axis: Use the formula (interval / 80)*x-axis distance to get the X-axis coordinate of the flight chart.
[0078] Figure 3 A schematic diagram of the components of an Android-based map drawing system provided in one embodiment of the present invention.
[0079] like Figure 3 As shown, the Android-based map drawing system provided in this embodiment may include the following modules:
[0080] A signal acquisition module, which acquires the original time domain sampling signal from the sensor and converts the original time domain sampling signal into fixed-length sampling points;
[0081] A sampling point filtering module, which filters a fixed-length sampling point array according to a set sampling threshold, and obtains a filtered sampling point array and a sequence number array corresponding to the sampling points;
[0082] An interval calculation module processes the sequence number array corresponding to the sampling points to obtain an interval array of the sampling points;
[0083] The atlas drawing module is based on the graphics drawing library file of the Android system. The module sends the sampling point array and the interval array to the graphics drawing library file of the Android system, and draws the atlas through the graphics drawing library file.
[0084] It should be noted that the steps in the method provided by the present invention can be implemented using corresponding modules, devices, units, etc. in the system. Those skilled in the art can refer to the technical solution of the method to implement the composition of the system, that is, the embodiments in the method can be understood as preferred examples of constructing the system, which will not be elaborated here.
[0085] An embodiment of the present invention provides an intelligent mobile device running an Android system, including a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, it can be used to execute any method of the above-mentioned embodiments of the present invention, or to run any system of the above-mentioned embodiments of the present invention.
[0086] An embodiment of the present invention further provides a readable storage medium having a program stored thereon. When the program is executed by a processor, it can be used to execute any method of the above embodiments of the present invention, or to run any system of the above embodiments of the present invention.
[0087] Optionally, the memory is used to store programs; the memory may include volatile memory (English: volatile memory), such as random-access memory (English: random-access memory, abbreviated: RAM), such as static random-access memory (English: static random-access memory, abbreviated: SRAM), double data rate synchronous dynamic random access memory (English: Double Data Rate Synchronous Dynamic Random Access Memory, abbreviated: DDR SDRAM), etc.; the memory may also include non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory). The memory is used to store programs (such as applications, functional modules, etc. that implement the above-mentioned methods), instructions, etc., and the above-mentioned programs, instructions, etc. can be partitioned and stored in one or more memories. And the above-mentioned programs, instructions, data, etc. can be called by the processor.
[0088] The above programs, instructions, etc. can be stored in one or more memories in partitions, and the above programs, instructions, data, etc. can be called by a processor.
[0089] The processor is configured to execute the program stored in the memory to implement the various steps of the method involved in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0090] The processor and memory can be independent structures or integrated structures. When the processor and memory are independent structures, the memory and processor can be coupled via a bus.
[0091] The Android-based map drawing method, system, device and medium provided by the above embodiments of the present invention use SurfaceView for map drawing, so the map supports synchronous data update and asynchronous refresh of the map interface, while reducing the delay between data update and map update.
[0092] The Android-based map drawing method, system, device and medium provided by the above embodiments of the present invention realize the data conversion and processing of the time domain signal collected by the sensor when using a smart mobile device with an Android system as a sensor signal processing unit, and draw it into an intuitive and feature-clear map for the detection personnel to quickly conduct on-site analysis; the sensor data transmission is convenient, and there is no need to carry too many devices. The data can be directly transmitted through the Android smart mobile device for data processing and map drawing; the map drawing effect is good, the characteristic values are more obvious, and the sampling and data display delay rate is low; it is suitable for data preprocessing and map drawing of any sensor, and is particularly suitable for drawing flight maps.
[0093] Matters not mentioned in the above embodiments of the present invention are well known in the art.
[0094] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art may make various variations or modifications within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. A method for drawing a map based on Android, characterized in that: include: Obtaining an original time-domain sampling signal from a sensor, and converting the original time-domain sampling signal into fixed-length sampling points; According to the set sampling threshold, filter the fixed-length sampling point array to obtain the filtered sampling point array and the sequence number array corresponding to the sampling points; where: According to the set sampling threshold, the sampling point data is filtered once to obtain the processed standard data point array. The array length is set according to the actual processing interface; While filtering, the serial numbers of the corresponding sampling point data that meet the sampling threshold are recorded and placed in the serial number array; The sequence number array corresponding to the sampling points is processed to obtain an interval array of the sampling points; wherein: Process the sequence number array, starting from the second digit, subtract the previous digit from the next digit to obtain the interval of the current sampling point; The first digit interval is set to 0 by default, and the interval array of the sampling points is obtained; The sampling point array and the interval array are sent to a graphics drawing library file of an Android system, and a graph is drawn using the graphics drawing library file.
2. The Android-based atlas drawing method according to claim 1, characterized in that: The sampling duration of the original time domain sampling signal is 1 second; and / or The converting the original time domain sampling signal into fixed-length sampling points includes: The original time domain sampling signal is converted into a plurality of data sampling point arrays with the same interval duration.
3. The Android-based atlas drawing method according to claim 1, characterized in that: The lengths of the sampling point array and the interval array are consistent, wherein the sampling point array corresponds to the Y axis of the spectrum, and the interval array corresponds to the X axis of the spectrum.
4. The Android-based atlas drawing method according to claim 3, characterized in that: The step of sending the sampling point array and the interval array into a graphics drawing library file of an Android system and drawing a graph through the graphics drawing library file includes: The graphics drawing library file is a graphics library file; the graphics library file draws a graph through the Canvas class; wherein: Customize the SufaceView view; In the SufaceView view, the maximum value in the sampling point array is taken out, and the Y-axis coordinate corresponding to the point in the spectrum is obtained through the formula (sampling point value / maximum value)×y-axis distance; the X-axis coordinate in the spectrum is obtained through the formula (interval / 80)×x-axis distance.
5. The Android-based graph drawing method according to any one of claims 1 to 4, characterized in that: Also includes: The drawn map is displayed on the screen of a smart mobile terminal running the Android system.
6. An Android-based map drawing system, characterized in that: include: A signal acquisition module, which acquires the original time domain sampling signal from the sensor and converts the original time domain sampling signal into fixed-length sampling points; The sampling point filtering module filters the fixed-length sampling point array according to the set sampling threshold to obtain the filtered sampling point array and the sequence number array corresponding to the sampling points; wherein: According to the set sampling threshold, the sampling point data is filtered once to obtain the processed standard data point array. The array length is set according to the actual processing interface; While filtering, the serial numbers of the corresponding sampling point data that meet the sampling threshold are recorded and placed in the serial number array; An interval calculation module processes the sequence number array corresponding to the sampling points to obtain an interval array of the sampling points; wherein: Process the sequence number array, starting from the second digit, subtract the previous digit from the next digit to obtain the interval of the current sampling point; The first digit interval is set to 0 by default, and the interval array of the sampling points is obtained; The atlas drawing module is based on the graphics drawing library file of the Android system, and sends the sampling point array and the interval array to the graphics drawing library file of the Android system, and draws the atlas through the graphics drawing library file.
7. A smart mobile device running an Android system, comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, it can be used to perform the method according to any one of claims 1 to 5, or run the system according to claim 6.
8. A readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, it can be used to perform the method according to any one of claims 1 to 5, or to run the system according to claim 6.
Citation Information
Patent Citations
Virtual type mechanical fault diagnosing instrument and method
CN103558048A