Working method of electric power security fence, computer device and storage medium

文档序号:4380 发布日期:2021-09-17 浏览:45次 中文

阅读说明:本技术 电力安全围栏的工作方法、计算机装置及存储介质 (Working method of electric power security fence, computer device and storage medium ) 是由 方道奎 杨琦琛 于 2021-06-25 设计创作,主要内容包括:本发明提供一种电力安全围栏的工作方法、计算机装置及存储介质,该方法包括:控制当前启动的超声波传感器进行一次采样,获得第一距离数据;判断第一距离数据是否处于有效范围内,若是,控制超声波传感器进行第一预设次数的连续采样,获得第一预设数量的第二距离数据;判断所有第二距离数据是否均处于有效范围内,若是,控制超声波传感器进行连续采样,并对每一次采样的数据进行有效性判断,直至采集到第二预设数量的有效距离数据;对第二预设数量的有效距离数据进行大小排序,获取中间值作为最终距离值;判断最终距离值是否处于预警范围值内,若是,进行报警操作。应用本发明的方法可提升电力安全围栏传感器灵敏度与准确度。(The invention provides a working method of an electric power security fence, a computer device and a storage medium, wherein the method comprises the following steps: controlling a currently started ultrasonic sensor to perform primary sampling to obtain first distance data; judging whether the first distance data are in an effective range, if so, controlling the ultrasonic sensor to perform continuous sampling for a first preset number of times to obtain second distance data of a first preset number; judging whether all the second distance data are within an effective range, if so, controlling the ultrasonic sensor to perform continuous sampling, and performing effectiveness judgment on the data sampled each time until a second preset number of effective distance data are acquired; sorting the effective distance data of the second preset quantity in size to obtain an intermediate value as a final distance value; and judging whether the final distance value is within the early warning range value, and if so, performing alarm operation. The method can improve the sensitivity and accuracy of the electric power security fence sensor.)

1. An operation method of an electric power safety fence is characterized by comprising the following steps:

controlling a currently started ultrasonic sensor to perform primary sampling to obtain first distance data;

judging whether the first distance data are in an effective range, if so, controlling the ultrasonic sensor to perform continuous sampling for a first preset number of times to obtain second distance data of a first preset number;

judging whether all the second distance data are in an effective range, if so, controlling the ultrasonic sensor to perform continuous sampling, and performing effectiveness judgment on the sampled data each time until a second preset number of effective distance data are acquired;

sorting the effective distance data of the second preset quantity in size to obtain an intermediate value as a final distance value;

and judging whether the final distance value is within an early warning range value, and if so, performing alarm operation.

2. The method of operating an electric power security fence according to claim 1,

the step of controlling the started ultrasonic sensor to perform one-time sampling and acquiring first distance data comprises the following steps:

and delaying the preset time length after the ultrasonic sensor is started and then sampling.

3. The method of operating an electric power security fence according to claim 1,

the effective range is 0 to 100 CM.

4. The method of operating an electric power security fence according to claim 1,

after the step of determining whether all of the second distance data are within the valid range, the method further includes:

and if the data out of the effective range exists in all the second distance data, returning to the step of sequentially starting the power supply of one ultrasonic sensor in a roll calling manner.

5. A method of operating an electric power safety fence according to any of claims 1 to 4,

the second preset number ranges from 11 to 31.

6. A method of operating an electric power safety fence according to any of claims 1 to 4,

before the step of controlling the currently activated ultrasonic sensor to perform one sampling to obtain the first distance data, the method further includes:

the power supply to the ultrasonic sensors is activated one at a time in a roll call fashion.

7. A method of operating an electric power safety fence according to any of claims 1 to 4,

the step of performing an alarm operation includes:

and performing sound and light alarm operation.

8. Method of operating an electric power safety fence according to claim 7 provided with a wireless communication module,

the step of performing an alarm operation further comprises:

and sending an alarm signal to a remote terminal through the wireless communication module.

9. A computer device comprising a processor and a memory, wherein: the memory stores a computer program which, when executed by the processor, carries out the steps of the method of operating a power safety fence according to any of claims 1 to 8.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program when executed by a controller implements the steps of a method of operating a power safety fence according to any of claims 1 to 8.

Technical Field

The invention relates to the technical field of electric power security fences, in particular to a working method of an electric power security fence, a computer device applying the working method of the electric power security fence and a computer readable storage medium applying the working method of the electric power security fence.

Background

The ultrasonic sensors used by the conventional electric power security fence are large in number, generally need to be set to four or five, are high in power consumption (close to one hundred milliamperes), and are easily influenced by environmental factors (such as illumination, uneven surfaces of reflecting objects and the like), so that the electric power security fence needs to be supported by commercial power in the use process, and meanwhile, false alarm or false alarm is frequently generated. In order to avoid the error, the conventional method is to increase the sampling times of the ultrasonic sensor to stabilize the data, but the method loses the sensitivity, and at the same time, the effect of coping with the environmental factors is still poor.

Therefore, a new method is needed to solve the above problems.

Disclosure of Invention

The first objective of the present invention is to provide a method for operating an electric power security fence to improve the sensitivity and accuracy of an electric power security fence sensor.

A second objective of the present invention is to provide a computer device for improving the sensitivity and accuracy of an electric power security fence sensor.

It is a third object of the present invention to provide a computer readable storage medium for improving the sensitivity and accuracy of a power safety fence sensor.

In order to achieve the first object, the present invention provides a method for operating an electric security fence, comprising: controlling a currently started ultrasonic sensor to perform primary sampling to obtain first distance data; judging whether the first distance data are in an effective range, if so, controlling the ultrasonic sensor to perform continuous sampling for a first preset number of times to obtain second distance data of a first preset number; judging whether all the second distance data are within an effective range, if so, controlling the ultrasonic sensor to perform continuous sampling, and performing effectiveness judgment on the data sampled each time until a second preset number of effective distance data are acquired; sorting the effective distance data of the second preset quantity in size to obtain an intermediate value as a final distance value; and judging whether the final distance value is within the early warning range value, and if so, performing alarm operation.

Therefore, the working method of the electric power safety fence provided by the invention can be used for sampling once through the currently started ultrasonic sensor to confirm whether the effective distance data is acquired, and when the effective distance data is acquired, the sensor is required to be confirmed not to be falsely triggered due to the influence of the external environment, so that continuous sampling for the first preset times is performed, and when all the second distance data are judged to be in the effective range, the data detected by the ultrasonic sensor are considered to be true and effective, actual distance measurement can be performed, and the second preset number of effective distance data can be acquired for distance measurement. Meanwhile, the effective distance data of the second preset number are sorted in size, and the intermediate value is obtained and used as the final distance value, so that the detection accuracy is improved. The invention effectively ensures that the device does not miss report and miss report through different definitions of the sampling times and iterative filtering in three stages, and the ultrasonic sensor can still give accurate information in severe environment.

In a further aspect, the step of controlling the started ultrasonic sensor to perform one-time sampling to obtain the first distance data includes: and delaying the preset time length after the ultrasonic sensor is started and then sampling.

Therefore, after the ultrasonic sensor is started, the preset time is delayed, sampling is carried out, the stability of data collected by the sensor can be ensured, and the read data messy codes are avoided.

In a further embodiment, the effective range is 0 to 100 CM.

Therefore, the acquired data is considered to be valid data when the acquired data is in the range of 0 to 100CM, and the detection accuracy is improved.

In a further aspect, after the step of determining whether all the second distance data are within the valid range, the method further includes: and if the data out of the effective range exists in all the second distance data, returning to the step of sequentially starting the power supply of one ultrasonic sensor in a roll calling manner.

Therefore, if data outside the effective range exists in all the second distance data, the data detected by the ultrasonic sensor is considered to have false triggering caused by external environment influence, and actual distance measurement operation is not needed.

In a further aspect, the second predetermined number ranges from 11 to 31.

Therefore, the second preset number ranges from 11 to 31, and the phenomenon that the precision is reduced when the sampling data is less and the missing report of other ultrasonic sensors is easily caused when the sampling times are more is avoided.

In a further aspect, before the step of controlling the currently activated ultrasonic sensor to perform one-time sampling to obtain the first distance data, the method further includes: the power supply to the ultrasonic sensors is activated one at a time in a roll call fashion.

Therefore, the power supply of one ultrasonic sensor is started at one time in a roll calling mode, the situation that the static power consumption is too high when all the sensors are turned on at the same time can be avoided, the working stability of the battery type equipment can be improved, and meanwhile, the standby time is prolonged.

In a further aspect, the step of performing an alarm operation comprises: and performing sound and light alarm operation.

Therefore, the user can know that an object is close to the mobile phone conveniently through sound and light alarm.

In a further scheme, the step of performing the alarm operation further comprises: and sending an alarm signal to the remote terminal through the wireless communication module.

Therefore, when the alarm operation is carried out, the alarm signal is sent to the remote terminal through the wireless communication module, so that the remote monitoring of a user is facilitated.

In order to achieve the second object of the present invention, the present invention provides a computer device including a processor and a memory, wherein the memory stores a computer program, and the computer program is executed by the processor to implement the steps of the operation method of the electric power safety fence.

In order to achieve the third object of the present invention, the present invention provides a computer readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a controller, implements the steps of the method for operating the electric power safety fence.

Drawings

Fig. 1 is a flowchart of an embodiment of a method for operating an electric security fence according to the present invention.

The invention is further explained with reference to the drawings and the embodiments.

Detailed Description

The working method of the electric power safety fence is to apply an application program in the electric power safety fence and is used for realizing detection control of the ultrasonic sensor in the electric power safety fence. Preferably, the electric power safety fence is provided with a plurality of ultrasonic sensors, and the electric power safety fence is powered by a battery. The invention also provides a computer device, which comprises a controller, wherein the controller is used for implementing the steps of the working method of the electric power safety fence when executing the computer program stored in the memory. The present invention also provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a controller, implements the steps of the method for operating an electric power safety fence as described above.

The working method embodiment of the electric power safety fence comprises the following steps:

the working method of the electric power security fence in the embodiment is an application program applied to the electric power security fence, and is used for realizing detection control of the ultrasonic sensor in the electric power security fence.

Referring to fig. 1, in the present embodiment, when the working method of the electric security fence works, step S1 is first executed to start the power supply of one ultrasonic sensor at a time in a roll-call manner. With multiple ultrasonic sensors in the power safety rail, if all sensors are turned on at the same time, the static power consumption will reach above 100mA, which is almost unacceptable for battery-type devices. The power supply of one ultrasonic sensor is started in a roll calling mode at a time, the static power consumption is reduced to about 20mA, the situation that the static power consumption is too high when all the sensors are turned on simultaneously can be avoided, the working stability of the battery type equipment can be improved, meanwhile, the standby time is prolonged, and the long-time cruising of the battery type equipment can be realized without commercial power.

After the ultrasonic sensor is started, step S2 is executed to control the currently started ultrasonic sensor to perform one sampling to obtain first distance data. The currently activated ultrasonic sensor performs a sampling to detect whether an object enters. In this embodiment, the step of controlling the started ultrasonic sensor to perform sampling once to obtain the first distance data includes: and delaying the preset time length after the ultrasonic sensor is started and then sampling. The time length is preset in the time delay after the ultrasonic sensor is started, and then sampling is carried out, so that the stability of data acquisition of the sensor can be ensured, and the disorder code of the read data is avoided. The preset time duration can be preset according to experimental data, and in this embodiment, the preset time duration is 10 milliseconds.

After the first distance data is obtained, step S3 is executed to determine whether the first distance data is within the valid range. Since the data detected by the ultrasonic sensor is distance data, the effective range is 0 to 100CM in the present embodiment.

If it is determined that the first distance data is not the valid distance data, it is determined that further determination is not necessary for the currently activated ultrasonic sensor, and therefore, the process returns to step S1 to activate the next ultrasonic sensor.

If the first distance data is determined to be within the valid range, it is determined that it is necessary to further determine whether an object enters, so step S4 is executed to control the ultrasonic sensor to perform continuous sampling for a first preset number of times, and obtain a first preset number of second distance data. When the effective distance data is acquired, it is necessary to confirm that the ultrasonic sensor is not erroneously triggered due to the influence of the external environment, and therefore, continuous sampling is performed for a first preset number of times. The first preset number of times can be set as required, and in this embodiment, the first preset number of times is 3, and the first preset number of times is 3.

After the first preset number of second distance data are obtained, step S5 is executed to determine whether all the second distance data are within the valid range. Whether the ultrasonic sensor is falsely triggered due to the influence of the external environment can be determined by judging whether all the second distance data are in the effective range.

If there is data outside the valid range in all the second distance data, it is considered that the ultrasonic sensor is a false trigger due to an influence of an external environment, and it is not necessary to further determine the currently activated ultrasonic sensor, and therefore, the process returns to step S1, and the power supply of one ultrasonic sensor is sequentially activated again by the roll call method, and the next ultrasonic sensor is activated.

If all the second distance data are within the effective range, step S6 is executed, the ultrasonic sensor is controlled to perform continuous sampling, and validity judgment is performed on the data sampled each time until a second preset number of effective distance data are acquired. The second preset number can be set according to actual needs, and in this embodiment, the second preset number is 11. When all the second distance data are judged to be in the effective range, the data detected by the ultrasonic sensor are considered to be real and effective, actual distance measurement can be carried out, and in order to improve the detection accuracy, a second preset number of effective distance data are obtained for judgment.

After the second preset number of effective distance data is acquired, step S7 is executed to sort the second preset number of effective distance data, and acquire an intermediate value as a final distance value. The intermediate value is used as the final distance value of judgment, so that the judgment accuracy can be improved.

After the final distance value is obtained, step S8 is executed to determine whether the final distance value is within the early warning range value. The early warning value can be set according to actual needs, and in the embodiment, the early warning range value is within 0-80 cm. Through the early warning range value, whether the currently started ultrasonic sensor detects that an object is close to the ultrasonic sensor can be judged.

When the final distance value is not within the warning range value, it is determined that the object is not close to the currently activated ultrasonic sensor, and therefore, the process returns to step S1 to perform sampling of the next sensor. When the final distance value is within the early warning range value, it is determined that the currently activated ultrasonic sensor detects that an object is approaching, and therefore, step S9 is executed to perform an alarm operation. In this embodiment, the step of performing the alarm operation includes: and performing sound and light alarm operation. In order to be more easily noticed by the user, sound and light alarm can be simultaneously carried out, so that the user can know the alarm conveniently. In an optional embodiment, the electric power security fence is provided with a wireless communication module, and when the alarm operation is performed, an alarm signal can be sent to the remote terminal through the wireless communication module.

The embodiment of the computer device comprises:

the computer device of this embodiment includes a controller, and the controller implements the steps of the working method embodiment of the electric power security fence when executing the computer program.

For example, a computer program may be partitioned into one or more modules, which are stored in a memory and executed by a controller to implement the present invention. One or more of the modules may be a sequence of computer program instruction segments for describing the execution of a computer program in a computer device that is capable of performing certain functions.

The computer device may include, but is not limited to, a controller, a memory. Those skilled in the art will appreciate that the computer apparatus may include more or fewer components, or combine certain components, or different components, e.g., the computer apparatus may also include input-output devices, network access devices, buses, etc.

For example, the controller may be a Central Processing Unit (CPU), other general purpose controller, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable Gate Array (FPGA) or other programmable logic device, discrete Gate or transistor logic, discrete hardware components, and so on. The general controller may be a microcontroller or the controller may be any conventional controller or the like. The controller is the control center of the computer device and connects the various parts of the entire computer device using various interfaces and lines.

The memory may be used to store computer programs and/or modules, and the controller may implement various functions of the computer apparatus by executing or otherwise executing the computer programs and/or modules stored in the memory and invoking data stored in the memory. For example, the memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (e.g., a sound receiving function, a sound-to-text function, etc.), and the like; the storage data area may store data (e.g., audio data, text data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.

Computer-readable storage medium embodiments:

the modules integrated by the computer apparatus of the above embodiments, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on such understanding, all or part of the flow of the working method embodiment of the electric power safety fence can also be completed by instructing the related hardware through a computer program, and the computer program can be stored in a computer readable storage medium, and when the computer program is executed by a controller, the steps of the working method embodiment of the electric power safety fence can be realized. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The storage medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, in accordance with legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunications signals.

Therefore, according to the working method of the electric power safety fence, sampling is performed once through the currently started ultrasonic sensor, whether effective distance data are obtained or not is confirmed, when the effective distance data are obtained, it is required to confirm that the sensor is not mistakenly triggered due to the influence of an external environment, therefore, continuous sampling is performed for the first preset times, when all the second distance data are judged to be within an effective range, the data detected by the ultrasonic sensor are considered to be real and effective, actual distance measurement can be performed, and accordingly, the second preset number of effective distance data are collected and used for distance measurement. Meanwhile, the effective distance data of the second preset number are sorted in size, and the intermediate value is obtained and used as the final distance value, so that the detection accuracy is improved. The invention effectively ensures that the device does not miss report and miss report through different definitions of the sampling times and iterative filtering in three stages, and the ultrasonic sensor can still give accurate information in severe environment. Meanwhile, the power supply of one ultrasonic sensor is started at one time in a roll call mode, so that the situation that the static power consumption is too high when all the sensors are turned on at the same time can be avoided, the working stability of the battery type equipment can be improved, and meanwhile, the standby time is prolonged.

It should be noted that the above is only a preferred embodiment of the present invention, but the design concept of the present invention is not limited thereto, and any insubstantial modifications made by using the design concept also fall within the protection scope of the present invention.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于BIM的建筑工程用防护栏

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!