Wireless LoRa data processing method and device

文档序号:1966263 发布日期:2021-12-14 浏览:12次 中文

阅读说明:本技术 一种无线LoRa数据处理方法及装置 (Wireless LoRa data processing method and device ) 是由 印贤涛 张贵 杜俊杰 于 2021-09-14 设计创作,主要内容包括:本申请提供了一种无线LoRa数据处理方法及装置,无线LoRa数据处理方法包括,检测所述灯塔的反应状态,生成状态记录;当检测到状态记录时,初始化并启动LoRa模组;通过所述LoRa模组转换所述状态记录,生成状态数据;对启动的所述LoRa模组和网关进行时钟同步;当时钟同步完成,通过LoRa模组发送所述状态据到所述网关。通过上述方法,解决不改变设备主体的情况下使设备具备一定的无线通信能力,使设备主体的运行状态可通过LoRa模组进行远距离传输。(The application provides a wireless LoRa data processing method and a wireless LoRa data processing device, wherein the wireless LoRa data processing method comprises the steps of detecting the reaction state of a lighthouse and generating a state record; when the state record is detected, initializing and starting the LoRa module; converting the state record through the LoRa module to generate state data; performing clock synchronization on the started LoRa module and the gateway; and when the clock synchronization is completed, sending the state data to the gateway through the LoRa module. By the method, the equipment has certain wireless communication capacity under the condition of not changing the equipment main body, and the running state of the equipment main body can be transmitted in a long distance through the LoRa module.)

1. A wireless LoRa data processing method is characterized in that the method relates to a LoRa module and a gateway, and the method is used for transmitting lighthouse data of a LoRa terminal in a wireless mode;

the method comprises the following steps:

detecting the reaction state of the lighthouse and generating state data according to the reaction state;

performing clock synchronization on the started LoRa module and the gateway;

and sending the state data to the gateway through the LoRa module after clock synchronization.

2. The method of claim 1, wherein the step of detecting a reaction state of the lighthouse and generating state data based on the reaction state comprises:

detecting the reaction state of the lighthouse and generating a state record;

when the state record is detected, initializing and starting the LoRa module;

and converting the state record through the LoRa module to generate state data.

3. The method of claim 2, wherein detecting the reaction status of the lighthouse, the step of generating a status record comprises:

detecting the indicating state of each group of indicating lamps in the lighthouse;

and recording the indication state and the equipment state corresponding to the indication state.

4. The method of claim 3, wherein the detecting the indicating status of each set of indicator lights in a lighthouse further comprises:

and detecting the flicker frequency of each group of indicator lamps in the lighthouse.

5. The method of claim 2, wherein the step of initializing and starting the LoRa module comprises:

initializing an LoRa module, and configuring communication parameters of the LoRa module according to preset FLASH parameters, wherein the communication parameters comprise channel parameters, power parameters, speed parameters and baud rate parameters;

and starting the LoRa module according to the channel parameter, the power parameter, the speed parameter and the baud rate parameter, and enabling the LoRa module to enter a ready state.

6. The method of claim 5, further comprising detecting whether any device is networked, and if so, reporting the status of the networked device and continuing the detection; otherwise, detection is continued.

7. The method of claim 1, wherein the step after sending the status data to the gateway via the LoRa module when the clock synchronization is completed further comprises:

and uploading the state data to a cloud terminal through the gateway.

8. The wireless LoRa data processing device is characterized by relating to a LoRa module and a gateway, and being used for transmitting lighthouse data of a LoRa terminal in a wireless mode;

the device comprises:

the state data generation module is used for detecting the reaction state of the lighthouse and generating state data according to the reaction state;

the clock synchronization module is used for carrying out clock synchronization on the started LoRa module and the gateway;

and the data transmission module is used for sending the state data to the gateway through the LoRa module when the clock synchronization is completed.

9. An apparatus comprising a processor, a memory, and a computer program stored on the memory and capable of running on the processor, the computer program when executed by the processor implementing the method of any one of claims 1 to 7.

10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.

Technical Field

The application relates to the technical field of LoRa data processing, in particular to a wireless LoRa data processing method and device.

Background

LoRa (Long Range) is an ultra-long distance wireless transmission scheme based on spread spectrum technology adopted and popularized by Semtech corporation in America. The LoRa network mainly comprises a terminal (which can be internally provided with a LoRa module), a gateway (or called a base station), a Server and a cloud, and application data can be transmitted in a two-way mode.

In industrial equipment, the running state of the equipment needs to be transmitted through network equipment, so that the running state of the equipment is monitored, and when the equipment breaks down, workers are timely notified to maintain the equipment.

However, the conventional industrial equipment does not have a wireless communication function, particularly does not have a remote wireless communication capability, and can only store data locally, and if the local storage equipment fails, the problems of data loss and the like are caused.

Disclosure of Invention

In view of the above problems, the present application is proposed to provide a wireless LoRa data processing method and apparatus that overcome or at least partially solve the above problems, including:

a wireless LoRa data processing method relates to a LoRa module and a gateway, and is used for transmitting lighthouse data of a LoRa terminal in a wireless mode;

the method comprises the following steps:

detecting the reaction state of the lighthouse and generating a state record;

when the state record is detected, initializing and starting the LoRa module;

converting the state record through the LoRa module to generate state data;

performing clock synchronization on the started LoRa module and the gateway;

and when the clock synchronization is completed, sending the state data to the gateway through the LoRa module.

Further, the step of detecting the reaction state of the lighthouse and generating the state record further comprises:

system parameters are initialized.

Further, the step of detecting the reaction state of the lighthouse and generating a state record comprises:

detecting an indication state of each group of indicator lamps in a lighthouse, specifically, detecting a lamp voltage state and a current state of each group of indicator lamps in the lighthouse through a state detection circuit, and detecting a color state of each group of indicator lamps through a color sensor, wherein the indication state corresponds to an operating state of equipment, and the indication state comprises a normally-on state, a flashing state and a non-lighting state;

and recording the indication state and the equipment state corresponding to the indication state.

Further, the detecting the indication state of each group of indicator lights in the lighthouse further includes:

and detecting the flicker frequency of each group of indicator lamps in the lighthouse.

Further, the step of initializing and starting the LoRa module includes:

initializing an LoRa module, and configuring communication parameters of the LoRa module according to preset FLASH parameters, wherein the communication parameters comprise a channel, power, speed and configuration baud rate;

and starting the LoRa module according to the communication parameters, and enabling the LoRa module to enter a ready state.

Further, whether equipment is accessed to the network is detected, if yes, the state of the equipment accessed to the network is reported and the detection is continued; otherwise, detection is continued.

Further, the step after the clock synchronization is completed and the state data is sent to the gateway through the LoRa module further includes:

and uploading the state data to a cloud terminal through the gateway.

A wireless LoRa data processing device relates to a LoRa module and a gateway, and is used for transmitting lighthouse data of a LoRa terminal in a wireless mode;

the device comprises:

the detection module is used for detecting the reaction state of the lighthouse and generating a state record;

the initialization module is used for initializing and starting the LoRa module when the state record is detected;

the data conversion module is used for converting the state record through the LoRa module to generate state data;

the clock synchronization module is used for carrying out clock synchronization on the started LoRa module and the gateway;

and the data transmission module is used for sending the state data to the gateway through the LoRa module when the clock synchronization is completed.

An apparatus comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the wireless LoRa data processing method as described above.

A computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of the wireless LoRa data processing method as described above.

The application has the following advantages:

in an embodiment of the present application, a status record is generated by detecting a reaction status of the lighthouse; when the state record is detected, initializing and starting the LoRa module; converting the state record through the LoRa module to generate state data; performing clock synchronization on the started LoRa module and the gateway; and when the clock synchronization is completed, sending the state data to the gateway through the LoRa module. By the method, the equipment has certain wireless communication capacity under the condition of not changing the equipment main body, and the running state of the equipment main body can be transmitted in a long distance through the LoRa module.

Drawings

In order to more clearly illustrate the technical solutions of the present application, the drawings needed to be used in the description of the present application will be briefly introduced below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive labor.

Fig. 1 is a flowchart illustrating steps of a wireless LoRa data processing method according to an embodiment of the present application;

fig. 2 is a block diagram illustrating a structure of a wireless LoRa data processing apparatus according to an embodiment of the present application;

fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application.

Detailed Description

In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

It should be noted that in any of the embodiments of the present application, the preamble is defined in connection with the whole text.

Referring to fig. 1, a wireless LoRa data processing method provided in an embodiment of the present application is shown, where the method involves an LoRa module and a gateway, and is used to transmit beacon data of an LoRa terminal in a wireless manner;

the method comprises the following steps:

s110, detecting the reaction state of the lighthouse, and generating state data according to the reaction state;

s120, performing clock synchronization on the started LoRa module and the gateway;

s130, the LoRa module after clock synchronization sends the state data to the gateway.

In an embodiment of the present application, a status record is generated by detecting a reaction status of the lighthouse; when the state record is detected, initializing and starting the LoRa module; converting the state record through the LoRa module to generate state data; performing clock synchronization on the started LoRa module and the gateway; and when the clock synchronization is completed, sending the state data to the gateway through the LoRa module. By the method, the equipment has certain wireless communication capacity under the condition of not changing the equipment main body, and the running state of the equipment main body can be transmitted in a long distance through the LoRa module.

Next, a wireless LoRa data processing method in the present exemplary embodiment will be further described.

In an embodiment of the present invention, in step S110, before the step of detecting the reaction state of the lighthouse and generating the state data according to the reaction state, the step further includes initializing a system parameter.

In the above embodiment, when the device is started, initializing the system parameters of the LoRa terminal to enable the lighthouse of the LoRa terminal to enter a power-on state, after the lighthouse is powered on, detecting the state of the device in real time through the sensor, and displaying the state of the lamp arranged in the lighthouse through the circuit drive in the lighthouse; the running state of the equipment is converted into the visual state of the lamp, so that the running state of the current equipment can be conveniently judged and identified, and whether the equipment is good or not can be conveniently judged.

Detecting the reaction state of the lighthouse and generating state data according to the reaction state in the step S110.

In an embodiment of the present application, a specific process of "detecting a reaction state of the lighthouse and generating state data according to the reaction state" in step S110 can be further described with reference to the following description.

Detecting a reaction state of the lighthouse as described in the following steps, the step of generating a state record comprising: detecting an indication state of each group of indicator lamps in a lighthouse, specifically, detecting a lamp voltage state and a current state of each group of indicator lamps in the lighthouse through a state detection circuit, and detecting a color state of each group of indicator lamps through a color sensor, wherein the indication state corresponds to an operating state of equipment, and the indication state comprises a normally-on state, a flashing state and a non-lighting state; and recording the indication state and the equipment state corresponding to the indication state.

When the state record is detected, initializing and starting a LoRa module; specifically, an LoRa module is initialized, and communication parameters of the LoRa module are configured according to preset FLASH parameters, wherein the communication parameters comprise a channel parameter, a power parameter, a speed parameter and a baud rate parameter; according to the channel parameter, the power parameter, the speed parameter and the baud rate parameter; and starting the LoRa module through the parameters, and sending a message of entering a ready state to equipment in the network, so that the on-line equipment can be connected to the LoRa module.

In an embodiment of the present application, the method further includes detecting whether a device in a device list in the LoRa module accesses the network, and if so, reporting a state of the network access device and continuing to detect; otherwise, detection is continued.

It should be noted that, when detecting that the lighthouse has a status record, the LoRa module is initialized; if the LoRa module is in a non-state, the LoRa module is not started, so that the LoRa module is initialized and started only when the LoRa module needs to participate, and the equipment can be more energy-saving; the basic parameters for starting the LoRa module are stored in a FLASH (FLASH memory) unit of the LoRa module, the parameters can be adjusted according to the actual running network environment, and the configured parameters including the channel, the power, the speed and the configuration baud rate are written into the FLASH to serve as default parameters, so that the LoRa module is more flexible to use, the problem that the parameters of the LoRa module in the prior art are fixed and can not be changed is solved, the parameters of network equipment need to be changed to adapt to the LoRa module, and the LoRa module has better adaptability and compatibility.

Converting the state record through the LoRa module to generate state data; sampling equipment through a lighthouse arranged on industrial equipment, wherein the lighthouse reflects the running state of the sampled equipment in real time and generates a state record; for example, in the device start state, the first group of lights of the lighthouse is always on as green, and in the pause standby state, the first group of lights flickers at a specific frequency, for example, the specific frequency may be, but is not limited to, 1 Hz;

in an embodiment of the present application, the detecting the indication state of each group of indicator lights in the lighthouse further includes: and detecting the flicker frequency of each group of indicator lamps in the lighthouse.

In the above embodiment, the indication of the device status is performed by the normally on status, the non-on status, the flashing status and the color display of each group of lamps, so that the indication of the device status is more detailed, and the device status also includes whether the device operating temperature is normal, for example, if the temperature is out of the range and the device is in the bearing range, a yellow lamp or flashing can be displayed, if the temperature is out of the range, a red lamp is lit, the light on status is detected by the current and voltage sensors and the color of the light is detected by the color sensor, and the status displayed by the lamps is recorded.

In an embodiment of the present application, the status data generated by converting the status records through the LoRa module may be further described with reference to the following description, specifically, the status records of the devices are converted through the LoRa module, and the records of the various statuses are converted into corresponding status data, for example, the records of the device statuses converted by the normally-on status, the non-on status, the flashing status, and the color display are converted into the status data.

In an embodiment of the present application, the clock synchronization of the activated LoRa module and the gateway in step S120 can be further described in conjunction with the following description, and can be widely used to synchronize the computer to an Internet Time server or other sources, such as a radio or satellite receiver or a telephone modem service, through a Network Time Protocol (NTP). It may also act as a server for the associated client. It typically provides less than one millisecond of accuracy on a LAN and several milliseconds on a WAN. A typical NTP configuration uses multiple redundant servers and different network paths to achieve high accuracy and reliability.

In step S130, the sending the status data to the gateway by the LoRa module after clock synchronization includes: and uploading the state data to a cloud terminal through the gateway.

In the embodiment, the state data cloud is uploaded through the gateway, so that the problems that the local storage in the industrial equipment is limited by the running state of the local storage and the state of the local storage device, the local storage device is easy to damage, the remote query is difficult, and the state number can be realized are solved.

For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.

Fig. 2 illustrates a wireless LoRa data processing apparatus according to an embodiment of the present application; the device relates to an LoRa module and a gateway, and is used for transmitting lighthouse data of an LoRa terminal in a wireless mode; the method specifically comprises the following steps:

a state data generating module 210, configured to detect a reaction state of the lighthouse, and generate state data according to the reaction state;

the clock synchronization module 220 is configured to perform clock synchronization on the started LoRa module and the gateway;

and the data conversion module 230 is configured to send the status data to the gateway through the LoRa module when the clock synchronization is completed.

In an embodiment of the present application, the system further includes a system startup module, configured to initialize system parameters and complete startup of the system according to the system parameters;

in an embodiment of the present application, the detecting module 210 includes a detecting submodule, configured to detect a reaction state of the lighthouse, and generate a state record, including detecting an indication state of each group of indicator lamps in the lighthouse, specifically, detecting a lamp voltage and a current state of each group of indicator lamps in the lighthouse through a state detecting circuit, and detecting a color state of each group of indicator lamps through a color sensor, where the indication state corresponds to an operating state of the device, and the indication state includes a normally-on state, a flashing state, and a non-on state; the initialization submodule is used for initializing and starting the LoRa module when the state record is detected; and the data conversion submodule is used for converting the state record through the LoRa module to generate state data.

In an embodiment of the application, the detection sub-module includes a first recording sub-module, configured to record the indication status and a device status corresponding to the indication status.

In an embodiment of the present application, the lighting control device further includes a frequency status detection sub-module, configured to detect a flashing frequency of each group of indicator lights in the lighthouse.

In an embodiment of the present application, the initialization sub-module includes a parameter configuration sub-module, configured to initialize the LoRa module, and configure a communication parameter of the LoRa module according to a preset FLASH parameter, where the communication parameter includes a channel, a power, a speed, and a configuration baud rate;

and the starting submodule is used for starting the LoRa module according to the communication parameters and enabling the LoRa module to enter a ready state.

In an embodiment of the present application, the system further includes a network access detection module, configured to detect whether a device accesses a network, and if so, report a state of the network access device and continue to detect; otherwise, detection is continued.

In an embodiment of the application, the system further includes an uploading module, configured to upload the status data to a cloud through the gateway.

Referring to fig. 3, a computer device for a wireless LoRa data processing method according to the present application is shown, which may specifically include the following:

the computer device 12 described above is embodied in the form of a general purpose computing device, and the components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that couples various system components including the memory 28 and the processing unit 16.

Bus 18 represents one or more of any of several types of bus 18 structures, including a memory bus 18 or memory controller, a peripheral bus 18, an accelerated graphics port, and a processor or local bus 18 using any of a variety of bus 18 architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus 18, micro-channel architecture (MAC) bus 18, enhanced ISA bus 18, audio Video Electronics Standards Association (VESA) local bus 18, and Peripheral Component Interconnect (PCI) bus 18.

Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.

The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory 30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (commonly referred to as "hard drives"). Although not shown in FIG. 3, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules 42, with the program modules 42 configured to carry out the functions of embodiments of the application.

A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules 42, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally perform the functions and/or methodologies of the embodiments described herein.

Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, camera, etc.), with one or more devices that enable an operator to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through the I/O interface 22. Also, computer device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN)), a Wide Area Network (WAN), and/or a public network (e.g., the Internet) via network adapter 20. As shown in FIG. 3, the network adapter 20 communicates with the other modules of the computer device 12 via the bus 18. It should be appreciated that although not shown in FIG. 3, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units 16, external disk drive arrays, RAID systems, tape drives, and data backup storage systems 34, etc.

The processing unit 16 executes various functional applications and data processing by running programs stored in the memory 28, for example, implementing a wireless LoRa data processing method provided in the embodiments of the present application.

That is, the processing unit 16 implements, when executing the program,: detecting the reaction state of the lighthouse and generating a state record; when the state record is detected, initializing and starting the LoRa module; converting the state record through the LoRa module to generate state data; performing clock synchronization on the started LoRa module and the gateway; and when the clock synchronization is completed, sending the state data to the gateway through the LoRa module.

In an embodiment of the present application, there is also provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements a wireless LoRa data processing method as provided in all embodiments of the present application;

that is, the program when executed by the processor implements: detecting the reaction state of the lighthouse and generating a state record; when the state record is detected, initializing and starting the LoRa module; converting the state record through the LoRa module to generate state data; performing clock synchronization on the started LoRa module and the gateway; and when the clock synchronization is completed, sending the state data to the gateway through the LoRa module.

Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.

Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the operator's computer, partly on the operator's computer, as a stand-alone software package, partly on the operator's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the operator's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.

While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.

Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.

The foregoing describes in detail a method and an apparatus for processing wireless LoRa data provided by the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the foregoing embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种5G通信侦控定位方法及系统

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!