Disclosure of Invention
The invention provides a data transmission method, equipment and medium, which are used for solving the technical problems that the existing multiple systems for processing different types of data are all arranged in a single system, so that the single system is huge and complex, the system expansion is relatively difficult, the coupling property between the multiple systems for processing different types of data is high, the concurrent processing effect on the different types of data is poor, and the access requirement of a large number of acquisition equipment cannot be met.
In a first aspect, the present invention provides a data transmission method, applied to an acquisition module, the method comprising:
 transmitting own equipment information and the data type of the data to be reported to a registration module;
 receiving address information of a data module sent by the registration module;
 transmitting a connection request to the data module based on the address information of the data module;
 and after the data module receives the connection request and is connected with the acquisition module, the data to be reported is sent to the data module.
In a possible embodiment, the method further comprises:
 receiving an RSA encrypted public key sent by the registration module;
 encrypting the data to be reported through the public key to obtain encrypted data;
 and transmitting the encrypted data to the data module.
In a second aspect, the present invention provides a data transmission method, applied to a registration module, the method comprising:
 Receiving equipment information of an acquisition module and a data type of data to be reported;
 determining a data module corresponding to the acquisition module based on the data type of the data to be reported by the acquisition module;
 transmitting a registration request including device information of the acquisition module to the data module;
 receiving address information of the data module;
 And sending the address information of the data module to the acquisition module.
In a possible implementation manner, the determining the data module corresponding to the acquisition module based on the data type of the data to be reported by the acquisition module includes:
 And determining the data module which can correctly process the data type, is available to the server and has the lowest load as the data module corresponding to the acquisition module.
In a possible embodiment, the method further comprises:
 Receiving an RSA encrypted public key sent by the data module;
 And sending the RSA encrypted public key to the acquisition module.
In a third aspect, the present invention provides a data transmission method, applied to a data module, the method comprising:
 receiving a registration request which is sent by a registration module and comprises equipment information of an acquisition module;
 Storing the equipment information of the acquisition module;
 and sending the address information of the self to the registration module.
In a possible embodiment, the method further comprises:
 receiving a connection request sent by the acquisition module;
 Comparing whether the equipment information of the acquisition module corresponding to the connection request is consistent with the stored equipment information of the acquisition module;
 And if the connection requests are consistent, connecting the acquisition modules corresponding to the connection requests.
In a possible embodiment, the method further comprises:
 Generating an RSA encrypted public key and private key;
 And sending the RSA encrypted public key to the registration module.
In a fourth aspect, the present invention provides a data transmission device comprising at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a data transmission method according to any of the above embodiments.
In a fifth aspect, the present invention provides a non-volatile computer storage medium, the storage medium being a non-volatile computer readable storage medium storing at least one program, each of the programs comprising instructions, which when executed by a terminal, cause the terminal to perform a data transmission method according to any one of the embodiments described above.
Compared with the prior art, the data transmission method, the data transmission equipment and the data transmission medium provided by the invention have the following beneficial technical effects:
 (1) In the invention, the business systems for processing different types of data are deployed in different data module servers, and the registration module selects different data module servers to be connected with the acquisition module according to the data type of the data to be reported by the acquisition module. In addition, the system for processing the data of different types is decoupled, the coupling among the systems is reduced, the effect of concurrent processing of the data is improved, and the access requirement of a large number of acquisition modules can be met.
(2) According to the invention, the data transmission is performed through the direct connection of the acquisition module (terminal) and the data module service server, so that the data transmission efficiency is improved.
(3) The invention encrypts the data to be reported through the RSA asymmetric algorithm, thereby improving the safety of data transmission.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to specific embodiments of the present invention and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The technical scheme provided by the invention is described in detail below through the attached drawings.
Fig. 1 is a flowchart of a data transmission method provided by the present invention. As shown in fig. 1, the method is applied to an acquisition module, and comprises the following steps:
 s101, transmitting the device information of the device and the data type of the data to be reported to a registration module.
The acquisition module is a module for acquiring data, the acquisition module reports the acquired data to the data module, and the acquisition module is generally mobile terminal equipment.
The self-device information sent by the acquisition module may represent self-identity information, and in some embodiments, the self-device information sent by the acquisition module may include self-device IP information.
S102, receiving address information of the data module sent by the registration module.
After the registration module receives the self equipment information sent by the acquisition module and the data type of the data to be reported, the data module corresponding to the acquisition module is determined according to the data type, and the address information of the data module is sent to the acquisition module, so that the acquisition module can receive the address information of the data module.
The address information of the data module may be a server connection address of the data module, and in some embodiments, the address information of the data module may be Netty connection information, where Netty is a Java NIO-based network programming, high-performance, asynchronous event-driven network application framework, and its design goal is to provide a simple, easy-to-use, high-performance, and extensible network programming framework.
S103, based on the address information of the data module, a connection request is sent to the data module.
And S104, after the data module receives the connection request and is connected with the acquisition module, transmitting data to be reported to the data module.
After the data module receives the connection request and is connected with the acquisition module, the acquisition module establishes corresponding connection with the corresponding data module, and at the moment, the acquisition module can send data to be reported to the corresponding data module through the connection.
The direct connection between the acquisition module terminal and the data module service server can improve the efficiency of data transmission.
As a possible implementation manner, the method further comprises the steps of receiving an RSA encrypted public key sent by the registration module, encrypting data to be reported through the public key to obtain encrypted data, and transmitting the encrypted data to the data module.
The RSA encryption is an asymmetric encryption algorithm and comprises two keys, wherein the two keys comprise a public key and a private key, the public key is used for encrypting data, and the private key is used for decrypting the encrypted data.
In some embodiments, the data to be reported may be encrypted as a Value of the TLV transmission protocol and then transmitted to the data module. The TLV protocol encodes data by using a triplet of Tag, length and Value, the Tag defines a data type, the Length describes the Length of the Value, and the Value contains actual data.
Fig. 2 is a flowchart of another data transmission method provided in the present invention. As shown in fig. 2, the method is applied to a registration module, and comprises the following steps:
 s201, receiving equipment information of an acquisition module and a data type of data to be reported.
S202, determining a data module corresponding to the acquisition module based on the data type of the data to be reported by the acquisition module.
In the invention, the business systems for processing different types of data are deployed in different data module servers, and the registration module selects different data module servers to be connected with the acquisition module according to the data type of the data to be reported by the acquisition module.
In this way, by disposing the service systems for processing different types of data in different data module servers, the distributed system is decoupled, thus greatly reducing the complexity of the system and facilitating the system expansion and concurrent processing of data.
It can be understood that the link relationship between the acquisition module and the data module is a many-to-many connection relationship, that is, one acquisition module can establish connection with a plurality of data modules to report data to the plurality of data modules, and one data module can also establish connection with the plurality of acquisition modules to receive the data of the plurality of acquisition modules.
As a possible implementation manner, the data module which can correctly process the data type, is available to the server and has the lowest load is determined as the data module corresponding to the acquisition module.
The registration module determines a data module corresponding to the acquisition module, the data type of the data to be reported by the acquisition module is required to be processed correctly, a server of the data module is required to be available, and further, more than one data module meeting the two conditions is possible, so that the registration module can determine the data module with the lowest load as the data module corresponding to the acquisition module for realizing the load balancing of the data module.
S203, a registration request including the device information of the acquisition module is sent to the data module.
In the invention, data can be transmitted between the acquisition module and the corresponding data module, and the registration module is used as an intermediary between the acquisition module and the data module, and after the data module corresponding to the acquisition module is determined, a registration request is sent to the data module, wherein the registration request contains equipment information of the acquisition module.
S204, receiving address information of the data module.
S205, address information of the data module is sent to the acquisition module.
If the data module receives the registration request, the data module sends the address information of the data module to the registration module, the registration module can receive the address information of the data module, and the address information can be used for sending a connection request to the data module by the acquisition module.
In short, the registration module serves as an intermediary to forward the address information of the data module to the acquisition module, so that the acquisition module can initiate a connection request to the data module through the address information.
As one possible implementation manner, the method further comprises the steps of receiving the RSA encrypted public key sent by the data module and sending the RSA encrypted public key to the acquisition module.
Similarly, the registration module serves as an intermediary, and the public key of RSA encryption sent by the data module can be forwarded to the acquisition module, so that the acquisition module can encrypt data to be reported to the data module through the public key.
Fig. 3 is a flowchart of another data transmission method provided by the present invention. As shown in fig. 3, the method is applied to a data module, and comprises the following steps:
 s301, receiving a registration request including equipment information of the acquisition module, wherein the registration request is sent by the registration module.
S302, storing equipment information of the acquisition module.
S303, sending the address information of the self to a registration module.
As a possible implementation manner, the method further comprises the steps of receiving a connection request sent by the acquisition module, comparing whether equipment information of the acquisition module corresponding to the connection request is consistent with stored equipment information of the acquisition module, and connecting with the acquisition module corresponding to the connection request if the equipment information of the acquisition module is consistent with the stored equipment information of the acquisition module.
As one possible implementation, the method further includes generating an RSA encrypted public key and private key and sending the RSA encrypted public key to the registration module.
If the connection of the terminal device or the data module server as the acquisition module is interrupted and the connection fails in a short time, the next connection needs to be re-registered by the registration module server, that is, the above-described process is repeated.
Fig. 4 is a diagram of another data transmission method according to the present invention, as shown in fig. 4, the method includes the following steps:
 s401, the acquisition module sends the device information of the acquisition module and the data type of the data to be reported to the registration module.
S402, the registration module receives the equipment information of the acquisition module and the data type of the data to be reported.
S403, the registration module determines a data module corresponding to the acquisition module based on the data type of the data to be reported by the acquisition module.
S404, the registration module sends a registration request including the device information of the acquisition module to the data module.
S405, the data module receives a registration request including the device information of the acquisition module, which is sent by the registration module.
S406, the data module stores the equipment information of the acquisition module.
S407, the data module sends the address information of the data module to the registration module.
S408, the registration module receives the address information of the data module.
S409, the registration module sends the address information of the data module to the acquisition module.
S410, the acquisition module receives address information of the data module sent by the registration module.
S411, the acquisition module sends a connection request to the data module based on the address information of the data module.
S412, the data module receives the connection request sent by the acquisition module, compares whether the equipment information of the acquisition module corresponding to the connection request is consistent with the stored equipment information of the acquisition module, and if so, connects with the acquisition module corresponding to the connection request.
S413, the acquisition module sends the data to be reported to the data module.
The data security transmission method provided by the invention can be realized through a system which is divided into three parts, namely an acquisition module, a registration module and a data module, wherein the acquisition module is generally mobile terminal equipment, the registration module is responsible for load balancing and information distribution, and various Netty services are deployed on the data module.
The acquisition module is generally mobile terminal equipment, transmits equipment information (including network information) and data types to the registration module, the registration module selects the most suitable data module to transmit the equipment information of the mobile terminal equipment and return an encryption public key, then returns connection information and the encryption public key of the selected data module to the terminal, the terminal establishes connection with the data module through Netty to transmit encrypted data, and the acquisition module needs to select and distribute through the registration module every time the acquisition module establishes connection.
Specifically, the system can realize the data transmission method provided by the invention through the following steps.
Step one, a mobile equipment terminal (acquisition module) sends own equipment ip information and the data type to be acquired and reported to a server of a registration module.
And secondly, the registration module selects a proper data module through the information transmitted by the terminal equipment, namely, the equipment can be correctly processed to collect the reported data, and the data module server is available and has the lowest load.
Step three, the server of the data module receives the equipment registration request of the registration module, stores the equipment information into the server, generates an RSA encrypted public key and private key, and returns the public key and the server connection address to the server of the registration module.
If the terminal device of the acquisition module is not connected to the data module server through Netty within a predetermined time (typically 30 seconds), the registration information of the device and the encryption information for transmitting the connection data are deleted.
Step four, the registration module server receives Netty connection information (server connection address of the data module) returned by the data module and returns the encrypted public key to the acquisition module terminal requesting registration;
 And fifthly, after receiving the information returned by the registration module, the acquisition module terminal stores the public key encrypted by data transmission and performs Netty connection to the data module.
And step six, after the data module receives the connection request of the acquisition module terminal, comparing the connection request with the connection equipment information stored in the server, and connecting the connection equipment information with the acquisition module terminal if the equipment information is consistent, otherwise, interrupting the connection.
And step seven, the acquisition module encrypts the Value of the TLV transmission protocol through the public key and then transmits the Value to the data module.
If the connection of the terminal equipment or the data module server is interrupted and the connection fails in a short time, the next connection needs to be re-registered through the registration module server again.
In the invention, different service systems are mutually independent, the equipment terminals of the acquisition module find the corresponding data modules to connect and transmit data through the registration module, and the selection and distribution functions of the registration module are utilized to ensure that the data acquisition terminal can select the proper data modules to transmit data, so that the coupling of different data modules is reduced, and meanwhile, the public key private key is utilized to encrypt the data, so that the security of data transmission is ensured.
Corresponding to the embodiment, the invention also provides a data transmission device. Fig. 5 is a schematic structural diagram of a data transmission device according to an embodiment of the present invention, where the device may include at least one processor, and a memory communicatively connected to the at least one processor, where the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a data transmission method as described in the foregoing embodiments.
In one possible implementation manner of the present invention, the at least one processor is capable of executing, sending its own device information and a data type of data to be reported to the registration module, receiving address information of the data module sent by the registration module, sending a connection request to the data module based on the address information of the data module, and sending the data to be reported to the data module after the data module receives the connection request and is connected to the acquisition module.
In one possible implementation manner of the present invention, the at least one processor is capable of executing, receiving device information of the acquisition module and a data type of data to be reported, determining a data module corresponding to the acquisition module based on the data type of the data to be reported by the acquisition module, sending a registration request including the device information of the acquisition module to the data module, receiving address information of the data module, and sending the address information of the data module to the acquisition module.
In one possible implementation manner of the present invention, the at least one processor is capable of executing, receiving a registration request including device information of the acquisition module sent by the registration module, storing the device information of the acquisition module, and sending the address information of the acquisition module to the registration module.
In a specific implementation, the present invention may also be provided as a non-volatile computer storage medium, where the storage medium is a non-volatile computer readable storage medium, where the non-volatile computer readable storage medium stores at least one program, each program including instructions that, when executed by a terminal, cause the terminal to perform a data transmission method as described in the above embodiments.
In one possible implementation manner of the invention, the terminal executes the method, sends the device information and the data type of the data to be reported to the registration module, receives the address information of the data module sent by the registration module, sends a connection request to the data module based on the address information of the data module, and sends the data to be reported to the data module after the data module receives the connection request and is connected with the acquisition module.
In one possible implementation manner of the invention, the terminal executes the method, receives the equipment information of the acquisition module and the data type of the data to be reported, determines the data module corresponding to the acquisition module based on the data type of the data to be reported, sends a registration request comprising the equipment information of the acquisition module to the data module, receives the address information of the data module, and sends the address information of the data module to the acquisition module.
In one possible implementation manner of the present invention, the terminal executes, receives a registration request including device information of the acquisition module sent by the registration module, stores the device information of the acquisition module, and sends the address information of the terminal to the registration module.
The embodiments of the present invention are described in a progressive manner, and the same and similar parts of the embodiments are all referred to each other, and each embodiment is mainly described in the differences from the other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The foregoing is merely exemplary of the present invention and is not intended to limit the present invention. Various modifications and variations of the present invention will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.