CN111125206A - Air pollutant data processing method and device - Google Patents

Air pollutant data processing method and device Download PDF

Info

Publication number
CN111125206A
CN111125206A CN201911368873.7A CN201911368873A CN111125206A CN 111125206 A CN111125206 A CN 111125206A CN 201911368873 A CN201911368873 A CN 201911368873A CN 111125206 A CN111125206 A CN 111125206A
Authority
CN
China
Prior art keywords
air pollutant
moment
pollutant data
stored
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911368873.7A
Other languages
Chinese (zh)
Other versions
CN111125206B (en
Inventor
刘亮
肖伟
康明
李必栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
3Clear Technology Co Ltd
Original Assignee
3Clear Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 3Clear Technology Co Ltd filed Critical 3Clear Technology Co Ltd
Priority to CN201911368873.7A priority Critical patent/CN111125206B/en
Publication of CN111125206A publication Critical patent/CN111125206A/en
Application granted granted Critical
Publication of CN111125206B publication Critical patent/CN111125206B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/5866Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Library & Information Science (AREA)
  • Remote Sensing (AREA)
  • Computational Linguistics (AREA)
  • Image Processing (AREA)

Abstract

The invention provides a method and a device for processing air pollutant data. The method comprises the following steps: the method comprises the steps that terminal equipment sends a data request to a server, the data request is used for requesting air pollutant data at a first moment, the server determines two pictures corresponding to a second moment related to the first moment and description information of the pictures corresponding to the second moment according to the data request, and the server sends a response message of the data request to the terminal equipment; the terminal equipment acquires air pollutant data of a plurality of places at two second moments according to the two pictures corresponding to the two second moments and the description information of the pictures corresponding to the two second moments; performing linear interpolation on the air pollutant data of the plurality of places at two second moments to obtain the air pollutant data of the plurality of places at the first moment; and drawing the air pollutant data of a plurality of places at a first moment to obtain an air pollutant distribution map at the first moment. The air pollutant distribution diagram at any moment is drawn.

Description

Air pollutant data processing method and device
Technical Field
The invention relates to the technical field of environmental processing, in particular to a method and a device for processing air pollutant data.
Background
Air pollution is a major component of environmental pollution and is affected by a number of factors, including weather conditions, different times of day, different days of the week, industrial activities, traffic intensity, etc. The air pollutants are monitored or predicted, and pollution prediction and prevention are carried out according to the monitoring or prediction result.
In the existing scheme, values of air pollutants at different places at different moments are monitored or predicted, the monitored or predicted values of the air pollutants are stored, an air pollutant distribution diagram is obtained according to the values of the air pollutants at the same moment and the positions, the air pollutant distribution diagram is further displayed and stored, and the air pollution distribution condition is intuitively reflected through the air pollutant distribution diagram.
However, in the prior art, the air pollutant profile can only be obtained at a specific time, which is usually separated by a long time, for example, only the whole hour of 24 hours. If the air pollution profile at a certain moment (e.g., not an entire hour) desired by the user does not belong to the specific moment, the air pollution profile at that moment cannot be provided to the user. If the period is shortened, the amount of data to be acquired is huge and the cost is too high.
Disclosure of Invention
The invention provides a method and a device for processing air pollutant data, which are used for solving the problem that the air pollutant data at any moment cannot be acquired in the existing scheme, so that an air pollutant distribution map at any moment cannot be displayed.
In a first aspect, the present invention provides a method for processing air pollutant data, including:
the method comprises the steps that a terminal device sends a data request to a server, wherein the data request is used for requesting air pollutant data at a first moment;
the terminal device receives a response message of a data request sent by the server, where the response message of the data request includes two pictures corresponding to second time associated with the first time and description information of the two pictures corresponding to the second time, where the pictures corresponding to the second time store stored values corresponding to air pollutant data of multiple places, where each pixel point in the pictures corresponding to the second time is used to store a stored value corresponding to air pollutant data of one place at two or four times, where each pixel point in the pictures includes R, G, B, A four channels, and each channel is used to store a stored value corresponding to air pollutant data of one time, or two channels are used to store a stored value corresponding to air pollutant data of one time; the first moment is any moment between the two second moments, and the pictures corresponding to the two second moments are one picture or two pictures;
the terminal equipment acquires air pollutant data of the plurality of places at the two second moments according to the two pictures corresponding to the two second moments and the description information of the pictures corresponding to the two second moments;
the terminal equipment performs linear interpolation on the air pollutant data of the plurality of places at the two second moments to obtain the air pollutant data of the plurality of places at the first moment;
and the terminal equipment draws the air pollutant data of the plurality of places at the first moment to obtain an air pollutant distribution map at the first moment.
Optionally, the description information of the picture corresponding to the second time includes: the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
the method for acquiring the air pollutant data of the multiple places at the two second moments by the terminal equipment according to the two pictures corresponding to the two second moments and the description information of the two pictures corresponding to the two second moments includes:
the terminal equipment obtains the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment;
determining that the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored in a single channel according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
when the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting a single channel, calculating the air pollutant data of the plurality of places at the second moment pixel by pixel according to the following formula:
Figure BDA0002339151890000031
wherein V is air pollutant data of the plurality of sites at the second time, V1The value of the air pollutant data stored in the picture corresponding to the second moment is stored, Max is the maximum value of the value range of the air pollutant data stored in the picture corresponding to the second moment, and Min is the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment.
Optionally, the description information of the picture corresponding to the second time includes: the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
the method for acquiring the air pollutant data of the multiple places at the two second moments by the terminal equipment according to the two pictures corresponding to the two second moments and the description information of the two pictures corresponding to the two second moments includes:
the terminal equipment obtains the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment;
determining that the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
when the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels, calculating the air pollutant data of the plurality of places at the second moment pixel by pixel according to the following formula:
Figure BDA0002339151890000032
wherein V is air pollutant data of the plurality of sites at the second time, V21The stored value V of the air pollutant data stored in the picture corresponding to the second moment in the first channel22And the Max is the maximum value of the value range of the air pollutant data stored in the picture corresponding to the second moment, and Min is the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment.
Optionally, the drawing, by the terminal device, the air pollutant data of the multiple places at the first time to obtain an air pollutant distribution map at the first time includes:
the terminal equipment determines a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode;
the terminal equipment determines the air pollutant data at the first moment on the pixel points to be filled corresponding to the actual pixel points of the multiple places according to the air pollutant data of the multiple places at the first moment and the rendering mode;
and the terminal equipment renders the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain the air pollutant distribution map at the first moment.
Optionally, the method further includes:
the terminal equipment receives a scaling instruction of the air pollutant distribution map at the first moment;
reading air pollutant data of the plurality of places at the first moment according to the scaling instruction;
the terminal equipment determines a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode;
the terminal equipment determines the air pollutant data at the first moment on the pixel points to be filled corresponding to the actual pixel points of the multiple places according to the air pollutant data of the multiple places at the first moment and the rendering mode, wherein the pixel points to be filled corresponding to the actual pixel points are the pixel points to be filled after the air pollutant distribution diagram at the first moment is amplified according to the zooming instruction;
and the terminal equipment renders the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain an enlarged image corresponding to the air pollutant distribution diagram at the first moment.
Optionally, the description information of the picture further includes time and/or precision of the air pollutant data stored in the picture.
In a second aspect, the present invention provides a method for processing air pollutant data, including:
the method comprises the steps that a server receives a data request sent by a terminal device, wherein the data request is used for requesting air pollutant data at a first moment;
the server determines two pictures corresponding to the second time and description information of the pictures corresponding to the two second times, which are associated with the first time, according to the data request, wherein stored values corresponding to the air pollutant data of a plurality of places are stored in the picture corresponding to the second time, each pixel point in the picture corresponding to the second time is used for storing the stored value corresponding to the air pollutant data of one place at two or four times, each pixel point in the picture comprises R, G, B, A four channels, and each channel is used for storing the stored value corresponding to the air pollutant data of one time, or two channels are used for storing the stored value corresponding to the air pollutant data of one time; the first moment is any moment between the two second moments;
and the server sends a response message of a data request to the terminal equipment, wherein the response message of the data request comprises pictures corresponding to two second moments associated with the first moment and description information of the pictures corresponding to the two second moments.
Optionally, the description information of the picture is stored in the picture;
the description information of the picture comprises one or more of the following information: the time, precision, value range or channel combination of the air pollutant data stored in the picture.
Optionally, the description information of the picture is stored in a first row of pixel points in the picture;
and storing values corresponding to the air pollutant data of the plurality of places from the second row of pixel points in the picture.
Optionally, the stored values corresponding to the air pollutant data of one place at two or four moments are stored in the picture as the stored values corresponding to the air pollutant data of adjacent moments.
In a third aspect, the present invention provides an apparatus for processing air pollutant data, comprising:
a sending module, configured to send a data request, where the data request is used to request air pollutant data at a first time;
a receiving module, configured to receive a response message of a data request sent by the server, where the response message of the data request includes two pictures corresponding to the second time associated with the first time and description information of the pictures corresponding to the two second times, wherein the picture corresponding to the second moment is stored with stored values corresponding to air pollutant data of a plurality of places, wherein each pixel point in the picture corresponding to the second moment is used for storing a storage value corresponding to air pollutant data of one place at two or four moments, wherein each pixel point in the picture comprises R, G, B, A four channels, each channel is used for storing a storage value corresponding to air pollutant data at a moment, or the two channels are used for storing a storage value corresponding to the air pollutant data at one moment; the first moment is any moment between the two second moments, and the pictures corresponding to the two second moments are one picture or two pictures;
the acquisition module is used for acquiring the air pollutant data of the plurality of places at the two second moments according to the pictures corresponding to the two second moments and the description information of the pictures corresponding to the two second moments;
the linear difference module is used for performing linear interpolation on the air pollutant data of the plurality of places at the two second moments to obtain the air pollutant data of the plurality of places at the first moment;
and the drawing module is used for drawing the air pollutant data of the plurality of places at the first moment to obtain an air pollutant distribution map at the first moment.
Optionally, the description information of the picture corresponding to the second time includes: the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
the acquisition module is specifically configured to:
obtaining the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment;
determining that the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored in a single channel according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
when the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting a single channel, calculating the air pollutant data of the plurality of places at the second moment pixel by pixel according to the following formula:
Figure BDA0002339151890000061
wherein V is air pollutant data of the plurality of sites at the second time, V1The value of the air pollutant data stored in the picture corresponding to the second moment is stored, Max is the maximum value of the value range of the air pollutant data stored in the picture corresponding to the second moment, and Min is the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment.
Optionally, the description information of the picture corresponding to the second time includes: the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
the acquisition module is specifically configured to:
obtaining the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment;
determining that the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
when the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels, calculating the air pollutant data of the plurality of places at the second moment pixel by pixel according to the following formula:
Figure BDA0002339151890000071
wherein V is air pollutant data of the plurality of sites at the second time, V21The stored value V of the air pollutant data stored in the picture corresponding to the second moment in the first channel22And the Max is the maximum value of the value range of the air pollutant data stored in the picture corresponding to the second moment, and Min is the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment.
Optionally, the drawing module is specifically configured to:
determining a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode;
determining the air pollutant data of the first moment on a pixel point to be filled corresponding to an actual pixel point where the plurality of places are located according to the air pollutant data of the plurality of places at the first moment and the rendering mode;
and rendering the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain the air pollutant distribution map at the first moment.
Optionally, the method further includes:
the receiving module is further used for receiving a scaling instruction of the air pollutant distribution map at the first moment;
the reading module is used for reading the air pollutant data of the plurality of places at the first moment according to the zooming instruction;
the determining module is used for determining a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode;
determining the air pollutant data at the first moment on a pixel point to be filled corresponding to an actual pixel point where the plurality of places are located according to the air pollutant data at the first moment and the rendering mode, wherein the pixel point to be filled corresponding to the actual pixel point is a pixel point which needs to be filled after the air pollutant distribution diagram at the first moment is amplified according to the zooming instruction;
and the drawing module is further used for rendering the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain an enlarged image corresponding to the air pollutant distribution diagram at the first moment.
Optionally, the description information of the picture further includes time and/or precision of the air pollutant data stored in the picture.
In a fourth aspect, the present invention provides an apparatus for processing air pollutant data, comprising:
the terminal equipment comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a data request sent by the terminal equipment, and the data request is used for requesting air pollutant data at a first moment;
a determining module, configured to determine, according to the data request, two pictures corresponding to second time points associated with the first time point and description information of the two pictures corresponding to the second time points, where the picture corresponding to the second time point stores stored values corresponding to air pollutant data of multiple locations, where each pixel point in the picture corresponding to the second time point is used to store a stored value corresponding to air pollutant data of one location at two or four time points, where each pixel point in the picture includes R, G, B, A four channels, and each channel is used to store a stored value corresponding to air pollutant data of one time point, or two channels are used to store a stored value corresponding to air pollutant data of one time point; the first moment is any moment between the two second moments;
and the sending module is used for sending a response message of a data request to the terminal equipment, wherein the response message of the data request comprises two pictures corresponding to the two second moments associated with the first moment and description information of the two pictures corresponding to the two second moments.
Optionally, the description information of the picture is stored in the picture;
the description information of the picture comprises one or more of the following information: the time, precision, value range or channel combination of the air pollutant data stored in the picture.
Optionally, the description information of the picture is stored in a first row of pixel points in the picture;
and storing values corresponding to the air pollutant data of the plurality of places from the second row of pixel points in the picture.
Optionally, the stored values corresponding to the air pollutant data of one place at two or four moments are stored in the picture as the stored values corresponding to the air pollutant data of adjacent moments.
In a fifth aspect, the present invention provides a terminal device, including:
a processor, a memory and a transceiver, wherein the memory is used for storing instructions, the transceiver is used for communicating with other devices, and the processor is used for executing the instructions stored in the memory, so that the terminal device executes the processing method of the air pollutant data in the first aspect.
In a sixth aspect, the present invention provides a server, comprising:
a processor, a memory for storing instructions, and a transceiver for communicating with other devices, the processor being configured to execute the instructions stored in the memory to cause the server to perform the method of processing air contaminant data of the second aspect.
In a seventh aspect, the present invention provides a computer-readable storage medium, which is applied in a terminal device, and the computer-readable storage medium stores computer-executable instructions, which when executed by a processor, are used to implement the processing method of air pollutant data according to the first aspect.
In an eighth aspect, the present invention provides a computer-readable storage medium for use in a server, the computer-readable storage medium having stored thereon computer-executable instructions for implementing the method for processing air pollution data as described in the second aspect above when the computer-executable instructions are executed by a processor.
The method and the device for processing the air pollutant data send a data request to a server through terminal equipment, wherein the data request is used for requesting the air pollutant data at a first moment, the server determines pictures corresponding to two second moments and description information of the pictures corresponding to the two second moments, which are associated with the first moment, according to the data request, wherein the pictures corresponding to the second moments store stored values corresponding to the air pollutant data of a plurality of places, each pixel point in the pictures corresponding to the second moments is used for storing a stored value corresponding to the air pollutant data of one place at two or four moments, wherein each pixel point in the pictures comprises R, G, B, A four channels, each channel is used for storing a stored value corresponding to the air pollutant data at one moment, or two channels are used for storing a stored value corresponding to the air pollutant data at one moment, the first moment is any moment between the two second moments, and the pictures corresponding to the two second moments are one picture or two pictures; the server sends a response message of the data request to the terminal equipment; the terminal equipment acquires air pollutant data of a plurality of places at two second moments according to the two pictures corresponding to the two second moments and the description information of the pictures corresponding to the two second moments; performing linear interpolation on the air pollutant data of the plurality of places at two second moments to obtain the air pollutant data of the plurality of places at the first moment; and drawing the air pollutant data of a plurality of places at a first moment to obtain an air pollutant distribution map at the first moment. The stored value converted from the air pollutant data is stored in the picture, and the stored value can be converted into the air pollutant data after the picture is obtained, and the air pollutant data of a plurality of places at any moment can be obtained by using a linear interpolation method, so that the air pollutant distribution map at any moment can be drawn without storing a large amount of air pollutant data.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic view of the distribution of an air pollutant;
FIG. 2 is a schematic flow chart of a method for processing air pollutant data according to the present invention;
FIG. 3 is a schematic flow chart of another method for processing air pollutant data according to the present invention;
FIG. 4 is a schematic flow chart of another method for processing air pollutant data according to the present invention
FIG. 5 is an interactive schematic view of a method for processing air pollutant data according to the present invention;
FIG. 6 is a schematic structural diagram of an apparatus for processing air pollutant data according to the present invention;
FIG. 7 is a schematic structural diagram of another apparatus for processing air pollutant data according to the present invention;
fig. 8 is a schematic structural diagram of a terminal device provided in the present invention;
fig. 9 is a schematic structural diagram of a server according to the present invention.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terms to which the present invention relates will be explained first:
air pollutants: refers to a substance that causes air pollution by a mixture of gaseous, volatile, semi-volatile, and particulate substances, including: sulfur dioxide (SO)2) Nitrogen dioxide (NO)2) Inhalable Particles (PM)10) Fine Particulate Matter (PM)2.5) Carbon monoxide (CO), ozone (O)3) And the like.
Linear interpolation: it refers to an interpolation mode in which the interpolation function is a first-order polynomial. The geometric meaning of linear interpolation is that the outline graph approximates an original function by a straight line passing through two points. Linear interpolation can be used to approximate instead of primitive functions, or can be used to compute values that are not present in the table lookup process.
Fig. 1 is a schematic diagram of distribution of air pollutants, and an application scenario of the present invention is described below with reference to fig. 1.
Air pollution is a major component of environmental pollution and is affected by a number of factors, including weather conditions, different times of day, different days of the week, industrial activities, traffic intensity, etc. The method comprises the steps of monitoring or predicting values of air pollutants at different sites at different moments, and storing the monitored or predicted values of the air pollutants in a server in a form of pictures with color patterns being RGBA, wherein R (red), G (green), B (blue), A (alpha) four channels of each pixel point in the pictures are used for storing corresponding stored values of the air pollutant data at two or four moments of one site, and the A channel is generally used for representing the transparency and translucency of one picture. When the terminal equipment needs the air pollutant data of a plurality of places at any time, the server can determine a second time related to the first time according to the first time in the received request by sending a request to the server, the terminal equipment obtains the air pollutant data of any time by a linear interpolation method, and the air pollutant data of any time is drawn into an air pollutant distribution map by selecting a rendering mode and a color legend, so that the distribution condition of the air pollutants is visually displayed.
As shown in fig. 1, according to the stored values of the air pollutants of the fine particulate matters in the range of China at a certain moment, a distribution diagram of the air pollutants is drawn, wherein the values of the fine particulate matters corresponding to different colors are defined, and the distribution condition of the fine particulate matters can be visually displayed, so that the prediction and prevention of the fine particulate matter pollution can be performed according to the monitoring or prediction result.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 2 is a schematic flow chart of a method for processing air pollutant data according to the present invention, as shown in fig. 2, the method of this embodiment is executed by a terminal device, which may be a computer, a mobile phone, a tablet device, and the like, and the present invention is not limited thereto, and the method of this embodiment is as follows:
s201, the terminal device sends a data request to a server, wherein the data request is used for requesting air pollutant data at a first moment.
The server stores pictures of stored values corresponding to different types of air pollutant data of multiple places, wherein the numerical precision and the value range of the air pollutant data of different types are different, the numerical precision of the air pollutant data can be an integer or one decimal is reserved, and according to practical experience, the value range of the air pollutant data detected at present is as follows: greater than or equal to 0 and less than or equal to 3840. Therefore, when the type of the air pollutants is determined, the numerical precision and the value range of the air pollutants can be determined. In the RGBA color space combination, R represents Red (Red), G represents Green (Green) B represents Blue (Blue), and a represents Alpha (transparency), that is, there are R, G, B, A four channels of the picture defined by the RGBA color space, where each channel can store an integer greater than or equal to 0 and less than or equal to 255, and if any two channels in the RGBA color space are used to store data, an integer greater than or equal to 0 and less than or equal to 65535 can be stored.
For example, according to the value range of the air pollutant data, the air pollutant data can be converted into a single-channel storage value or a dual-channel storage value, the single-channel storage means that one channel can completely store the air pollutant data of one place at one moment, and the dual-channel storage means that two channels can completely store the air pollutant data of one place at one moment. For example, when the difference between the maximum value and the minimum value in the range of values of the air pollutant data is less than or equal to 255, the air pollutant data may be converted into a single-channel stored value; and when the difference value between the maximum value and the minimum value in the value range of the air pollutant data is larger than 255, converting the air pollutant data into two-channel stored values, storing the stored values corresponding to the air pollutant data of a plurality of places and the description information of the pictures in the pictures, and storing the pictures in the server.
Optionally, the description information of the picture includes: the value range of the air pollutant data and the channel combination mode.
S202, the terminal equipment receives a response message of the data request sent by the server, wherein the response message of the data request comprises two pictures corresponding to the second time associated with the first time and description information of the pictures corresponding to the second time.
The picture corresponding to the second moment stores stored values corresponding to air pollutant data of a plurality of places, wherein each pixel point in the picture corresponding to the second moment is used for storing a stored value corresponding to the air pollutant data of one place at two or four moments, each pixel point in the picture comprises R, G, B, A four channels, and each channel is used for storing a stored value corresponding to the air pollutant data of one moment, or two channels are used for storing a stored value corresponding to the air pollutant data of one moment; the first moment is any moment between the two second moments, and the picture corresponding to the two second moments is one picture or two pictures.
In this embodiment, after receiving a data request sent by a terminal device, a server determines, according to a first time in the data request, a picture that needs to be sent to the terminal device. Illustratively, when the first time is the time already stored in the stored pictures, the server sends the pictures stored at the first time to the terminal device; when the first time is not the stored time in the stored pictures, the server determines the pictures corresponding to two second times and the description information of the pictures corresponding to the two second times which are related to the first time, wherein the first time is any time between the two second times, for example, a time earlier than and closest to the first time among the times stored in the picture is determined, and two of the stored time instants in the pictures later than and closest to the first time instant are second time instants, each picture in the server may store stored values of air contaminant data for two or four time instants, it will be appreciated that the stored values corresponding to the two second moments in time may be stored on one picture, on both pictures, therefore, the server sends the acquired pictures corresponding to the two second moments to the terminal device.
Optionally, the description information of the picture further includes time and/or precision of the air pollutant data stored in the picture. The time and/or precision of the air pollutant data stored in the picture can be obtained through the description information of the picture.
And S203, the terminal equipment acquires air pollutant data of a plurality of places at two second moments according to the pictures corresponding to the two second moments and the description information of the pictures corresponding to the two second moments.
Illustratively, the description information of the picture corresponding to the second time includes: and the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment.
And the terminal equipment converts the stored values of the air pollutant data of the plurality of places at two second moments, which are stored in the picture corresponding to the second moment, into the air pollutant data of the plurality of places at the two second moments by analyzing the value range and the channel combination mode of the air pollutant data.
The terminal equipment obtains the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment; and determining whether the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored in a single channel or a double channel according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment.
When the storage value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting a single channel, calculating the air pollutant data of a plurality of places at the second moment pixel by pixel according to the following formula:
Figure BDA0002339151890000141
wherein V is the air pollutant data at the second moment, V1The value of the air pollutant data stored in the picture corresponding to the second moment is stored, Max is the maximum value of the value range of the air pollutant data stored in the picture corresponding to the second moment, and Min is the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment.
When the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels, calculating the air pollutant data of a plurality of places at the second moment pixel by pixel according to the following formula:
Figure BDA0002339151890000142
wherein V is the air pollutant data at the second moment, V21The stored value V of the air pollutant data stored in the picture corresponding to the second moment in the first channel22The value of the air pollutant data stored in the picture corresponding to the second moment in the second channel is shown as Max, the value of the air pollutant data stored in the picture corresponding to the second moment is shown as Max, and the value of the air pollutant data stored in the picture corresponding to the second moment is shown as Min.
And S204, the terminal equipment performs linear interpolation on the air pollutant data of the plurality of places at two second moments to obtain the air pollutant data of the plurality of places at the first moment.
Illustratively, when the first moment is a moment already stored in the stored pictures, the server sends the pictures stored at the first moment and description information of the pictures to the terminal device, and the terminal device obtains air pollutant data of a plurality of places at the first moment according to the pictures and the description information of the pictures; when the first time is not the stored time in the stored pictures, the server determines that the description information of two pictures corresponding to the second time and two pictures corresponding to the second time related to the first time is sent to the terminal device, the terminal device obtains air pollutant data of a plurality of places at the two second times according to the description information of the pictures corresponding to the two second times and the pictures corresponding to the two second times, the terminal device performs linear interpolation on the air pollutant data of the plurality of places at the two second times to obtain the air pollutant data of the plurality of places at the first time, and the air pollutant data of the plurality of places at the first time can be calculated pixel by pixel according to the following formula:
Figure BDA0002339151890000143
wherein i is a first time, ViIs the air pollutant data at a first time, m is the time earlier than the first time in two second times, VmIs the air pollutant data at time m, n is the time later than the first time of the two second times, VnIs the air pollutant data at time n.
S205, the terminal device draws air pollutant data of a plurality of places at a first moment to obtain an air pollutant distribution map at the first moment.
When the acquired air pollutant data of the plurality of places at the first moment do not need to be displayed in an enlarged manner, for example, when the size of a picture stored by the air pollutant data of the plurality of places at the first moment is 200 pixels × 200 pixels, and the size of an air pollutant distribution map at the first moment to be displayed is 200 pixels × 200 pixels or 100 pixels × 100 pixels, selecting a color legend, determining, by the terminal device, a used color legend according to the type of the air pollutant data, and rendering the air pollutant data of an actual pixel point at the first moment according to the corresponding relationship between the color legend and the air pollutant data to obtain the air pollutant distribution map at the first moment.
Wherein the color legend is pre-selected by the user, for example, to be used to plot a pollutant distribution map of the fine particulate matter, in one possible implementation, the fine particulate matter data may be defined as represented by green between 0 and 35 (RGBA values of 0, 228, 0, 1), yellow between 36 and 75 (RGBA values of 255, 255, 0, 1), orange between 76 and 115 (RGBA values of 255, 126, 0, 1), red between 116 and 250 (RGBA values of 255, 0, 0, 1), purple between 151 and 250 (RGBA values of 255, 0, 76, 1), and brown between 251 and 500 (RGBA values of 126, 0, 35, 1);
in another possible implementation, a transition color legend may be customized, where a transparent representation is used at 0 (RGBA values 0, 0, 0, 0), a green representation is used at 35 (RGBA values 0, 228, 0, 1), a yellow representation is used at 75 (RGBA values 255, 255, 0, 1), an orange representation is used at 115 (RGBA values 255, 126, 0, 1), a red representation is used at 150 (RGBA values 255, 0, 0, 1), a purple representation is used at 250 (RGBA values 153, 0, 76, 1), a brownish red representation is used at 500 (RGBA values 126, 0, 35, 1), and the color legend for the defined values not shown in the middle is a transition color between the colors of the two defined values.
When the acquired air pollutant data of a plurality of places at the first moment needs to be displayed in an enlarged mode, the method can be realized by the following steps:
and the terminal equipment determines a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode.
For example, the size of an image stored by air pollutant data of a plurality of places at a first moment is 200 pixels × 200 pixels, each pixel corresponds to the air pollutant data of one place at the first moment, when a user wants to use the image of 400 pixels × 400 pixels for display, 1 original pixel is equivalent to be expanded into 4 pixels, one of the 4 pixels can be used for taking the value of the original pixel, and the other 3 pixels have no value, wherein the linear interpolation mode is obtained by performing linear interpolation on two adjacent pixels with values around the pixel without value; the adjacent value-taking mode is that the pixel point without the value takes the value of a pixel point with the value adjacent to the pixel point without the value.
The rendering mode may be determined according to the type of the air contaminant, or may be selected by the user. For example, a linear interpolation mode can be selected for rendering air pollutants such as particulate matters, sulfur dioxide, nitrogen dioxide and ozone, and in a drawn picture, the air pollutant data of a plurality of places are in smooth transition; the rendering mode of the air primary pollutants can select an adjacent value-taking mode, and in the drawn picture, the air pollutant data of a plurality of places are in a block grid form.
And the terminal equipment determines the air pollutant data at the first moment on the pixel points to be filled corresponding to the actual pixel points where the multiple places are located according to the air pollutant data and the rendering mode of the multiple places at the first moment.
And the terminal equipment renders the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain an air pollutant distribution map at the first moment.
Through the selection to colour legend and rendering mode, can carry out the nimble selection according to the show demand of different air contaminant distributions, can demonstrate the air contaminant distribution map of different effects.
Optionally, the terminal device may include a Graphics Processing Unit (GPU for short), and when drawing, the terminal device may convert the air pollutant data into a texture picture required by rendering by the GPU, select a color legend and a rendering manner, and draw the air pollutant distribution map by using a GPU texture mapping manner. And the GPU is used for drawing an air pollutant distribution map, so that the drawing speed is high.
In this embodiment, the terminal device sends a data request to the server, where the data request is used to request air pollutant data at a first time, and the server determines, according to the data request, two pictures corresponding to a second time and description information of the two pictures corresponding to the second time, where the pictures corresponding to the first time are associated with each other, where the pictures corresponding to the second time store stored values corresponding to air pollutant data at multiple locations, and each pixel point in the pictures corresponding to the second time is used to store a stored value corresponding to air pollutant data at two or four times, where each pixel point in the pictures includes R, G, B, A four channels, each channel is used to store a stored value corresponding to air pollutant data at one time, or two channels are used to store a stored value corresponding to air pollutant data at one time, and the first time is any time between the two second times, the two pictures corresponding to the second moment are one picture or two pictures; the server sends a response message of the data request to the terminal equipment; the terminal equipment acquires air pollutant data of a plurality of places at two second moments according to the two pictures corresponding to the two second moments and the description information of the pictures corresponding to the two second moments; performing linear interpolation on the air pollutant data of the plurality of places at two second moments to obtain the air pollutant data of the plurality of places at the first moment; and drawing the air pollutant data of a plurality of places at a first moment to obtain an air pollutant distribution map at the first moment. The stored value converted from the air pollutant data is stored in the picture, and the stored value can be converted into the air pollutant data after the picture is obtained, and the air pollutant data of a plurality of places at any moment can be obtained by using a linear interpolation method, so that the air pollutant distribution map at any moment can be drawn without storing a large amount of air pollutant data.
Fig. 3 is a schematic flow chart of another method for processing air pollutant data according to the present invention, and fig. 3 is a flowchart of the method according to the embodiment shown in fig. 2, as shown in fig. 3, the method according to the embodiment further includes:
s206, the terminal equipment receives a scaling instruction of the air pollutant distribution map at the first moment.
The zooming instruction is input by a user, and the air pollutant distribution map is zoomed for a specific operation of the user to check more or global air pollutant distribution conditions.
And S207, reading air pollutant data of a plurality of places at a first moment according to the zooming instruction.
The air pollutant data of the plurality of sites at the first time is the data obtained in the step S204.
And S208, the terminal equipment determines a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode.
S209, the terminal equipment determines the air pollutant data of the first moment on the pixel point to be filled corresponding to the actual pixel point where the plurality of places are located according to the air pollutant data of the plurality of places at the first moment and the rendering mode.
And the pixel points to be filled corresponding to the actual pixel points are the pixel points to be filled after the air pollutant distribution diagram at the first moment is amplified according to the zooming instruction.
S210, the terminal device renders the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain the enlarged image corresponding to the air pollutant distribution diagram at the first moment.
When the zooming instruction is used for amplifying the air pollutant distribution map, a rendering mode of drawing is determined according to the type of the air pollutant data, after the image is amplified, the actual pixel points are pixel points which have the original pollutant data, the pixel points to be filled corresponding to the actual pixel points, namely the pixel points without values, take values according to the rendering mode, and then the air pollutant data at the first moment on the pixel to be filled corresponding to the actual pixel points and the actual pixel points are rendered according to the determined color legend.
In this embodiment, after the terminal device receives the scaling instruction for the air pollutant distribution map at the first time, the terminal device obtains the air pollutant data of the plurality of places at the first time, and renders the air pollutant data at the first time according to the determined rendering mode and the determined color legend, so that the rendering effect of the amplified air pollutant distribution map is achieved, and the quality of the air pollutant distribution map is ensured.
Optionally, the terminal device may obtain air pollutant data of a plurality of locations at a plurality of consecutive first times, render the air pollutant data of the plurality of locations at the plurality of consecutive first times, thereby obtaining air pollutant distribution maps at the plurality of consecutive times, and make an animation of the air pollutant distribution maps at the plurality of consecutive times according to a time sequence, so that a change process of the air pollutant distribution within a period of time can be visually demonstrated, and the data at any time can be obtained without jumping between the data, thereby increasing readability of the data.
Fig. 4 is a schematic flow chart of another method for processing air pollutant data according to the present invention, as shown in fig. 4, the method provided in this embodiment is executed by a server, and the method of this embodiment includes:
s401, the server receives a data request sent by the terminal device, wherein the data request is used for requesting air pollutant data at a first moment.
S402, the server determines the pictures corresponding to the two second moments associated with the first moment and the description information of the pictures corresponding to the two second moments according to the data request.
The picture corresponding to the second moment stores stored values corresponding to air pollutant data of a plurality of places, wherein each pixel point in the picture corresponding to the second moment is used for storing a stored value corresponding to the air pollutant data of one place at two or four moments, each pixel point in the picture comprises R, G, B, A four channels, and each channel is used for storing a stored value corresponding to the air pollutant data of one moment, or two channels are used for storing a stored value corresponding to the air pollutant data of one moment; the first moment is any moment between the two second moments;
s403, the server sends a response message of the data request to the terminal device, wherein the response message of the data request comprises two pictures corresponding to the second time associated with the first time and description information of the pictures corresponding to the second time.
Optionally, the description information of the picture is stored in the picture;
the description information of the picture includes one or more of the following information: the time, precision, value range or channel combination of the air pollutant data stored in the picture.
Optionally, the description information of the picture is stored in a first row of pixel points in the picture;
the stored values corresponding to the air pollutant data for the multiple locations are stored starting from the second row of pixel points in the picture.
Optionally, the stored values corresponding to the air pollutant data of one place at two or four moments are stored in the picture as the stored values corresponding to the air pollutant data of adjacent moments.
The method of this embodiment, which has similar implementation principle and technical effect to the embodiment shown in fig. 2, is not described herein again.
Fig. 5 is an interactive schematic view of a processing method of air pollutant data provided by the present invention, as shown in fig. 5, the method of the embodiment includes:
s501, the terminal device sends a data request to a server, and the data request is used for requesting air pollutant data at a first moment.
S502, the server determines two pictures corresponding to the second time and description information of the two pictures corresponding to the second time, which are associated with the first time, according to the data request, wherein the pictures corresponding to the second time store stored values corresponding to air pollutant data of a plurality of places, each pixel point in the pictures corresponding to the second time is used for storing a stored value corresponding to the air pollutant data of one place at two or four times, each pixel point in the pictures comprises R, G, B, A four channels, and each channel is used for storing a stored value corresponding to the air pollutant data of one time, or two channels are used for storing a stored value corresponding to the air pollutant data of one time; the first time is any time between the two second times.
S503, the server sends a response message of the data request to the terminal device, wherein the response message of the data request comprises two pictures corresponding to the second time associated with the first time and description information of the pictures corresponding to the second time.
And S504, the terminal equipment acquires air pollutant data of a plurality of places at two second moments according to the two pictures corresponding to the two second moments and the description information of the two pictures corresponding to the two second moments.
And S505, the terminal equipment performs linear interpolation on the air pollutant data of the plurality of places at two second moments to obtain the air pollutant data of the plurality of places at the first moment.
S506, the terminal device draws the air pollutant data of the plurality of places at the first moment to obtain an air pollutant distribution map at the first moment.
The method of the present embodiment, which has the similar implementation principle and technical effect to those of the above-mentioned embodiments, is not described herein again.
Fig. 6 is a schematic structural diagram of an apparatus for processing air pollutant data according to the present invention, as shown in fig. 6, the apparatus provided in this embodiment includes:
a sending module 601, configured to send a data request, where the data request is used to request air pollutant data at a first time;
a receiving module 602, configured to receive a response message of a data request sent by a server, where the response message of the data request includes description information of two pictures corresponding to a second time and two pictures corresponding to the second time, where the pictures corresponding to the second time are associated with the first time, where the pictures corresponding to the second time store stored values corresponding to air pollutant data of multiple places, where each pixel in the pictures corresponding to the second time is used to store a stored value corresponding to air pollutant data of one place at two or four times, where each pixel in the pictures includes R, G, B, A four channels, and each channel is used to store a stored value corresponding to air pollutant data of one time, or two channels are used to store a stored value corresponding to air pollutant data of one time; the first moment is any moment between the two second moments, and the pictures corresponding to the two second moments are one picture or two pictures;
the obtaining module 603 is configured to obtain air pollutant data of multiple locations at two second moments according to the two pictures corresponding to the two second moments and the description information of the two pictures corresponding to the two second moments;
a linear difference module 604, configured to perform linear interpolation on the air pollutant data of the multiple locations at two second times to obtain the air pollutant data of the multiple locations at the first time;
the drawing module 605 is configured to draw the air pollutant data of the multiple locations at the first time to obtain an air pollutant distribution map at the first time.
Optionally, the description information of the picture corresponding to the second time includes: the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
the obtaining module 603 is specifically configured to:
obtaining the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment;
determining that the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored in a single channel according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
when the storage value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting a single channel, calculating the air pollutant data of a plurality of places at the second moment pixel by pixel according to the following formula:
Figure BDA0002339151890000211
wherein V is air pollutant data of a plurality of places at a second moment, V1The value of the air pollutant data stored in the picture corresponding to the second moment is stored, Max is the maximum value of the value range of the air pollutant data stored in the picture corresponding to the second moment, and Min is the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment.
Optionally, the description information of the picture corresponding to the second time includes: the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
the obtaining module 603 is specifically configured to:
obtaining the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment;
determining that the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
when the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels, calculating the air pollutant data of a plurality of places at the second moment pixel by pixel according to the following formula:
Figure BDA0002339151890000212
wherein V is air pollutant data of a plurality of places at a second moment, V21The stored value V of the air pollutant data stored in the picture corresponding to the second moment in the first channel22The value of the air pollutant data stored in the picture corresponding to the second moment in the second channel is shown as Max, the value of the air pollutant data stored in the picture corresponding to the second moment is shown as Max, and the value of the air pollutant data stored in the picture corresponding to the second moment is shown as Min.
Optionally, the drawing module 605 is specifically configured to:
determining a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode;
determining air pollutant data of a first moment on a pixel point to be filled corresponding to an actual pixel point where a plurality of places are located according to the air pollutant data of the plurality of places at the first moment and a rendering mode;
and rendering the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain an air pollutant distribution map at the first moment.
Optionally, the method further includes:
a receiving module 602, further configured to receive a scaling instruction of an air pollutant distribution map at a first time;
the reading module is used for reading air pollutant data of a plurality of places at a first moment according to the zooming instruction;
the determining module is used for determining a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode;
determining air pollutant data at a first moment on a pixel point to be filled corresponding to an actual pixel point where a plurality of places are located according to the air pollutant data and the rendering mode of the plurality of places at the first moment, wherein the pixel point to be filled corresponding to the actual pixel point is a pixel point to be filled after the air pollutant distribution diagram at the first moment is amplified according to a zooming instruction;
the drawing module 605 is further configured to render the actual pixel point and the air pollutant data at the first moment on the pixel to be filled corresponding to the actual pixel point according to the corresponding relationship between the color legend and the air pollutant data, so as to obtain an enlarged image corresponding to the air pollutant distribution map at the first moment.
Optionally, the description information of the picture further includes the time and/or accuracy of the air pollutant data stored in the picture.
The apparatus of the foregoing embodiment may be configured to implement the technical solution of the foregoing method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of another apparatus for processing air pollutant data according to the present invention, as shown in fig. 7, the apparatus provided in this embodiment includes:
a receiving module 701, configured to receive a data request sent by a terminal device, where the data request is used to request air pollutant data at a first time;
a determining module 702, configured to determine, according to a data request, description information of two pictures corresponding to a second time and two pictures corresponding to the second time, where the pictures corresponding to the second time store stored values corresponding to air pollutant data of multiple places, where each pixel in the picture corresponding to the second time is used to store a stored value corresponding to air pollutant data of one place at two or four times, where each pixel in the picture includes R, G, B, A four channels, and each channel is used to store a stored value corresponding to air pollutant data of one time, or two channels are used to store a stored value corresponding to air pollutant data of one time; the first moment is any moment between the two second moments;
the sending module 703 is configured to send a response message of the data request to the terminal device, where the response message of the data request includes two pictures corresponding to the second time associated with the first time and description information of the two pictures corresponding to the second time.
Optionally, the description information of the picture is stored in the picture;
the description information of the picture includes one or more of the following information: the time, precision, value range or channel combination of the air pollutant data stored in the picture.
Optionally, the description information of the picture is stored in a first row of pixel points in the picture;
the stored values corresponding to the air pollutant data for the multiple locations are stored starting from the second row of pixel points in the picture.
Optionally, the stored values corresponding to the air pollutant data of one place at two or four moments are stored in the picture as the stored values corresponding to the air pollutant data of adjacent moments.
The apparatus of the foregoing embodiment may be configured to implement the technical solution of the foregoing method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 8 is a schematic structural diagram of a terminal device provided in the present invention, and as shown in fig. 8, the device provided in this embodiment includes:
a processor 801, a memory 802, and a transceiver 803.
Wherein the memory 802 is configured to store instructions, the transceiver 803 is configured to communicate with other devices, and the processor 801 is configured to execute the instructions stored in the memory 802, so as to enable the terminal device to perform the method for processing air pollution data as shown in fig. 2 or fig. 3.
Fig. 9 is a schematic structural diagram of a server according to the present invention, and as shown in fig. 9, the apparatus provided in this embodiment includes:
a processor 901, a memory 902, and a transceiver 903.
Wherein the memory 902 is configured to store instructions, the transceiver 903 is configured to communicate with other devices, and the processor 901 is configured to execute the instructions stored in the memory 902, so as to enable the server to execute the processing method of the air pollution data shown in fig. 4.
The invention provides a computer-readable storage medium, which is applied in a terminal device, and the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the processing method of air pollutant data as shown in fig. 2 or fig. 3.
The present invention provides a computer-readable storage medium, which is applied in a server, and the computer-readable storage medium stores computer-executable instructions, which when executed by a processor, are used for implementing the processing method of air pollution data as shown in fig. 4.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (24)

1. A method for processing air pollutant data, comprising:
the method comprises the steps that a terminal device sends a data request to a server, wherein the data request is used for requesting air pollutant data at a first moment;
the terminal device receives a response message of a data request sent by the server, where the response message of the data request includes two pictures corresponding to second time associated with the first time and description information of the two pictures corresponding to the second time, where the pictures corresponding to the second time store stored values corresponding to air pollutant data of multiple places, where each pixel point in the pictures corresponding to the second time is used to store a stored value corresponding to air pollutant data of one place at two or four times, where each pixel point in the pictures includes R, G, B, A four channels, and each channel is used to store a stored value corresponding to air pollutant data of one time, or two channels are used to store a stored value corresponding to air pollutant data of one time; the first moment is any moment between the two second moments, and the pictures corresponding to the two second moments are one picture or two pictures;
the terminal equipment acquires air pollutant data of the plurality of places at the two second moments according to the two pictures corresponding to the two second moments and the description information of the pictures corresponding to the two second moments;
the terminal equipment performs linear interpolation on the air pollutant data of the plurality of places at the two second moments to obtain the air pollutant data of the plurality of places at the first moment;
and the terminal equipment draws the air pollutant data of the plurality of places at the first moment to obtain an air pollutant distribution map at the first moment.
2. The method according to claim 1, wherein the description information of the picture corresponding to the second time includes: the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
the method for acquiring the air pollutant data of the multiple places at the two second moments by the terminal equipment according to the two pictures corresponding to the two second moments and the description information of the two pictures corresponding to the two second moments includes:
the terminal equipment obtains the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment;
determining that the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored in a single channel according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
when the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting a single channel, calculating the air pollutant data of the plurality of places at the second moment pixel by pixel according to the following formula:
Figure FDA0002339151880000021
wherein V is air pollutant data of the plurality of sites at the second time, V1The value of the air pollutant data stored in the picture corresponding to the second moment is stored, Max is the maximum value of the value range of the air pollutant data stored in the picture corresponding to the second moment, and Min is the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment.
3. The method according to claim 1, wherein the description information of the picture corresponding to the second time includes: the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
the method for acquiring the air pollutant data of the multiple places at the two second moments by the terminal equipment according to the two pictures corresponding to the two second moments and the description information of the two pictures corresponding to the two second moments includes:
the terminal equipment obtains the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment;
determining that the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
when the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels, calculating the air pollutant data of the plurality of places at the second moment pixel by pixel according to the following formula:
Figure FDA0002339151880000022
wherein V is air pollutant data of the plurality of sites at the second time, V21The stored value V of the air pollutant data stored in the picture corresponding to the second moment in the first channel22And the Max is the maximum value of the value range of the air pollutant data stored in the picture corresponding to the second moment, and Min is the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment.
4. The method according to any one of claims 1-3, wherein the terminal device plots the air pollutant data of the plurality of sites at the first time to obtain the air pollutant profile at the first time, and the method comprises:
the terminal equipment determines a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode;
the terminal equipment determines the air pollutant data at the first moment on the pixel points to be filled corresponding to the actual pixel points of the multiple places according to the air pollutant data of the multiple places at the first moment and the rendering mode;
and the terminal equipment renders the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain the air pollutant distribution map at the first moment.
5. The method according to any one of claims 1-3, further comprising:
the terminal equipment receives a scaling instruction of the air pollutant distribution map at the first moment;
reading air pollutant data of the plurality of places at the first moment according to the scaling instruction;
the terminal equipment determines a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode;
the terminal equipment determines the air pollutant data at the first moment on the pixel points to be filled corresponding to the actual pixel points of the multiple places according to the air pollutant data of the multiple places at the first moment and the rendering mode, wherein the pixel points to be filled corresponding to the actual pixel points are the pixel points to be filled after the air pollutant distribution diagram at the first moment is amplified according to the zooming instruction;
and the terminal equipment renders the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain an enlarged image corresponding to the air pollutant distribution diagram at the first moment.
6. The method of claim 2, wherein the descriptive information of the picture further comprises a time and/or an accuracy of the air contaminant data stored in the picture.
7. A method for processing air pollutant data, comprising:
the method comprises the steps that a server receives a data request sent by a terminal device, wherein the data request is used for requesting air pollutant data at a first moment;
the server determines two pictures corresponding to the second time and description information of the pictures corresponding to the two second times, which are associated with the first time, according to the data request, wherein stored values corresponding to the air pollutant data of a plurality of places are stored in the picture corresponding to the second time, each pixel point in the picture corresponding to the second time is used for storing the stored value corresponding to the air pollutant data of one place at two or four times, each pixel point in the picture comprises R, G, B, A four channels, and each channel is used for storing the stored value corresponding to the air pollutant data of one time, or two channels are used for storing the stored value corresponding to the air pollutant data of one time; the first moment is any moment between the two second moments;
and the server sends a response message of a data request to the terminal equipment, wherein the response message of the data request comprises pictures corresponding to two second moments associated with the first moment and description information of the pictures corresponding to the two second moments.
8. The method according to claim 7, wherein the description information of the picture is stored in the picture;
the description information of the picture comprises one or more of the following information: the time, precision, value range or channel combination of the air pollutant data stored in the picture.
9. The method according to claim 8, wherein the description information of the picture is stored in a first row of pixel points in the picture;
and storing values corresponding to the air pollutant data of the plurality of places from the second row of pixel points in the picture.
10. The method according to any one of claims 7 to 9, wherein the stored values corresponding to air pollutant data at two or four times for a location are stored in the picture as stored values corresponding to air pollutant data at adjacent times.
11. An apparatus for processing air pollutant data, comprising:
a sending module, configured to send a data request, where the data request is used to request air pollutant data at a first time;
a receiving module, configured to receive a response message of a data request sent by the server, where the response message of the data request includes two pictures corresponding to the second time associated with the first time and description information of the pictures corresponding to the two second times, wherein the picture corresponding to the second moment is stored with stored values corresponding to air pollutant data of a plurality of places, wherein each pixel point in the picture corresponding to the second moment is used for storing a storage value corresponding to air pollutant data of one place at two or four moments, wherein each pixel point in the picture comprises R, G, B, A four channels, each channel is used for storing a storage value corresponding to air pollutant data at a moment, or the two channels are used for storing a storage value corresponding to the air pollutant data at one moment; the first moment is any moment between the two second moments, and the pictures corresponding to the two second moments are one picture or two pictures;
the acquisition module is used for acquiring the air pollutant data of the plurality of places at the two second moments according to the pictures corresponding to the two second moments and the description information of the pictures corresponding to the two second moments;
the linear difference module is used for performing linear interpolation on the air pollutant data of the plurality of places at the two second moments to obtain the air pollutant data of the plurality of places at the first moment;
and the drawing module is used for drawing the air pollutant data of the plurality of places at the first moment to obtain an air pollutant distribution map at the first moment.
12. The apparatus according to claim 11, wherein the description information of the picture corresponding to the second time includes: the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
the acquisition module is specifically configured to:
obtaining the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment;
determining that the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored in a single channel according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
when the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting a single channel, calculating the air pollutant data of the plurality of places at the second moment pixel by pixel according to the following formula:
Figure FDA0002339151880000051
wherein V is air pollutant data of the plurality of sites at the second time, V1The value of the air pollutant data stored in the picture corresponding to the second moment is stored, Max is the maximum value of the value range of the air pollutant data stored in the picture corresponding to the second moment, and Min is the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment.
13. The apparatus according to claim 11, wherein the description information of the picture corresponding to the second time includes: the value range and the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
the acquisition module is specifically configured to:
obtaining the maximum value and the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment according to the value range of the air pollutant data stored in the picture corresponding to the second moment;
determining that the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels according to the channel combination mode of the air pollutant data stored in the picture corresponding to the second moment;
when the stored value of the air pollutant data stored in the picture corresponding to the second moment is stored by adopting two channels, calculating the air pollutant data of the plurality of places at the second moment pixel by pixel according to the following formula:
Figure FDA0002339151880000061
wherein V is air pollutant data of the plurality of sites at the second time, V21The stored value V of the air pollutant data stored in the picture corresponding to the second moment in the first channel22And the Max is the maximum value of the value range of the air pollutant data stored in the picture corresponding to the second moment, and Min is the minimum value of the value range of the air pollutant data stored in the picture corresponding to the second moment.
14. The apparatus according to any one of claims 11-13, wherein the rendering module is specifically configured to:
determining a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode;
determining the air pollutant data of the first moment on a pixel point to be filled corresponding to an actual pixel point where the plurality of places are located according to the air pollutant data of the plurality of places at the first moment and the rendering mode;
and rendering the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain the air pollutant distribution map at the first moment.
15. The apparatus of any one of claims 11-13, further comprising:
the receiving module is further used for receiving a scaling instruction of the air pollutant distribution map at the first moment;
the reading module is used for reading the air pollutant data of the plurality of places at the first moment according to the zooming instruction;
the determining module is used for determining a color legend and a rendering mode used for drawing according to the type of the air pollutant data, wherein the rendering mode is a linear interpolation mode or an adjacent value mode;
determining the air pollutant data at the first moment on a pixel point to be filled corresponding to an actual pixel point where the plurality of places are located according to the air pollutant data at the first moment and the rendering mode, wherein the pixel point to be filled corresponding to the actual pixel point is a pixel point which needs to be filled after the air pollutant distribution diagram at the first moment is amplified according to the zooming instruction;
and the drawing module is further used for rendering the actual pixel points and the air pollutant data at the first moment on the pixels to be filled corresponding to the actual pixel points according to the corresponding relation between the color legend and the air pollutant data to obtain an enlarged image corresponding to the air pollutant distribution diagram at the first moment.
16. The apparatus of claim 12, wherein the descriptive information of the picture further comprises a time and/or an accuracy of the air contaminant data stored in the picture.
17. An apparatus for processing air pollutant data, comprising:
the terminal equipment comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a data request sent by the terminal equipment, and the data request is used for requesting air pollutant data at a first moment;
a determining module, configured to determine, according to the data request, two pictures corresponding to second time points associated with the first time point and description information of the two pictures corresponding to the second time points, where the picture corresponding to the second time point stores stored values corresponding to air pollutant data of multiple locations, where each pixel point in the picture corresponding to the second time point is used to store a stored value corresponding to air pollutant data of one location at two or four time points, where each pixel point in the picture includes R, G, B, A four channels, and each channel is used to store a stored value corresponding to air pollutant data of one time point, or two channels are used to store a stored value corresponding to air pollutant data of one time point; the first moment is any moment between the two second moments;
and the sending module is used for sending a response message of a data request to the terminal equipment, wherein the response message of the data request comprises two pictures corresponding to the two second moments associated with the first moment and description information of the two pictures corresponding to the two second moments.
18. The apparatus according to claim 17, wherein the description information of the picture is stored in the picture;
the description information of the picture comprises one or more of the following information: the time, precision, value range or channel combination of the air pollutant data stored in the picture.
19. The apparatus according to claim 18, wherein the description information of the picture is stored in a first row of pixel points in the picture;
and storing values corresponding to the air pollutant data of the plurality of places from the second row of pixel points in the picture.
20. The apparatus of any one of claims 17-19, wherein the stored values corresponding to air pollutant data for a location at two or four times are stored in the picture as stored values corresponding to air pollutant data at adjacent times.
21. A terminal device, comprising:
a processor, a memory for storing instructions, and a transceiver for communicating with other devices, the processor being configured to execute the instructions stored in the memory to cause the terminal device to perform the method of processing air contaminant data of any of claims 1-6.
22. A server, comprising:
a processor, a memory for storing instructions, and a transceiver for communicating with other devices, the processor being configured to execute the instructions stored in the memory to cause the server to perform the method of processing air contaminant data of any of claims 7-10.
23. A computer-readable storage medium for use in a terminal device, wherein the computer-readable storage medium has stored therein computer-executable instructions for implementing the method of processing air contaminant data according to any one of claims 1-6 when executed by a processor.
24. A computer-readable storage medium for use in a server, wherein the computer-readable storage medium has stored thereon computer-executable instructions for implementing the method of processing air contaminant data according to any one of claims 7-10 when executed by a processor.
CN201911368873.7A 2019-12-26 2019-12-26 Air pollutant data processing method and device Active CN111125206B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911368873.7A CN111125206B (en) 2019-12-26 2019-12-26 Air pollutant data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911368873.7A CN111125206B (en) 2019-12-26 2019-12-26 Air pollutant data processing method and device

Publications (2)

Publication Number Publication Date
CN111125206A true CN111125206A (en) 2020-05-08
CN111125206B CN111125206B (en) 2020-11-17

Family

ID=70503389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911368873.7A Active CN111125206B (en) 2019-12-26 2019-12-26 Air pollutant data processing method and device

Country Status (1)

Country Link
CN (1) CN111125206B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112001074A (en) * 2020-08-19 2020-11-27 中科三清科技有限公司 Method, device and storage medium for treating pollutants based on vegetation coverage
CN112102433A (en) * 2020-09-17 2020-12-18 中科三清科技有限公司 Method and device for drawing vertical distribution map of air pollutants and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2426476A1 (en) * 2010-09-07 2012-03-07 NGK Insulators, Ltd. Particulate matter detection device
CN103024432A (en) * 2012-12-11 2013-04-03 上海卫星工程研究所 Automatic efficient full-covering test method of over-the-ground visible light remote sensing satellite image data
CN105740643A (en) * 2016-03-15 2016-07-06 杭州电子科技大学 Self-adaptive PM<2.5>concentration speculating method based on city region grid
CN106528997A (en) * 2016-10-28 2017-03-22 江苏天瑞仪器股份有限公司 Method for drawing particulate matter hour concentration distribution graph of region

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2426476A1 (en) * 2010-09-07 2012-03-07 NGK Insulators, Ltd. Particulate matter detection device
CN103024432A (en) * 2012-12-11 2013-04-03 上海卫星工程研究所 Automatic efficient full-covering test method of over-the-ground visible light remote sensing satellite image data
CN105740643A (en) * 2016-03-15 2016-07-06 杭州电子科技大学 Self-adaptive PM<2.5>concentration speculating method based on city region grid
CN106528997A (en) * 2016-10-28 2017-03-22 江苏天瑞仪器股份有限公司 Method for drawing particulate matter hour concentration distribution graph of region

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112001074A (en) * 2020-08-19 2020-11-27 中科三清科技有限公司 Method, device and storage medium for treating pollutants based on vegetation coverage
CN112102433A (en) * 2020-09-17 2020-12-18 中科三清科技有限公司 Method and device for drawing vertical distribution map of air pollutants and storage medium
CN112102433B (en) * 2020-09-17 2021-06-01 中科三清科技有限公司 Method and device for drawing vertical distribution map of air pollutants and storage medium

Also Published As

Publication number Publication date
CN111125206B (en) 2020-11-17

Similar Documents

Publication Publication Date Title
KR101159395B1 (en) Design of arbitrary linear and non-linear maps
CN111125206B (en) Air pollutant data processing method and device
KR101253213B1 (en) Method and apparatus for controlling video display in mobile terminal
CN103020250B (en) The map-indication method of a kind of Distribution GIS and device
CN104536771B (en) According to the icon sequencing display method and system of Icon Color
CN104731894A (en) Thermodynamic diagram display method and device
CN103761315A (en) Method and system for displaying webpage content
Sun et al. Embedding temporal display into maps for occlusion-free visualization of spatio-temporal data
TW200714032A (en) Single-to-multiple image division method
CN104657934A (en) Image data processing method and device
CN111104615A (en) Meteorological element superposition display method based on vector electronic chart
CN112102433A (en) Method and device for drawing vertical distribution map of air pollutants and storage medium
JP2019049705A (en) Boundary gain system and method for electronic display
CN105955754A (en) Method and device for displaying characters of user interface
CN109104608A (en) TV performance test methods, equipment and computer readable storage medium
CN112066997A (en) Method and system for exporting high-definition route map
CN115439609A (en) Three-dimensional model rendering method, system, device and medium based on map service
KR100860673B1 (en) Apparatus and method for generating image to generate 3d image
CN108279402B (en) WMTS-based browser-side radar video display method
CN114443787B (en) Atmospheric pollution characteristic identification method and device
US9286705B1 (en) Presenting wireless-telecommunications coverage areas
CN114170359A (en) Volume fog rendering method, device and equipment and storage medium
CN114625990A (en) Method, device, equipment and medium for rendering webpage end grid data
CN114244968A (en) Image conversion method, image conversion device and image signal generator
JP4195067B2 (en) MAP DATA OUTPUT DEVICE, MAP DATA OUTPUT METHOD, AND MAP DATA OUTPUT PROGRAM

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20200508

Assignee: Beijing Zhongke Sanqing Environmental Technology Co.,Ltd.

Assignor: 3CLEAR TECHNOLOGY Co.,Ltd.

Contract record no.: X2022980012305

Denomination of invention: Method and device for processing air pollutant data

Granted publication date: 20201117

License type: Common License

Record date: 20220815

EE01 Entry into force of recordation of patent licensing contract