CN110113771B - Data processing method, device, gateway equipment and storage medium - Google Patents

Data processing method, device, gateway equipment and storage medium Download PDF

Info

Publication number
CN110113771B
CN110113771B CN201910224211.6A CN201910224211A CN110113771B CN 110113771 B CN110113771 B CN 110113771B CN 201910224211 A CN201910224211 A CN 201910224211A CN 110113771 B CN110113771 B CN 110113771B
Authority
CN
China
Prior art keywords
data
gateway device
file
packet capturing
main processor
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.)
Active
Application number
CN201910224211.6A
Other languages
Chinese (zh)
Other versions
CN110113771A (en
Inventor
周正梅
魏雅琴
刘宏伟
颜亨海
何彦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Feibit Electronic Technology Co ltd
Original Assignee
Shenzhen Feibit Electronic Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Feibit Electronic Technology Co ltd filed Critical Shenzhen Feibit Electronic Technology Co ltd
Priority to CN201910224211.6A priority Critical patent/CN110113771B/en
Publication of CN110113771A publication Critical patent/CN110113771A/en
Application granted granted Critical
Publication of CN110113771B publication Critical patent/CN110113771B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/16Gateway arrangements

Abstract

The embodiment of the application discloses a data processing method, a data processing device, gateway equipment and a storage medium, and relates to the technical field of communication. The data processing method is applied to gateway equipment and comprises the following steps: when receiving first data transmitted in a network, a physical layer of a wireless module of the gateway device transmits the first data to an MAC layer of the wireless module of the gateway device and a main processor of the gateway device; when receiving second data sent by the layers above the MAC layer, the MAC layer of the wireless module of the gateway device transmits the second data to the physical layer of the wireless module of the gateway device and the main processor; and the main processor generates a packet capturing file according to the first data and the second data. The method can realize the capture of data in the communication network through the gateway equipment.

Description

Data processing method, device, gateway equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data processing method and apparatus, a gateway device, and a storage medium.
Background
At present, in the operation process of node equipment in a wireless network, network communication faults or equipment operation faults are easy to occur, so that the node equipment cannot realize functions related to network communication. Therefore, technicians are required to monitor the wireless network and analyze and locate the fault problem when the wireless network has a fault problem. Currently, a device for performing over-the-air data packet capture is usually installed on the site, and captures all data packets (i.e., communication data packets) in the working channel of the on-site wireless network in real time to monitor the on-site network. However, the device has no actual application function on site, and the function is single only for realizing the debugging function of the network.
Disclosure of Invention
In view of the foregoing problems, embodiments of the present application provide a data processing method and apparatus, a gateway device, and a storage medium, which can capture data in a communication network through the gateway device.
In a first aspect, an embodiment of the present application provides a data processing method, which is applied to a gateway device, and the method includes: when receiving first data transmitted in a network, a physical layer of a wireless module of the gateway device transmits the first data to an MAC layer of the wireless module of the gateway device and a main processor of the gateway device; when receiving second data sent by the layers above the MAC layer, the MAC layer of the wireless module of the gateway device transmits the second data to the physical layer of the wireless module of the gateway device and the main processor; and the main processor generates a packet capturing file according to the first data and the second data.
In a second aspect, an embodiment of the present application provides a data processing apparatus, which is applied to a gateway device, where the apparatus includes: the gateway device comprises a first data transmission module, a second data transmission module and a file generation module, wherein the first data transmission module is used for transmitting first data to an MAC (media access control) layer of a wireless module of the gateway device and a main processor of the gateway device when a physical layer of the wireless module of the gateway device receives the first data transmitted in a network; the second data transmission module is used for transmitting second data to a physical layer of a wireless module of the gateway device and the main processor when an MAC layer of the wireless module of the gateway device receives the second data transmitted by a layer above the MAC layer; the file generation module is used for generating a packet capture file by the main processor according to the first data and the second data.
In a third aspect, an embodiment of the present application provides a gateway device, including: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the data processing method provided by the first aspect described above.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code may be called by a processor to execute the data processing method provided in the first aspect.
The scheme provided by the application is applied to the gateway equipment, when the physical layer of the wireless module of the gateway equipment receives first data transmitted in a network, the first data are transmitted to the MAC layer of the wireless module of the gateway equipment and the main processor of the gateway equipment, and when the MAC layer of the wireless module of the gateway equipment receives second data transmitted by the layers above the MAC layer, the second data are transmitted to the physical layer of the wireless module of the gateway equipment and the main processor, so that the main processor generates a packet capturing file according to the first data and the second data, and therefore under the condition that no equipment or cost is added, the gateway equipment can achieve a normal gateway function, capture network air communication data, and achieve a packet capturing function.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious 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 to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a schematic diagram of an application environment suitable for the embodiment of the present application.
Fig. 2 shows a schematic structural diagram of a gateway device according to an embodiment of the present application.
FIG. 3 shows a flow diagram of a data processing method according to one embodiment of the present application.
FIG. 4 shows a flow diagram of a data processing method according to another embodiment of the present application.
Fig. 5 shows a flowchart of step S240 in the data processing method according to the embodiment of the present application.
FIG. 6 shows a block diagram of a data processing apparatus according to an embodiment of the present application.
Fig. 7 is a block diagram of a gateway device for executing a data processing method according to an embodiment of the present application.
Fig. 8 is a storage unit according to an embodiment of the present application, configured to store or carry program codes for implementing a data processing method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
At present, in the operation process of node devices in a wireless network (for example, a short-distance wireless communication network such as a Zigbee network), network communication failures or device operation failures are likely to occur, so that the node devices cannot implement functions related to network communication. Especially in the early debugging and commissioning phase of the network, the probability of problems is higher. In order to analyze and locate network problems of a wireless network in the operation process, a common and effective method at present is to capture all data packets (i.e., communication data packets) in a wireless network working channel through packet capture over the air, and analyze the packet files afterwards.
In order to capture the air communication message during the operation of the field wireless network in real time, a specific device for capturing the air data packet is often required to be installed on the field, and the device has no actual application function on the field and only realizes the debugging function of the network. Therefore, a specific bale grabbing device is installed on the site but has no actual application function, the whole equipment product is redundant, and the cost of the equipment product is increased.
In some scenarios, in order to reduce the cost of the device product, there is also a case where the function of a certain device of the field wireless network is switched to the packet capture function, for example, for convenience of development and debugging, most developers switch the function of the gateway device in the field wireless network to the packet capture function. If the function of the field gateway device is directly switched to the packet capturing function, the gateway device loses the function of the gateway, and the gateway device is very important for network operation, so that the whole network needs to be managed, and an interactive bridge with the outside (the internet) is needed. Therefore, the loss of the gateway function of the gateway equipment not only affects the normal operation of the network, but also loses the significance of network analysis and problem diagnosis on the capture of the network air communication data.
In view of the above problems, the inventors have made research and propose a data processing method, an apparatus, a gateway device, and a storage medium in the embodiments of the present application, and integrate a packet capturing function in the gateway device, so that the gateway device can not only function as a whole network manager to work normally and implement an application function, but also function as a network packet capturing function to capture network over-the-air communication data, and thus, there is no need to add any device or cost.
An application scenario of the data processing method provided in the embodiment of the present application is described below.
Referring to fig. 1, an interactive system 10 includes a gateway device 100 and a node device 200 communicatively connected to the gateway device 100 according to an embodiment of the present application.
In this embodiment, the gateway device 100 may be an intelligent gateway in an intelligent home, or may be an intelligent gateway in other scenarios, and may implement functions such as system information acquisition, information input, information output, centralized control, remote control, and coordinated control. For example, the gateway device 100 may be embodied as a Zigbee gateway. The gateway device 100 may be responsible for specific security alarm, appliance control, and power consumption information acquisition. The gateway device 100 may also perform information interaction with products such as an intelligent interactive terminal in a wireless manner. The gateway equipment also has the wireless routing function, excellent wireless performance, network safety and coverage area. The gateway device 100 can also interact information with the server in a wireless mode such as 2G/3G/4G/5G/WiFi and the like. Of course, the connection mode between the gateway device 100 and the server may not be limited in the embodiment of the present application.
In the embodiment of the present application, the node device 200 may include various intelligent home devices, sensing devices, detection devices, and the like, for example, an intelligent television, an intelligent refrigerator, an intelligent air conditioner, and the like. A Zigbee module may be included in the node device 200 to communicatively connect with the gateway device 100 through the Zigbee protocol or the IEEE 802.15.4 protocol. The gateway device 100 and the node device 200 may also be connected through communication manners such as bluetooth, WiFi (Wireless-Fidelity), bluetooth Mesh, and Thread (home internet of things communication protocol), and of course, the connection manner of the gateway device 100 and the node device 200 may not be limited in this embodiment of the application.
The following illustrates a gateway device in an embodiment of the present application.
Referring to fig. 2, which illustrates a gateway device provided in an embodiment of the present application, the gateway device 100 may include a wireless module 101, a Microcontroller (MCU) module 102, and a main processor module 103, where the wireless module 101 is connected to the Microcontroller module 102, and the Microcontroller module 102 is connected to the main processor module 103.
In this embodiment, the wireless module 101 is configured to implement data receiving and transmitting, and may include a physical layer module 1011 and a MAC layer module 1012, where the physical layer module 1011 is connected to the MAC layer module 1012, and the MAC layer module 1012 is connected to the microcontroller module 102. In this embodiment, the physical layer module 1011 may also be directly connected to the main processor module 103, and the MAC layer module 1012 may also be directly connected to the main processor module 103.
In the embodiment of the present application, the physical layer module 1011 includes a Radio Frequency (RF) transceiver compliant with the 2.4GHz IEEE 802.15.4 standard. The RF transceiver is used for receiving and transmitting data. The physical layer module 101 may be used for receiving, transmitting, digital-to-analog converting, analog-to-digital converting, modulating, demodulating, etc. of data.
In the present embodiment, the MAC layer module 1012 may receive a data packet transmitted from the microcontroller module 102 (upper layers of the MAC layer) and may encapsulate the data packet into a MAC layer protocol data unit (MAC frame). In some embodiments, the MAC layer may write the encapsulated MAC frame into a transmit buffer queue. The MAC layer module 1012 may also receive data sent from the physical layer, and check and filter the data to obtain correct received data of the gateway device.
In this embodiment, the microcontroller module 102 may read the data checked and filtered by the MAC layer module 1012 and send the data to the upper layer protocol stack (the upper layer of the MAC layer). So as to encapsulate the data in the upper layer protocol stack and send the encapsulated data to the main processor module 103. The microcontroller module 102 may also encapsulate the data sent by the main processor module 103, and transmit the encapsulated data to the MAC layer module 1012 for further data encapsulation.
In the embodiment of the present application, the main processor module 103 may receive data sent from the microcontroller module 102, and may send the data to an upper layer user processing program or forward the data to a network in another frequency band according to actual needs. The main processor module 103 may send the data to be sent to the microcontroller module 102 for data encapsulation.
In some embodiments, an interface between the physical layer module 1011 and the MAC layer module 1012 may be directly connected to the main processor module 103, so that the main processor module 103 may acquire the received data before checking and filtering and the transmitted data before modulating, thereby implementing a packet capture function. The interface may be a serial port, or may also be an SPI interface, which is not limited herein, and only the main processor module 103 may acquire the received data before checking and filtering and the transmitted data before modulation.
In the embodiment of the present application, the main processing module 103 is separately integrated on a chip. In some embodiments, the wireless module 101 and the microcontroller module 102 may be integrated on one chip, or the microcontroller module 102 may be separately integrated on one chip, and the wireless module 101 is integrated on another chip, and the integration manner between the modules is not limited in this application.
Based on the interactive system and the gateway device, the embodiment of the application provides a data processing method, which is applied to the gateway device. The following describes a specific data processing method.
Referring to fig. 3, an embodiment of the present application provides a data processing method, which is applicable to a gateway device, and the data processing method may include:
step S110: when receiving first data transmitted in a network, a physical layer of a wireless module of the gateway device transmits the first data to an MAC layer of the wireless module of the gateway device and a main processor of the gateway device.
At present, in order to capture an air data message during operation of a field wireless network in real time, a specific packet capturing device is usually installed on the field, or the function of a gateway device of the field wireless network is switched to a packet capturing function, so that the normal operation of the field wireless network is affected if the equipment cost is increased. Therefore, in the embodiment of the present application, the packet capturing function is integrated in the gateway device, so that the gateway device has both the gateway function and the packet capturing function, thereby eliminating the need to add any devices and costs.
It can be understood that, in general, the normal data receiving process of the gateway device is mainly as follows: after receiving data transmitted In a network through a receiver, a physical layer of a wireless module of a gateway device demodulates the data through a demodulator, the demodulated data is stored In a First In First Out (FIFO) receiving Unit, and meanwhile, an MAC layer of the wireless module of the gateway device checks the demodulated data and filters a data frame so as to filter Out data which is not checked correctly or is not sent to a local device, obtain correct data which the gateway device should receive, and then notify an MCU (Microcontroller Unit) through interruption to read the received correct data.
Therefore, in the embodiment of the present application, in order to implement a function of capturing communication data in the entire wireless network, the data needs to be fetched before entering checksum filtering to obtain all data currently transmitted in the network without affecting the normal function of the receiver. It will be appreciated that the data obtained prior to checksum filtering may include data sent to the local device, data sent to other devices in the network, incorrect data for checking, and so forth.
Specifically, when receiving first data transmitted in the network, the physical layer of the wireless module of the gateway device transmits the first data to the MAC layer of the wireless module of the gateway device and the main processor of the gateway device. The first data is all data transmitted in the current network, and may be data whose destination address is a non-local hardware address, or may be data whose destination address is a local hardware address, which is not limited herein and is determined only according to a specific network communication situation.
In this embodiment of the application, the physical layer of the wireless module of the gateway device transmits the first data to the MAC layer of the wireless module of the gateway device, which is a data receiving step of the gateway device, so that the MAC layer of the wireless module of the gateway device can check and filter the first data, and thus the gateway device can obtain data which is checked correctly and has a target address as a local hardware address. And the physical layer of the wireless module of the gateway device transmits the first data to the main processor of the gateway device, which is a packet capturing step of the gateway device, i.e. the communication data in the current whole network is transmitted to the main processor, so that the gateway device can capture the communication data in the whole network, and the packet capturing function is realized. Therefore, the capturing of the communication data in the current whole network is realized under the condition that the normal receiving function of the gateway equipment is not influenced.
Step S120: and when the MAC layer of the wireless module of the gateway equipment receives the second data sent by the upper layer of the MAC layer, the MAC layer transmits the second data to the physical layer of the wireless module of the gateway equipment and the main processor.
It can be understood that, in general, the normal data transmission process of the gateway device mainly includes: when receiving data to be sent by layers above the MAC layer, the MAC layer of the wireless module of the gateway device sends the data to be sent to the physical layer of the wireless module, and the physical layer modulates the data to be sent by a modulator and sends the modulated data to be sent to a network by a transmitter for transmission.
Therefore, in the embodiment of the present application, in order to capture data that is sent by the gateway device and to implement a capture function of communication data in the entire wireless network, it is necessary to take out the data before sending the data to the physical layer of the wireless module for modulation without affecting the normal sending function of the gateway device. Specifically, when receiving the second data sent by the upper layer of the MAC layer, the MAC layer of the wireless module of the gateway device transmits the second data to the physical layer of the wireless module of the gateway device and the main processor. The second data is data that the gateway device needs to send out.
In this embodiment of the application, the MAC layer of the wireless module of the gateway device transmits the second data to the physical layer of the wireless module of the gateway device, which is a data transmission step of the gateway device, so that the physical layer of the wireless module of the gateway device can modulate the second data, and transmit the modulated second data to the network through the transmitter. And the MAC layer of the wireless module of the gateway device transmits the second data to the main processor of the gateway device, which is a packet capturing step of the gateway device, i.e. the data sent by the gateway device is transmitted to the main processor, so that the gateway device can capture the data sent by the gateway device, and the packet capturing function is realized. Therefore, the capturing of the communication data in the current whole network is realized under the condition that the normal sending function of the gateway equipment is not influenced.
Step S130: and the main processor generates a packet capture file according to the first data and the second data.
In this embodiment, the main processor of the gateway device may generate the packet capture file according to the first data and the second data. The packet capturing file can be used for analyzing network problems and positioning problems. Therefore, under the condition of not increasing any equipment and cost, the gateway equipment can realize the normal gateway function, and can also grab the network aerial communication data to realize the packet grabbing function.
As can be seen from the above, when receiving the first data transmitted in the network, the physical layer of the wireless module of the gateway device may transmit the first data to the main processor of the gateway device, and when receiving the first data, the main processor may process the first data to generate a packet capture file for analysis. Similarly, when receiving the second data sent by the layer above the MAC layer, the MAC layer of the wireless module of the gateway device may transmit the second data to the main processor of the gateway device, and when receiving the second data, the main processor may also process the second data to generate a packet capture file for analysis.
It is understood that the first data and the second data captured by the gateway device may have a source address and a destination address, and in some cases, may also have an ID number of the node device. Therefore, when a technician acquires the packet capturing file generated according to the first data and the second data, the position where the first data and the second data are sent can be analyzed according to the packet capturing file, and if the problem of the packet capturing file is analyzed, the node equipment with the problem can be positioned according to detailed information such as a destination address, a source address and the like in the packet capturing file, so that the problem analysis is performed according to the packet capturing file, and the problem node equipment is solved.
The data processing method provided by the embodiment of the application is applied to gateway equipment, when a physical layer of a wireless module of the gateway equipment receives first data transmitted in a network, the first data are transmitted to an MAC layer of the wireless module of the gateway equipment and a main processor of the gateway equipment, and when an MAC layer of the wireless module of the gateway equipment receives second data transmitted by an upper layer of the MAC layer, the second data are transmitted to the physical layer of the wireless module of the gateway equipment and the main processor, so that the main processor generates a packet capturing file according to the first data and the second data, the gateway equipment can realize a normal gateway function, can realize a packet capturing function, and can capture data of network air communication, and does not need to increase any equipment and cost.
Referring to fig. 4, another embodiment of the present application provides a data processing method, which is applicable to a gateway device, and the data processing method may include:
step S210: when receiving first data transmitted in a network, a physical layer of a wireless module of the gateway device transmits the first data to an MAC layer of the wireless module of the gateway device and a main processor of the gateway device.
Step S220: and when the MAC layer of the wireless module of the gateway equipment receives the second data sent by the upper layer of the MAC layer, the MAC layer transmits the second data to the physical layer of the wireless module of the gateway equipment and the main processor.
Step S230: and the main processor generates a packet capture file according to the first data and the second data.
In some embodiments, the contents of step S210, step S220, and step S230 may refer to the contents of the above embodiments, and are not described herein again.
In some embodiments, the gateway host processor may implement periodic generation of the bale capture file. Specifically, the generating, by the main processor, the packet capture file according to the first data and the second data may include:
and when the time length of the main processor for receiving the first data and the second data meets the specified time length, the main processor generates a packet capturing file according to the first data and the second data received in the specified time length.
The specified duration is the time interval between the generation of the packet capturing file and the generation of the packet capturing file. It can be understood that, after the current main processor generates a packet capture file according to the received first data and second data, new first data and second data continue to be received, and when the receiving time meets the specified duration, the main processor may generate a new packet capture file again according to all new first data and second data received within the specified duration. Therefore, the regular generation of the bale plucking file is realized.
In some embodiments, to facilitate a technician being able to find the bale capture file needed for analysis in a timely manner, the bale capture file may be associated with a timestamp. Specifically, the generating, by the main processor, the packet capture file according to the first data and the second data may include:
and the main processor generates a packet capturing file associated with a time stamp according to the first data and the second data, wherein the time stamp is the time point of receiving the first data and the second data.
It can be understood that after the main processor generates the packet capturing file associated with the timestamp according to the first data and the second data, when a network communication or equipment has a fault during operation, the packet capturing file before and after the fault time can be directly inquired according to the fault occurrence time and the timestamp associated with the packet capturing file, so that problem tracing, problem analysis and problem positioning can be performed on a fault site in time.
In some embodiments, the main processor generates the bale plucking file associated with the timestamp according to the first data and the second data, and may store the first data and the second data in a local file according to a specific format, and name the file through the timestamp, so as to generate the bale plucking file associated with the timestamp. Therefore, when the problematic package capture file is analyzed, a technician can judge the time point of the fault according to the file name. The specific format may specify a file size or a time interval.
In some embodiments, the naming of the file by the timestamp may be naming the file by a timestamp range of the first data and the second data stored in the file, for example, if the timestamp of the first data (the first data or the second data) in the file is 20181220113050, and the timestamp of the last data (the first data or the second data) is 20181220113240, the file name may be 20181220113050 and 20181220113240. Or may be named with the timestamp of the first data stored in the file, for example, the file name may be 20181220113050. It may also be named with the timestamp of the last data stored in the file, for example the file name may be 20181220113240. It should be understood that the above named way of the timestamp is only an example, and may not be a limitation in the embodiment of the present application.
In some embodiments, in order to save the storage space of the gateway device, the gateway device may perform periodic storage after associating the packet capture file with the timestamp. That is to say, when the storage date of the bale plucking file reaches the date upper limit (for example, the bale plucking file of 1 year is stored), the gateway device can clear the bale plucking file, so that the unnecessary storage space occupied by the meaningless bale plucking file stored for a long time is avoided. The storage period of the package capture file can be specifically set according to a specific application environment, for example, 3 months, 6 months, 1 year, and the like.
In some embodiments, the packet capture file generated by the host processor based on the first data and the second data may be a specified file size. The designated file size is the maximum capacity of the file for storing the first data and the second data, and can be set reasonably according to a specific application environment. For example, the designated file size may be set to be larger, e.g., 5M, when the amount of data traffic in the communication network is large, and may be set to be smaller, e.g., 1M, when the amount of data traffic in the communication network is small.
It can be understood that a plurality of first data and second data can be stored in the bale plucking file, and when the remaining storage space of the bale plucking file is not enough to store a new first data or second data, a file with a specified file size can be regenerated, and the storage of the first data and the second data is continued.
In some embodiments, the gateway device may periodically send the generated packet capture file to the server to remotely monitor the operating condition of the field network. Specifically, referring to fig. 4 again, after the host processor generates the packet capture file according to the first data and the second data, the data processing method may further include:
step S240: and uploading the packet capturing file generated in the preset time duration to a server at every preset time duration.
In the embodiment of the application, when the operation condition of the field network needs to be remotely acquired in real time, the gateway device can send the generated packet capture file to the server at regular time. Specifically, every preset time interval, the gateway device may upload the packet capture file generated within the preset time interval to the server. That is to say, after the current gateway device uploads the generated packet capturing file to the server for the preset time length, the gateway device may upload the newly generated packet capturing file to the server again, where the newly generated packet capturing file is a new packet capturing file generated by the gateway device within the preset time length.
In some embodiments, the gateway device may perform periodic inspection on the generated packet capturing file to obtain a new packet capturing file generated by the gateway device within a preset time length, so that the new packet capturing file can be uploaded to the server in time.
It can be understood that when a newly generated packet capturing file needs to be uploaded to a server, the gateway device can acquire the uploading time of the last packet capturing file to the server, and acquire the next uploading time according to the last uploading time and the preset time length, so that the gateway device can determine whether the newly generated packet capturing file needs to be uploaded to the server by judging whether the current time is the next uploading time, and thus the regular uploading of the packet capturing file is realized.
The preset time period may be set reasonably according to a specific application environment, for example, the preset time period may be 10s, 30s, 1 minute, and the like.
It can be understood that the gateway device uploads the packet capturing file to the server, and communication connection between the gateway device and the server is required, so that the gateway device can send a communication connection request to the server at every preset time interval, and upload the packet capturing file generated within the preset time interval to the server when receiving a communication connection response returned by the server. In some embodiments, the communication network between the gateway device and the server may be a third party network, as distinguished from a live wireless network.
In addition, after the gateway equipment uploads all generated packet capturing files to the server, technicians can download the packet capturing files uploaded by the gateway equipment from the server, so that the running state of a field network can be analyzed according to the packet capturing files, problems occurring in a certain specific time period can be analyzed in a targeted mode, the technicians do not need to arrive at the field to acquire the packet capturing files, monitoring of the field wireless network is directly carried out according to the packet capturing files in the server, remote monitoring of the field wireless network is achieved, and problem analysis and problem positioning efficiency of the field wireless network is improved.
Further, in some embodiments, when the gateway device needs to upload the packet capture file to the server, a situation that the communication network between the gateway device and the server is disconnected or does not work may be encountered, and therefore, in this situation, the gateway device may temporarily store the packet capture file to be uploaded locally.
Specifically, referring to fig. 5, uploading the packet capturing file generated within the preset duration to the server at every preset duration may include:
step S241: and detecting whether a communication network between the gateway equipment and the server is communicated or not at preset time intervals.
When the gateway device needs to upload the packet capturing file, whether a communication network between the gateway device and the server is connected or not can be detected firstly. It will be appreciated that the gateway device may successfully upload the capture packet file only if the communication network between the gateway device and the server is connected.
In some embodiments, the gateway device may detect whether the communication network between the gateway device and the server is connected by sending a connection test message to the server. Specifically, the gateway device sends a connection test message to the server, the server may reply a response message to the gateway device after receiving the test message, and when the gateway device receives the response message, it may determine that the communication network between the gateway device and the server is connected. It can be understood that, if the gateway device does not receive the response message returned by the server after the gateway device continuously sends several test messages to the server, the gateway device may determine that the communication network between the gateway device and the server is disconnected.
Step S242: and if the communication network is connected, uploading the packet capturing file generated within the preset time length to a server.
When the gateway device detects that the communication network between the gateway device and the server is communicated, the gateway device can upload the packet capturing file generated within the preset time length to the server. It can be understood that when the gateway device detects that the communication network between the gateway device and the server is not connected, the gateway device cannot upload the packet capturing file generated within the preset time period to the server, and needs to temporarily store the non-uploaded packet capturing file, that is, the storage state of the packet capturing file generated within the preset time period is maintained, and the communication network between the gateway device and the server is waited for being connected.
In some embodiments, after temporarily storing the non-uploaded packet capturing file, the gateway device still detects the operation condition of the communication network between the gateway device and the server in real time, so that the non-uploaded packet capturing file can be timely uploaded to the server when communication of the communication network between the gateway device and the server is detected.
In other embodiments, after temporarily storing the non-uploaded packet capturing file, the gateway device may detect the communication network between the gateway device and the server again when the next packet capturing file needs to be uploaded to the server, that is, if the gateway device detects that the communication network between the gateway device and the server is not connected when the last packet capturing file needs to be uploaded to the server, the gateway device may wait for the preset duration to detect the communication network between the gateway device and the server again when the next packet capturing file needs to be uploaded to the server. And if the communication network connection between the gateway equipment and the server is detected next time, uploading the packet capturing files which need to be uploaded last time and next time to the server together. If the next time that the communication network between the gateway equipment and the server is not connected is still detected, the gateway equipment continues to wait for the next preset time period and then detects the communication network.
In some embodiments, the first data includes data sent by the node device to the gateway device, where the gateway device and the node device are communicatively connected by using a Zigbee protocol or an IEEE 802.15.4 protocol. That is, the network device and the node device are in a Zigbee network.
In some embodiments, two chips may be installed on the gateway device, where one chip is used to implement the normal gateway function, and the other chip is used to implement the packet capturing function.
In other embodiments, only one chip may be installed on the gateway device, and the normal gateway function and the packet capturing function are simultaneously implemented, so that the cost of the gateway device is reduced, and the attractiveness of the device is maintained. In this embodiment, the main processor of the gateway device may implement the fetching of the first data and the second data and the generation of the packet-fetching file by using separate programs.
In the data processing method provided by the embodiment of the application, when receiving first data transmitted in a network, a physical layer of a wireless module of a gateway device transmits the first data to an MAC layer of the wireless module of the gateway device and a host processor of the gateway device, and when receiving second data transmitted by an upper layer of the MAC layer, an MAC layer of the wireless module of the gateway device transmits the second data to the physical layer of the wireless module of the gateway device and the host processor, so that the host processor generates a packet capture file according to the first data and the second data. Therefore, the gateway equipment can realize the normal gateway function and the packet capturing function so as to capture the data of network aerial communication, thereby not needing to increase any equipment and cost. Furthermore, the gateway device can realize the regular generation and the regular uploading of the packet capturing file, wherein the packet capturing file can be associated with the timestamp, so that technicians can directly monitor the field wireless network according to the packet capturing file in the server, the remote monitoring of the field wireless network is realized, and the problem analysis and problem positioning efficiency of the field wireless network is improved.
Referring to fig. 6, a block diagram of a data processing apparatus 500 provided in an embodiment of the present application is shown, where the data processing apparatus is applied to a gateway device, and the apparatus may include: a first data transmission module 510, a second data transmission module 520, and a file generation module 530. The first data transmission module 510 is configured to, when receiving first data transmitted in a network, transmit the first data to an MAC layer of a wireless module of a gateway device and a main processor of the gateway device by a physical layer of the wireless module of the gateway device; the second data transmission module 520 is configured to, when the MAC layer of the wireless module of the gateway device receives second data sent by an upper layer of the MAC layer, transmit the second data to the physical layer of the wireless module of the gateway device and the host processor; the file generating module 530 is configured to generate a packet capture file according to the first data and the second data by the host processor.
In some embodiments, the file generation module 530 may be specifically configured to: and when the time length of the main processor for receiving the first data and the second data meets the specified time length, the main processor generates a packet capturing file according to the first data and the second data received in the specified time length.
In some embodiments, the file generating module 530 may be specifically configured to: and the main processor generates a packet capturing file associated with a time stamp according to the first data and the second data, wherein the time stamp is a time point for receiving the first data and the second data.
Further, the data processing apparatus 500 may further include: and a file uploading module. The file uploading module is used for uploading the packet capturing files generated in the preset duration to the server every preset duration.
In some embodiments, the file uploading module may be specifically configured to: detecting whether a communication network between the gateway equipment and the server is communicated or not at preset time intervals; and if the communication network is connected, uploading the packet capturing file generated within the preset time duration to a server.
In some embodiments, the above-mentioned bale plucking file is a specified file size.
In some embodiments, the first data includes data sent by the node device to the gateway device, where the gateway device and the node device are communicatively connected by using a Zigbee protocol or an IEEE 802.15.4 protocol.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working processes of the above-described devices, modules and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In several embodiments provided in the present application, the coupling of the modules to each other may be electrical, mechanical or other forms of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
To sum up, according to the data processing method and apparatus provided in the embodiments of the present application, when receiving first data transmitted in a network, a physical layer of a wireless module of a gateway device transmits the first data to an MAC layer of the wireless module of the gateway device and a host processor of the gateway device, and when receiving second data transmitted by an MAC layer above the MAC layer, an MAC layer of the wireless module of the gateway device transmits the second data to the physical layer of the wireless module of the gateway device and the host processor, so that the host processor generates a packet capture file according to the first data and the second data, and thus the gateway device can implement a normal gateway function and also implement a packet capture function to capture data of network over-the-air communication, and thus does not need to add any device and cost.
Referring to fig. 7, a block diagram of a gateway device according to an embodiment of the present application is shown. The gateway device 100 may be a Zigbee gateway. The gateway device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a communication module 130, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform the methods as described in the aforementioned method embodiments.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall gateway device 100 using various interfaces and lines, performs various functions of the gateway device 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the gateway device 100 in use, and the like.
The communication module 130 is used for receiving and transmitting electromagnetic waves, and implementing interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. The communication module 130 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The communication module 130 may communicate with various networks such as the internet, an intranet, a preset type of wireless network, or other devices through a preset type of wireless network. The preset types of wireless networks described above may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The Wireless network of the above-mentioned preset type may use various Communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Zigbee, bluetooth Mesh, Thread, Wireless Fidelity (WiFi) (e.g. IEEE802.11 a, IEEE802.11 b, IEEE 802.2.11 g and/or IEEE802.11 n, Internet protocol, VoIP), Internet protocol, VoIP, Wi-Max), other protocols for email, instant messaging, and short messaging, and any other suitable communication protocol.
Referring to fig. 8, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 800 includes a non-volatile computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 for performing any of the method steps of the method described above. The program code can be read from and written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A data processing method is applied to a gateway device, and the method comprises the following steps:
when receiving first data transmitted in a network, a physical layer of a wireless module of the gateway device transmits the first data to an MAC layer of the wireless module of the gateway device and a main processor of the gateway device;
when receiving second data sent by the layers above the MAC layer, the MAC layer of the wireless module of the gateway device transmits the second data to the physical layer of the wireless module of the gateway device and the main processor, wherein the first data and the second data both carry device identification numbers of node devices, and communication connection is established between the node devices and the gateway device;
the main processor generates a packet capturing file according to the first data and the second data, the file name of the packet capturing file is obtained by naming based on the time stamps of the first data and the second data, and the packet capturing file is used for analyzing and positioning the node equipment with the fault.
2. The method of claim 1, wherein generating, by the master processor, a bale capture file from the first data and the second data comprises:
and when the time length of the main processor for receiving the first data and the second data meets the specified time length, the main processor generates a packet capturing file according to the first data and the second data received in the specified time length.
3. The method of claim 1, wherein generating, by the master processor, a bale capture file from the first data and the second data comprises:
and the main processor generates a packet capturing file associated with a time stamp according to the first data and the second data, wherein the time stamp is a time point for receiving the first data and the second data.
4. The method of any of claims 1-3, wherein after the master processor generates a bale capture file from the first data and the second data, the method further comprises:
and uploading the packet capturing file generated in the preset time length to a server at every preset time length.
5. The method according to claim 4, wherein uploading the packet capturing file generated within a preset time period to a server every interval of the preset time period comprises:
detecting whether a communication network between the gateway equipment and a server is communicated every preset time interval;
and if the communication network is connected, uploading the packet capturing file generated in the preset time length to a server.
6. The method of any of claims 1-3, wherein the bale pluck file is a specified file size.
7. The method according to any one of claims 1 to 3, wherein the first data includes data sent by a node device to the gateway device, and wherein the gateway device and the node device are communicatively connected using a Zigbee protocol or an IEEE 802.15.4 protocol.
8. A data processing apparatus, applied to a gateway device, the apparatus comprising:
the first data transmission module is used for transmitting first data to an MAC layer of a wireless module of the gateway device and a main processor of the gateway device when a physical layer of the wireless module of the gateway device receives the first data transmitted in a network;
a second data transmission module, configured to, when receiving second data sent by an upper layer of the MAC layer, transmit the second data to a physical layer of a wireless module of the gateway device and the host processor, where the first data and the second data both carry a device identification number of a node device, and a communication connection is established between the node device and the gateway device;
and the file generation module is used for generating a packet capturing file according to the first data and the second data by the main processor, wherein the file name of the packet capturing file is obtained based on the time stamp naming of the first data and the time stamp naming of the second data, and the packet capturing file is used for analyzing and positioning the node equipment with the fault.
9. A gateway device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-7.
10. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 7.
CN201910224211.6A 2019-03-22 2019-03-22 Data processing method, device, gateway equipment and storage medium Active CN110113771B (en)

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 CN110113771A (en) 2019-08-09
CN110113771B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111023269B (en) * 2019-12-30 2021-06-15 宁波奥克斯电气股份有限公司 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
CN113347038B (en) * 2021-06-08 2022-11-22 上海天旦网络科技发展有限公司 Circulation mutual-backup high-availability system for bypass flow processing

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101114932B (en) * 2006-07-27 2012-09-19 华为数字技术有限公司 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
CN102044063B (en) * 2010-12-23 2012-11-21 中国科学院自动化研究所 FPGA (Field Programmable Gate Array) and DSP (Digital Signal Processor) based machine vision system
CN104468190B (en) * 2014-11-03 2018-12-25 青岛海信移动通信技术股份有限公司 A kind of wifi data packet snapping method, device and intelligent terminal
WO2017124307A1 (en) * 2016-01-19 2017-07-27 华为技术有限公司 Data transmission method, device and system
CN105740396B (en) * 2016-01-27 2019-12-10 广州酷狗计算机科技有限公司 HTTP data processing method and device
CN108282811A (en) * 2017-01-05 2018-07-13 中兴通讯股份有限公司 A kind of data processing method and device
CN107347025A (en) * 2017-06-14 2017-11-14 云丁网络技术(北京)有限公司 Data processing method, device, server and system
CN109194679B (en) * 2018-09-25 2020-04-14 北京航空航天大学 Multi-protocol interface data acquisition device and acquisition method based on SpaceFibre interface
CN109040144B (en) * 2018-10-19 2021-09-24 京信网络系统股份有限公司 Internet of things gateway data processing method and device, storage medium and gateway equipment

Also Published As

Publication number Publication date
CN110113771A (en) 2019-08-09

Similar Documents

Publication Publication Date Title
CN110113771B (en) Data processing method, device, gateway equipment and storage medium
RU2571568C2 (en) Method and apparatus for remote fault location in wireless network
JP2017514335A (en) Network range extender with multiple RF radio support for multiple network interfaces
CN105263155B (en) The method and system of remote real time monitoring intelligent mobile terminal baseband processor operating status
CN110071847A (en) Message processing method, device, terminal device and storage medium
CN103873164B (en) Mobile terminal test device and method
CN107204924B (en) Link discovery method and device
CN111400127B (en) Service log monitoring method and device, storage medium and computer equipment
CN111263377B (en) Network configuration method, device, equipment and system and distribution network testing method and system
CN107222887B (en) Communication performance testing method and device for base station wireless side transmission path
CN103686854A (en) Method and device for controlling AP
CN109743717B (en) Data processing method and device, terminal equipment and storage medium
CN102387521A (en) Method and system for monitoring states of nodes of wireless sensor network (WSN)
CA3121748A1 (en) Systems and methods for node outage determination and reporting
CN104038446A (en) Link discovery method and device
CN102143070B (en) Remote traffic acquisition method, device and system
CN110876155A (en) Simulation system and method for wireless mesh network
CN111182507B (en) Method and device for operation, maintenance and management of Internet of things network
US11128544B2 (en) Remote wireless sniffer management
CN112399446A (en) Edge gateway communication method, device, computer equipment and storage medium
CN110753363A (en) Intelligent device wireless debugging system and method
CN112469087B (en) Method for adjusting communication rate of air conditioning equipment, terminal and storage medium
CN115277450A (en) OPNET-based virtual-real combined heterogeneous communication network fusion system and application
CN114785659A (en) Instruction configuration method and device, electronic equipment and computer-readable storage medium
CN113965904A (en) Device registration method, device and storage medium

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