Disclosure of Invention
The embodiment of the application provides a data processing method, a device, equipment and a storage medium, which are used for solving the problem that communication connection cannot be carried out between edge equipment and an Internet of things platform in the prior art.
In a first aspect, an embodiment of the present application provides a data processing method, applied to a proxy server, where the method includes: receiving a connection request sent by edge equipment, wherein the connection request comprises an identification code of the edge equipment; determining whether the proxy server stores the identification code of the edge device according to the connection request; under the condition that the proxy server stores the identification code of the edge equipment, first notification information is sent to the edge equipment, wherein the first notification information is used for indicating that the edge equipment is allowed to be in communication connection with the proxy server; receiving data to be processed sent by edge equipment; and sending the data to be processed to the platform of the Internet of things.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the proxy server is used as an intermediate server for communication connection between the edge equipment and the Internet of things platform, so that the proxy server is respectively in communication connection with the edge equipment and the Internet of things platform, then the proxy server receives data to be processed sent by the edge equipment and forwards the data to the Internet of things platform, and the purpose of indirect communication connection between the edge equipment and the Internet of things platform is achieved.
In one possible embodiment, the method further comprises: under the condition that the proxy server does not store the identification code of the edge equipment, the identification code of the edge equipment is sent to the platform of the Internet of things; receiving second notification information sent by the internet of things platform, wherein the second notification information is used for indicating whether an identification code of the edge equipment is stored in the internet of things platform or not; and sending the first notification information to the edge equipment under the condition that the second notification information is used for representing that the identification code of the edge equipment is stored in the internet of things platform.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: when the edge equipment is in communication connection with the proxy server, the edge equipment needs to be ensured to be legal equipment, so that the edge equipment can be successfully in communication connection with the proxy server, whether the identification code of the edge equipment exists or not is determined in the internet of things platform, the problem that the accuracy is low due to the fact that whether the edge equipment is legal equipment or not is avoided by the proxy server, and the accuracy of judging the validity of the edge equipment is improved.
In one possible embodiment, the method further comprises: under the condition that the second notification information is used for indicating that the identification code of the edge equipment is not stored in the internet of things platform, the edge equipment is determined to be abnormal equipment; and recording a first exception log, wherein the first exception log is used for indicating that the edge equipment is an exception equipment.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: when the edge equipment is abnormal equipment, the information of the edge equipment which is the abnormal equipment can be recorded through the first abnormal log, so that reference information is provided for subsequent abnormal processing, and the processing efficiency of the abnormality is improved.
In one possible embodiment, the method further comprises: acquiring the receiving rate of the proxy server for receiving the data to be processed; under the condition that the receiving rate is greater than or equal to a preset rate threshold value, the communication connection between the edge equipment and the edge equipment is disconnected; and recording a second exception log, wherein the second exception log is used for representing the connection exception between the edge equipment and the proxy server.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the receiving rate of the data to be processed, which is sent by the edge equipment, of the proxy server needs to be ensured to be within a certain threshold, and when the receiving rate is higher than a preset rate threshold, the connection between the edge equipment and the proxy server is disconnected, so that the problem that the proxy server cannot accurately forward the data to be processed to the internet of things platform due to the fact that the edge equipment still continues to send the data to be processed to the proxy server when communication between the edge equipment and the proxy server is abnormal can be avoided, the accuracy of communication between the proxy server and the edge equipment can be improved, and the subsequent processing efficiency of the abnormality can be improved through a second abnormality log.
In one possible implementation manner, the sending the data to be processed to the platform of the internet of things includes: under the condition that the receiving rate is smaller than a preset rate threshold, analyzing the data to be processed according to a private protocol of the edge equipment to obtain first analysis data, wherein the private protocol is a protocol for communication connection between the edge equipment and the proxy server; changing the data format of the first analysis data according to a preset format to obtain second analysis data; and sending the second analysis data to the Internet of things platform.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the proxy server can analyze the data to be processed sent by the edge equipment according to the private protocols of different edge equipment, and then changes the data format of the data obtained by analysis into the data format applicable to the Internet of things platform, so that the edge equipment can be not changed too much, and the communication between the edge equipment and the Internet of things platform can be realized.
In a second aspect, an embodiment of the present application further provides a data processing method, applied to an edge device, where the method includes: sending a connection request to a proxy server, wherein the connection request comprises an identification code of the edge equipment; receiving first notification information sent by a proxy server, wherein the first notification information is used for indicating that the edge equipment is allowed to be in communication connection with the proxy server; the proxy server is in communication connection with the first notification information; and transmitting the data to be processed to the proxy server.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the proxy server is used as an intermediate server for communication connection between the edge equipment and the Internet of things platform, so that the proxy server is respectively in communication connection with the edge equipment and the Internet of things platform, then the proxy server receives data to be processed sent by the edge equipment and forwards the data to the Internet of things platform, and the purpose of indirect communication connection between the edge equipment and the Internet of things platform is achieved.
In a third aspect, an embodiment of the present application further provides a data processing method, applied to an internet of things platform, where the method includes: pre-storing identification codes of a plurality of edge devices; the identification codes of the plurality of edge devices are stored to the proxy server.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the identification codes of a plurality of edge devices are required to be stored in the internet of things platform in advance, so that when the proxy server does not find the identification codes of the edge devices, whether the identification codes of the edge devices exist in the internet of things platform or not can be determined, and the problem that indirect communication cannot be realized between the edge devices and the internet of things platform due to misjudging the edge devices as abnormal devices can be avoided, and therefore, the legal indirect communication between the edge devices and the internet of things platform can be realized.
In one possible embodiment, the method further comprises: receiving an identification code of the edge equipment sent by the proxy server; determining second notification information according to the identification codes of the edge devices sent by the proxy server and the prestored identification codes of the plurality of edge devices, wherein the second notification information is used for indicating whether the identification codes of the edge devices are stored in the internet of things platform or not; and sending the second notification information to the proxy server.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: when the edge equipment is in communication connection with the proxy server, the edge equipment needs to be ensured to be legal equipment, so that the edge equipment can be successfully in communication connection with the proxy server, whether the identification code of the edge equipment exists or not is determined in the internet of things platform, the problem that the accuracy is low due to the fact that whether the edge equipment is legal equipment or not is avoided by the proxy server, and the accuracy of judging the validity of the edge equipment is improved.
In a possible implementation manner, in a case that the prestored identification codes of the plurality of edge devices include the identification codes of the edge devices sent by the proxy server, the second notification information is used for indicating that the identification codes of the edge devices are stored in the internet of things platform; and under the condition that the prestored identification codes of the plurality of edge devices do not comprise the identification codes of the edge devices sent by the proxy server, the second notification information is used for indicating that the identification codes of the edge devices are not stored in the internet of things platform.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the identification codes of the edge devices are stored in the internet of things platform, the edge devices are legal devices, the identification codes of the edge devices are not stored in the internet of things platform, and therefore whether the identification codes of the edge devices exist or not is determined in the internet of things platform, the problem that accuracy is low when the fact that whether the edge devices are legal devices or not is judged only through the proxy server can be avoided, and accuracy of judging the validity of the edge devices is improved.
In a fourth aspect, embodiments of the present application provide a data processing apparatus, where the apparatus includes functional modules for implementing the method of the first aspect, and any functional module may be implemented by using software and/or hardware.
For example, the apparatus may include a first receiving module, a determining module, a first transmitting module, a second receiving module, and a second transmitting module.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the proxy server is used as an intermediate server for communication connection between the edge equipment and the Internet of things platform, so that the proxy server is respectively in communication connection with the edge equipment and the Internet of things platform, then the proxy server receives data to be processed sent by the edge equipment and forwards the data to the Internet of things platform, and the purpose of indirect communication connection between the edge equipment and the Internet of things platform is achieved.
In a fifth aspect, embodiments of the present application provide a data processing apparatus, where the apparatus includes respective functional modules for implementing the method of the second aspect, and any functional module may be implemented by using software and/or hardware.
For example, the apparatus may include a third transmitting module, a third receiving module, a connecting module, and a fourth transmitting module.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the proxy server is used as an intermediate server for communication connection between the edge equipment and the Internet of things platform, so that the proxy server is respectively in communication connection with the edge equipment and the Internet of things platform, then the proxy server receives data to be processed sent by the edge equipment and forwards the data to the Internet of things platform, and the purpose of indirect communication connection between the edge equipment and the Internet of things platform is achieved.
In a sixth aspect, embodiments of the present application provide a data processing apparatus, where the apparatus includes functional modules for implementing the method of the third aspect, and any functional module may be implemented by using software and/or hardware.
For example, the apparatus may include a first memory module and a second memory module.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the identification codes of a plurality of edge devices are required to be stored in the internet of things platform in advance, so that when the proxy server does not find the identification codes of the edge devices, whether the identification codes of the edge devices exist in the internet of things platform or not can be determined, and the problem that indirect communication cannot be realized between the edge devices and the internet of things platform due to misjudging the edge devices as abnormal devices can be avoided, and therefore, the legal indirect communication between the edge devices and the internet of things platform can be realized.
In a seventh aspect, an embodiment of the present application provides a terminal device, including: the processor, the memory, the interactive interface; the memory is used for storing executable instructions of the processor; wherein the processor is configured to perform the data processing method of the second aspect via execution of the executable instructions.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the proxy server is used as an intermediate server for communication connection between the edge equipment and the Internet of things platform, so that the proxy server is respectively in communication connection with the edge equipment and the Internet of things platform, then the proxy server receives data to be processed sent by the edge equipment and forwards the data to the Internet of things platform, and the purpose of indirect communication connection between the edge equipment and the Internet of things platform is achieved.
In an eighth aspect, embodiments of the present application provide a server, including: the processor, the memory, the interactive interface; the memory is used for storing executable instructions of the processor; wherein the processor is configured to perform the data processing method of the first or third aspect via execution of executable instructions.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the proxy server is used as an intermediate server for communication connection between the edge equipment and the Internet of things platform, so that the proxy server is respectively in communication connection with the edge equipment and the Internet of things platform, then the proxy server receives data to be processed sent by the edge equipment and forwards the data to the Internet of things platform, and the purpose of indirect communication connection between the edge equipment and the Internet of things platform is achieved.
In a ninth aspect, embodiments of the present application provide a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the data processing method of the first to third aspects.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the proxy server is used as an intermediate server for communication connection between the edge equipment and the Internet of things platform, so that the proxy server is respectively in communication connection with the edge equipment and the Internet of things platform, then the proxy server receives data to be processed sent by the edge equipment and forwards the data to the Internet of things platform, and the purpose of indirect communication connection between the edge equipment and the Internet of things platform is achieved.
In a tenth aspect, embodiments of the present application provide a computer program product comprising a computer program for implementing the data processing methods of the first to third aspects when the computer program is executed by a processor.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects: the proxy server is used as an intermediate server for communication connection between the edge equipment and the Internet of things platform, so that the proxy server is respectively in communication connection with the edge equipment and the Internet of things platform, then the proxy server receives data to be processed sent by the edge equipment and forwards the data to the Internet of things platform, and the purpose of indirect communication connection between the edge equipment and the Internet of things platform is achieved.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of 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, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments made by a person of ordinary skill in the art based on the embodiments in this application, in light of the teachings of this embodiment, are within the scope of this application.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims of this application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the prior art provided in the background art, the technical scheme for realizing communication connection between the edge equipment and the platform of the internet of things at least has the following technical problems:
some old edge devices, such as 2G modules, generally transmit data through TCP, but because the 2G modules cannot support TCP encryption and use a private protocol when transmitting data, and the security of the internet of things platform is higher and the private protocol is not supported, the old edge devices cannot communicate with the internet of things platform with higher security; if the direct communication between the edge device and the internet of things platform is desired, the old edge device needs to be modified or upgraded, for example, the 2G module is upgraded to the 4G module, but this method increases the cost, so in the prior art, the old edge device and the internet of things platform cannot be connected in a communication manner.
In view of the above problems, the present application proposes a data processing method, by setting a proxy server, so that the proxy server is in communication connection with an edge device, after the edge device sends data to be processed to the proxy server, the proxy server parses the received data to be processed according to a private protocol of the edge device, and then after changing a data format of the data obtained after parsing into a format applicable to an internet of things platform, sends the data with the changed format to the internet of things platform, and the internet of things platform stores the data so as to utilize the data subsequently. The proxy server is arranged, so that indirect communication connection between the edge equipment and the Internet of things platform can be realized, and the proxy server can analyze data to be processed sent by the edge equipment according to the private protocol of the edge equipment, so that modification or upgrading of the edge equipment is avoided, the original edge equipment is directly used, the indirect communication connection between the edge equipment and the Internet of things platform can be realized through the proxy server, and meanwhile, the cost can be reduced. The terms referred to in the present application are explained first below.
Edge device: devices that provide access points to an enterprise core network or service provider core network, such as routers, routing switches, integrated access devices, multiplexers, and various metropolitan area network access devices and wide area network access devices, etc.;
internet of things platform: information exchange and communication are carried out by connecting various articles with the Internet according to agreed protocols through information equipment such as radio frequency automatic identification, infrared sensors, a global positioning system, a laser scanner, an image sensor and the like so as to realize an intelligent identification, positioning, tracking, monitoring and management system.
The data processing method has the core ideas that the proxy server is arranged to realize communication connection between the proxy server and the edge equipment and between the proxy server and the Internet of things platform, so that the edge equipment can send data to be processed to the proxy server according to own private protocol, the proxy server analyzes the data to be processed according to the private protocol of the edge equipment, and after modifying the data format of the analyzed data into the data format suitable for the Internet of things platform, the data is forwarded to the Internet of things platform, and the Internet of things platform can utilize the data subsequently, thereby realizing indirect communication connection between the edge equipment and the Internet of things platform; and because the edge equipment and the proxy server can communicate according to the private protocol of the edge equipment, and the proxy server can analyze and change the format again according to the data to be processed sent by the edge equipment according to the private protocol of the edge equipment, the edge equipment does not need to be modified greatly, so that the cost can be reduced, and the problems that the edge equipment and the internet of things platform are easy to realize communication connection are solved.
In one possible implementation, the data processing method of this embodiment may be applied in an application scenario, and fig. 1 is a schematic diagram of an application scenario of the data processing method provided in this embodiment of the present application, as shown in fig. 1, in this scenario, the proxy server may be a TCP proxy server, and the edge device 1, the edge device 2, and the edge device 3 are legal devices that have been registered in the internet of things platform, so that the edge device 1 may perform TCP communication with the TCP proxy server according to the private protocol 1, the edge device 2 may perform TCP communication with the TCP proxy server according to the private protocol 2, and the edge device 3 may perform TCP communication with the TCP proxy server according to the private protocol 3.
In the above scenario, after the edge device 1, the edge device 2 and the edge device 3 successfully communicate with the TCP proxy server, the data to be processed may be sent to the proxy server, where the proxy server parses the data to be processed 1 sent by the edge device 1 according to the private protocol 1, then changes the data format of the parsed data to JSON data format according to the JSON protocol applicable to the internet of things platform, encrypts the encrypted data to be processed 1 by the standard secure socket protocol (Secure Sockets Layer, abbreviated as SSL) to obtain the data to be processed 1 after the data format is changed, and then sends the data to be processed 1 after the data format is changed to the internet of things platform, and similarly processes the data to be processed 2 sent by the edge device 2 and the data to be processed 3 sent by the edge device 3, thereby implementing indirect communication connection between the edge device and the internet of things platform.
In the above scenario, when the edge device is connected with the proxy server, the edge device needs to send its identification code to the proxy server, the proxy server confirms the identification code of the edge device, and when the local of the proxy server stores the identification code of the edge device, it is determined that the edge device is legal device, so that the edge device and the proxy server can be successfully connected; when the identification codes of the edge devices are not stored in the local of the proxy server, the identification codes of the edge devices are pre-stored in the internet of things platform, so that the proxy server can send the identification codes of the edge devices to the internet of things platform, the internet of things platform confirms whether the edge devices are legal devices or not, and when the identification codes of the edge devices are stored in the internet of things platform, the edge devices are determined to be legal devices, and the proxy server can be successfully connected with the edge devices; when the identification code of the edge device is not stored in the internet of things platform, the edge device is determined to be not legal, the proxy server and the edge device cannot be successfully connected, and at the moment, the proxy server can record an exception log, so that the exception is recorded. Therefore, the successful connection between the edge equipment and the proxy server can be ensured, and the abnormal situation can be rapidly processed according to the recorded abnormal log when the abnormal situation occurs.
Based on the above-described scenario, the data processing method will be described in detail below by way of several exemplary embodiments.
Fig. 2 is a flowchart of an embodiment of a data processing method provided in the embodiment of the present application, and as shown in fig. 2, the data processing method may be applied to a proxy server, and the method may include the following steps:
s201: and receiving a connection request sent by the edge equipment.
In this step, the connection request includes an identification code of the edge device, which is a unique device code of the edge device, that is, a unique identifier of the edge device, and the identification codes of each edge device are different, so that the corresponding edge device can be determined by the identification code. After receiving the connection request sent by the edge device, the proxy server can determine the validity of the edge device through the identification code in the connection request.
In the above scheme, the proxy server may be a dedicated TCP proxy server, and the proxy server may be a gateway of the platform of the internet of things, so long as the edge device supports the TCP protocol, and the edge device is a legal device, and the edge device may be connected with the proxy server.
S202: and determining whether the proxy server stores the identification code of the edge device according to the connection request.
In this step, the identification codes of the edge devices in the proxy server are prestored in the internet of things platform, and the plurality of edge devices can be registered in the internet of things platform in advance, so that the identification codes of the plurality of edge devices can be prestored in the internet of things platform, and the edge devices stored in the internet of things platform are legal devices. In order to increase the speed of inquiring the identification codes of the edge devices, the internet of things platform can periodically store the stored identification codes of a plurality of edge devices to the local of the proxy server, so that after the proxy server receives a connection request sent by the edge devices, whether the identification codes of the edge devices are stored in the local can be directly inquired, and the problem of low inquiring speed caused by the need of inquiring the identification codes of the edge devices to the internet of things platform is avoided.
S203: and sending the first notification information to the edge device in the case that the proxy server stores the identification code of the edge device.
In this step, the first notification information is used to indicate that the edge device is allowed to make a communication connection with the proxy server. When the identification code of the edge device is stored in the local area of the proxy server, the edge device is indicated to be legal, and at this time, the proxy server can send first notification information to the edge device, so that the edge device and the proxy server are successfully connected.
S204: and receiving the data to be processed sent by the edge equipment.
In this step, after a successful connection between the edge device and the proxy server, the edge device may send the data to be processed to the proxy server.
S205: and sending the data to be processed to the platform of the Internet of things.
According to the data processing method, the proxy server is used as an intermediate server for communication connection between the edge equipment and the Internet of things platform, so that the proxy server is respectively in communication connection with the edge equipment and the Internet of things platform, then the proxy server receives data to be processed sent by the edge equipment and forwards the data to the Internet of things platform, and the purpose of indirect communication connection between the edge equipment and the Internet of things platform is achieved.
The above data processing method will be described in detail.
In one possible implementation, the method further comprises: under the condition that the proxy server does not store the identification code of the edge equipment, the identification code of the edge equipment is sent to the platform of the Internet of things; receiving second notification information sent by the internet of things platform, wherein the second notification information is used for indicating whether an identification code of the edge equipment is stored in the internet of things platform or not; and sending the first notification information to the edge equipment under the condition that the second notification information is used for representing that the identification code of the edge equipment is stored in the internet of things platform.
In this scheme, if the proxy server does not store the identification code of the edge device, it may be stated that the edge device is a newly added device, and the internet of things platform does not store the identification code of the newly added edge device in the local area of the proxy server yet; or the edge device is an illegal device. Therefore, the proxy server needs to send the identification code of the edge device to the internet of things platform, and the internet of things platform determines whether the identification code of the edge device is stored.
In the above scheme, when the identifier code of the edge device is stored in the internet of things platform, the proxy server can determine that the edge device is legal after receiving the second notification information, so that the proxy server can send the first notification information to the edge device to allow the edge device to connect, and therefore the edge device can be successfully connected with the proxy server.
In the above scheme, when the edge device is in communication connection with the proxy server, the edge device needs to be ensured to be legal, so that the edge device can successfully complete communication connection with the proxy server, and therefore, whether the identification code of the edge device exists or not is determined in the internet of things platform, the problem of lower accuracy caused by judging whether the edge device is legal or not only through the proxy server can be avoided, and the accuracy of judging the validity of the edge device is improved.
In one possible implementation, the method further comprises: under the condition that the second notification information is used for indicating that the identification code of the edge equipment is not stored in the internet of things platform, the edge equipment is determined to be abnormal equipment; and recording a first exception log, wherein the first exception log is used for indicating that the edge equipment is an exception equipment.
In the scheme, when the identification code of the edge equipment is not stored in the internet of things platform, the proxy server determines that the edge equipment is not registered in the internet of things platform, so that the edge equipment is abnormal equipment, namely illegal equipment, and the proxy server cannot be successfully connected with the edge equipment, so that a first abnormal log indicating that the edge equipment is abnormal equipment needs to be recorded, and when the subsequent processing of the abnormality is performed, reference information can be provided through the first abnormal log, and the processing efficiency of the abnormality is improved.
In one possible implementation, the method further comprises: acquiring the receiving rate of the proxy server for receiving the data to be processed; under the condition that the receiving rate is greater than or equal to a preset rate threshold value, the communication connection between the edge equipment and the edge equipment is disconnected; and recording a second exception log, wherein the second exception log is used for representing the connection exception between the edge equipment and the proxy server.
In this scheme, after the edge device is successfully connected with the proxy server, the data to be processed can be sent to the proxy server according to a certain transmission rate, and the receiving rate of the proxy server when receiving the data to be processed needs to be smaller than a preset rate threshold, for example, the preset rate threshold is 10 pieces/min, so that the proxy server can be guaranteed to normally receive the data to be processed, if the receiving rate of the proxy server is greater than or equal to the preset rate threshold, the receiving rate of the proxy server when receiving the data to be processed is too fast, at the moment, it is indicated that the communication between the proxy server and the edge device is abnormal, therefore, the receiving of the data to be processed needs to be limited, namely, the connection between the edge device and the proxy server is disconnected, normal communication between the proxy server and the edge device is guaranteed, and an abnormal log of the time, namely, a second abnormal log is recorded, so that when the abnormality is processed later, reference information can be provided through the second abnormal log, and the processing efficiency of the abnormality is improved.
In the scheme, when the communication between the proxy server and the edge equipment is abnormal, the connection between the edge equipment and the proxy server is disconnected, so that the problem that the proxy server cannot accurately forward the data to be processed to the Internet of things platform due to the fact that the edge equipment continues to send the data to be processed to the proxy server when the communication between the edge equipment and the proxy server is abnormal can be avoided, and the accuracy of the communication between the proxy server and the edge equipment can be improved.
In one possible implementation, sending the data to be processed to the internet of things platform includes: under the condition that the receiving rate is smaller than a preset rate threshold, analyzing the data to be processed according to a private protocol of the edge equipment to obtain first analysis data, wherein the private protocol is a protocol for communication connection between the edge equipment and the proxy server; changing the data format of the first analysis data according to a preset format to obtain second analysis data; and sending the second analysis data to the Internet of things platform.
In this scheme, when the receiving rate is smaller than the preset rate threshold, it is indicated that the edge device and the proxy server can normally communicate, so that the edge device can normally send the data to be processed to the proxy server. Because the communication between the edge equipment and the proxy server is performed according to the private protocol of the edge equipment, and the internet of things platform does not support the private protocol of the edge equipment, the proxy server is required to analyze the data to be processed sent by the edge equipment and repackage the data into the data in the data format supported by the internet of things, so that the internet of things platform can store and utilize the data sent by the proxy server.
In the above scheme, the proxy server can analyze the data to be processed sent by the edge device according to the private protocols of different edge devices, and then change the data format of the data obtained by analysis into the data format applicable to the internet of things platform, so that the edge device can be changed without too much change, and the communication between the edge device and the internet of things platform can be realized.
In the above scheme, the proxy server can provide customized compatibility for the edge device, that is, the proxy server can analyze the data to be processed sent by the edge device according to the existing private protocol of the edge device, and the proxy server can analyze the data to be processed according to the private protocol of the edge device through the script, and the script can be written or modified according to the actual situation, so that the requirements of different private protocols of different edge devices can be met, and the compatibility range of the edge device is enlarged.
In the above scheme, the proxy server may receive the connection request sent by the plurality of edge devices, so as to implement connection with the plurality of edge devices, and because the private protocols of each edge device may be different, the proxy server may respectively parse the data to be processed sent by the corresponding edge device according to different private protocols of different edge devices.
In the above scheme, when the edge device and the proxy server are in communication, the encryption of the transmitted data and the data format are both responsible for the private protocol of the original edge device, and when the proxy server and the internet of things platform are in communication, the encryption of the transmitted data is carried out by adopting an SSL encryption protocol, and the data format adopts a JSON data format unified by the internet of things platform.
Fig. 3 is a flowchart of a second embodiment of a data processing method provided in the embodiment of the present application, where, as shown in fig. 3, the data processing method may be applied to an edge device, and the method may include the following steps:
s301: and sending a connection request to the proxy server.
In this step, the connection request includes an identification code of the edge device, which is a unique identifier of the edge device, and the identification code of each edge device is different, so that the corresponding edge device can be determined by the identification code. After the edge device sends a connection request to the proxy server, the proxy server can determine the validity of the edge device by the identification code in the connection request after receiving the connection request sent by the edge device.
S302: and receiving the first notification information sent by the proxy server.
In this step, the first notification information is used to indicate that the edge device is allowed to make a communication connection with the proxy server.
S303: and carrying out communication connection with the proxy server according to the first notification information.
In this step, after receiving the connection request sent by the edge device, if the local area of the proxy server stores the identification code of the edge device or the internet of things platform stores the identification code of the edge device, which indicates that the edge device is a legal device, the proxy server may send first notification information to the edge device, and after receiving the first notification information sent by the proxy server, the edge device determines that the edge device may be connected to the proxy server, so that the edge device and the proxy server may be successfully connected.
S304: and sending the data to be processed to the proxy server.
In this step, after a successful connection between the edge device and the proxy server, the edge device may send the data to be processed to the proxy server.
In the scheme, the edge equipment is indirectly communicated with the Internet of things platform through the proxy server, so that the edge equipment is not required to be greatly modified, only the address of the edge equipment when the edge equipment transmits the data to be processed is required to be modified, namely, only the address of the edge equipment for transmitting the data to be processed is required to be modified into the address of the proxy server, and then the data to be processed is transmitted to the Internet of things platform through the proxy server, and the indirect communication between the edge equipment and the Internet of things platform can be realized under the condition that the edge equipment is not greatly modified.
According to the data processing method, the proxy server is used as an intermediate server for communication connection between the edge equipment and the Internet of things platform, so that the proxy server is respectively in communication connection with the edge equipment and the Internet of things platform, then the proxy server receives data to be processed sent by the edge equipment and forwards the data to the Internet of things platform, and the purpose of indirect communication connection between the edge equipment and the Internet of things platform is achieved.
Fig. 4 is a flowchart of a third embodiment of a data processing method provided in the embodiment of the present application, where, as shown in fig. 4, the data processing method may be applied to an internet of things platform, and the method may include the following steps:
s401: the identification codes of a plurality of edge devices are stored in advance.
In this step, the internet of things platform may register a plurality of edge devices in advance, so that the internet of things platform may store identification codes of a plurality of edge devices in advance, and the edge devices stored in the internet of things platform are legal devices.
S402: the identification codes of the plurality of edge devices are stored to the proxy server.
In the step, in order to accelerate the query speed of the identification codes of the edge devices, the internet of things platform can periodically store the stored identification codes of the plurality of edge devices to the local of the proxy server, so that after the proxy server receives the connection request sent by the edge devices, whether the identification codes of the edge devices are stored in the local of the proxy server can be directly queried, and the problem of low query speed caused by the need of querying the identification codes of the edge devices to the internet of things platform is avoided.
In the above scheme, only if the proxy server cannot query the identification code of the edge device in its local area, the proxy server needs to send the identification code of the edge device to the internet of things platform for query, so that the proxy server does not need to immediately confirm the internet of things platform when receiving the identification code of the edge device. If the identification code of the edge device is not stored in the proxy server, it can be stated that the edge device is newly added device, and the platform of the internet of things does not store the identification code of the newly added edge device in the local area of the proxy server yet; or the edge device is an illegal device. Therefore, the speed of inquiring the identification code of the edge device can be increased.
According to the data processing method provided by the embodiment, the identification codes of the plurality of edge devices are required to be stored in the internet of things platform in advance, so that when the proxy server does not find the identification codes of the edge devices, whether the identification codes of the edge devices exist in the internet of things platform or not can be determined, and the problem that indirect communication cannot be realized between the edge devices and the internet of things platform due to misjudgment of the edge devices as abnormal devices can be avoided, and therefore, legal indirect communication between the edge devices and the internet of things platform can be realized.
In one possible implementation, the method further comprises: receiving an identification code of the edge equipment sent by the proxy server; determining second notification information according to the identification codes of the edge devices sent by the proxy server and the prestored identification codes of the plurality of edge devices, wherein the second notification information is used for indicating whether the identification codes of the edge devices are stored in the internet of things platform or not; and sending the second notification information to the proxy server.
In the scheme, after the internet of things platform receives the identification code of the edge equipment sent by the proxy server, whether the identification code of the edge equipment is stored in the internet of things platform or not needs to be determined, so that the legitimacy of the edge equipment is determined, and therefore the internet of things platform needs to send second notification information to the proxy server to inform the proxy server whether the identification code of the edge equipment is stored in the internet of things platform or not.
In the above scheme, when the edge device is in communication connection with the proxy server, the edge device needs to be ensured to be legal, so that the edge device can successfully complete communication connection with the proxy server, and therefore, whether the identification code of the edge device exists or not is determined in the internet of things platform, the problem of lower accuracy caused by judging whether the edge device is legal or not only through the proxy server can be avoided, and the accuracy of judging the validity of the edge device is improved.
In one possible implementation, in the case that the prestored identification codes of the plurality of edge devices include the identification codes of the edge devices sent by the proxy server, the second notification information is used for indicating that the identification codes of the edge devices are stored in the internet of things platform; and under the condition that the prestored identification codes of the plurality of edge devices do not comprise the identification codes of the edge devices sent by the proxy server, the second notification information is used for indicating that the identification codes of the edge devices are not stored in the internet of things platform.
In the scheme, the identification code of the edge equipment is stored in the internet of things platform, the edge equipment is legal equipment, the identification code of the edge equipment is not stored in the internet of things platform, and therefore whether the identification code of the edge equipment exists or not is determined in the internet of things platform, the problem that the accuracy is low when the fact that the edge equipment is legal equipment or not is judged only through the proxy server can be avoided, and the accuracy of judging the validity of the edge equipment is improved.
In the data processing method provided by the embodiment of the application, in the connection stage of the edge equipment and the proxy server, the validity of the edge equipment needs to be authenticated, so that the edge equipment needs to send a connection request to the proxy server, the proxy server determines that the edge equipment is legal according to the identification code of the edge equipment included in the connection request and then successfully connects with the edge equipment, and at the moment, the edge equipment and the proxy server can communicate according to the private protocol of the edge equipment; in the communication stage of the edge equipment and the proxy server, the edge equipment sends data to be processed to the proxy server, the proxy server receives the data to be processed according to a preset receiving rate threshold, then analyzes the data to be processed according to a private protocol of the corresponding edge equipment, packages the analyzed data to be processed according to a data format applicable to the Internet of things platform, sends the packaged data to the Internet of things platform, and stores and utilizes the data by the Internet of things platform. The edge equipment and the proxy server can communicate according to the private protocol of the edge equipment, the proxy server can analyze the data to be processed sent by the edge equipment according to the private protocol of the edge equipment, and can send the packaged data to the Internet of things platform after packaging according to the data format applicable to the Internet of things platform, so that the original edge equipment does not need to be modified greatly, and the communication between the edge equipment and the Internet of things platform can be realized under the condition of saving cost.
In general, the technical scheme provided by the application is a technical implementation method which can save cost and also can realize communication between the edge equipment and the platform of the Internet of things.
Fig. 5 is a schematic structural diagram of a first embodiment of a data processing apparatus according to an embodiment of the present application, and as shown in fig. 5, thedata processing apparatus 50 includes:
afirst receiving module 51, configured to receive a connection request sent by an edge device, where the connection request includes an identification code of the edge device;
a determiningmodule 52, configured to determine, according to the connection request, whether the proxy server stores an identification code of the edge device;
afirst sending module 53, configured to send, when the proxy server stores the identification code of the edge device, first notification information to the edge device, where the first notification information is used to indicate that the edge device is allowed to perform communication connection with the proxy server;
asecond receiving module 54, configured to receive data to be processed sent by an edge device;
thesecond sending module 55 is configured to send the data to be processed to the platform of the internet of things.
Optionally, the device is further configured to send the identification code of the edge device to the platform of the internet of things when the proxy server does not store the identification code of the edge device; receiving second notification information sent by the internet of things platform, wherein the second notification information is used for indicating whether an identification code of the edge equipment is stored in the internet of things platform or not; and sending the first notification information to the edge equipment under the condition that the second notification information is used for representing that the identification code of the edge equipment is stored in the internet of things platform.
Optionally, the device is further configured to determine that the edge device is an abnormal device when the second notification information is used to indicate that the identifier of the edge device is not stored in the platform of the internet of things; and recording a first exception log, wherein the first exception log is used for indicating that the edge equipment is an exception equipment.
Optionally, the device is further configured to obtain a receiving rate of the proxy server for receiving the data to be processed; under the condition that the receiving rate is greater than or equal to a preset rate threshold value, the communication connection between the edge equipment and the edge equipment is disconnected; and recording a second exception log, wherein the second exception log is used for representing the connection exception between the edge equipment and the proxy server.
Optionally, thesecond sending module 55 is further configured to parse the data to be processed according to a private protocol of the edge device to obtain first parsed data when the receiving rate is less than a preset rate threshold, where the private protocol is a protocol for performing communication connection between the edge device and the proxy server; changing the data format of the first analysis data according to a preset format to obtain second analysis data; and sending the second analysis data to the Internet of things platform.
The data processing device provided in this embodiment is configured to execute the technical scheme of the data processing method of the proxy server in the foregoing method embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
Fig. 6 is a schematic structural diagram of a second embodiment of a data processing apparatus according to the embodiment of the present application, and as shown in fig. 6, thedata processing apparatus 60 includes:
athird sending module 61, configured to send a connection request to the proxy server, where the connection request includes an identification code of the edge device;
athird receiving module 62, configured to receive first notification information sent by the proxy server, where the first notification information is used to indicate that the edge device is allowed to perform communication connection with the proxy server;
aconnection module 63 for performing communication connection with the proxy server according to the first notification information;
afourth sending module 64, configured to send the data to be processed to the proxy server.
The data processing device provided in this embodiment is configured to execute the technical scheme of the data processing method of the edge device in the foregoing method embodiment, and its implementation principle and technical effect are similar, and are not described herein again.
Fig. 7 is a schematic structural diagram of a third embodiment of a data processing apparatus according to the embodiment of the present application, and as shown in fig. 7, thedata processing apparatus 70 includes:
afirst storage module 71 for storing identification codes of a plurality of edge devices in advance;
asecond storage module 72 is configured to store identification codes of a plurality of edge devices to the proxy server.
Optionally, the device is further configured to receive an identification code of the edge device sent by the proxy server; determining second notification information according to the identification codes of the edge devices sent by the proxy server and the prestored identification codes of the plurality of edge devices, wherein the second notification information is used for indicating whether the identification codes of the edge devices are stored in the internet of things platform or not; and sending the second notification information to the proxy server.
Optionally, when the prestored identification codes of the plurality of edge devices include the identification codes of the edge devices sent by the proxy server, the second notification information is used for indicating that the identification codes of the edge devices are stored in the internet of things platform; and under the condition that the prestored identification codes of the plurality of edge devices do not comprise the identification codes of the edge devices sent by the proxy server, the second notification information is used for indicating that the identification codes of the edge devices are not stored in the internet of things platform.
The data processing device provided in this embodiment is configured to execute the technical scheme of the data processing method of the internet of things platform in the foregoing method embodiment, and its implementation principle and technical effect are similar, and are not described herein again.
Fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application, as shown in fig. 8, the terminal device 800 includes:
Processor 811, memory 812, and interaction interface 813;
memory 812 is used to store executable instructions executable by processor 811;
the processor 811 is configured to execute the technical solution of the data processing method provided in the foregoing method embodiment via executing executable instructions.
In the above terminal device, the memory 812 and the processor 811 are electrically connected directly or indirectly to enable transmission or interaction of data. For example, the elements may be electrically connected to each other via one or more communication buses or signal lines, such as through a bus connection. Stored in the memory 812 are computer-executable instructions for implementing the data processing method, including at least one software functional module that may be stored in the memory in the form of software or firmware, and the processor 811 performs various functional applications and data processing by executing the software programs and modules stored in the memory 812.
Fig. 9 is a schematic structural diagram of a server according to an embodiment of the present application, as shown in fig. 9, the server 900 includes:
a processor 911, a memory 912, and an interaction interface 913;
memory 912 is used to store executable instructions executable by processor 911;
Wherein the processor 911 is configured to execute the technical solution of the data processing method provided by the foregoing method embodiment via execution of executable instructions.
In the above-described servers, the memory 912 and the processor 911 are electrically connected directly or indirectly to enable transmission or interaction of data. For example, the elements may be electrically connected to each other via one or more communication buses or signal lines, such as through a bus connection. The memory 912 has stored therein computer-executable instructions for implementing the data processing method, including at least one software functional module that may be stored in the memory in the form of software or firmware, and the processor 911 executes various functional applications and data processing by running the software programs and modules stored in the memory 912.
The Memory may be, but is not limited to, random access Memory (Random Access Memory; RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory; PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory; EPROM), electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory; EEPROM), etc. The memory is used for storing a program, and the processor executes the program after receiving the execution instruction. Further, the software programs and modules within the memory may also include an operating system, which may include various software components and/or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components.
The processor may be an integrated circuit chip with signal processing capabilities. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, abbreviated as CPU), a network processor (Network Processor, abbreviated as NP), and the like. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The embodiment of the application also provides a readable storage medium, on which a computer program is stored, which when executed by a processor, implements the technical scheme of the data processing method provided by the foregoing method embodiment.
The embodiment of the application also provides a computer program product, which comprises a computer program, and the computer program is used for realizing the technical scheme of the data processing method provided by the embodiment of the method when being executed by a processor.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features can be replaced equivalently; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.