Data acquisition and processing method for intelligent street lamp

文档序号:1172704 发布日期:2020-09-18 浏览:8次 中文

阅读说明:本技术 智慧路灯用数据采集及处理方法 (Data acquisition and processing method for intelligent street lamp ) 是由 徐博 何勇 于 2020-06-05 设计创作,主要内容包括:本发明公开了一种智慧路灯用数据采集及处理方法,网关采集自身和外设的数据后先对数据进行处理,然后再发送给服务器;本方法包括气象数据采集及处理方法,该方法包括以下步骤:网关向气象仪发送气象环境查询命令,在接收气象仪反馈的数据后进行校验和真实性判断,校验成功且数据真实则进入下一步骤;重复获得多组气象数据;对同一参数的多个数据进行平均和方差运算,网关将计算后数据发送给服务器;对其它不同参数的多个数据进行处理后发送给服务器。本发明通过网关对自身和外设数据进行采集并处理后再发送给服务器,大大节约了服务器的运算能力,有利于服务器的扩展和兼容;通过平均和方差计算规避了采集数据的波动误差,提高了外设监测精度。(The invention discloses a data acquisition and processing method for an intelligent street lamp, wherein a gateway acquires data of the gateway and peripheral equipment, processes the data and then sends the processed data to a server; the method comprises a meteorological data acquisition and processing method, and comprises the following steps: the gateway sends a meteorological environment query command to the meteorological instrument, verification and authenticity judgment are carried out after data fed back by the meteorological instrument are received, and the next step is carried out if the verification is successful and the data are real; repeatedly obtaining a plurality of groups of meteorological data; carrying out average and variance operation on a plurality of data with the same parameter, and sending the calculated data to a server by a gateway; and processing a plurality of data of other different parameters and then sending the processed data to the server. The invention collects and processes the data of the gateway and the peripheral equipment and then sends the data to the server, thereby greatly saving the computing capacity of the server and being beneficial to the expansion and compatibility of the server; the fluctuation error of the collected data is avoided through average and variance calculation, and the peripheral monitoring precision is improved.)

1. A data acquisition and processing method for an intelligent street lamp is used for acquiring self and peripheral data through a gateway and processing the data, and is characterized in that: the gateway collects the data of the gateway and the peripheral equipment, processes the data and then sends the data to the server; the data acquisition and processing method for the intelligent street lamp comprises a meteorological data acquisition and processing method aiming at a meteorological instrument, and the meteorological data acquisition and processing method comprises the following steps:

step 1.1, the gateway sends a meteorological environment query command to the meteorological instrument, verification and authenticity judgment are carried out after data fed back by the meteorological instrument are received, if verification is successful and the data are real, the next step is carried out, and otherwise, the meteorological environment query command is sent again;

step 1.2, repeating the step 1.1 to obtain a plurality of groups of meteorological data;

step 1.3, carrying out average and variance operation on a plurality of data of the same parameter, determining the final data of the parameter according to the average and variance operation, and sending the final data to a server by a gateway;

and step 1.4, processing a plurality of data of other different parameters according to the step 1.3 until the processing of all parameter data is completed.

2. The data acquisition and processing method for the intelligent street lamp as claimed in claim 1, wherein: the step 1.1 comprises the following steps:

step 1.1.1, the gateway sends a first meteorological environment query command to a meteorological instrument through an RS485 protocol;

step 1.1.2, the gateway receives data fed back by the meteorological instrument, wherein the data comprises but is not limited to PM2.5 data, PM10 data, wind direction data and wind speed data;

step 1.1.3, performing CRC by the gateway, if the two times of the CRC are not successful, abandoning all data and resending the meteorological environment query command, after the CRC is successful, saving the data according to a byte analysis protocol, judging the authenticity of the data when analyzing one environmental data, abandoning all data and resending the meteorological environment query command if the data is not authentic, and if the data is authentic, indicating that the data acquisition is effective and entering the next step;

the step 1.3 comprises the following steps:

step 1.3.1, n data with the same parameter are set respectivelyx1、x2…xn, calculating the average value of n data,

Figure 645809DEST_PATH_IMAGE002

step 1.3.2, calculate the variance s of n data according to the following formula2

Step 1.3.3, mixing s2With s pre-stored in the gateway1Making a comparison if s is1If the parameter is larger than the threshold value, the maximum value and the minimum value in the n data are removed, the average value of the rest data is taken as the final data of the parameter, and if the parameter is larger than the threshold value, the average value is compared with the threshold value s1If the parameter is small, taking the average value of n data as the final data of the parameter; s1The variance is calculated for a large amount of data that passed earlier.

3. The data acquisition and processing method for the intelligent street lamp as claimed in claim 2, wherein: n in the step 1.3 is 5.

4. The data collecting and processing method for intelligent street lamp according to claim 1, 2 or 3, wherein: the data acquisition and processing method for the intelligent street lamp further comprises a current and voltage data acquisition and processing method which is carried out aiming at the gateway, a sound box, a display screen and a wireless AP, and the current and voltage data acquisition and processing method comprises the following steps:

step 2.1, the gateway reads the current data of the gateway for m times through the first acquisition chip, calculates to obtain an average value a, and averagesMultiplying the value a by a coefficient f1 to obtain a current value, comparing the current value with 30mA, judging that the current leakage is abnormal if the current value is larger than or equal to the current value, sending leakage abnormal alarm information to a server by a gateway, judging that the current leakage is normal if the current value is smaller than the current value, and then entering the next step; the formula for f1 is f WhereinzThe actual current value is measured by using a voltage-stabilized power supply device in advance,athe average value of a plurality of times of current values measured by using a voltage-stabilized power supply device in advance;

step 2.2, the gateway reads current data of the gateway for m times again through the first acquisition chip, calculates the average value of 2m current data to obtain a total current average value b, compares the total current average value b with a current threshold value, judges that the load is abnormal if the total current average value b is larger than the current threshold value, sends load abnormality alarm information to the server, judges that the load is normal if the total current average value b is smaller than or equal to the current threshold value, and then enters the next step; the current threshold value is a maximum current value calculated by utilizing the maximum power of each peripheral;

step 2.3, the gateway reads the voltage data of the gateway for m times again through the first acquisition chip, calculates to obtain an average value c, multiplies the average value c by a coefficient f2 to obtain a current voltage value, judges that the current voltage is normal if the current voltage value is 198V-235V, judges that the voltage is abnormal if the current voltage value is higher than 235V or lower than 198V, sends leakage abnormity alarm information to the server, and then enters the next step; the formula for f2 is

Figure DEST_PATH_IMAGE018

step 2.4, the gateway reads the voltage data of the display screen for m times through the second acquisition chip, calculates to obtain an average value d, compares the average value d with the voltage threshold value of the display screen to judge whether the voltage is abnormal or not, sends the information that the voltage of the display screen is abnormal or normal to the server, and then enters the next step; the display screen voltage threshold value is obtained according to the specification of the display screen;

step 2.5, the gateway reads the voltage data of the sound equipment for m times through the third acquisition chip, calculates to obtain an average value e, compares the average value e with the voltage threshold value of the sound equipment to judge whether the voltage is abnormal or not, sends the information that the voltage of the sound equipment is abnormal or normal to the server, and then enters the next step; the voltage threshold value of the sound is obtained according to the specification of the sound;

step 2.6, the gateway reads the voltage data of the wireless AP for m times through the fourth acquisition chip, calculates to obtain an average value g, compares the average value g with the voltage threshold of the wireless AP to judge whether the voltage is abnormal or not, sends the information of the abnormal or normal voltage of the wireless AP to the server, and finishes current and voltage data acquisition and processing; the wireless AP voltage threshold is obtained according to the specification of the wireless AP.

5. The method for collecting and processing data for intelligent street lamp according to claim 4, wherein the method comprises the following steps: and m is 5.

Technical Field

The invention relates to a data acquisition and processing method of a street lamp system, in particular to a data acquisition and processing method for an intelligent street lamp.

Background

The street lamp system is more and more important in urban construction, and the intelligent design of the street lamp system is more and more refined.

The intelligent street lamp is one of the important intelligent devices of the modern street lamp system. The definition of intelligent street lamp includes two kinds of narrow and broad, narrow: remote control and management of the lamp are realized through the communication technology of the Internet of things, and the remote control and management comprise brightness adjustment, on-off control, alarming and the like; in a broad sense: the intelligent street lamp has a narrow range and carries various Internet of things devices such as a display screen, a wireless AP (access point), an environment collector and the like by taking the intelligent street lamp as a carrier.

In practical application, wisdom street lamp not only just controls lamps and lanterns, still need compromise and carry out data acquisition to each peripheral hardware that the condition of surrounding environment and gateway are connected, for example, through carrying on the weather instrument on wisdom street lamp, detects surrounding meteorological environment to obtain meteorological data such as PM2.5, PM10, wind direction, wind speed. Therefore, the wisdom street lamp among the present practical application is a generalized wisdom street lamp.

As shown in fig. 1, the basic electrical structure of the smart street lamp includes an external device and a gateway, the external device includes a weather meter, a sound, a display screen, a wireless AP and the like, the gateway collects data of the gateway and related data of the external device and then transmits the data to a server, and the wireless AP, i.e., a wireless access device, such as a wireless router, is a bridge for communication between a wireless network and a wired network.

Traditional wisdom street lamp, its gateway only have collection and transfer function to self and peripheral hardware's data, do not have the function of handling data, all carry out centralized processing at the server after with data transfer to server, this kind of mode has following drawback: because a lot of data are needed to improve the detection precision, the data information amount is large, a large amount of computing power of the server is wasted for preprocessing of data screening and the like, the load capacity of the server is seriously weakened, the expansion and compatibility of the server are greatly limited, and the processing capacity of the server is lower along with the more data access until the platform crashes. In addition, the lack of an authenticity judgment process in the existing peripheral data acquisition may cause errors in the acquired data and the monitoring result; in the existing peripheral data processing, variance calculation is not carried out, fluctuation errors of collected data are not well avoided, and peripheral monitoring precision is reduced.

Disclosure of Invention

The invention aims to solve the problems and provide a data acquisition and processing method for an intelligent street lamp, which can save the calculation power of a server and obtain a high-precision monitoring result.

The invention realizes the purpose through the following technical scheme:

a data acquisition and processing method for an intelligent street lamp is used for acquiring data of the intelligent street lamp and data of peripheral equipment through a gateway and processing the data, wherein the gateway acquires the data of the intelligent street lamp and the data of the peripheral equipment, processes the data and then sends the processed data to a server; the data acquisition and processing method for the intelligent street lamp comprises a meteorological data acquisition and processing method aiming at a meteorological instrument, and the meteorological data acquisition and processing method comprises the following steps:

step 1.1, the gateway sends a meteorological environment query command to the meteorological instrument, verification and authenticity judgment are carried out after data fed back by the meteorological instrument are received, if verification is successful and the data are real, the next step is carried out, and otherwise, the meteorological environment query command is sent again;

step 1.2, repeating the step 1.1 to obtain a plurality of groups of meteorological data;

step 1.3, carrying out average and variance operation on a plurality of data of the same parameter, determining the final data of the parameter according to the average and variance operation, and sending the final data to a server by a gateway;

and step 1.4, processing a plurality of data of other different parameters according to the step 1.3 until the processing of all parameter data is completed.

Preferably, said step 1.1 comprises the steps of:

step 1.1.1, the gateway sends a first meteorological environment query command to a meteorological instrument through an RS485 protocol;

step 1.1.2, the gateway receives data fed back by the meteorological instrument, wherein the data comprises but is not limited to PM2.5 data, PM10 data, wind direction data and wind speed data;

step 1.1.3, performing CRC by the gateway, if the two times of the CRC are not successful, abandoning all data and resending the meteorological environment query command, after the CRC is successful, saving the data according to a byte analysis protocol, judging the authenticity of the data when analyzing one environmental data, abandoning all data and resending the meteorological environment query command if the data is not authentic, and if the data is authentic, indicating that the data acquisition is effective and entering the next step;

the step 1.3 comprises the following steps:

step 1.3.1, n data with the same parameter are set respectivelyx1、x2…xn, calculating the average value of n data,

Figure 100002_DEST_PATH_IMAGE001

Figure 441261DEST_PATH_IMAGE002

Figure 100002_DEST_PATH_IMAGE009

step 1.3.2, calculate the variance s of n data according to the following formula2

Step 1.3.3, mixing s2With s pre-stored in the gateway1Making a comparison if s is1If the parameter is larger than the threshold value, the maximum value and the minimum value in the n data are removed, the average value of the rest data is taken as the final data of the parameter, and if the parameter is larger than the threshold value, the average value is compared with the threshold value s1If the parameter is small, taking the average value of n data as the final data of the parameter; s1The variance is calculated for a large amount of data that passed earlier.

The RS485 protocol is a typical serial communication standard protocol, and the reliability and the authenticity of data can be better ensured in the invention; CRC (cyclic redundancy check), which is a commonly used check code having error detection and correction capabilities; the data authenticity judgment is judged according to a preset standard, and the specific preset standard is determined according to the actual situation.

Preferably, n in step 1.3 is 5.

Further, the data acquisition and processing method for the intelligent street lamp further comprises a current and voltage data acquisition and processing method aiming at the gateway, a sound box, a display screen and a wireless AP, wherein the current and voltage data acquisition and processing method comprises the following steps:

step 2.1, the gateway reads current data of the gateway for m times through a first acquisition chip, calculates to obtain an average value a, multiplies the average value a by a coefficient f1 to obtain a current value, compares the current value with 30mA, judges that the current leakage is abnormal if the current value is larger than or equal to the coefficient f1, sends leakage abnormal alarm information to a server, judges that the current leakage is normal if the current value is smaller than the coefficient f1, and then enters the next step; the formula for f1 is f

Figure 100002_DEST_PATH_IMAGE015

WhereinzThe actual current value is measured by using a voltage-stabilized power supply device in advance,athe average value of a plurality of times of current values measured by using a voltage-stabilized power supply device in advance;

step 2.2, the gateway reads current data of the gateway for m times again through the first acquisition chip, calculates the average value of 2m current data to obtain a total current average value b, compares the total current average value b with a current threshold value, judges that the load is abnormal if the total current average value b is larger than the current threshold value, sends load abnormality alarm information to the server, judges that the load is normal if the total current average value b is smaller than or equal to the current threshold value, and then enters the next step; the current threshold value is a maximum current value calculated by utilizing the maximum power of each peripheral;

step 2.3, the gateway reads the voltage data of the gateway for m times again through the first acquisition chip, calculates to obtain an average value c, multiplies the average value c by a coefficient f2 to obtain a current voltage value, judges that the current voltage is normal if the current voltage value is 198V-235V, judges that the voltage is abnormal if the current voltage value is higher than 235V or lower than 198V, sends leakage abnormity alarm information to the server, and then enters the next step; the formula for f2 is

Figure 100002_DEST_PATH_IMAGE017

WhereinvIs the actual voltage value measured by the voltage-stabilized power supply equipment in advance,cthe average value of multiple voltage values measured by using a voltage-stabilized power supply device in advance;

step 2.4, the gateway reads the voltage data of the display screen for m times through the second acquisition chip, calculates to obtain an average value d, compares the average value d with the voltage threshold value of the display screen to judge whether the voltage is abnormal or not, sends the information that the voltage of the display screen is abnormal or normal to the server, and then enters the next step; the display screen voltage threshold value is obtained according to the specification of the display screen;

step 2.5, the gateway reads the voltage data of the sound equipment for m times through the third acquisition chip, calculates to obtain an average value e, compares the average value e with the voltage threshold value of the sound equipment to judge whether the voltage is abnormal or not, sends the information that the voltage of the sound equipment is abnormal or normal to the server, and then enters the next step; the voltage threshold value of the sound is obtained according to the specification of the sound;

step 2.6, the gateway reads the voltage data of the wireless AP for m times through the fourth acquisition chip, calculates to obtain an average value g, compares the average value g with the voltage threshold of the wireless AP to judge whether the voltage is abnormal or not, sends the information of the abnormal or normal voltage of the wireless AP to the server, and finishes current and voltage data acquisition and processing; the wireless AP voltage threshold is obtained according to the specification of the wireless AP.

Preferably, m is 5.

The invention has the beneficial effects that:

the invention collects and processes the data of the gateway and the peripheral equipment and then sends the data to the server, thereby greatly saving the computing capacity of the server and being beneficial to the expansion and compatibility of the server; the data fed back by the weather instrument is verified after being received, and the authenticity is judged, so that the data is confirmed to be true, the phenomenon that error data are sent to a server is avoided, the gateway calculates the average and variance of a plurality of data of each parameter and then sends the data to the server is avoided, the fluctuation error of the collected data is well avoided, and the peripheral monitoring precision is improved; the current and voltage data of the gateway and the peripheral equipment are acquired for multiple times, the average value of the current and voltage data is taken, whether the current and voltage data are normal or not is judged, and the average value is sent to the server, so that the purpose of monitoring the current and voltage states of the gateway and the peripheral equipment in the gateway is achieved, and the operational capacity of the server is further saved.

Drawings

Fig. 1 is a block diagram of a basic electrical structure related to the data acquisition and processing method for the intelligent street lamp.

Detailed Description

The invention will be further described with reference to the accompanying drawings in which:

as shown in fig. 1, the basic electrical structure of the intelligent street lamp of the present invention includes peripherals and a gateway, the peripherals include a weather instrument, a sound, a display screen, a wireless AP, etc., signal output terminals of the peripherals are connected with signal input terminals of the gateway, and the gateway is connected with a server in a wireless communication manner.

With reference to fig. 1, the data acquisition and processing method for the intelligent street lamp is used for acquiring data of the intelligent street lamp and data of peripheral equipment through a gateway and processing the data, wherein the gateway acquires the data of the intelligent street lamp and the data of the peripheral equipment, processes the data and then sends the processed data to a server; the data acquisition and processing method for the intelligent street lamp comprises a meteorological data acquisition and processing method aiming at a meteorological instrument, wherein the meteorological data acquisition and processing method comprises the following steps:

step 1.1, the gateway sends a meteorological environment query command to the meteorological instrument, verification and authenticity judgment are carried out after data fed back by the meteorological instrument are received, if verification is successful and the data are real, the next step is carried out, and otherwise, the meteorological environment query command is sent again;

the specific method of the step comprises the following steps:

step 1.1.1, the gateway sends a first meteorological environment query command to a meteorological instrument through an RS485 protocol;

step 1.1.2, the gateway receives data fed back by the meteorological instrument, wherein the data comprises but is not limited to PM2.5 data, PM10 data, wind direction data and wind speed data;

step 1.1.3, performing CRC by the gateway, if the two times of the CRC are not successful, abandoning all data and resending the meteorological environment query command, after the CRC is successful, saving the data according to a byte analysis protocol, judging the authenticity of the data when analyzing one environmental data, abandoning all data and resending the meteorological environment query command if the data is not authentic, and if the data is authentic, indicating that the data acquisition is effective and entering the next step;

step 1.2, repeating the step 1.1 to obtain a plurality of groups of meteorological data;

step 1.3, carrying out average and variance operation on a plurality of data of the same parameter, determining the final data of the parameter according to the average and variance operation, and sending the final data to a server by a gateway;

the specific method of the step comprises the following steps:

step 1.3.1, n data with the same parameter are set respectivelyx1、x2…xn, calculating the average value of n data,

Figure 730245DEST_PATH_IMAGE006

Figure 594296DEST_PATH_IMAGE008

Figure 674247DEST_PATH_IMAGE009

step 1.3.2, calculate the variance s of n data according to the following formula2

Step 1.3.3, mixing s2With s pre-stored in the gateway1Making a comparison if s is1If the parameter is larger than the threshold value, the maximum value and the minimum value in the n data are removed, the average value of the rest data is taken as the final data of the parameter, and if the parameter is larger than the threshold value, the average value is compared with the threshold value s1If the parameter is small, taking the average value of n data as the final data of the parameter; s1Variance calculated for a large amount of data through the previous period;

and step 1.4, processing a plurality of data of other different parameters according to the step 1.3 until the processing of all parameter data is completed.

Preferably, n in step 1.3 is 5.

With reference to fig. 1, the data acquisition and processing method for the smart street lamp further includes a current and voltage data acquisition and processing method for the gateway itself, the sound, the display screen, and the wireless AP, and the current and voltage data acquisition and processing method includes the following steps:

step 2.1, the gateway reads current data of the gateway for m times through a first acquisition chip, calculates to obtain an average value a, multiplies the average value a by a coefficient f1 to obtain a current value, compares the current value with 30mA, judges that the current leakage is abnormal if the current value is larger than or equal to the coefficient f1, sends leakage abnormal alarm information to a server, judges that the current leakage is normal if the current value is smaller than the coefficient f1, and then enters the next step; the formula for f1 is f WhereinzThe actual current value is measured by using a voltage-stabilized power supply device in advance,athe average value of a plurality of times of current values measured by using a voltage-stabilized power supply device in advance;

step 2.2, the gateway reads current data of the gateway for m times again through the first acquisition chip, calculates the average value of 2m current data to obtain a total current average value b, compares the total current average value b with a current threshold value, judges that the load is abnormal if the total current average value b is larger than the current threshold value, sends load abnormality alarm information to the server, judges that the load is normal if the total current average value b is smaller than or equal to the current threshold value, and then enters the next step; the current threshold value is a maximum current value calculated by utilizing the maximum power of each peripheral;

step 2.3, the gateway reads the voltage data of the gateway for m times again through the first acquisition chip, calculates to obtain an average value c, multiplies the average value c by a coefficient f2 to obtain a current voltage value, judges that the current voltage is normal if the current voltage value is 198V-235V, judges that the voltage is abnormal if the current voltage value is higher than 235V or lower than 198V, sends leakage abnormity alarm information to the server, and then enters the next step; the formula for f2 is

Figure 749519DEST_PATH_IMAGE017

WhereinvIs the actual voltage value measured by the voltage-stabilized power supply equipment in advance,cthe average value of multiple voltage values measured by using a voltage-stabilized power supply device in advance;

step 2.4, the gateway reads the voltage data of the display screen for m times through the second acquisition chip, calculates to obtain an average value d, compares the average value d with the voltage threshold value of the display screen to judge whether the voltage is abnormal or not, sends the information that the voltage of the display screen is abnormal or normal to the server, and then enters the next step; the display screen voltage threshold value is obtained according to the specification of the display screen;

step 2.5, the gateway reads the voltage data of the sound equipment for m times through the third acquisition chip, calculates to obtain an average value e, compares the average value e with the voltage threshold value of the sound equipment to judge whether the voltage is abnormal or not, sends the information that the voltage of the sound equipment is abnormal or normal to the server, and then enters the next step; the voltage threshold value of the sound is obtained according to the specification of the sound;

step 2.6, the gateway reads the voltage data of the wireless AP for m times through the fourth acquisition chip, calculates to obtain an average value g, compares the average value g with the voltage threshold of the wireless AP to judge whether the voltage is abnormal or not, sends the information of the abnormal or normal voltage of the wireless AP to the server, and finishes current and voltage data acquisition and processing; the wireless AP voltage threshold is obtained according to the specification of the wireless AP.

Preferably, m is 5.

The acquisition and processing of the gateway and the data of each peripheral connected with the gateway are all centralized in the gateway, so that the computing capacity of the server is greatly saved, and the expansion and compatibility of the server are facilitated.

Description of the drawings: the peripherals connected with the gateway are not limited to the weather instrument, the sound, the display screen and the wireless AP in the embodiment, and other peripherals can be provided, and the monitoring method for other peripherals is similar to that of the monitoring method for other peripherals according to actual needs.

The above embodiments are only preferred embodiments of the present invention, and are not intended to limit the technical solutions of the present invention, so long as the technical solutions can be realized on the basis of the above embodiments without creative efforts, which should be considered to fall within the protection scope of the patent of the present invention.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:终端信号质量评估方法、装置及干扰处理方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类