CN110943994A - Communication interaction method and module based on Netty processing - Google Patents
Communication interaction method and module based on Netty processing Download PDFInfo
- Publication number
- CN110943994A CN110943994A CN201911216679.7A CN201911216679A CN110943994A CN 110943994 A CN110943994 A CN 110943994A CN 201911216679 A CN201911216679 A CN 201911216679A CN 110943994 A CN110943994 A CN 110943994A
- Authority
- CN
- China
- Prior art keywords
- client
- server
- data
- processing
- netty
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/20—Network architectures or network communication protocols for network security for managing network security; network security policies in general
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a communication interaction module and a method based on Netty processing, wherein the module comprises a client and a server, wherein: the server is used for receiving the collected data sent by the client and sending a data processing instruction to the client according to the collected data; wherein the data processing instruction comprises a called policy name; the client is used for analyzing the data processing instruction after receiving the data processing instruction so as to obtain a strategy name in the data processing instruction; the client is also used for calling the processing strategy corresponding to the strategy name and executing the processing strategy. According to the invention, the data is personalized through the factory mode and the strategy mode, and the code complexity and the coupling degree are reduced.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a communication interaction method and module based on Netty processing.
Background
With the continuous update of applications, companies no longer satisfy the realization of application functions, but pursue high performance and high reliability of applications. Netty is a high-performance data processing framework that provides the basis for performance optimization of processing data, enabling high-performance and high-reliability data processing.
The existing Netty framework application is mainly used for remote access of each node in a distributed system in the internet industry, convenient writing and development of various private protocol stacks as a high-performance communication component in the game industry and cross-endpoint communication in the field of big data, and the development is carried out only on the basis of the original Netty function.
Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a communication interaction method and module based on Netty processing, which implement personalized processing on data through a factory mode and a policy mode, reduce code complexity and coupling degree, and simultaneously create, store, and delete a broken line on a channel in a unified manner, thereby implementing mutual access control on multiple clients and a server.
The embodiment of the invention provides a communication interaction module based on Netty processing, which comprises a client and a server, wherein:
the server is used for receiving the collected data sent by the client and sending a data processing instruction to the client according to the collected data; wherein the data processing instruction comprises a called policy name;
the client is used for analyzing the data processing instruction after receiving the data processing instruction so as to obtain a strategy name in the data processing instruction;
the client is also used for calling the processing strategy corresponding to the strategy name and executing the processing strategy.
Preferably, the client is further configured to initiate a communication connection with the server;
the client is also used for saving a channel communicated with the server after the communication with the server is successful;
the server is also used for uniformly collecting and processing channels formed by each client and the server through a set, so that mutual access between the server and the multiple clients is realized.
Preferably, the server is further configured to delete the channel corresponding to the disconnected client when the client is disconnected.
Preferably, the client is further configured to perform uniform processing on the received data to obtain processable data; wherein the processing includes at least encryption and decryption.
The embodiment of the invention also provides a communication interaction method based on Netty processing, which realizes the following steps in a Netty framework:
the server receives the collected data sent by the client and sends a data processing instruction to the client according to the collected data; wherein the data processing instruction comprises a called policy name;
after receiving the data processing instruction, the client analyzes the data processing instruction to obtain a strategy name in the data processing instruction;
and the client calls a processing strategy corresponding to the strategy name and executes the processing strategy.
Preferably, the method further comprises the following steps:
the client initiates communication connection with the server;
after the client communicates with the server successfully, a channel for communicating with the server is stored;
the server side collects and processes channels formed by the clients and the server side through a set, and therefore mutual access between the server side and the multiple clients is achieved.
Preferably, the method further comprises the following steps:
and when the client is disconnected, the server deletes the channel corresponding to the disconnected client in the set.
Preferably, the method further comprises the following steps:
the client performs uniform processing on the received data to obtain processable data; wherein the processing includes at least encryption and decryption.
In the embodiment, the data is personalized through the factory mode and the strategy mode, the code complexity and the coupling degree are reduced, the channels are created, stored and deleted in a unified mode, the mutual access control of the multiple clients and the server is realized, and the operation that the system is in a problem due to misadjustment and misdeletion caused by a direct Netty control method is avoided.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a communication interaction module based on Netty processing according to a first embodiment of the present invention.
Fig. 2 is a schematic flow chart of a communication interaction method based on Netty processing according to a second embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a first embodiment of the present invention provides a communication interaction module based on Netty processing, including a plurality of clients 10 and a server 20, wherein:
the server 20 is configured to receive the collected data sent by the client 10, and send a data processing instruction to the client 10 according to the collected data; wherein the data processing instruction includes a called policy name.
The client 10 is configured to, after receiving the data processing instruction, analyze the data processing instruction to obtain a policy name in the data processing instruction.
The client 10 is further configured to invoke a processing policy corresponding to the policy name, and execute the processing policy.
In this embodiment, the client 10 is usually deployed under the same lan as a device (e.g., an Internet of things device or an associated smart device), and then connected to the server 20 through the Internet.
In this embodiment, the client 10 may initiate a communication connection with the server 20, and the server 20 establishes communication with the client 10 according to the communication connection. After the client 10 successfully communicates with the server 20, the channel communicating with the server 20 is saved, and meanwhile, the server 20 also collects and processes the channels formed by the clients 10 and the server through a set, so that the server 20 and the clients 10 can access each other. In addition, after the client 10 is disconnected, the server 20 deletes the corresponding channel.
In this embodiment, the client 10 may obtain data collected by the device, for example, when the device is an access control device, the data is data of whether a vehicle enters or exits, when the device is a smoke sensor, the data is smoke concentration, and when the device is a geomagnetic detection device, the data is geomagnetic data, and the like, which is not limited in particular.
In this embodiment, the client 10 performs unified processing on the received data to obtain processable data; in general, data is encrypted for the purpose of data confidentiality, and the encrypted data is subjected to special encryption and decryption to obtain corresponding processable data.
In this embodiment, the client 10 may send acquired data from a device to the server 20, and after receiving the acquired data, the server 20 analyzes the data and sends a data processing instruction corresponding to the client 10 according to an analysis result, where the data processing instruction includes a called policy name.
In this embodiment, after receiving the data processing instruction, the client 10 analyzes the data processing instruction to obtain a policy name therein, and executes a preset processing policy corresponding to the policy name.
The client 10 writes the processing policy corresponding to each policy name and names the processing policy, and then the server 20 writes the policy name into the corresponding designated policy processing field according to the defined policy name and transmits the policy name to the client 10 when calling, and the client will call the processing policy corresponding to the policy name and execute the processing policy after receiving the policy name.
In order to facilitate understanding of the present embodiment, several practical examples are described below to illustrate the application of the present embodiment.
In a first example, the device is an access control device of a cell, wherein when the access control device detects that a vehicle enters the cell, the access control device sends information data of the vehicle to the client 10, and then the client 10 sends the information data to the server 20, and the server 20 determines whether the vehicle is a vehicle that can legally travel in the cell. When the policy name is judged to be legal, the client sends data to call the rod lifting function of the client, writes the policy name into the corresponding designated policy processing field and transmits the policy name to the client 10, and after receiving the policy name, the client 10 calls a processing policy (such as a rod lifting policy) corresponding to the policy name to control the access control management equipment to lift the rod so as to allow a vehicle to enter.
In a second example, the device is a smoke alarm, which sends the collected smoke data to the client 10, and then the smoke data is sent to the server 20 by the client 10 to determine whether the smoke exceeds the standard, if so, the server 20 sends a policy name corresponding to the alarm to the client 10, and the client 10 invokes a corresponding alarm program to perform an alarm operation.
In the embodiment, the data is personalized through the factory mode and the strategy mode, the code complexity and the coupling degree are reduced, the channels are created, stored and deleted in a unified mode, the mutual access control of the multiple clients and the server is realized, and the operation that the system is in a problem due to misadjustment and misdeletion caused by a direct Netty control method is avoided.
Referring to fig. 2, a second embodiment of the present invention provides a communication interaction method based on Netty processing, and in a Netty framework, the following steps are implemented:
s101, a server receives collected data sent by a client and sends a data processing instruction to the client according to the collected data; wherein the data processing instruction comprises a called policy name;
s102, after receiving the data processing instruction, the client analyzes the data processing instruction to obtain a strategy name in the data processing instruction;
s103, the client calls a processing strategy corresponding to the strategy name and executes the processing strategy.
Preferably, the method further comprises the following steps:
the client initiates communication connection with the server;
after the client communicates with the server successfully, a channel for communicating with the server is stored;
the server side collects and processes channels formed by the clients and the server side through a set, and therefore mutual access between the server side and the multiple clients is achieved.
Preferably, the method further comprises the following steps:
and when the client is disconnected, the server deletes the channel corresponding to the disconnected client in the set.
Preferably, the method further comprises the following steps:
the client performs uniform processing on the received data to obtain processable data; wherein the processing includes at least encryption and decryption.
It should be noted that the above-described embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.
Claims (8)
1. A communication interaction module based on Netty processing is characterized by comprising a client and a server, wherein:
the server is used for receiving the collected data sent by the client and sending a data processing instruction to the client according to the collected data; wherein the data processing instruction comprises a called policy name;
the client is used for analyzing the data processing instruction after receiving the data processing instruction so as to obtain a strategy name in the data processing instruction;
the client is also used for calling the processing strategy corresponding to the strategy name and executing the processing strategy.
2. The Netty processing based communication interaction module of claim 1 wherein,
the client is also used for initiating communication connection with the server;
the client is also used for saving a channel communicated with the server after the communication with the server is successful;
the server is also used for uniformly collecting and processing channels formed by each client and the server through a set, so that mutual access between the server and the multiple clients is realized.
3. The Netty process based communication interaction module of claim 2 wherein,
and the server is also used for deleting the channel corresponding to the disconnected client in the set when the client is disconnected.
4. The Netty processing based communication interaction module of claim 1 wherein,
the client is also used for uniformly processing the received data to obtain processable data; wherein the processing includes at least encryption and decryption.
5. A communication interaction method based on Netty processing is characterized in that the following steps are realized in a Netty framework:
the server receives the collected data sent by the client and sends a data processing instruction to the client according to the collected data; wherein the data processing instruction comprises a called policy name;
after receiving the data processing instruction, the client analyzes the data processing instruction to obtain a strategy name in the data processing instruction;
and the client calls a processing strategy corresponding to the strategy name and executes the processing strategy.
6. The Netty process based communication interaction method of claim 5, further comprising:
the client initiates communication connection with the server;
after the client communicates with the server successfully, a channel for communicating with the server is stored;
the server side collects and processes channels formed by the clients and the server side through a set, and therefore mutual access between the server side and the multiple clients is achieved.
7. The Netty process based communication interaction method of claim 6 further comprising:
and when the server detects that the client is disconnected, deleting the channel corresponding to the disconnected client in the set.
8. The Netty process based communication interaction method of claim 5, further comprising:
the client performs uniform processing on the received collected data to obtain processable data; wherein the processing includes at least encryption and decryption.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911216679.7A CN110943994A (en) | 2019-11-28 | 2019-11-28 | Communication interaction method and module based on Netty processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911216679.7A CN110943994A (en) | 2019-11-28 | 2019-11-28 | Communication interaction method and module based on Netty processing |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110943994A true CN110943994A (en) | 2020-03-31 |
Family
ID=69909662
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911216679.7A Pending CN110943994A (en) | 2019-11-28 | 2019-11-28 | Communication interaction method and module based on Netty processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110943994A (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100768564B1 (en) * | 2006-09-19 | 2007-10-24 | 씨아이토피아 주식회사 | Remote device control system and its control method |
CN102045346A (en) * | 2010-11-25 | 2011-05-04 | 深圳市科陆电子科技股份有限公司 | TCP (Transmission Control Protocol) service channel realized by adopting Netty framework |
CN103578160A (en) * | 2012-07-31 | 2014-02-12 | 同济大学 | Vehicle monitoring system based on vehicle-mounted wireless data recorder |
CN104219132A (en) * | 2013-05-31 | 2014-12-17 | 中国电信股份有限公司 | Method and system of implementing multi-party communication as well as information server |
CN104580531A (en) * | 2015-02-05 | 2015-04-29 | 湖南合天智汇信息技术有限公司 | Web remote desktop access control method based on WebSocket agency |
CN106657393A (en) * | 2017-02-08 | 2017-05-10 | 浪潮(苏州)金融技术服务有限公司 | Device remote interaction system and method based on Websocket |
CN107765732A (en) * | 2017-10-24 | 2018-03-06 | 中国农业大学 | A kind of greenhouse wound membrane machine remote monitoring system and method |
CN108011979A (en) * | 2017-12-29 | 2018-05-08 | 广东克劳迪卫浴科技股份有限公司 | An intelligent public toilet remote monitoring system |
CN109347854A (en) * | 2018-11-08 | 2019-02-15 | 上海博泰悦臻网络技术服务有限公司 | Control method for vehicle, system and server based on cloud server |
US20190087211A1 (en) * | 2017-09-20 | 2019-03-21 | Huawei Technologies Co., Ltd. | Re-Playable Execution Optimized for Page Sharing in a Managed Runtime Environment |
-
2019
- 2019-11-28 CN CN201911216679.7A patent/CN110943994A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100768564B1 (en) * | 2006-09-19 | 2007-10-24 | 씨아이토피아 주식회사 | Remote device control system and its control method |
CN102045346A (en) * | 2010-11-25 | 2011-05-04 | 深圳市科陆电子科技股份有限公司 | TCP (Transmission Control Protocol) service channel realized by adopting Netty framework |
CN103578160A (en) * | 2012-07-31 | 2014-02-12 | 同济大学 | Vehicle monitoring system based on vehicle-mounted wireless data recorder |
CN104219132A (en) * | 2013-05-31 | 2014-12-17 | 中国电信股份有限公司 | Method and system of implementing multi-party communication as well as information server |
CN104580531A (en) * | 2015-02-05 | 2015-04-29 | 湖南合天智汇信息技术有限公司 | Web remote desktop access control method based on WebSocket agency |
CN106657393A (en) * | 2017-02-08 | 2017-05-10 | 浪潮(苏州)金融技术服务有限公司 | Device remote interaction system and method based on Websocket |
US20190087211A1 (en) * | 2017-09-20 | 2019-03-21 | Huawei Technologies Co., Ltd. | Re-Playable Execution Optimized for Page Sharing in a Managed Runtime Environment |
CN107765732A (en) * | 2017-10-24 | 2018-03-06 | 中国农业大学 | A kind of greenhouse wound membrane machine remote monitoring system and method |
CN108011979A (en) * | 2017-12-29 | 2018-05-08 | 广东克劳迪卫浴科技股份有限公司 | An intelligent public toilet remote monitoring system |
CN109347854A (en) * | 2018-11-08 | 2019-02-15 | 上海博泰悦臻网络技术服务有限公司 | Control method for vehicle, system and server based on cloud server |
Non-Patent Citations (1)
Title |
---|
庄国强: "一种基于Netty的环保物联网实时双向通信模型研究", 《郑州师范教育》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111752799A (en) | Service link tracking method, device, equipment and storage medium | |
CN112738791A (en) | User information correlation backfill method, device, equipment and medium based on 5G core network | |
CN105867837A (en) | Method, equipment and system for updating configurations of clients in distributed high-speed cache systems | |
CN105868040A (en) | Log collection method and collection terminal | |
CN110932918B (en) | Log data acquisition method and device and storage medium | |
CN111800408A (en) | Policy configuration device, security policy configuration method of terminal, and readable storage medium | |
CN112637081A (en) | Bandwidth speed limiting method and device | |
CN102238486B (en) | The management method of internet-of-things terminal group and platform of internet of things equipment | |
CN112087475B (en) | Message pushing method and device for cloud platform component application and message server | |
CN114465867A (en) | Server maintenance method and device, storage medium and processor | |
CN114979133A (en) | Deployment method and device of converged communication cloud platform | |
CN113542263A (en) | Firewall policy migration method and device | |
CN113423120A (en) | Data distribution processing method and device based on private network terminal and electronic equipment | |
EP2472785B1 (en) | Service linkage control system and method | |
CN102053808A (en) | Method, device for printing software information as well as equipment with network interface | |
CN110943994A (en) | Communication interaction method and module based on Netty processing | |
CN105959160A (en) | Debugging information transmission method and apparatus | |
CN114640522B (en) | Firewall security policy processing method, device, equipment and storage medium | |
CN111611134A (en) | Time monitoring method and device, application terminal and storage medium | |
CN113079055B (en) | AGV operation data dynamic acquisition method and device | |
CN115052003A (en) | Data synchronization method, related device and medium | |
CN104735097A (en) | Information collecting method and system | |
CN114338271A (en) | Data processing method, device, terminal and computer readable storage medium | |
CN114679472A (en) | Communication system, method, apparatus, storage medium, and electronic device | |
CN113190410A (en) | Log collection method, system, client and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200331 |