CN110113771A - Data processing method, device, gateway and storage medium - Google Patents
Data processing method, device, gateway and storage medium Download PDFInfo
- Publication number
- CN110113771A CN110113771A CN201910224211.6A CN201910224211A CN110113771A CN 110113771 A CN110113771 A CN 110113771A CN 201910224211 A CN201910224211 A CN 201910224211A CN 110113771 A CN110113771 A CN 110113771A
- Authority
- CN
- China
- Prior art keywords
- data
- gateway
- packet capturing
- primary processor
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/04—Arrangements for maintaining operational condition
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W88/00—Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
- H04W88/16—Gateway arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the present application discloses a kind of data processing method, device, gateway and storage medium, is related to field of communication technology.The data processing method is applied to gateway, when the data processing method includes: the first data that the physical layer of the wireless module of the gateway is transmitted in receiving network, by the primary processor of the MAC layer of the wireless module of the first data transmission to the gateway and the gateway;The MAC layer of the wireless module of the gateway receive the MAC layer with upper layer send the second data when, by second data be transmitted to the wireless module of the gateway physical layer and the primary processor;The primary processor generates packet capturing file according to first data and second data.This method may be implemented to grab the data in communication network by gateway.
Description
Technical field
This application involves field of communication technology, more particularly, to a kind of data processing method, device, gateway and
Storage medium.
Background technique
Currently, the node device in wireless network is in the process of running, it is easy to appear network communication failure or equipment operation
Failure causes node device to cannot achieve function relevant to network communication.Therefore, it is necessary to technical staff to carry out wireless network
Monitoring, and in wireless network failure problem, carry out failure problems analysis and positioning.It is at present usually to install one at the scene
A equipment for carrying out air-data packet capturing, all data messages grabbed in on-site wireless network working channel in real time (communicate
Data packet), to be monitored to field network.But there is no actual application functions at the scene for the equipment, only for realizing
The debugging function of network, function are relatively simple.
Summary of the invention
In view of the above problems, the embodiment of the present application proposes a kind of data processing method, device, gateway and storage and is situated between
Matter can be realized the data grabbed in communication network by gateway.
In a first aspect, the embodiment of the present application provides a kind of data processing method, it is applied to gateway, the method packet
It includes: when the first data that the physical layer of the wireless module of the gateway is transmitted in receiving network, by first number
According to the MAC layer for the wireless module for being transmitted to the gateway and the primary processor of the gateway;The gateway
Wireless module MAC layer receive the MAC layer with upper layer send the second data when, will second data transmission
Physical layer and the primary processor to the wireless module of the gateway;The primary processor is according to first data
And second data generate packet capturing file.
Second aspect, the embodiment of the present application provide a kind of data processing equipment, are applied to gateway, described device packet
It includes: first data transmission module, the second data transmission module and file generating module, wherein the first data transmission mould
When the first data that block transmits in receiving network for the physical layer of the wireless module of the gateway, by described first
Data are transmitted to the MAC layer of the wireless module of the gateway and the primary processor of the gateway;Second number
According to transmission module for the wireless module of the gateway MAC layer in the sent with upper layer for receiving the MAC layer
When two data, by second data be transmitted to the wireless module of the gateway physical layer and the primary processor;
The file generating module generates packet capturing text according to first data and second data for the primary processor
Part.
The third aspect, the embodiment of the present application provide a kind of gateway, comprising: one or more processors;Memory;
One or more application program, wherein one or more application programs are stored in memory and are configured as by one or more
A processor executes, and one or more programs are configured to carry out the data processing method that above-mentioned first aspect provides.
Fourth aspect, the embodiment of the present application provide a kind of computer-readable storage medium, computer-readable storage
Program code is stored in medium, program code can be called the data processing side for executing above-mentioned first aspect and providing by processor
Method.
Scheme provided by the present application, is applied to gateway, and the physical layer of the wireless module of gateway is receiving net
When the first data transmitted in network, by the way that the MAC layer of the wireless module of first data transmission to gateway and gateway are set
The MAC layer of the wireless module of standby primary processor and gateway is in the second data sent with upper layer for receiving MAC layer
When, by the way that the second data to be transmitted to the physical layer and primary processor of the wireless module of gateway, so that primary processor root
Packet capturing file is generated according to the first data and the second data, thus, in the case where not increasing any equipment and cost, gateway is set
It is standby that normal gateway function not only may be implemented, but also the crawl of network air communication data can be carried out, realize packet capturing function.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for
For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 shows a kind of application environment schematic diagram suitable for the embodiment of the present application.
Fig. 2 shows the structural schematic diagrams according to the gateway of the application one embodiment.
Fig. 3 shows the data processing method flow chart according to the application one embodiment.
Fig. 4 shows the data processing method flow chart according to another embodiment of the application.
Fig. 5 shows a flow chart of step S240 in the data processing method according to the embodiment of the present application.
Fig. 6 shows the block diagram of the data processing equipment according to the application one embodiment.
Fig. 7 is the embodiment of the present application for executing the gateway of the data processing method according to the embodiment of the present application
Block diagram.
Fig. 8 is the embodiment of the present application for saving or carrying the data processing method realized according to the embodiment of the present application
Program code storage unit.
Specific embodiment
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application
Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described.
Currently, the node device in wireless network (such as the Small Area Wireless Communication Networks such as Zigbee network) was being run
Cheng Zhong is easy to appear network communication failure or equipment operation failure, causes node device cannot achieve relevant to network communication
Function.It is especially higher in the debugging of network early period and trial operation stage, the probability to go wrong.In order to in operational process
Wireless network carries out network problem analysis and positioning problems, and common and effective method is to grab nothing by aerial packet capturing at present
All data messages (i.e. communication data packet) in gauze network working channel, and message file is being analyzed afterwards.
In order to grab the air communication message when on-site wireless network operation in real time, it is often necessary to pacify at the scene
The specific equipment for carrying out air-data packet capturing is filled, and there is no actual application functions at the scene for this equipment, only
Realize the debugging function of network.One specific packet capturing equipment is installed at the scene in this way but without actual application function,
Seem extra for complete equipment product, and increases the cost of device product.
In some scenes, for the cost for reducing device product, there is also by the function of some equipment of on-site wireless network
The case where packet capturing function can be switched to, for example, most of developer is in on-site wireless network for the ease of developing and debugging
The function switch of gateway is at packet capturing function.If directly the function switch of live gateway at packet capturing function,
The gateway loses the function of gateway, and gateway is very important equipment for the network operation, both needs
Whole network realized and be managed, and need to play the bridge interacted with extraneous (internet).Therefore, the gateway function of gateway
Can missing, not only affect the normal operation of network, to the crawl of network air communication data be lost network analysis and
The meaning of problem diagnosis.
In view of the above-mentioned problems, inventor after study, propose data processing method in the embodiment of the present application, device,
Packet capturing function is integrated in gateway by gateway and storage medium, so that the gateway can either be used as entire net
Network manager works normally, and realizes and applies upper function, and can be used as network packet capturing function and realize to network air communication number
According to crawl, without increasing any equipment and cost.
The application scenarios of data processing method provided by the embodiments of the present application are introduced below.
Referring to Figure 1, the embodiment of the present application provides a kind of interactive system, which includes gateway 100
And the node device 200 communicated to connect with gateway 100.
In the embodiment of the present application, gateway 100 can be the intelligent gateway in smart home, be also possible to other
Acquisition, information input, information output, centralized control, the long-range control, connection of system information may be implemented in intelligent gateway in scape
The functions such as dynamic control.For example, gateway 100 can be specially Zigbee gateway.Gateway 100 can be responsible for specifically pacifying
Anti- alarm, home wiring control, power information acquisition.Gateway 100 can also be produced wirelessly with smart-interactive terminal etc.
Product carry out information exchange.Gateway has been also equipped with wireless routing function, excellent wireless performance, network security and covering surface
Product.Gateway 100 can also carry out the interaction of information by the wireless modes such as 2G/3G/4G/5G/WiFi and server.When
So, the connection type between gateway 100 and server in the embodiment of the present application can be not as restriction.
In the embodiment of the present application, node device 200 may include a variety of intelligent appliance equipment, sensing equipment and detection
Equipment etc., such as smart television, intelligent refrigerator or intelligent air condition etc..It may include Zigbee module in node device 200, with logical
Zigbee protocol or IEEE 802.15.4 agreement is crossed to be communicatively coupled with gateway 100.Gateway 100 and node
Equipment 200 can also pass through bluetooth, WiFi (Wireless-Fidelity, Wireless Fidelity), bluetooth Mesh (the netted skill of bluetooth
Art), the connection of the communication modes such as Thread (family's Internet of Things communications protocol technology), certainly, gateway 100 and node device
200 connection type in the embodiment of the present application can be not as restriction.
The gateway in the embodiment of the present application is illustrated below.
Fig. 2 is referred to, it illustrates a kind of gateway provided by the embodiments of the present application, which be can wrap
Include wireless module 101, microcontroller (Microcontroller Unit, MCU) module 102 and main processor modules 103, nothing
Wire module 101 is connect with micro controller module 102, and micro controller module 102 is connect with main processor modules 103.
In the embodiment of the present application, the sending and receiving for realizing data of wireless module 101 may include physical layer mould
Block 1011 and MAC layer module 1012, wherein physical layer block 1011 is connect with MAC layer module 1012, MAC layer module 1012
It is connect with micro controller module 102.In the embodiment of the present application, physical layer block 1011 can also directly and main processor modules
103 connections, MAC layer module 1012 can also directly be connect with main processor modules 103.
In the embodiment of the present application, physical layer block 1011 includes the radio frequency for meeting 2.4GHz IEEE 802.15.4 standard
(Radio Frequency, RF) transceiver.Wherein, RF transceiver is used to carry out the reception and transmission of data.Physical layer block
101 can be used for reception, transmission, digital-to-analogue conversion, analog-to-digital conversion, modulation, demodulation of data etc..
In the embodiment of the present application, MAC layer module 1012 can receive from micro controller module 102 (more than MAC layer
Layer) send data packet, and can by the packet encapsulation be mac-layer protocol data cell (mac frame).In some embodiments
In, packaged mac frame can be written and be sent in buffer queue by MAC layer.MAC layer module 1012 also can receive from physics
The data that layer is sent, and the data are verified, are filtered, to obtain the correct reception data of gateway.
In the embodiment of the present application, micro controller module 102 can read the verification of MAC layer module 1012, filtered number
According to, and send supreme layer protocol stack (MAC layer with upper layer).To be sent to main place after upper-layer protocol stack is packaged data
Manage device module 103.After the data that main processor modules 103 are sent can also be packaged by micro controller module 102, it is transmitted to
MAC layer module 1012 carries out further data encapsulation.
In the embodiment of the present application, main processor modules 103 can receive the data sent from micro controller module 102,
And it can be sent to its upper-layer user's processing routine according to actual needs or forward the data in the network in other frequency ranges.
Main processor modules 103 can will need the data sent to be sent to micro controller module 102, to carry out data encapsulation.
In some embodiments, it can be the interface between above-mentioned physical layer block 1011 and above-mentioned MAC layer module 1012
It can directly be connect with main processor modules 103, so that the available reception number to before checksum filter of main processor modules 103
Accordingly and modulation before transmission data, to realize packet capturing function.Wherein, which can be serial ports, is also possible to SPI etc. and connects
Mouthful, it is not limited thereto, only makes main processor modules 103 available to before the reception data and modulation before checksum filter
Send data.
In the embodiment of the present application, above-mentioned main processing block 103 is individually integrated on a chip.In some embodiments
In, above-mentioned wireless module 101 and micro controller module 102 can be integrated on a chip, be also possible to microcontroller
Module 102 is individually integrated in a chip, and wireless module 101 is integrated in another chip, and the integration mode between module is in this Shen
Please in and be not construed as limiting.
Based on above-mentioned interactive system and gateway, the embodiment of the present application provides a kind of data processing method, application
In above-mentioned gateway.Specific data processing method is introduced below.
Referring to Fig. 3, the embodiment of the present application provides a kind of data processing method, gateway can be applied to, the data
Processing method may include:
Step S110:, will when the first data that the physical layer of the wireless module of gateway is transmitted in receiving network
First data transmission to gateway wireless module MAC layer and gateway primary processor.
Currently, usually being installed at the scene to grab the air-data message when on-site wireless network operation in real time
One specific packet capturing equipment, or by the function switch of the gateway of on-site wireless network at packet capturing function, cause be not
Equipment cost is increased, the normal operation of on-site wireless network is exactly affected.Therefore, in the embodiment of the present application, pass through by
Packet capturing function is integrated in gateway, so that gateway has the function of gateway function and packet capturing simultaneously, without increasing
Any equipment and cost.
It is understood that under normal conditions, the process that gateway carries out normal data receiver is mainly: gateway is set
After the physical layer of standby wireless module receives the data transmitted in network by receiver, can by demodulator to the data into
Row demodulation, the data after demodulation can be stored to FIFO (First In First Out, first in first out) receiving unit, while gateway
The MAC layer of the wireless module of equipment the data after demodulation can be carried out verification and data frame filtering, will verify it is incorrect or
The data filtering that person is not intended for local equipment falls, obtain gateway should received correct data, then pass through interruption
Notice MCU (Microcontroller Unit, microcontroller) reads the correct data received.
Therefore, in the embodiment of the present application, in order to realize to the crawl function of entire communication in wireless networks data, need
In the case where not influencing receiver normal function, data are taken out data before entering verification and filtering, to be worked as
The preceding all data transmitted in a network.It is understood that the data obtained before verification and filtering may include being sent to this
The data of machine equipment may also comprise the data for being sent to other equipment in network, may also include school and examines incorrect data etc..
Specifically, when the first data that the physical layer of the wireless module of gateway is transmitted in receiving network, by
One data are transmitted to the MAC layer of the wireless module of gateway and the primary processor of gateway.Wherein, which is
All data transmitted in current network can be the data that destination address is non-local hardware address, be also possible to destination
Location is the data of local hardware address, is not limited thereto, depending on specific network traffic conditions.
In the embodiment of the present application, the physical layer of the wireless module of gateway is by first data transmission to gateway
The MAC layer of wireless module is the data reception step of gateway, so that the MAC layer of the wireless module of gateway can be right
First data are verified and are filtered, so that the available verification of gateway is correct and destination address is local hardware address
Data.And the physical layer of the wireless module of gateway is by the primary processor of first data transmission to gateway, is gateway
The packet capturing step of equipment, i.e., by the communication data transfer in current whole network to primary processor, so that gateway can grab
The communication data in whole network is got, realizes packet capturing function.To in the feelings for normally receiving function for not influencing gateway
Under condition, the crawl of the communication data in current whole network is realized.
Step S120: the MAC layer of the wireless module of gateway is in the second data sent with upper layer for receiving MAC layer
When, the second data are transmitted to the physical layer and primary processor of the wireless module of gateway.
It is understood that under normal conditions, the process that gateway carries out normal data transmission is mainly: gateway is set
The MAC layer of standby wireless module can send out the data to be sent in the data to be sent sent with upper layer for receiving MAC layer
It send to the physical layer of wireless module, physical layer can be modulated the data to be sent by modulator, and transmitter is then passed through
Modulated data to be sent are sent in network and are transmitted.
Therefore, in the embodiment of the present application, the data grabber in order to equally send gateway arrives, and realizes
To the crawl function of entire communication in wireless networks data, need in the case where not influencing the normal sending function of gateway,
Data are taken out data before the physical layer for being sent to wireless module is modulated.Specifically, the wireless mould of gateway
Second data are transmitted to the wireless of gateway in the second data sent with upper layer for receiving MAC layer by the MAC layer of block
The physical layer and primary processor of module.Wherein, which is the data that gateway needs to send.
In the embodiment of the present application, the second data are transmitted to gateway by the MAC layer of the wireless module of gateway
The physical layer of wireless module is the data sending step of gateway, so that the physical layer of the wireless module of gateway can be with
Second data are modulated, and modulated second data are sent in network by transmitter.And the nothing of gateway
Second data are transmitted to the primary processor of gateway by the MAC layer of wire module, are the packet capturing step of gateway, i.e., by gateway
The data that equipment is sent are transmitted to primary processor, so that gateway can grab the data that gateway is sent out,
Realize packet capturing function.To realize in current whole network in the case where not influencing the normal sending function of gateway
The crawl of communication data.
Step S130: primary processor generates packet capturing file according to the first data and the second data.
In the embodiment of the present application, the primary processor of gateway can be according to above-mentioned first data and above-mentioned second number
According to generation packet capturing file.Wherein, which can be used for carrying out network problem analysis and positioning problems.To not increase
In the case where any equipment and cost, normal gateway function had not only been may be implemented in gateway, but also can be carried out network air and be led to
Packet capturing function is realized in the crawl of letter data.
It can be seen from the above, the physical layer of the wireless module of gateway transmitted in receiving network the first data when,
Can by the primary processor of first data transmission to gateway, primary processor when receiving first data, can to this
One data are handled, to generate the packet capturing file for analysis.Similarly, the MAC layer of the wireless module of gateway is connecing
When receiving the second data of MAC layer sent with upper layer, the second data can be transmitted to the primary processor of gateway, main place
Device is managed when receiving second data, second data can also be handled, to generate the packet capturing file for analysis.
It is understood that all can be with source address and purpose in the first data and the second data of gateway crawl
Address, in some cases it is also possible to which the ID number of node device can be had.Therefore, when technical staff gets according to the first number
Accordingly and the second data generate packet capturing file when, first data and the second data can be gone out according to the packet capturing file analysis
It is where is sent to by where, it, can be according to destination address, source in packet capturing file if analyzing the packet capturing file there are when problem
The details such as address position the node device to go wrong, to carry out case study according to packet capturing file, and to ging wrong
Node device is solved.
Data processing method provided by the embodiments of the present application is applied to gateway, the object of the wireless module of gateway
When the first data that reason layer transmits in receiving network, by by the wireless module of first data transmission to gateway
The MAC layer of the wireless module of the primary processor and gateway of MAC layer and gateway is receiving MAC layer or more
When the second data that layer is sent, by physical layer and main process task that the second data are transmitted to the wireless module of gateway
Device, so that primary processor generates packet capturing file according to the first data and the second data, so that gateway both may be implemented just
Normal gateway function, and packet capturing function may be implemented, to grab the data of network air communication, without increasing any equipment
And cost.
Referring to Fig. 4, another embodiment of the application provides a kind of data processing method, gateway can be applied to, it should
Data processing method may include:
Step S210:, will when the first data that the physical layer of the wireless module of gateway is transmitted in receiving network
First data transmission to gateway wireless module MAC layer and gateway primary processor.
Step S220: the MAC layer of the wireless module of gateway is in the second data sent with upper layer for receiving MAC layer
When, the second data are transmitted to the physical layer and primary processor of the wireless module of gateway.
Step S230: primary processor generates packet capturing file according to the first data and the second data.
In some embodiments, step S210, the content of step S220 and step S230 can be refering to above-described embodiments
Content, details are not described herein.
In some embodiments, being periodically generated for packet capturing file may be implemented in gateway primary processor.Specifically, above-mentioned main place
It manages device and generates packet capturing file according to the first data and the second data, may include:
When the duration of primary processor the first data of reception and the second data meets specified duration, primary processor is according to finger
Received first data and the second data in timing is long, generate packet capturing file.
Wherein, a length of front and back generates the time interval of packet capturing file twice when specifying.It is to be understood that current main process task root
After generating a packet capturing file according to received first data and the second data, new the first data and the second number are continued to
According to, when 330 receiving between when meeting specified duration, primary processor can be according to all the first new numbers received in specified duration
Accordingly and the second data, a new packet capturing file is generated again.To realize being periodically generated for packet capturing file.
In some embodiments, the packet capturing file needed for analysis can be found in time for the ease of technical staff, it can
Packet capturing file to be associated with timestamp.Specifically, above-mentioned primary processor is generated according to the first data and the second data
Packet capturing file may include:
Primary processor according to first data and second data, generate with the associated packet capturing file of timestamp,
Timestamp is the time point for receiving first data and second data.
It is understood that primary processor is generated and is closed with timestamp according to first data and second data
After the packet capturing file of connection, when network communication or equipment operation break down when, can according to time of failure and with grab
The associated timestamp of APMB package inquires the packet capturing file before and after fault time, directly so as in time to fault in-situ
The retrospect of carry out problem, case study and positioning problems.
In some embodiments, primary processor is according to first data and second data, generates and the time
Associated packet capturing file is stabbed, can be and the first data and the second data are stored in local file according to specific format, pass through
Timestamp is to file designation, to generate and the associated packet capturing file of timestamp.In this way, when analyzing problematic packet capturing file
When, technical staff can then judge the time point that failure occurs according to filename.Wherein, it is big to can specify file for specific format
It is small, it is also possible to specified time interval.
In some embodiments, above-mentioned that file is named with timestamp, can be with stored in file first
The timestamp scope of data and the second data is named file, for example, first in file data (above-mentioned first number
According to or above-mentioned second data) timestamp be 20181220113050, the last one data (above-mentioned first data or above-mentioned second
Data) timestamp be 20181220113240, then filename can be 20181220113050-20181220113240.?
It can be the timestamp name with first data stored in file, for example, file designation can be 20181220113050.
It can also be the timestamp name with the last one data stored in file, for example, file designation can be
20181220113240.It is understood that above-mentioned timestamp naming method is only for example, in the embodiment of the present application may not be used
As restriction.
It in some embodiments, is the memory space for saving gateway, gateway closes packet capturing file and timestamp
After connection, scheduled store can be carried out.That is, (such as being stored 1 year after reaching the date upper limit on the storage date of packet capturing file
Packet capturing file), gateway can clear up the packet capturing file, in this way, avoid for a long time storage it is meaningless
Packet capturing file occupies unnecessary memory space.Wherein, the storage period of packet capturing file can carry out according to specific application environment
Specific setting, for example, 3 months, 6 months, 1 year etc..
In some embodiments, the packet capturing file that above-mentioned primary processor is generated according to the first data and the second data can be with
It is specified file size.Wherein, specified file size is to store the maximum capacity of the file of the first data and the second data, can
To carry out reasonable set according to specific application environment.For example, can will be specified when the data traffic in communication network is big
File size be set to it is bigger than normal, as specified file size can be set to by 5M when the data traffic in communication network is small
It is less than normal, such as 1M.
It is understood that multiple first data and the second data can be stored in packet capturing file, when packet capturing file
When residual memory space is not enough to store new first data or the second data, it is big that a specified file can be regenerated
Small file continues the storage of the first data and the second data.
In some embodiments, gateway can regularly send the packet capturing file of generation to server, with long-range real
Now to the monitoring of the operation conditions of field network.Specifically, referring to Fig. 4, in above-mentioned primary processor according to the first data
And second data generate packet capturing file after, which can also include:
Step S240: at interval of preset duration, the packet capturing file generated in preset duration is uploaded to server.
In the embodiment of the present application, when needing remotely to realize the operation conditions for obtaining field network in real time, gateway can
Regularly sending the packet capturing file of generation to server.Specifically, at interval of preset duration, gateway can be when will be default
The packet capturing file generated in long is uploaded to server.That is, the packet capturing file of generation is uploaded in current gateway equipment
After the preset duration of server, newly-generated packet capturing file can be uploaded to server again by gateway, wherein newly-generated
Packet capturing file be preset duration in, gateway generate new packet capturing file.
In some embodiments, gateway can periodically check the packet capturing file of generation, pre- to obtain
If in duration, the new packet capturing file that gateway generates enables new packet capturing file to be uploaded to server in time.
It is understood that gateway is when needing newly-generated packet capturing file being uploaded to server, it is available
Packet capturing file is uploaded to the uplink time of server by the last time, and according to last uplink time and preset duration, is obtained
Primary uplink time is removed, so that gateway can be come by judging whether current time is uplink time next time
It decides whether newly-generated packet capturing file being uploaded to server, to realize the regular upload of packet capturing file.
Wherein, above-mentioned preset duration can carry out reasonable set according to specific application environment, for example, preset duration can be
10s, 30s, 1 minute etc..
It is understood that packet capturing file is uploaded to server by gateway, gateway and server is needed to carry out
Communication connection, therefore, gateway just can send communication connection request to server, and receiving at interval of preset duration
When the communication connection returned to server responds, the packet capturing file generated in preset duration is uploaded to server.In some realities
It applies in example, the communication network between gateway and server can be third party's network, be different from on-site wireless network.
In addition, technical staff can be from server after gateway uploads onto the server whole packet capturing files of generation
The packet capturing file that middle downloading gateway uploads can also so as to according to the operating status of packet capturing file analysis field network
The problem of some special time period to occur, carries out specific aim analysis, and technical staff goes to obtain packet capturing text without reaching scene
Part directly carries out the monitoring of on-site wireless network according to the packet capturing file in server, realizes the long-range of on-site wireless network
The problem of monitoring, improving on-site wireless network analysis and positioning problems efficiency.
Further, in some embodiments, it when gateway needs to upload packet capturing file to server, can be potentially encountered
Communication network between gateway and server is not connected to or idle situation, therefore, in this case, gateway
The packet capturing file uploaded can will be needed to be temporarily stored in local.
Specifically, the packet capturing file generated in preset duration is uploaded to referring to Fig. 5, above-mentioned at interval of preset duration
Server may include:
Step S241: at interval of preset duration, whether the communication network detected between gateway and server is connected to.
Gateway can first detect the communication network between gateway and server when needing to upload packet capturing file
Whether it is connected to.It is understood that gateway just may be used when being only connected to when the communication network between gateway and server
Successfully to upload packet capturing file.
In some embodiments, gateway can be by sending connecting test message to server, to detect gateway
Whether the communication network between equipment and server is connected to.Specifically, gateway sends a connecting test message to service
Device after server receives the test packet, can reply a response message to gateway, answer when gateway receives this
Message is answered, then can determine that the communication network between gateway and server is connected to.It is understood that if gateway is continuous
After sending several test packets to server, gateway does not all receive the response message of server return, then gateway can
Determine that the communication network between gateway and server is not connected to.
Step S242: if communication network is connected to, the packet capturing file generated in preset duration is uploaded to server.
When detecting that the communication network between gateway and server is connected to, gateway can will be preset gateway
The packet capturing file generated in duration is uploaded to server.It is understood that gateway is detecting gateway and service
When communication network between device is not connected to, the packet capturing file generated in preset duration can not be then uploaded to service by gateway
Device, the packet capturing file for needing not upload are kept in, that is to say, that keep the storage of the packet capturing file generated in preset duration
State waits the communication network between gateway and server to be connected to.
In some embodiments, gateway is still examined in real time after the packet capturing file that will do not uploaded is kept in
The operating condition of the communication network between gateway and server is surveyed, to detect leading between gateway and server
When communication network is connected to, the packet capturing file not uploaded can be uploaded to server in time.
In other embodiments, gateway, can be next after the packet capturing file that will do not uploaded is kept in
It is secondary to detect the communication network between gateway and server again when needing to upload packet capturing file to server, that is,
It says, if the gateway last time needs to upload packet capturing file to server, detects logical between gateway and server
Communication network is not connected to, then gateway can wait above-mentioned preset duration, to need to upload packet capturing file next time to service
When device, then the communication network between gateway and server is detected.If detecting gateway and clothes next time
Packet capturing file that is last and needing to upload next time then can be uploaded to service by the communication network connection between business device together
Device.If still detecting that the communication network between gateway and server is not connected to next time, gateway continues
After next preset duration, then carry out the detection of communication network.
In some embodiments, the first data include the data that node device is sent to gateway, wherein gateway
It is communicatively coupled between node device using Zigbee protocol or IEEE 802.15.4 agreement.That is, network is set
It is standby to be in Zigbee network with node device.
In some embodiments, chip there are two can installing in gateway, a chip is for realizing above-mentioned normal
Gateway function, another chip is for realizing above-mentioned packet capturing function.
In further embodiments, a chip can be only installed in gateway, while realizing above-mentioned normal gateway
Function and above-mentioned packet capturing function, reduce the cost of gateway, maintain the beauty of equipment.In this embodiment, gateway is set
Standby primary processor can realize the crawl of above-mentioned first data and the second data by individual program and realize packet capturing text
The generation of part.
The physical layer of data processing method provided by the embodiments of the present application, the wireless module of gateway is receiving network
When the first data of middle transmission, by by the MAC layer and gateway of the wireless module of first data transmission to gateway
Primary processor and gateway wireless module MAC layer receive MAC layer with upper layer send the second data
When, by the way that the second data to be transmitted to the physical layer and primary processor of the wireless module of gateway, so that primary processor root
Packet capturing file is generated according to the first data and the second data.To which normal gateway function had not only may be implemented in gateway, but also can
To realize packet capturing function, to grab the data of network air communication, without increasing any equipment and cost.Further,
Being periodically generated and periodically uploading for packet capturing file may be implemented in gateway, wherein packet capturing file can also be closed with timestamp
Connection allows a technician to the monitoring for directly carrying out on-site wireless network according to the packet capturing file in server, realizes existing
The long-range monitoring of wireless network, the problem of improving on-site wireless network analysis and positioning problems efficiency.
Referring to Fig. 6, being answered it illustrates a kind of structural block diagram of data processing equipment 500 provided by the embodiments of the present application
For gateway, the apparatus may include: first data transmission module 510, the second data transmission module 520 and file
Generation module 530.Wherein, first data transmission module 510 is receiving net for the physical layer of the wireless module of gateway
When the first data transmitted in network, by the MAC layer of the wireless module of first data transmission to gateway and gateway
Primary processor;MAC layer of second data transmission module 520 for the wireless module of gateway is receiving MAC layer or more
When the second data that layer is sent, the second data are transmitted to the physical layer and primary processor of the wireless module of gateway;Text
Part generation module 530 generates packet capturing file according to the first data and the second data for primary processor.
In some embodiments, file generating module 530 can be specifically used for: when primary processor receive the first data and
When the duration of second data meets specified duration, primary processor is according to received first data in specified duration and the second number
According to generation packet capturing file.
In some embodiments, file generating module 530 can be specifically used for: primary processor is according to the first data and
Two data, generate and the associated packet capturing file of timestamp, timestamp are the time point for receiving the first data and the second data.
Further, above-mentioned data processing equipment 500 can also include: file uploading module.File uploading module is used for
At interval of preset duration, the packet capturing file generated in preset duration is uploaded to server.
In some embodiments, above-mentioned file uploading module can be specifically used for: at interval of preset duration, detecting gateway and set
Whether the standby communication network between server is connected to;If communication network is connected to, the packet capturing file that will be generated in preset duration
It is uploaded to server.
In some embodiments, above-mentioned packet capturing file is specified file size.
In some embodiments, above-mentioned first data include the data that node device is sent to gateway, wherein gateway
It is communicatively coupled between equipment and node device using Zigbee protocol or IEEE 802.15.4 agreement.
It is apparent to those skilled in the art that for convenience and simplicity of description, foregoing description device, mould
The specific work process of block, unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, the mutual coupling of module can be electrical property, mechanical or other
The coupling of form.
It, can also be in addition, can integrate in a processing module in each functional module in each embodiment of the application
It is that modules physically exist alone, can also be integrated in two or more modules in a module.Above-mentioned integrated mould
Block both can take the form of hardware realization, can also be realized in the form of software function module.
To sum up, a kind of data processing method provided by the embodiments of the present application and device, the object of the wireless module of gateway
When the first data that reason layer transmits in receiving network, by by the wireless module of first data transmission to gateway
The MAC layer of the wireless module of the primary processor and gateway of MAC layer and gateway is receiving MAC layer or more
When the second data that layer is sent, by physical layer and main process task that the second data are transmitted to the wireless module of gateway
Device, so that primary processor generates packet capturing file according to the first data and the second data, so that gateway both may be implemented just
Normal gateway function, and packet capturing function may be implemented, to grab the data of network air communication, without increasing any equipment
And cost.
Referring to FIG. 7, it illustrates a kind of structural block diagrams of gateway provided by the embodiments of the present application.The gateway
100 can be Zigbee gateway.Gateway 100 in the application may include one or more such as lower component: processor
110, memory 120, communication module 130 and one or more application program, wherein one or more application programs can be by
It is stored in memory 120 and is configured as being executed by one or more processors 110, one or more programs are configured to hold
Row method as described in preceding method embodiment.
Processor 110 may include one or more processing core.Processor 110 is whole using various interfaces and connection
Various pieces in a gateway 100, by run or execute the instruction being stored in memory 120, program, code set or
Instruction set, and the data being stored in memory 120 are called, execute the various functions and processing data of gateway 100.It can
Selection of land, processor 110 can use Digital Signal Processing (Digital Signal Processing, DSP), field-programmable
Gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic
Array, PLA) at least one of example, in hardware realize.Processor 110 can integrating central processor (Central
Processing Unit, CPU), in image processor (Graphics Processing Unit, GPU) and modem etc.
One or more of combinations.Wherein, the main processing operation system of CPU, user interface and application program etc.;GPU is for being responsible for
Show the rendering and drafting of content;Modem is for handling wireless communication.It is understood that above-mentioned modem
It can not be integrated into processor 110, be realized separately through one piece of communication chip.
Memory 120 may include random access memory (Random Access Memory, RAM), also may include read-only
Memory (Read-Only Memory).Memory 120 can be used for store instruction, program, code, code set or instruction set.It deposits
Reservoir 120 may include storing program area and storage data area, wherein the finger that storing program area can store for realizing operating system
Enable, for realizing at least one function instruction (such as touch function, sound-playing function, image player function etc.), be used for
Realize the instruction etc. of following each embodiments of the method.Storage data area can also store gateway 100 and be created in use
Data etc..
Communication module 130 is used to receive and transmit electromagnetic wave, realizes the mutual conversion of electromagnetic wave and electric signal, thus with
Communication network or other equipment are communicated.Communication module 130 may include various existing for executing the electricity of these functions
Circuit component, for example, antenna, RF transceiver, digital signal processor, encryption/deciphering chip, subscriber identity module (SIM) card,
Memory etc..Communication module 130 can be with the wireless network progress of various networks such as internet, intranet, preset type
Communication is communicated by the wireless network of preset type with other equipment.The wireless network of above-mentioned preset type can wrap
Include cellular telephone networks, WLAN or Metropolitan Area Network (MAN).Various communications can be used in the wireless network of above-mentioned preset type
Standard, agreement and technology, including but not limited to global system for mobile communications (Global System for Mobile
Communication, GSM), enhanced mobile communication technology (Enhanced Data GSM Environment, EDGE) is wide
Band Code Division Multiple Access (Wideband Code Division Multiple Access, W-CDMA), Code Division Multiple Access
(Code Division Access, CDMA), time division multiple access technology (Time Division Multiple Access, TDMA),
Zigbee (ZigBee protocol), bluetooth, bluetooth Mesh (bluetooth mesh technologies), Thread (family's Internet of Things communications protocol technology),
Adopting wireless fidelity technology (Wireless-Fidelity, WiFi) (such as American Institute of Electrical and Electronics Engineers's standard IEEE
802.11a, IEEE 802.11b, IEEE802.11g and/or IEEE 802.11n), the networking telephone (Voice over
Internet Protocal, VoIP), worldwide interoperability for microwave accesses (Worldwide Interoperability for
Microwave Access, Wi-Max), other for mail, instant messaging and short message agreement and any other is suitable
Communications protocol.
Referring to FIG. 8, it illustrates a kind of structural block diagrams of computer readable storage medium provided by the embodiments of the present application.
The computer readable storage medium 800 can be such as flash memory, EEPROM (electrically erasable programmable read-only memory), EPROM,
The electronic memory of hard disk or ROM etc.Optionally, computer readable storage medium 800 can including non-volatile computer
It reads medium (non-transitory computer-readable storage medium).Computer readable storage medium 800
Memory space with the program code 810 for executing any method and step in the above method.These program codes can be from one
It reads or is written in a or multiple computer program products in this one or more computer program product.Program generation
Code 810 can for example be compressed in a suitable form.
Finally, it should be noted that above embodiments are only to illustrate the technical solution of the application, rather than its limitations;Although
The application is described in detail with reference to the foregoing embodiments, those skilled in the art are when understanding: it still can be with
It modifies the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;And
These are modified or replaceed, do not drive corresponding technical solution essence be detached from each embodiment technical solution of the application spirit and
Range.
Claims (10)
1. a kind of data processing method, which is characterized in that be applied to gateway, which comprises
When the first data that the physical layer of the wireless module of the gateway is transmitted in receiving network, by first number
According to the MAC layer for the wireless module for being transmitted to the gateway and the primary processor of the gateway;
The MAC layer of the wireless module of the gateway, will in the second data sent with upper layer for receiving the MAC layer
Second data be transmitted to the wireless module of the gateway physical layer and the primary processor;
The primary processor generates packet capturing file according to first data and second data.
2. the method according to claim 1, wherein the primary processor is according to first data and described
Second data generate packet capturing file, comprising:
When the duration that the primary processor receives first data and second data meets specified duration, the master
Processor generates packet capturing file according to received first data and second data in specified duration.
3. the method according to claim 1, wherein the primary processor is according to first data and described
Second data generate packet capturing file, comprising:
The primary processor according to first data and second data, generate with the associated packet capturing file of timestamp,
The timestamp is the time point for receiving first data and second data.
4. method according to claim 1-3, which is characterized in that in the primary processor according to first number
Accordingly and after second data generation packet capturing file, the method also includes:
At interval of preset duration, the packet capturing file generated in the preset duration is uploaded to server.
5., will be in the preset duration according to the method described in claim 4, it is characterized in that, described at interval of preset duration
The packet capturing file generated is uploaded to server, comprising:
At interval of preset duration, detect whether the communication network between the gateway and server is connected to;
If communication network is connected to, the packet capturing file generated in the preset duration is uploaded to server.
6. method according to claim 1-3, which is characterized in that the packet capturing file is specified file size.
7. method according to claim 1-3, which is characterized in that first data include that node device is sent
To the data of the gateway, wherein between the gateway and node device using Zigbee protocol or
IEEE802.15.4 agreement is communicatively coupled.
8. a kind of data processing equipment, which is characterized in that be applied to gateway, described device includes:
First data transmission module, the physical layer of the wireless module for the gateway transmitted in receiving network
When one data, by the MAC layer of the wireless module of the first data transmission to the gateway and the gateway
Primary processor;
The MAC layer of second data transmission module, the wireless module for the gateway is receiving the MAC layer or more
When the second data that layer is sent, second data are transmitted to the physical layer of the wireless module of the gateway and described
Primary processor;
File generating module generates packet capturing text according to first data and second data for the primary processor
Part.
9. a kind of gateway characterized by comprising
One or more processors;
Memory;
One or more application program, wherein one or more of application programs are stored in the memory and are configured
To be executed by one or more of processors, one or more of programs are configured to carry out as claim 1-7 is any
Method described in.
10. a kind of computer-readable storage medium, which is characterized in that be stored with journey in the computer-readable storage medium
Sequence code, said program code can be called by processor and execute the method according to claim 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910224211.6A CN110113771B (en) | 2019-03-22 | 2019-03-22 | Data processing method, device, gateway equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910224211.6A CN110113771B (en) | 2019-03-22 | 2019-03-22 | Data processing method, device, gateway equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110113771A true CN110113771A (en) | 2019-08-09 |
CN110113771B CN110113771B (en) | 2022-06-17 |
Family
ID=67484529
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910224211.6A Active CN110113771B (en) | 2019-03-22 | 2019-03-22 | Data processing method, device, gateway equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110113771B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111023269A (en) * | 2019-12-30 | 2020-04-17 | 宁波奥克斯电气股份有限公司 | Online detection method and device for multi-split air conditioner indoor unit and multi-split air conditioner |
CN111988218A (en) * | 2020-08-13 | 2020-11-24 | 支付宝(杭州)信息技术有限公司 | Data processing method, device, equipment and medium |
CN113347038A (en) * | 2021-06-08 | 2021-09-03 | 上海天旦网络科技发展有限公司 | Circulation mutual-backup high-availability system for bypass flow processing |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101114932A (en) * | 2006-07-27 | 2008-01-30 | 华为数字技术有限公司 | Method and system for implementing remote capturing packet |
CN101977192A (en) * | 2010-10-21 | 2011-02-16 | 大连理工大学 | Family medical insurance gateway device and protocol conversion method |
CN102044063A (en) * | 2010-12-23 | 2011-05-04 | 中国科学院自动化研究所 | FPGA (Field Programmable Gate Array) and DSP (Digital Signal Processor) based machine vision system |
CN104468190A (en) * | 2014-11-03 | 2015-03-25 | 青岛海信移动通信技术股份有限公司 | Wifi data package capturing method and device and intelligent terminal |
CN105740396A (en) * | 2016-01-27 | 2016-07-06 | 广州酷狗计算机科技有限公司 | HTTP data processing method and device |
WO2017124307A1 (en) * | 2016-01-19 | 2017-07-27 | 华为技术有限公司 | Data transmission method, device and system |
CN107347025A (en) * | 2017-06-14 | 2017-11-14 | 云丁网络技术(北京)有限公司 | Data processing method, device, server and system |
WO2018126757A1 (en) * | 2017-01-05 | 2018-07-12 | 中兴通讯股份有限公司 | Data processing method and device |
CN109040144A (en) * | 2018-10-19 | 2018-12-18 | 京信通信系统(中国)有限公司 | Things-internet gateway data processing method, device, storage medium and gateway |
CN109194679A (en) * | 2018-09-25 | 2019-01-11 | 北京航空航天大学 | A kind of multi-protocol interface data acquisition device and acquisition method based on SpaceFibre interface |
-
2019
- 2019-03-22 CN CN201910224211.6A patent/CN110113771B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101114932A (en) * | 2006-07-27 | 2008-01-30 | 华为数字技术有限公司 | Method and system for implementing remote capturing packet |
CN101977192A (en) * | 2010-10-21 | 2011-02-16 | 大连理工大学 | Family medical insurance gateway device and protocol conversion method |
CN102044063A (en) * | 2010-12-23 | 2011-05-04 | 中国科学院自动化研究所 | FPGA (Field Programmable Gate Array) and DSP (Digital Signal Processor) based machine vision system |
CN104468190A (en) * | 2014-11-03 | 2015-03-25 | 青岛海信移动通信技术股份有限公司 | Wifi data package capturing method and device and intelligent terminal |
WO2017124307A1 (en) * | 2016-01-19 | 2017-07-27 | 华为技术有限公司 | Data transmission method, device and system |
CN105740396A (en) * | 2016-01-27 | 2016-07-06 | 广州酷狗计算机科技有限公司 | HTTP data processing method and device |
WO2018126757A1 (en) * | 2017-01-05 | 2018-07-12 | 中兴通讯股份有限公司 | Data processing method and device |
CN107347025A (en) * | 2017-06-14 | 2017-11-14 | 云丁网络技术(北京)有限公司 | Data processing method, device, server and system |
CN109194679A (en) * | 2018-09-25 | 2019-01-11 | 北京航空航天大学 | A kind of multi-protocol interface data acquisition device and acquisition method based on SpaceFibre interface |
CN109040144A (en) * | 2018-10-19 | 2018-12-18 | 京信通信系统(中国)有限公司 | Things-internet gateway data processing method, device, storage medium and gateway |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111023269A (en) * | 2019-12-30 | 2020-04-17 | 宁波奥克斯电气股份有限公司 | Online detection method and device for multi-split air conditioner indoor unit and multi-split air conditioner |
CN111988218A (en) * | 2020-08-13 | 2020-11-24 | 支付宝(杭州)信息技术有限公司 | Data processing method, device, equipment and medium |
CN113347038A (en) * | 2021-06-08 | 2021-09-03 | 上海天旦网络科技发展有限公司 | Circulation mutual-backup high-availability system for bypass flow processing |
CN113347038B (en) * | 2021-06-08 | 2022-11-22 | 上海天旦网络科技发展有限公司 | Circulation mutual-backup high-availability system for bypass flow processing |
Also Published As
Publication number | Publication date |
---|---|
CN110113771B (en) | 2022-06-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11943280B2 (en) | 5G network edge and core service dimensioning | |
CN108260163B (en) | Information sending and receiving method and device | |
CN105939381B (en) | A kind of controlling terminal automatically switches the method and system of downloading file mode | |
CN107395572B (en) | Data processing method and Internet of things gateway | |
CN111565418A (en) | O-RAN and MEC communication method and system | |
CN110071847A (en) | Message processing method, device, terminal device and storage medium | |
CN110113771A (en) | Data processing method, device, gateway and storage medium | |
TWI396398B (en) | Method and apparatus of transmission time interval bundling management | |
CN107222887B (en) | Communication performance testing method and device for base station wireless side transmission path | |
CN104159306B (en) | A kind of method, equipment and system for controlling interface-free resources | |
CN110352610A (en) | The method and device thereof of TCP ACK grouping are sent in a wireless communication system | |
CN104885556A (en) | Keep alive periodicity determination for WIFI networks | |
CN107079524B (en) | Data forwarding method and controller | |
CN104658226A (en) | Wireless meter reading system and method | |
CN104662946A (en) | Methods and network nodes for managing transmission of at least one channel quality report | |
CN104410982A (en) | Terminal aggregation and refactoring method in wireless heterogeneous network | |
CN105517174B (en) | A kind of method and device for transmitting data | |
CN107889095B (en) | Method for realizing wireless data transmission by adopting multilink channel | |
CN102546637B (en) | Communication terminal and method thereof for realizing communication protocol | |
CN108064087A (en) | DRX cycle collocation method, terminal, access network equipment and storage medium | |
CN109474956A (en) | Uplink data transmission method, timer configuration method and relevant device | |
CN103428701A (en) | Communication method, system and equipment based on security gateway | |
CN112135329B (en) | Parameter transmission method, device and system | |
CN109495918B (en) | Data transmission method and device | |
CN107466018A (en) | The data transferring method and terminal device of a kind of terminal device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: Data processing method, device, gateway device, and storage medium Effective date of registration: 20230317 Granted publication date: 20220617 Pledgee: Zhuhai Aisheng Technology Co.,Ltd. Pledgor: SHENZHEN FEIBIT ELECTRONIC TECHNOLOGY CO.,LTD. Registration number: Y2023980035300 |
|
PE01 | Entry into force of the registration of the contract for pledge of patent right |