Data transmission method, equipment and medium
By deploying business systems of different types of data on different data module servers, and using the registration module to select appropriate data modules and RSA encryption algorithms, the problem of overcomplexity and high coupling of stand-alone systems is solved, and system expansion and efficient concurrent processing are achieved , meets the access needs of a large number of acquisition equipment, and improves the security and efficiency of data transmission.
Patent Information
- Application Number
- CN202411601865.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, multiple systems used to process different types of data are arranged in a single machine system, resulting in too large and complex systems, difficult to expand, high system coupling, poor concurrent processing effect, and unable to meet the connection of a large number of acquisition equipment. Enter the demand.
By deploying business systems that process different types of data in different data module servers, the registration module selects the appropriate data module to connect to the acquisition module according to the data type of data to be reported by the acquisition module, and uses the RSA asymmetric algorithm to perform data processing encryption.
It realizes decoupling of distributed systems, reduces system complexity, facilitates expansion, improves data concurrency processing effect, meets the access needs of a large number of acquisition equipment, and improves the security and efficiency of data transmission.
Smart Images

Figure CN119484082A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to a data transmission method, device and medium. Background Art
[0002] With the development of the Internet of Things industry, more and more data collection devices are connected, and a data collection device often needs to collect different types of data to meet the needs of different systems. For example, for applications in the water conservancy industry, the equipment inspection trajectory and problem data need to be reported to the inspection system, and the water level, flow and other detection information monitored by the equipment needs to be reported to the monitoring system.
[0003] In the prior art, multiple systems for processing different types of data are all set up in a single-machine system, which makes the single-machine system too large and complex, and the system expansion is relatively difficult; and the coupling between the multiple systems processing different types is high, and the concurrent processing effect of these different types of data is not good, which is increasingly unable to meet the access needs of a large number of acquisition devices. Summary of the invention
[0004] The present invention provides a data transmission method, device and medium to solve the technical problems that multiple systems for processing different types of data are currently set up in a single-machine system, which causes the single-machine system to be too large and complex, and the system expansion is relatively difficult; and the coupling between the multiple systems processing different types is high, the concurrent processing effect of these different types of data is not good, and it is increasingly unable to meet the access requirements of a large number of acquisition devices.
[0005] In a first aspect, the present invention provides a data transmission method, which is applied to a collection module, and the method comprises:
[0006] Send its own device information and the data type of the data to be reported to the registration module;
[0007] Receiving address information of the data module sent by the registration module;
[0008] Based on the address information of the data module, sending a connection request to the data module;
[0009] After the data module receives the connection request and connects with the acquisition module, the data to be reported is sent to the data module.
[0010] In a feasible implementation manner, the method further includes:
[0011] Receive the RSA encrypted public key sent by the registration module;
[0012] Encrypting the data to be reported by using the public key to obtain encrypted data;
[0013] The encrypted data is transmitted to the data module.
[0014] In a second aspect, the present invention provides a data transmission method, which is applied to a registration module, and the method comprises:
[0015] Receive the device information of the acquisition module and the data type of the data to be reported;
[0016] Determine the data module corresponding to the acquisition module based on the data type of the data to be reported by the acquisition module;
[0017] Sending a registration request including device information of the acquisition module to the data module;
[0018] Receiving address information of the data module;
[0019] The address information of the data module is sent to the acquisition module.
[0020] In a feasible implementation manner, based on the data type of the data to be reported by the acquisition module, determining the data module corresponding to the acquisition module includes:
[0021] The data module that can correctly process the data type, is available on the server and has the lowest load is determined as the data module corresponding to the acquisition module.
[0022] In a feasible implementation manner, the method further includes:
[0023] Receive the RSA encrypted public key sent by the data module;
[0024] The RSA encrypted public key is sent to the acquisition module.
[0025] In a third aspect, the present invention provides a data transmission method, applied to a data module, the method comprising:
[0026] Receiving a registration request including device information of the acquisition module sent by the registration module;
[0027] Storing device information of the acquisition module;
[0028] Send its own address information to the registration module.
[0029] In a feasible implementation manner, the method further includes:
[0030] Receiving a connection request sent by the acquisition module;
[0031] Comparing whether the device information of the acquisition module corresponding to the connection request is consistent with the stored device information of the acquisition module;
[0032] If they are consistent, then the acquisition module corresponding to the connection request is connected.
[0033] In a feasible implementation manner, the method further includes:
[0034] Generate public and private keys for RSA encryption;
[0035] The RSA encrypted public key is sent to the registration module.
[0036] In a fourth aspect, the present invention provides a data transmission device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor so that the at least one processor can execute a data transmission method described in any of the above embodiments.
[0037] In a fifth aspect, the present invention provides a non-volatile computer storage medium, which is a non-volatile computer-readable storage medium, and the non-volatile computer-readable storage medium stores at least one program, each of which includes instructions, and when the instructions are executed by a terminal, the terminal executes a data transmission method described in any of the above-mentioned embodiments.
[0038] Compared with the prior art, the data transmission method, device and medium provided by the present invention have the following beneficial technical effects:
[0039] (1) In the present invention, the business systems that process different types of data are deployed in different data module servers. The registration module selects different data module servers to connect with the acquisition module according to the data type of the data to be reported by the acquisition module. In this way, by deploying the business systems that process different types of data in different data module servers, the distributed system is decoupled, which greatly reduces the complexity of the system and facilitates system expansion; and the systems that process different types of data are decoupled, which reduces the coupling between these systems, improves the effect of concurrent data processing, and can meet the access requirements of a large number of acquisition modules.
[0040] (2) In the present invention, data transmission is performed by directly connecting the acquisition module (terminal) and the data module service server, thereby improving the efficiency of data transmission.
[0041] (3) The present invention encrypts the data to be reported through the RSA asymmetric algorithm, thereby improving the security of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0043] Figure 1 A flow chart of a data transmission method provided by the present invention;
[0044] Figure 2 A flowchart of another data transmission method provided by the present invention;
[0045] Figure 3 A flowchart of another data transmission method provided by the present invention;
[0046] Figure 4 A flowchart of another data transmission method provided by the present invention;
[0047] Figure 5 A structural schematic diagram of a data transmission device provided by the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0049] The technical solution proposed by the present invention is described in detail below with reference to the accompanying drawings.
[0050] Figure 1 The present invention provides a flow chart of a data transmission method. Figure 1 As shown, the method is applied to the acquisition module and includes the following execution steps:
[0051] S101. Send the device information and the data type of the data to be reported to the registration module.
[0052] In the present invention, the acquisition module is a module for collecting data. The acquisition module needs to report the collected data to the data module. The acquisition module is generally a mobile terminal device.
[0053] The device information sent by the acquisition module may represent its own identity information. In some embodiments, the device information sent by the acquisition module may include its own device IP information.
[0054] S102: Receive address information of the data module sent by the registration module.
[0055] In the present invention, after the registration module receives its own device information and the data type of the data to be reported sent by the acquisition module, it determines the data module corresponding to the acquisition module according to the data type, and sends the address information of the data module to the acquisition module, so that the acquisition module can receive the address information of the data module.
[0056] The address information of the data module may be the server connection address of the data module. In some embodiments, the address information of the data module may be Netty connection information, wherein Netty is a network programming, high-performance, asynchronous event-driven network application framework based on Java NIO. Its design goal is to provide a simple, easy-to-use, high-performance, and scalable network programming framework.
[0057] S103: Send a connection request to the data module based on the address information of the data module.
[0058] S104: After the data module receives the connection request and connects with the acquisition module, the data to be reported is sent to the data module.
[0059] After the data module receives the connection request and connects with the acquisition module, a corresponding connection is established between the acquisition module and the corresponding data module. At this time, the acquisition module can send the data to be reported to the corresponding data module through the connection.
[0060] The direct connection between the acquisition module terminal and the data module business server can improve the efficiency of data transmission.
[0061] As a possible implementation, the method further includes: receiving an RSA-encrypted public key sent by a registration module; encrypting the data to be reported by using the public key to obtain encrypted data; and transmitting the encrypted data to a data module.
[0062] The present invention improves the security of data transmission through asymmetric data encryption; RSA encryption is an asymmetric encryption algorithm with two keys, including a public key and a private key, wherein the public key is used to encrypt data and the private key is used to decrypt the encrypted data.
[0063] In some embodiments, the data to be reported can be encrypted as the Value value of the TLV transmission protocol and then transmitted to the data module. The TLV protocol uses a triplet of Tag, Length and Value to encode data, where Tag defines the data type, Length describes the length of the Value, and the Value contains the actual data.
[0064] Figure 2 Flow chart of another data transmission method provided by the present invention. Figure 2As shown, the method is applied to the registration module and includes the following execution steps:
[0065] S201, receiving device information of a collection module and data type of data to be reported.
[0066] S202: Determine a data module corresponding to the collection module based on the data type of the data to be reported by the collection module.
[0067] In the present invention, the business system for processing different types of data is deployed in different data module servers, and the registration module selects different data module servers to connect with the collection module according to the data type of the data to be reported by the collection module.
[0068] In this way, by deploying business systems that process different types of data in different data module servers, the distributed system is decoupled, which greatly reduces the complexity of the system and facilitates system expansion and concurrent data processing.
[0069] 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 connections with multiple data modules and report data to multiple data modules; one data module can also establish connections with multiple acquisition modules and receive data from multiple acquisition modules.
[0070] As a possible implementation manner, a data module that can correctly process the data type, is available on the server and has the lowest load is determined as the data module corresponding to the acquisition module.
[0071] First, the data module corresponding to the collection module determined by the registration module must be able to correctly process the data type of the data to be reported by the collection module; and the server of the data module should be available; further, there may be more than one data module that meets the above two conditions. In order to achieve load balancing of the data modules, the registration module can determine the data module with the lowest load as the data module corresponding to the collection module.
[0072] S203: Send a registration request including device information of the acquisition module to the data module.
[0073] In the present invention, data can be transmitted between the acquisition module and the corresponding data module. The registration module serves as an intermediary between the acquisition module and the data module. After determining the data module corresponding to the acquisition module, the registration request is sent to the data module, wherein the registration request contains the device information of the acquisition module.
[0074] S204: Receive address information of the data module.
[0075] S205: Send the address information of the data module to the acquisition module.
[0076] If the data module receives the above registration request, the data module sends its own address information to the registration module. The registration module can receive the address information of the data module, and the address information can be used by the acquisition module to send a connection request to the data module.
[0077] In short, the registration module acts as an intermediary to forward the address information of the data module to the collection module, so that the collection module can initiate a connection request to the data module through the address information.
[0078] As a possible implementation manner, the method further includes: receiving an RSA-encrypted public key sent by the data module; and sending the RSA-encrypted public key to the acquisition module.
[0079] Similarly, the registration module, as an intermediary, can also forward the RSA encrypted public key sent by the data module to the collection module, so that the collection module can encrypt the data to be reported to the data module through the public key.
[0080] Figure 3 Flow chart of another data transmission method provided by the present invention. Figure 3 As shown, the method is applied to the data module and includes the following execution steps:
[0081] S301, receiving a registration request including device information of a collection module sent by a registration module.
[0082] S302: Store device information of the acquisition module.
[0083] S303: Send its own address information to the registration module.
[0084] As a possible implementation, the method further includes: receiving a connection request sent by the acquisition module; comparing whether the device information of the acquisition module corresponding to the connection request is consistent with the device information of the stored acquisition module; if they are consistent, connecting to the acquisition module corresponding to the connection request.
[0085] As a possible implementation manner, the method further includes: generating an RSA-encrypted public key and a private key; and sending the RSA-encrypted public key to a registration module.
[0086] It should be noted that if the terminal device or data module server serving as the acquisition module is disconnected and fails to connect within a short period of time, the next connection needs to be re-registered through the registration module server, that is, the above process is repeated.
[0087] Figure 4 Another data transmission method provided by the present invention is as follows: Figure 4 As shown, the method includes the following execution steps:
[0088] S401: The acquisition module sends its own device information and the data type of the data to be reported to the registration module.
[0089] S402: The registration module receives the device information of the acquisition module and the data type of the data to be reported.
[0090] S403: The registration module determines the data module corresponding to the collection module based on the data type of the data to be reported by the collection module.
[0091] S404: The registration module sends a registration request including the device information of the acquisition module to the data module.
[0092] S405: The data module receives the registration request including the device information of the acquisition module sent by the registration module.
[0093] S406. The data module stores the device information of the acquisition module.
[0094] S407: The data module sends its own address information to the registration module.
[0095] S408: The registration module receives the address information of the data module.
[0096] S409: The registration module sends the address information of the data module to the collection module.
[0097] S410, the acquisition module receives the address information of the data module sent by the registration module.
[0098] S411. The acquisition module sends a connection request to the data module based on the address information of the data module.
[0099] S412, the data module receives the connection request sent by the acquisition module; compares the device information of the acquisition module corresponding to the connection request with the stored device information of the acquisition module to see if they are consistent; if they are consistent, connects to the acquisition module corresponding to the connection request.
[0100] S413: The acquisition module sends the data to be reported to the data module.
[0101] A data security transmission method provided by the present invention can be implemented by the following system. The system is divided into three parts: an acquisition module, a registration module and a data module. Among them, the acquisition module is generally a mobile terminal device, the registration module is responsible for load balancing and information distribution, and various Netty services are deployed on the data module.
[0102] The acquisition module is generally a mobile terminal device, which passes the device information (including network information) and data type to the registration module. The registration module selects the most appropriate data module to transmit the device information of the mobile terminal device and returns the encrypted public key. The connection information and encrypted public key of the selected data module are then returned to the terminal. The terminal then establishes a connection with the data module through Netty for encrypted data transmission. Each time the acquisition module establishes a connection, it needs to be selected and distributed through the registration module.
[0103] Specifically, the system can implement a data transmission method provided by the present invention through the following steps.
[0104] Step 1: The mobile device terminal (collection module) sends its own device IP information and the type of data to be collected and reported to the server of the registration module.
[0105] Step 2: The registration module selects a suitable data module through the information transmitted by the terminal device, that is, it can correctly process the data collected and reported by the device, and the data module server is available and has the lowest load.
[0106] Step 3: The server of the data module receives the device registration request from the registration module, stores the device information in the server, generates RSA-encrypted public and private keys, and returns the public key and server connection address to the server of the registration module.
[0107] If the terminal device of the acquisition module does not connect to the data module server through Netty within the specified time (usually 30 seconds), the device registration information and the encryption information used for connecting data transmission will be deleted.
[0108] Step 4: The registration module server receives the Netty connection information (server connection address of the data module) and the encrypted public key returned by the data module and returns them to the acquisition module terminal requesting registration;
[0109] Step 5: After receiving the information returned by the registration module, the acquisition module terminal saves the public key for data transmission encryption and connects Netty to the data module.
[0110] Step 6: After receiving the connection request from the acquisition module terminal, the data module compares it with the connection device information saved in the server. If the device information is consistent, it connects to the acquisition module terminal, otherwise the connection is terminated.
[0111] Step 7: The collection module encrypts the Value of the TLV transmission protocol through the public key and then transmits it to the data module.
[0112] If the terminal device or data module server connection is interrupted and fails to connect within a short period of time, the next connection will need to be re-registered through the registration module server.
[0113] In the present invention, different business systems are independent of each other. The device terminal of the acquisition module finds the corresponding data module through the registration module to connect and transmit data. The selection and distribution function of the registration module is utilized to ensure that the data acquisition terminal can select the appropriate data module for data transmission, thereby reducing the coupling of different data modules. At the same time, data encryption is performed using public and private keys to ensure the security of data transmission.
[0114] Corresponding to the above embodiment, the present invention also provides a data transmission device. Figure 5 A structural schematic diagram of a data transmission device provided for an embodiment of the present invention, the device may include: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor so that the at least one processor can execute a data transmission method as described in the above embodiment.
[0115] In one possible implementation of the present invention, the aforementioned at least one processor is capable of executing the following steps: sending its own device information and the data type of the data to be reported to the registration module; receiving the 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 connects with the acquisition module.
[0116] In one possible implementation of the present invention, the aforementioned at least one processor is capable of executing the following steps: receiving device information of the acquisition module and the data type of the data to be reported; determining the 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 the address information of the data module; and sending the address information of the data module to the acquisition module.
[0117] In a possible implementation of the present invention, the aforementioned 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 its own address information to the registration module.
[0118] In a specific implementation, the present invention can also be provided as a non-volatile computer storage medium, wherein the storage medium is a non-volatile computer-readable storage medium, and the non-volatile computer-readable storage medium stores at least one program, each program includes instructions, and when the instructions are executed by a terminal, the terminal executes a data transmission method described in the above embodiment.
[0119] In a possible implementation of the present invention, the aforementioned terminal executes, sending its own device information and the data type of the data to be reported to the registration module; receiving the 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; after the data module receives the connection request and connects with the acquisition module, sending the data to be reported to the data module.
[0120] In a possible implementation of the present invention, the aforementioned terminal executes, receiving the device information of the acquisition module and the data type of the data to be reported; determining the 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 the address information of the data module; and sending the address information of the data module to the acquisition module.
[0121] In a possible implementation of the present invention, the terminal executes: 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 its own address information to the registration module.
[0122] The various embodiments of the present invention are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0123] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0124] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. 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.
Claims
1. A data transmission method, characterized in that: Applied to the acquisition module, the method includes: Send its own device information and the data type of the data to be reported to the registration module; Receiving address information of the data module sent by the registration module; Based on the address information of the data module, sending a connection request to the data module; After the data module receives the connection request and connects with the acquisition module, the data to be reported is sent to the data module.
2. A data transmission method according to claim 1, the method further comprising: Receive the RSA encrypted public key sent by the registration module; Encrypting the data to be reported by using the public key to obtain encrypted data; The encrypted data is transmitted to the data module.
3. A data transmission method, characterized in that: Applied to the registration module, the method comprises: Receive the device information of the acquisition module and the data type of the data to be reported; Determine the 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 device information of the acquisition module to the data module; Receiving address information of the data module; The address information of the data module is sent to the acquisition module.
4. A data transmission method according to claim 3, characterized in that: Determining a data module corresponding to the acquisition module based on the data type of the data to be reported by the acquisition module includes: The data module that can correctly process the data type, is available on the server and has the lowest load is determined as the data module corresponding to the acquisition module.
5. A data transmission method according to claim 3, characterized in that: The method further comprises: Receive the RSA encrypted public key sent by the data module; The RSA encrypted public key is sent to the acquisition module.
6. A data transmission method, characterized in that: Applied to a data module, the method comprises: Receiving a registration request including device information of the acquisition module sent by the registration module; Storing device information of the acquisition module; Send its own address information to the registration module.
7. A data transmission method according to claim 6, characterized in that: The method further comprises: Receiving a connection request sent by the acquisition module; Comparing whether the device information of the acquisition module corresponding to the connection request is consistent with the stored device information of the acquisition module; If they are consistent, then connect with the acquisition module corresponding to the connection request.
8. A data transmission method according to claim 6, characterized in that: The method further comprises: Generate public and private keys for RSA encryption; The RSA encrypted public key is sent to the registration module.
9. A data transmission device, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute a data transmission method according to any one of claims 1-8.
10. A non-volatile computer storage medium, characterized in that: The storage medium is a non-volatile computer-readable storage medium, and the non-volatile computer-readable storage medium stores at least one program, each of which includes instructions, and when the instructions are executed by the terminal, the terminal executes a data transmission method according to any one of claims 1-8.