CN112165531A - Communication method, device and storage medium realized based on port of monitoring device - Google Patents

Communication method, device and storage medium realized based on port of monitoring device Download PDF

Info

Publication number
CN112165531A
CN112165531A CN202011092205.9A CN202011092205A CN112165531A CN 112165531 A CN112165531 A CN 112165531A CN 202011092205 A CN202011092205 A CN 202011092205A CN 112165531 A CN112165531 A CN 112165531A
Authority
CN
China
Prior art keywords
port
app
data
communication method
communication
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
Application number
CN202011092205.9A
Other languages
Chinese (zh)
Inventor
陈明亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Huanwang Technology Co Ltd
Original Assignee
Guangdong Huanwang Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Huanwang Technology Co Ltd filed Critical Guangdong Huanwang Technology Co Ltd
Priority to CN202011092205.9A priority Critical patent/CN112165531A/en
Publication of CN112165531A publication Critical patent/CN112165531A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a communication method, equipment and a storage medium realized based on a port of monitoring equipment, wherein the method comprises the following steps: the first APP monitors a first preset port; the second APP sends target data to the first preset port; the first APP receives target data sent by the second APP through the first preset port. Therefore, between the APPs, the first APP monitors the port of the local machine, the second APP can send data to the local port, the first APP monitoring the first preset port can receive the data at the moment, and meanwhile, feedback can be carried out based on the received data, so that communication between the first APP and the second APP is achieved; and first APP can receive the data that a plurality of second APPs sent, realizes the mutual communication between a plurality of APPs, has solved prior art, can only realize the communication between two APPs through complicated android native AIDL, can't realize the shortcoming of communication between a plurality of APPs.

Description

Communication method, device and storage medium realized based on port of monitoring device
Technical Field
The invention belongs to the technical field of Android app development, and particularly relates to a communication method, equipment and a storage medium based on a port of monitoring equipment.
Background
In the prior art, all the communication between the APPs is performed through the aid l native to android, but in this way, only the communication between two APPs can be realized, the communication between multiple APPs cannot be realized simultaneously, and the realization is complicated.
Disclosure of Invention
In order to at least solve the above problems in the prior art, the present invention provides a communication method, device and storage medium implemented based on a port of a listening device.
The technical scheme provided by the invention is as follows:
in a first aspect, the present invention provides a communication method implemented based on a port of a monitoring device, including:
the first APP monitors a first preset port;
the second APP sends target data to the first preset port;
the first APP receives target data sent by the second APP through the first preset port.
Optionally, the number of APPs of the second APP is one or more.
Optionally, the target data includes data information and a data request.
Optionally, when the target data is data information, the first APP receives the target data, and the second APP monitors a second preset port to complete communication with the second APP.
Optionally, when the data is request data, the first APP sends data corresponding to the request data to the second APP based on the request data.
Optionally, the first preset port and the second preset port are local ports; wherein the local port is any number port between 1000 and 65535.
Optionally, the ports of the host computer correspond to APPs of the monitoring ports one to one.
In a second aspect, the present invention provides a communication device implemented based on a port of a monitoring device, including: a processor, and a memory coupled to the processor;
the memory is used for storing a computer program, and the computer program is at least used for executing the communication method realized based on the port of the monitoring equipment;
the processor is used for calling and executing the computer program in the memory
In a third aspect, the present invention provides a storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in the communication method implemented based on the port of the listening device implemented according to the present invention are implemented.
The invention has the beneficial effects that:
the communication method realized based on the port of the monitoring equipment provided by the embodiment of the invention comprises the following steps: the first APP monitors a first preset port; the second APP sends target data to the first preset port; the first APP receives target data sent by the second APP through the first preset port. So, between the APP, first APP listens to the port of local, second APP can be for sending data on the port through being listened to by first APP locally, after the port received data, first APP just can receive data, with this realize the communication between first APP and the second APP, and the quantity of the second APP that sends data to the port can be a plurality of, first APP can receive the data that a plurality of second APPs sent, and can also send data to the second APP through first predetermined port, simultaneously because local port quantity is very big, so every APP can all be through listening to predetermine the port, thereby realize the intercommunication between a plurality of APPs, in having solved prior art, can only realize the communication between the APPs through the native AIDL's of android complicated mode, can only realize the communication between two APPs, can't realize the shortcoming of communication between a plurality of APPs.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a communication method implemented based on a port of a monitoring device according to an embodiment of the present invention;
fig. 2 is a flowchart of a communication method implemented based on a port of a monitoring device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a communication device implemented based on a port of a listening device according to an embodiment of the present invention.
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 described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
In order to at least solve the technical problem proposed in the present invention, an embodiment of the present invention provides a communication method implemented based on a port of a monitoring device.
Fig. 1 is a schematic flow chart of a communication method implemented based on a port of a monitoring device according to an embodiment of the present invention, and referring to fig. 1, the communication method implemented based on the port of the monitoring device according to the embodiment of the present invention may include the following steps:
s11, the first APP monitors a first preset port.
Specifically, each device has its own IP address, and when the APP in the local device performs a network request, the local IP address can also be accessed, the local APP establishes a connection with a port through a monitoring port, and after the APP establishes a connection with the port, other APPs can use the APP establishing the connection as a remote address, for example, the address is the local IP + designated port, and when the network request is performed, the transmitted data and the returned data are the same as those accessing the address outside the local.
In a specific implementation process, the first APP is one of parties of communication, the first APP is a data receiving party, and also can be used as a server side to monitor the first preset port, at this time, the first preset port can only be monitored by the first APP, and after the first APP monitors the first preset port, the first preset port is connected with the first preset APP.
The second APP sends target data to the first preset port;
specifically, after the first APP is connected to the preset port, the other party of communication, that is, the second APP, can send data in the second APP to the first preset port, where the data sent by the second APP can be data required by the first APP, or can be a request containing data required by the second APP, that is, the second APP needs data in the first APP, and after the request for data acquisition is received by the first APP, data corresponding to the request is sent to the second APP through the first preset port.
In addition, the number of the second APPs may be one or more, that is, the APPs that transmit data to the first predetermined port may be multiple, and transmit data to the first predetermined port simultaneously or non-simultaneously.
The first APP receives target data sent by the second APP through the first preset port
Specifically, after the second APP sends data to the first predetermined port, since the first predetermined port is monitored by the first APP, the first APP receives the data when the data appears in the first predetermined port. Therefore, data sent by the second APP are received, and communication between the first APP and the second APP is achieved.
The application provides a communication method implemented based on a port of a monitoring device, which specifically comprises the following steps: the first APP monitors a first preset port; the second APP sends target data to the first preset port; the first APP receives target data sent by the second APP through the first preset port. Therefore, after the first APP monitors the first preset port, the data sent by the second APP to the first preset port can be acquired, and therefore communication among the APPs is achieved. By the method, the first APP of the monitoring port can receive the data sent by the plurality of APPs through the first preset port, and the data sent by the second port is fed back, so that mutual communication among the plurality of APPs is realized, and the defects that in the prior art, the realization process is complex and communication among the plurality of APPs cannot be realized are overcome.
Fig. 2 is a flowchart of a communication method implemented based on a port of a monitoring device according to an embodiment of the present invention; as shown in fig. 2.
The data that second APP sent to first predetermined port can be the information data that is directly received by first APP and supplies first APP to use, also can be the second APP needs first APP to send to the request data of second APP data content, when the data that second APP sent to first predetermined port is request data, first APP is equivalent to server side, second APP is equivalent to the client, first APP receives the data request that second APP sent through monitoring first predetermined port, then based on the data request, send corresponding data to the second APP in through first predetermined port.
It should be noted that the first APP and the second APP just represent two parties in communication processes, and in practical applications, the first APP in one communication process may also become the second APP in another communication process, so as to exchange the identities of data reception and transmission. Of course, in the other communication process, the first APP and the second APP in one communication process may also change the identity of the listening port to realize that the original data sender becomes the data receiver and the original data receiver becomes the data sender. The specific determination of the data sending party and the data receiving party can be correspondingly determined and changed according to the actual application scene.
In practical applications, the first preset port and the second preset port mentioned above in the present application are network communication ports in the local computer, and specifically may be any digital ports between 1000-plus 65535, so theoretically, different ports are monitored through different APPs, and the number of the ports of 1000-plus 65535 may implement mutual communication between tens of thousands of APPs, including the case of identity transformation of the receiver and the sender.
Based on a general inventive concept, the embodiment of the present invention further provides a communication device implemented based on the port of the monitoring device. Fig. 3 is a schematic structural diagram of a communication device implemented based on a port of a monitoring device according to an embodiment of the present invention, and as shown in fig. 3, the communication device implemented based on the port of the monitoring device according to the embodiment of the present invention includes: a processor, and a memory coupled to the processor;
the memory is used for storing a computer program, and the computer program is at least used for executing the communication method realized based on the port of the monitoring device;
the processor is used for calling and executing the computer program in the memory
Based on a general inventive concept, an embodiment of the present invention further provides a storage medium, where the storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the communication method implemented based on the port of the listening device.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present invention, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A communication method realized based on a port of a monitoring device is characterized by comprising the following steps:
the first APP monitors a first preset port;
the second APP sends target data to the first preset port;
the first APP receives target data sent by the second APP through the first preset port.
2. The communication method implemented based on the port of the listening device of claim 1, wherein the number of the APPs of the second APP is one or more.
3. The listening device port implementation based communication method of claim 1, wherein the target data comprises data information and a data request.
4. The communication method implemented based on the port of the listening device of claim 3,
and when the target data is data information, the first APP receives the target data, and the second APP monitors a second preset port to complete communication with the second APP.
5. The communication method implemented based on the port of the listening device of claim 3, wherein when the data is request data, the first APP sends data corresponding to the request data to the second APP based on the request data.
6. The communication method implemented based on the port of the monitoring device according to claim 1, wherein the second APP monitors a second predetermined port, and is configured to receive data sent by other APPs through the second predetermined port.
7. The communication method implemented based on the port of the listening device of claim 6, wherein the first preset port and the second preset port are local ports; wherein the local port is any number port between 1000 and 65535.
8. The communication method implemented based on the port of the snooping device of claim 7, wherein the port of the native device corresponds to the APP of the snooping port one by one.
9. A communication device implemented based on a listening device port, comprising: a processor, and a memory coupled to the processor;
the memory is used for storing a computer program, and the computer program is at least used for executing the communication method realized based on the port of the listening device in any one of claims 1-8;
the processor is used for calling and executing the computer program in the memory.
10. A storage medium, characterized in that the storage medium stores a computer program, which when executed by a processor implements the steps of the communication method implemented based on a listening device port according to any one of claims 1-8.
CN202011092205.9A 2020-10-13 2020-10-13 Communication method, device and storage medium realized based on port of monitoring device Pending CN112165531A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011092205.9A CN112165531A (en) 2020-10-13 2020-10-13 Communication method, device and storage medium realized based on port of monitoring device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011092205.9A CN112165531A (en) 2020-10-13 2020-10-13 Communication method, device and storage medium realized based on port of monitoring device

Publications (1)

Publication Number Publication Date
CN112165531A true CN112165531A (en) 2021-01-01

Family

ID=73866710

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011092205.9A Pending CN112165531A (en) 2020-10-13 2020-10-13 Communication method, device and storage medium realized based on port of monitoring device

Country Status (1)

Country Link
CN (1) CN112165531A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827154A (en) * 2021-01-18 2022-07-29 网宿科技股份有限公司 Port monitoring method, system and server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105426242A (en) * 2015-11-17 2016-03-23 腾讯科技(深圳)有限公司 Data transmission method and device
CN107463453A (en) * 2017-08-10 2017-12-12 腾讯科技(深圳)有限公司 Method, apparatus, equipment and the storage medium to be communicated between same terminal different application
US20190109848A1 (en) * 2017-10-06 2019-04-11 Stealthpath, Inc. Methods for Internet Communication Security
CN111385265A (en) * 2018-12-29 2020-07-07 北京奇虎科技有限公司 Communication method and device in iOS system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105426242A (en) * 2015-11-17 2016-03-23 腾讯科技(深圳)有限公司 Data transmission method and device
CN107463453A (en) * 2017-08-10 2017-12-12 腾讯科技(深圳)有限公司 Method, apparatus, equipment and the storage medium to be communicated between same terminal different application
US20190109848A1 (en) * 2017-10-06 2019-04-11 Stealthpath, Inc. Methods for Internet Communication Security
CN111385265A (en) * 2018-12-29 2020-07-07 北京奇虎科技有限公司 Communication method and device in iOS system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827154A (en) * 2021-01-18 2022-07-29 网宿科技股份有限公司 Port monitoring method, system and server

Similar Documents

Publication Publication Date Title
CN102638586B (en) Sharing method, system and device for application program information
CN111263338A (en) Network distribution method of Bluetooth Mesh network and related network distribution equipment and system
CN110582998A (en) Group communication method and device, computer storage medium and computer equipment
CN107734592B (en) core network selection method, access network entity, UE and system
CN106899605B (en) Communication method and device based on STOMP protocol
CN110311855B (en) User message processing method and device, electronic equipment and storage medium
CN112134915A (en) Application layer protocol decoupling universal network processing system
CN112165531A (en) Communication method, device and storage medium realized based on port of monitoring device
CN104683217A (en) Multimedia information transmission method and instant messaging client
CN106657076B (en) TCP service implementation method and device for network name space
CN116761144A (en) Method and device for accessing equipment to Internet of things platform
CN115695497A (en) Diagnostic data remote transmission method and device, electronic equipment and medium
CN112995095B (en) Data processing method, device and computer readable storage medium
CN114697339A (en) Load balancing method and device under centralized architecture
CN114884805A (en) Data transmission method, device, terminal and storage medium
CN114500036A (en) Method, device and medium for transmitting data
CN113553206A (en) Data event execution method and device, electronic equipment and computer readable medium
CN108805741B (en) Fusion method, device and system of power quality data
CN103546513B (en) The method and device of communication between a kind of customer terminal webpage
CN112737864A (en) Edge cloud network division monitoring method
CN112434111A (en) Basic data synchronization method, device, equipment and storage medium
CN111416852A (en) Method for session synchronization among multiple load balancers and load balancer
CN114846901B (en) Communication method, device, equipment and storage medium
CN115834691B (en) Distributed publishing and subscribing method and device, electronic equipment and storage medium
CN110768855A (en) Method and device for testing linkmzation performance

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

Application publication date: 20210101

RJ01 Rejection of invention patent application after publication