Network communication method, device, computer equipment and storage medium

文档序号:1449077 发布日期:2020-02-18 浏览:22次 中文

阅读说明:本技术 网络通信方法、装置、计算机设备及存储介质 (Network communication method, device, computer equipment and storage medium ) 是由 吴佳彬 于 2019-11-11 设计创作,主要内容包括:本发明实施例公开了一种网络通信方法、装置、计算机设备及存储介质。所述方法包括:第一设备通过网络通信方式接收服务器发送的待处理数据;如果确定所述待处理数据满足第二设备处理条件,则所述第一设备通过预设设备间通信方式将所述待处理数据转发至所述第二设备,以使所述第二设备进行处理;所述设备间通信方式是除网络通信方式之外的通信方式。本发明实施例可以快速实现网络通信功能,并降低网络通信的实现成本。(The embodiment of the invention discloses a network communication method, a network communication device, computer equipment and a storage medium. The method comprises the following steps: the method comprises the steps that first equipment receives to-be-processed data sent by a server in a network communication mode; if the data to be processed meets the processing condition of second equipment, the first equipment forwards the data to be processed to the second equipment in a preset inter-equipment communication mode so as to enable the second equipment to process the data; the inter-device communication method is a communication method other than a network communication method. The embodiment of the invention can quickly realize the network communication function and reduce the realization cost of the network communication.)

1. A network communication method, comprising:

the method comprises the steps that first equipment receives to-be-processed data sent by a server in a network communication mode;

if the data to be processed meets the processing condition of second equipment, the first equipment forwards the data to be processed to the second equipment in a preset inter-equipment communication mode so as to enable the second equipment to process the data; the inter-device communication method is a communication method other than a network communication method.

2. The method of claim 1, wherein the inter-device communication means comprises a bluetooth communication means.

3. The method according to claim 2, wherein before the first device forwards the to-be-processed data to the second device in a preset inter-device communication manner if it is determined that the to-be-processed data meets a second device processing condition, the method further comprises:

the first equipment starts Bluetooth and registers;

and the first equipment establishes Bluetooth connection with the second equipment so as to communicate with the second equipment in a Bluetooth communication mode.

4. The method of claim 1, wherein the determining that the data to be processed satisfies a second device processing condition comprises:

if the processing party of the data to be processed is determined to be the second equipment according to the data to be processed, the first equipment determines that the data to be processed meets the processing condition of the second equipment; and/or

And if the data to be processed is determined to comprise a second equipment state information acquisition request according to the data to be processed, the first equipment determines that the data to be processed meets the processing condition of the second equipment.

5. The method of claim 1, wherein the receiving, by the first device, the to-be-processed data sent by the server through a network communication manner includes:

the first equipment establishes network communication connection with the server and monitors the server;

and the first equipment receives the data to be processed sent by the server, wherein the first equipment establishes network communication connection in a cellular mobile communication mode or Wi-Fi.

6. The method of claim 5, prior to the first device establishing a network communication connection over Wi-Fi, further comprising:

the first equipment receives Wi-Fi configuration information sent by third equipment;

and if the first equipment searches for the Wi-Fi signal matched with the Wi-Fi configuration information, establishing network communication connection according to the Wi-Fi configuration information.

7. The method of claim 6, wherein the establishing a network communication connection according to the Wi-Fi configuration information further comprises:

if the first equipment establishes the network communication connection through the cellular mobile communication mode, the first equipment disconnects the network communication connection established through the cellular mobile communication mode.

8. A network communication apparatus, comprising:

the network communication module is used for receiving the data to be processed sent by the server in a network communication mode;

the device communication module is used for forwarding the data to be processed to the second device in a preset inter-device communication mode to enable the second device to process if the data to be processed meets the processing condition of the second device; the inter-device communication method is a communication method other than a network communication method.

9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the network communication method according to any of claims 1-7 when executing the program.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the network communication method according to any one of claims 1 to 7.

Technical Field

The embodiment of the invention relates to the field of computer networks, in particular to a network communication method, a network communication device, computer equipment and a storage medium.

Background

With the popularization of the internet, more and more devices can interact with the server in a network communication mode, upload data so that the server monitors the state of the devices, and receive instructions sent by the server to execute corresponding operations.

At present, some modules or devices do not have the network communication function, and if the communication function is separately integrated for the modules or devices, an additional communication module needs to be added, or the layout of the modules or devices is re-involved, so that the implementation cost of the communication function is increased.

Disclosure of Invention

Embodiments of the present invention provide a network communication method, apparatus, computer device, and storage medium, which can quickly implement a network communication function and reduce implementation cost of network communication.

In a first aspect, an embodiment of the present invention provides a network communication method, including:

when an application program generates a network service access requirement, intercepting a network communication request sent by the application program;

extracting a domain name to be resolved from the network communication request;

inquiring the domain name to be analyzed in a corresponding relation between a prestored domain name and an internet protocol address;

and generating an analysis result matched with the network communication request according to the inquired internet protocol address matched with the domain name to be analyzed, and feeding back the analysis result to the application program.

In a second aspect, an embodiment of the present invention further provides a network communication apparatus, including:

the network communication request intercepting module is used for intercepting a network communication request sent by an application program when the application program generates a network service access requirement;

the domain name extraction module to be resolved is used for extracting the domain name to be resolved from the network communication request;

the Internet protocol address query module is used for querying the domain name to be analyzed in the corresponding relation between the prestored domain name and the Internet protocol address;

and the internet protocol address feedback module is used for generating an analysis result matched with the network communication request according to the inquired internet protocol address matched with the domain name to be analyzed and feeding back the analysis result to the application program.

In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the network communication method according to any one of the embodiments of the present invention.

In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the network communication method according to any one of the embodiments of the present invention.

According to the embodiment of the invention, the to-be-processed data sent by the server is obtained through the first equipment in a network communication mode, and when the to-be-processed data needs to be processed by the second equipment, the to-be-processed data is sent to the second equipment through inter-equipment communication, so that the second equipment obtains the to-be-processed data sent by the server, the problem that in the prior art, the communication cost of the equipment is high because the equipment without a network communication function needs to be additionally integrated with other equipment to realize network communication is solved, the network data can be indirectly obtained through inter-equipment communication, the network communication function is indirectly realized, the realization cost of network communication is reduced, the communication integration operation is avoided, and the network communication efficiency is improved.

Drawings

Fig. 1 is a flowchart of a network communication method according to a first embodiment of the present invention;

fig. 2a is a flowchart of a network communication method according to a second embodiment of the present invention;

FIG. 2b is a diagram illustrating an application scenario in which the present invention is applied;

fig. 2c is a flowchart of a network communication method according to a second embodiment of the present invention;

fig. 3 is a schematic structural diagram of a network communication device according to a third embodiment of the present invention;

fig. 4 is a schematic structural diagram of a computer device in the fourth embodiment of the present invention.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:多终端的连接建立方法和装置、存储介质及电子装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!