Data processing method and device, electronic equipment and storage medium
By generating images in the database, the problems of slowing graphics generation speed and server crashes in large numbers of graphics generation and display tasks are solved, and more efficient image generation and better user experience are achieved.
Patent Information
- Application Number
- CN202411579245.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-21
AI Technical Summary
When handling large numbers of graphics generation and display tasks, the existing technology causes graphics generation to slow down, and may even lead to front-end or server crashes, seriously affecting the user experience.
By receiving an image generation request in the database, querying the target data according to the request parameters and generating the target image, the image generation is submerged to the database to complete, avoiding the transmission of a large amount of data between the database and the server and the client.
Reduces pressure on the server and/or front-end, improves the speed of image generation, and improves the user experience.
Smart Images

Figure CN119669502A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for data processing. Background Art
[0002] Generating and displaying corresponding graphics based on data in a database is a commonly used computer interaction method in all walks of life.
[0003] In the related art, the technical solutions for generating and displaying corresponding graphics are usually divided into server-side implementation or front-end implementation. First, the server connected to the database will query the original data from the database through SQL (Structured Query Language) according to the user's request. Then, if the technical solution implemented on the server side is adopted, the server will generate the corresponding graphics based on the original data and send the generated graphics to the front end for display; if the technical solution implemented on the front end is adopted, the server will forward the original data to the front end, and the front end will dynamically render and generate and display the corresponding graphics.
[0004] For tasks of generating and displaying a large number of graphics, adopting the technical solutions in related technologies will greatly slow down the speed of graphics generation and may even cause the front end or server to crash, seriously affecting the user experience. Summary of the invention
[0005] The purpose of the embodiments of the present disclosure is to provide a data processing method, device, electronic device and storage medium.
[0006] To solve the above technical problems, the embodiments of the present disclosure are implemented through the following aspects.
[0007] According to a first aspect of an embodiment of the present disclosure, a method for data processing is provided, which is applied to a database, and the method comprises: receiving an image generation request, wherein the image generation request comprises image generation request parameters; according to the image generation request parameters, querying target data from the database, and generating a target image corresponding to the target data.
[0008] According to a second aspect of an embodiment of the present disclosure, a method for data processing is provided, which is applied to a server, and the method includes: sending an image generation request, wherein the image generation request includes image generation request parameters, so that the database queries target data from the database according to the image generation request parameters, and generates a target image corresponding to the target data.
[0009] According to a third aspect of an embodiment of the present disclosure, there is provided a data processing device, which is applied to a database, and the device includes: a receiving module, which is used to receive an image generation request, wherein the image generation request includes image generation request parameters; and a generating module, which is used to query target data from the database according to the image generation request parameters, and generate a target image corresponding to the target data.
[0010] According to a fourth aspect of an embodiment of the present disclosure, a data processing device is provided, which is applied to a server, and the device includes: a sending module, which is used to send an image generation request, and the image generation request includes image generation request parameters, so that the database queries target data from the database according to the image generation request parameters, and generates a target image corresponding to the target data.
[0011] According to a fifth aspect of an embodiment of the present disclosure, a database is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the data processing method described in the first aspect when executed by the processor.
[0012] According to the sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program implements the data processing method described in the second aspect when executed by the processor.
[0013] According to a seventh aspect of an embodiment of the present disclosure, a server is provided, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for data processing as described in the first aspect is implemented, or when the computer program is executed by the processor, the method for data processing as described in the second aspect is implemented.
[0014] By adopting the above technical solution, the database queries the target data from the database according to the image generation request parameters, and generates the target image corresponding to the target data. The target image generated according to the queried target data is sunk to the database, thereby avoiding the transmission of a large amount of target data between the database and the server and the client, reducing the pressure on the server and / or the front end, increasing the speed of image generation, and improving the user experience.
[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
[0016] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, 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 recorded in the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0018] Figure 1 A schematic diagram showing a flow chart of a data processing method provided by an embodiment of the present disclosure; Figure 2 Another flowchart diagram showing the data processing method provided by the embodiment of the present disclosure; Figure 3 Another flowchart of the data processing method provided by the embodiment of the present disclosure is shown; Figure 4 Another flowchart of the data processing method provided by the embodiment of the present disclosure is shown; Figure 5 Another flowchart of the data processing method provided by the embodiment of the present disclosure is shown; Figure 6 Another flowchart of the data processing method provided by the embodiment of the present disclosure is shown; Figure 7 A block diagram showing a data processing device provided by an embodiment of the present disclosure; Figure 8 A block diagram showing another data processing device provided by an embodiment of the present disclosure; Fig. 9 A block diagram showing another data processing device provided by an embodiment of the present disclosure; Fig.10 A block diagram showing another data processing device provided by an embodiment of the present disclosure; Fig.11 A schematic diagram of the hardware structure of an electronic device for executing the data processing method provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the technical solutions in the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present disclosure.
[0020] Taking the alarm event heat map as an example, the following two technical solutions are commonly used in related technologies: 1. Calculate the alarm heat map based on Geo server Geo server is an open source geospatial data server software. Geo server provides heat map calculation function. Its heat map calculation is based on the heat map algorithm provided by Geo Tools library. The heat map uses point layer as data source, which can be Shapefile, PostGIS, etc.
[0021] The Geo server heat map function is a server-based heat map implementation with the following obvious disadvantages: 1) The original alarm data is transmitted from the data source to the server. When the data volume is large, there is a lot of network overhead.
[0022] 2) The heat map is implemented on the Geo server. The original alarm data will occupy a large amount of memory on the server. The heat map calculation is relatively complex and requires higher CPU resources. Therefore, it has higher requirements on the server resources and performance of the Geo server.
[0023] 2. Calculate the alarm heat map based on Open Layers Open Layers is an open source front-end map visualization library that can visualize geographic data in various formats. Open Layers provides a Heatmap layer for visualizing point data.
[0024] The Open Layers heat map function is a front-end-based heat map implementation with the following obvious disadvantages: 1) The original alarm data is transmitted from the database to the server, and then from the server to the front end. When the amount of data is large, there is a lot of network overhead.
[0025] 2) The heat map is calculated using the Open Layers library, that is, the calculation is performed inside the client browser. When the amount of data is large, it will occupy a large amount of client memory, CPU, and GPU resources, and the heat map may not be displayed normally, and may even cause the client memory to run out.
[0026] It should be noted that although the disclosure is described in terms of generating an alarm heat map, the data processing method provided in the embodiments of the disclosure can also be applied to different scenarios of generating corresponding graphics based on target data queried in a database, and can be used to generate different graphics, including but not limited to histograms, bar graphs, scatter plots, bubble graphs, radar graphs, pie charts, box graphs, waterfall graphs, funnel graphs, surface graphs, area graphs, etc., and any combination of different graphics can also be generated. The disclosure does not limit this.
[0027] The database in the present disclosure may be a stand-alone database, or a cloud database or a database cluster, and the present disclosure does not impose any restrictions on this.
[0028] Figure 1 A flow chart of a data processing method provided by an embodiment of the present disclosure is shown, and the method is applied to a database, such as Figure 1 As shown, the method may include the following steps: In step S101 , an image generation request is received.
[0029] The image generation request includes image generation request parameters.
[0030] In some possible implementations, the SQL language may be improved, and the server may send an image generation request to the database through the improved SQL language, and the corresponding database may receive the image generation request through the improved SQL language.
[0031] In some embodiments, the image generation request parameter includes an image generation indication, which can be used to instruct the database to generate at least one corresponding target image and can further indicate the image type of the at least one target image generated by the database.
[0032] In some embodiments, the image generation request parameter may further include at least one of the following: Data query condition parameters; Image control parameters; Generate mission control parameters.
[0033] The data query condition parameter may be used to instruct the database to determine target data that satisfies the data query condition parameter, so as to generate a corresponding target image according to the target data that satisfies the data query condition parameter. It is understandable that the data query condition parameter may not be mandatory, for example, the database may also use all data in at least one preset data table as target data and generate a corresponding target image.
[0034] The image control parameters may be used to indicate the parameters required by the database when generating the target image, such as image rendering parameters, so that the database can flexibly render according to the image rendering parameters in the process of generating the target image. It is understandable that the image control parameters may not be mandatory, for example, the database may also render according to preset image rendering parameters in the process of generating the target image.
[0035] The generation task control parameter can be used to indicate at least one of the triggering conditions, generation time, generation cycle, and post-generation feedback strategy for the database to generate the target image, so that the target image can be generated and / or fed back in a more flexible manner. For example, the database can automatically generate the target image when the specified triggering condition is met (for example, the number in the corresponding data table is greater than the number threshold), can automatically generate the target image at the specified generation time, can also generate the target image according to the specified generation cycle, and can also actively or in response to the query request according to the specified post-generation feedback strategy Feedback generated target image. It can be understood that the image control parameter may not be mandatory.
[0036] The image generation request parameters may include multiple items of data query condition parameters, image control parameters, and generation task control parameters, thereby more flexibly controlling the generation of a target image from a database.
[0037] In step S102, target data is queried from a database according to image generation request parameters, and a target image corresponding to the target data is generated.
[0038] In some embodiments, the database may query the target data from the database according to the image generation request parameters, and may generate a target image corresponding to the target data based on the image generation indication and the target data in the image generation request parameters.
[0039] For example, the image generation instruction can be to generate a bar graph, and the target data can be counted according to a preset or specified statistical method to obtain the statistical data, and a corresponding bar graph can be drawn based on the statistical data to generate a corresponding target image. For example, a target image in PNG format can be generated to facilitate storage through binary data.
[0040] For another example, the image generation instruction may be to generate a scatter plot, and the corresponding scatter plot may be drawn according to a preset or specified scatter plot field.
[0041] In some embodiments, the database may query the target data from the database according to the image generation request parameters, and may generate a target image corresponding to the target data based on the image generation instruction and the target data in the image generation request parameters in combination with at least one of the data query condition parameters, the image control parameters, and the generation task control parameters, thereby further improving the flexibility of generating the target image.
[0042] It can be understood that the image generation request parameters in the image generation request can be multiple groups, so that multiple target images can be generated through one image generation request. When the target data corresponding to multiple groups of image generation request parameters are the same, a target image including different graphic elements can also be generated, such as generating a combination of a bar chart and a line chart.
[0043] By adopting the above technical solution, the target image generated according to the queried target data is sunk into the database, thereby avoiding the transmission of a large amount of target data between the database and the server and the client, reducing the pressure on the server and / or the front end, increasing the speed of image generation, and improving the user experience.
[0044] Figure 2 Another flow chart of the data processing method provided by the embodiment of the present disclosure is shown as follows: Figure 2 As shown, after the database generates the target image corresponding to the target data, the database may further execute step S103 and / or step S104.
[0045] In step S103, an image generation response including the target image is sent.
[0046] In some possible implementations, the SQL language may be improved, and the database may send an image generation response to the server using the improved SQL language, wherein the target image may be included in the image generation response in the form of binary data and then sent.
[0047] In step S104, the target image is stored in a database, and in response to receiving an image query request for the target image, an image query response including the target image is sent.
[0048] After generating the target image corresponding to the target data, the database may also save the target image, and upon receiving an image query request for the target image, send an image query response including the target image, wherein the target image may be included in the image query response in the form of binary data and sent.
[0049] It is understandable that after generating the target image corresponding to the target data, the database may also save the target image while sending the image generation response including the target image, and send the image query response including the target image when receiving the image query request for the target image.
[0050] By adopting the above technical solution, the database can send the target image to the server in a flexible manner, so that the server can display the target image on the front end, further improving the flexibility of the target image display. Storing the target image in the database can further improve the reliability of the target image. When different servers use the same image generation request parameters to generate the target image, the saved target image can be directly fed back without repeatedly generating the target image, thereby reducing the pressure on database data processing.
[0051] Figure 3Another flow chart of the data processing method provided by the embodiment of the present disclosure is shown, the target image is an alarm event heat map, the image generation instruction is a heat map generation function, and the image control parameters include a heat map range parameter, a heat map grid parameter, and a heat map rendering parameter, such as Figure 3 As shown, step S102 may include the following steps.
[0052] In step S1021, target data is queried from the alarm data table according to the data query condition parameters.
[0053] The target data includes a plurality of alarm data satisfying the data query condition parameters.
[0054] For example, the alarm data table may be a data table storing alarm information, and the fields in the alarm data table may include the fields shown in Table 1 below. It is understandable that the alarm data table may further include other fields, and the present disclosure does not limit this.
[0055]
[0056] Table 1 In some embodiments, the image generation request parameters may include the parameters shown in Table 2 below.
[0057]
[0058] Table 2 In some possible implementations, SQL may be improved by embedding a heat map generation function in SQL, using the parameters in Table 2 as parameters of the heat map generation function, and sending an image generation request.
[0059] For example, the improved SQL statement is as follows: SELECT rast_heatmap( ROW (geom, level::double precision)::heatmapaggtype, 117.1, 117.2, 32.1, 32.2, 1024,768, '0% 43 121 186 0 20% 171 221 164 199 40% 255 255 191 199 60% 253 174 97 199 80% 215 25 28 199 ') FROM vm_warning_order_t WHERE type=1; Among them, rast_heatmap is the image generation instruction, that is, the heat map generation function, "ROW (geom, level::double precision)::heatmapaggtype" represents the point object field and the weight field are respectively associated with the geom field and the level field in the data table, "117.1, 117.2, 32.1, 32.2" are "left, right, lower, upper", that is, the coordinates of the heat map range, and "1024, 768" are "output_width, output_height", that is, the size of the heat map grid.
[0060] The last part of the rast_heatmap parameter is the rendering parameter, which is defined by a string. Any set of rendering parameters includes the sub-parameters shown in Table 3.
[0061]
[0062] Table 3 "vm_warning_order_t" is the name of the alarm data table. It is understandable that the data query condition parameters can also reuse the original SQL condition parameters, for example, "WHERE type=1" represents filtering the alarm data with the alarm type of 1 as the target data.
[0063] In some embodiments, the data may be queried from the alarm data table according to the improved SQL statement to obtain multiple alarm data that meet the data query condition parameters, as target data for generating an alarm event heat map.
[0064] In step S1022, a plurality of heat map grids within the heat map range are generated according to the heat map range parameters and the heat map grid parameters.
[0065] In some possible implementations, the resolution of the alarm event heat map may be determined by the following formula 1.
[0066] (Formula 1) in, is the grid resolution in the X-axis direction, that is, the number of pixels in the X-axis direction. is the grid resolution in the Y-axis direction, that is, the number of pixels in the Y-axis direction. , , , are the heat map range parameters in Table 2, , They are the heat map grid parameters in Table 2. After determining the resolution in the X-axis and Y-axis directions, the heat map includes * pixels.
[0067] In step S1023, multiple alarm data are associated with corresponding heat map grids according to the location information in the alarm data.
[0068] In some possible implementations, the row and column of the associated heat map grid may be determined according to the location information of each alarm data using the following formula 2.
[0069] (Formula 2) in, The number of columns of the grid corresponding to the i-th alarm event, is the number of rows of the grid corresponding to the i-th alarm event, and They are the grid resolution in the X-axis direction and the resolution in the Y-axis direction, and They are the heat map range parameters in the table respectively.
[0070] After determining the heat map grids to which the plurality of alarm data respectively correspond based on the position information in the alarm data, the alarm data may be associated with the corresponding heat map grids.
[0071] In step S1024, an alarm event heat map is generated according to the heat map grid and heat map rendering parameters after associating the alarm data.
[0072] After the alarm data is associated with the corresponding heat map grid, the alarm event heat map can be generated according to the number of alarm data associated with each heat map grid and\or the alarm weight (alarm level) combined with the heat map rendering parameters. For example, it can be rendered according to the number of alarm data associated with the heat map grid, or it can be rendered according to the highest alarm weight of the alarm data associated with the heat map grid. Of course, it can also be rendered in combination with the number of alarm data associated with the heat map grid and the alarm weight (for example, weighted summing the alarm data according to the weight).
[0073] By adopting the above technical solution, the target image generated according to the queried target data is sunk into the database, thereby avoiding the transmission of a large amount of target data between the database and the server and the client, reducing the pressure on the server and / or the front end, increasing the speed of image generation, and improving the user experience.
[0074] In some preferred embodiments, the alarm event heat map may be generated according to the heat map grid and heat map rendering parameters associated with the alarm data through the following steps.
[0075] Step 10: Determine the corresponding alarm thermal value based on the alarm data associated with each heat map grid.
[0076] In some embodiments, the image control parameters also include a window parameter Radius, and each heat map grid corresponds to a window defined by the window parameter, and the alarm data associated with the heat map grid is the alarm data within the window defined by the window parameter. The shape of the window can be a preset shape (such as a square or a circle). Taking the window square as an example, the window corresponding to a certain heat map grid is the heat map grid and a square window formed by extending Radius pixels to the left, right, up, and down from the heat map grid. Taking the window as a circle as an example, the window corresponding to a certain heat map grid is a circular window formed by the center coordinates of the heat map grid as a circle and a radius of Radius.
[0077] After determining the alarm data associated with each heat map grid (i.e., the alarm data in the window corresponding to the heat map grid), the heat map can be convolved by the kernel density function shown in the following formula three, so as to determine the alarm probability distribution value corresponding to each heat map grid according to the weight and position of the alarm data associated with each heat map grid.
[0078] (Formula 3) in, is the alarm probability distribution value (i.e., alarm thermal value) corresponding to the heat map grid, which is equivalent to the probability of an alarm at that location. is the window parameter Radius, n is the total number of alarms in the window corresponding to the heat map grid, is the alarm level corresponding to the i-th alarm data. In some possible implementations, the alarm level can be normalized, that is, the alarm level is transformed so that . is the Euclidean distance from the window center to the location information of the ith alarm, and the degree of influence of the alarm location on the current location. The closer the distance, the greater the influence of the alarm event on the current location.
[0079] In some embodiments, the alarm probability distribution value corresponding to each heat map grid can also be normalized to [0, L] according to the following formula 4 to obtain the alarm thermal value corresponding to each heat map grid, and the normalized alarm probability distribution value is used as the final alarm thermal value.
[0080] (Formula 4) in, is the normalized alarm thermal value, is the alarm probability distribution value obtained in formula 3, is the maximum density value in the heat map grid, is the minimum density value in the heat map grid, and L is a normalization parameter, such as 255.
[0081] Step 20: Render each heat map grid based on the heat map rendering parameters and the alarm thermal value corresponding to the heat map grid to obtain an alarm event heat map.
[0082] When rendering, the pixel values in the multiple groups of rendering parameters in the heat map rendering parameters can be binned according to the value range [0, L], and the target bin i corresponding to the heat map grid is determined according to the product of the alarm thermal value corresponding to the heat map grid and L+1, and the heat map grid can be rendered in color according to the corresponding (Ri, Gi, Bi, Ai).
[0083] By adopting the above technical solution, the alarm thermal value is calculated by convolution of each heat map grid using a window through the kernel density method, so as to further improve the visualization effect of the alarm event heat map.
[0084] Figure 4 Another flow chart of the data processing method provided by the embodiment of the present disclosure is shown as follows: Figure 4 As shown, the method includes the following steps.
[0085] In step 100, an image generation request is received.
[0086] In step 101, target data is queried from an alarm data table.
[0087] In some possible implementations, the target data may be queried according to the data query condition parameters in the image generation request.
[0088] In step 102, the alarm data is associated with the heat map grid.
[0089] In some possible implementations, the alarm data may be associated with the heat map grid according to the alarm location information in the target data.
[0090] In step 103, the associated data is cached.
[0091] When performing data association, the associated alarm data and the corresponding heat map grid can be cached in the database. In step 104, kernel density convolution is performed.
[0092] After all the alarm data in the target data are associated with the heat map grid, kernel density convolution calculation can be performed on the alarm data associated with each heat map grid through the window, and the alarm probability distribution value corresponding to each heat map grid can be determined according to the weight and position of the alarm data associated with each heat map grid.
[0093] In step 105, normalization is performed.
[0094] The alarm probability distribution value corresponding to each heat map grid can be normalized to obtain the alarm thermal value corresponding to each heat map grid.
[0095] In step 106, a heat map of the alarm event is rendered.
[0096] Each heat map grid in the heat map can be rendered according to the heat map rendering parameters in the image generation request and the alarm probability distribution value corresponding to each heat map grid to obtain the final alarm event heat map.
[0097] In step 107, the alarm event heat map format is converted.
[0098] In some possible implementations, the alarm event heat map may be converted into a PNG format to facilitate storage and / or transmission of the alarm event heat map.
[0099] By adopting the above technical solution, the target image generated according to the queried target data is sunk into the database, thereby avoiding the transmission of a large amount of target data between the database and the server and the client, reducing the pressure on the server and / or the front end, increasing the speed of image generation, and improving the user experience.
[0100] Figure 5 Another flow chart of the data processing method provided by the embodiment of the present disclosure is shown, which is applied to a server, such as Figure 5 As shown, the method may include the following steps.
[0101] In step S201, an image generation request is sent.
[0102] The image generation request includes image generation request parameters, so that the database queries the target data from the database according to the image generation request parameters, and generates a target image corresponding to the target data.
[0103] In some embodiments, the image generation request parameters include an image generation instruction and at least one of the following: Data query condition parameters; Image control parameters; Generate mission control parameters.
[0104] In some embodiments, the target image is an alarm event heat map, the image generation instruction is a heat map generation function, and the image control parameters include heat map range parameters, heat map grid parameters, and heat map rendering parameters.
[0105] The steps of the database generating request parameters according to the image, querying the target data from the database, and generating the target image corresponding to the target data can be found in the first aspect and will not be elaborated here.
[0106] By adopting the above technical solution, the server can send an image generation request to the database, and complete it by generating a target image based on the queried target data and sinking it to the database, thereby avoiding the transmission of a large amount of target data between the database and the server and the client, reducing the pressure on the server and / or front end, increasing the speed of image generation, and improving the user experience.
[0107] Figure 6 Another flow chart of the data processing method provided by the embodiment of the present disclosure is shown as follows: Figure 6 As shown, the server may also execute step S202 and / or step S203.
[0108] In step S202 , an image generation response including a target image is received.
[0109] In some embodiments, after generating the target image, the database may include the target image in an image generation response in the form of binary data and send the result. The server may receive the image generation response and obtain the target image.
[0110] In another embodiment, the server may also forward the target image to the front end so that the target image is displayed on the front end.
[0111] In step S203, an image query request for a target image is sent to a database, and an image query response including the target image is received.
[0112] In some embodiments, after the database generates the target image corresponding to the target data, the database may also save the target image. When the preset query conditions are met (for example, a preset query cycle is reached or a query request from the front end is received), the server may send an image query request for the target image to the database and receive an image query response including the target image. The server may also forward the target image to the front end so that the target image is displayed on the front end.
[0113] By adopting the above technical solution, the database can send the target image to the server in a flexible manner, thereby facilitating the server to display the target image on the front end, further improving the flexibility of the target image display.
[0114] Figure 7 A block diagram of a data processing device provided by an embodiment of the present disclosure is shown as follows: Figure 7 As shown, the device 200 applied to a database and data processing includes: The receiving module 210 is used to receive an image generation request, wherein the image generation request includes image generation request parameters; The generating module 220 is used to query the target data from the database according to the image generation request parameters, and generate the target image corresponding to the target data.
[0115] Optionally, the target image is a warning event heat map, the image generation instruction is a heat map generation function, the image control parameters include a heat map range parameter, a heat map grid parameter and a heat map rendering parameter, and the generation module 220 is further used to: Query target data from the alarm data table according to the data query condition parameters, where the target data includes multiple alarm data that meet the data query condition parameters; Generate a plurality of heat map grids within the heat map range according to the heat map range parameter and the heat map grid parameter; Associating multiple alarm data with corresponding heat map grids according to the location information in the alarm data; Generate an alarm event heat map based on the heat map grid and heat map rendering parameters after associating the alarm data.
[0116] Optionally, the generating module 220 is further configured to: Determine the corresponding alarm thermal value according to the alarm data associated with each heat map grid; Render each heat map grid based on the heat map rendering parameters and the alarm thermal value corresponding to the heat map grid to obtain the alarm event heat map.
[0117] Optionally, the image control parameters further include window parameters, and the alarm data associated with the heat map grid is the alarm data within the window defined by the window parameters. The generation module 220 is further used for: Determine the alarm probability distribution value corresponding to each heat map grid according to the weight and position of the alarm data associated with each heat map grid; The alarm probability distribution values corresponding to each heat map grid are normalized respectively to obtain the alarm thermal value corresponding to each heat map grid.
[0118] The device 200 provided in the embodiment of the present application can execute each method in the foregoing method embodiment and realize the functions and beneficial effects of each method in the foregoing method embodiment, which will not be repeated here.
[0119] Figure 8 A block diagram showing another data processing device provided by an embodiment of the present disclosure is shown as follows: Figure 8 As shown, the data processing device 200 also includes: The first processing module 230 is used to send an image generation response including a target image; and / or, save the target image in the database, and send an image query response including the target image when a preset sending condition is met.
[0120] The device 200 provided in the embodiment of the present application can execute each method in the foregoing method embodiment and realize the functions and beneficial effects of each method in the foregoing method embodiment, which will not be repeated here.
[0121] Fig. 9 A block diagram of another data processing device provided by an embodiment of the present disclosure is shown as follows: Fig. 9 As shown, the data processing device 300 applied to the server includes: The sending module 310 is used to send an image generation request, which includes image generation request parameters, so that the database queries the target data from the database according to the image generation request parameters and generates a target image corresponding to the target data.
[0122] The device 300 provided in the embodiment of the present application can execute each method in the foregoing method embodiment and realize the functions and beneficial effects of each method in the foregoing method embodiment, which will not be repeated here.
[0123] Fig.10 A block diagram of another data processing device provided by an embodiment of the present disclosure is shown as follows: Fig.10 As shown, the data processing device 300 also includes: The second processing module 320 is configured to receive an image generation response including a target image; and / or send an image query request for the target image to a database, and receive an image query response including the target image.
[0124] The device 300 provided in the embodiment of the present application can execute each method in the foregoing method embodiment and realize the functions and beneficial effects of each method in the foregoing method embodiment, which will not be repeated here.
[0125] Fig.11 FIG. 1 shows a schematic diagram of the structure of a server or a database provided in an embodiment of the present disclosure. The server or the database may be an electronic device, such as Fig.11 As shown, at the hardware level, the electronic device includes at least one processor, and optionally includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device may also include hardware required for other services.
[0126] The processor, network interface and memory can be interconnected through an internal bus, which can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0127] The memory stores the program. Specifically, the program may include a program code, and the program code includes at least one computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0128] At least one processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a device for locating the target user at the logical level. At least one processor executes the program stored in the memory and specifically performs: the method disclosed in the first aspect or the second aspect of the present disclosure and realizes the functions and beneficial effects of each method described in the method embodiment above, which will not be repeated here.
[0129] The method disclosed in the embodiment shown in the first aspect or the second aspect of the present disclosure can be applied to at least one processor, or implemented by at least one processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware or software instructions in at least one processor. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0130] The electronic device can also execute the methods described in the foregoing method embodiments, and realize the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be repeated here.
[0131] Of course, in addition to software implementation, the electronic device disclosed in the present invention does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0132] The embodiments of the present disclosure also propose a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by at least one processor, they implement the method disclosed in the embodiments shown in the present disclosure and realize the functions and beneficial effects of the various methods described in the previous method embodiments, which will not be repeated here.
[0133] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0134] Furthermore, the embodiments of the present disclosure also provide a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the following process is implemented: the method disclosed in the embodiments shown in the present disclosure and the functions and beneficial effects of the various methods described in the previous method embodiments are implemented, which will not be repeated here.
[0135] In short, the above is only a preferred embodiment of the present disclosure and does not limit the protection scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
[0136] The systems, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0137] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0138] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0139] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system 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.
Claims
1. A method for data processing, characterized in that: Applied to a database, the method comprises: receiving an image generation request, wherein the image generation request includes image generation request parameters; According to the image generation request parameters, target data is queried from the database, and a target image corresponding to the target data is generated.
2. The method according to claim 1, characterized in that The method further comprises at least one of the following: sending an image generation response including the target image; The target image is stored in the database, and in response to receiving an image query request for the target image, an image query response including the target image is sent.
3. The method according to claim 1, characterized in that The image generation request parameter includes an image generation instruction and at least one of the following: Data query condition parameters; Image control parameters; Generate mission control parameters.
4. The method according to claim 3, characterized in that The target image is a warning event heat map, the image generation instruction is a heat map generation function, the image control parameters include a heat map range parameter, a heat map grid parameter, and a heat map rendering parameter, and the target data is queried from the database according to the image generation request parameter, and a target image corresponding to the target data is generated, including: Querying the target data from the alarm data table according to the data query condition parameter, wherein the target data includes a plurality of alarm data satisfying the data query condition parameter; Generate a plurality of heat map grids within the heat map range according to the heat map range parameter and the heat map grid parameter; Associating the plurality of alarm data to corresponding heat map grids according to location information in the alarm data; The alarm event heat map is generated according to the heat map grid associated with the alarm data and the heat map rendering parameters.
5. The method according to claim 4, characterized in that The generating the alarm event heat map according to the heat map grid and the heat map rendering parameters after associating the alarm data includes: Determine the corresponding alarm thermal value according to the alarm data associated with each heat map grid; Each heat map grid is rendered based on the heat map rendering parameters and the alarm thermal value corresponding to the heat map grid to obtain the alarm event heat map.
6. The method according to claim 5, characterized in that The image control parameters also include window parameters, the alarm data associated with the heat map grid is the alarm data within the window defined by the window parameters, and the corresponding alarm thermal value is determined according to the alarm data associated with each heat map grid, including: Determine the alarm probability distribution value corresponding to each heat map grid according to the weight and position of the alarm data associated with each heat map grid; The alarm probability distribution values corresponding to each heat map grid are normalized respectively to obtain the alarm thermal value corresponding to each heat map grid.
7. A method of data processing, characterized in that: Applied to a server, the method comprises: An image generation request is sent, wherein the image generation request includes image generation request parameters, so that the database queries the target data from the database according to the image generation request parameters, and generates a target image corresponding to the target data.
8. The method according to claim 7, characterized in that The method further comprises at least one of the following: receiving an image generation response including the target image; An image query request for the target image is sent to the database, and an image query response including the target image is received.
9. The method according to claim 7, characterized in that: The image generation request parameter includes an image generation instruction and at least one of the following: Data query condition parameters; Image control parameters; Generate mission control parameters.
10. The method according to claim 9, characterized in that The target image is a heat map of an alarm event, the image generation instruction is a heat map generation function, and the image control parameters include a heat map range parameter, a heat map grid parameter, and a heat map rendering parameter.
11. A data processing device, characterized in that: Applied to a database, the device comprises: A receiving module, configured to receive an image generation request, wherein the image generation request includes image generation request parameters; A generating module is used to generate request parameters according to the image, query target data from the database, and generate a target image corresponding to the target data.
12. A data processing device, characterized in that: Applied to a server, the device comprises: The sending module is used to send an image generation request, wherein the image generation request includes image generation request parameters, so that the database queries the target data from the database according to the image generation request parameters, and generates a target image corresponding to the target data.
13. A database, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the data processing method according to any one of claims 1 to 6 when executed by the processor.
14. A server, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method for data processing according to any one of claims 7 to 10 is implemented.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the data processing method as claimed in any one of claims 1 to 6, or, when executed by a processor, implements the data processing method as claimed in any one of claims 7 to 10.