CN114827197B - Service communication method, device, equipment and medium based on Internet of things - Google Patents

Service communication method, device, equipment and medium based on Internet of things Download PDF

Info

Publication number
CN114827197B
CN114827197B CN202210337488.1A CN202210337488A CN114827197B CN 114827197 B CN114827197 B CN 114827197B CN 202210337488 A CN202210337488 A CN 202210337488A CN 114827197 B CN114827197 B CN 114827197B
Authority
CN
China
Prior art keywords
service
internet
things
name
edge server
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.)
Active
Application number
CN202210337488.1A
Other languages
Chinese (zh)
Other versions
CN114827197A (en
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.)
Shanghai Envision Innovation Intelligent Technology Co Ltd
Envision Digital International Pte Ltd
Original Assignee
Shanghai Envision Innovation Intelligent Technology Co Ltd
Envision Digital International Pte 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 Shanghai Envision Innovation Intelligent Technology Co Ltd, Envision Digital International Pte Ltd filed Critical Shanghai Envision Innovation Intelligent Technology Co Ltd
Priority to CN202210337488.1A priority Critical patent/CN114827197B/en
Priority to PCT/SG2022/050248 priority patent/WO2023191705A1/en
Publication of CN114827197A publication Critical patent/CN114827197A/en
Application granted granted Critical
Publication of CN114827197B publication Critical patent/CN114827197B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • 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/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y10/00Economic sectors
    • G16Y10/75Information technology; Communication
    • 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]
    • 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/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/563Data redirection of data network streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The application discloses a service communication method, device, equipment and medium based on the Internet of things, and the method is applied to the field of the Internet of things. The method is applied to the cloud server, and comprises the following steps: receiving the name of an edge server sent by an Internet of things client; sending a request message to the edge server through a long connection corresponding to the name of the edge server; the request message is used for requesting the target service from the edge server, and the long connection is used for connecting the cloud server and the edge server; analyzing the processing result returned by the edge server to obtain response content; and sending the response content to the client of the Internet of things. According to the method, the target content can be accessed without the cloud server acquiring the address and the port of the edge server, and the communication efficiency is high.

Description

Service communication method, device, equipment and medium based on Internet of things
Technical Field
The application relates to the field of internet of things, in particular to a service communication method, device, equipment and medium based on the internet of things.
Background
The cloud server provides services to the outside through the Internet (Internet). The cloud server generally has a public network IP (Internet Protocol ), the cloud server refers to a platform integrated with multiple services, a user can obtain required services on the cloud server, the edge server refers to a client on a terminal close to a thing or a data source, and the edge server can quickly extract data of the data source and provide services.
In the related art, a cloud server issues a service to an edge server, and designates a port and an address of the service at the edge server. When the service needs to be used, the edge server reports the address of the edge server to the cloud server. The cloud server accesses the service through the address of the edge server and the port address of the service.
However, the address reported by the edge server to the cloud server may be a lan IP, which results in that the cloud server cannot access the corresponding service through the address and port of the edge server.
Disclosure of Invention
The embodiment of the application provides a service communication method, device, equipment and medium based on the Internet of things, and the method provides long connection for a cloud server to access an edge server, so that the cloud server can directly access the edge server. The technical scheme is as follows:
According to one aspect of the application, a service communication method based on the Internet of things is provided, and is applied to a cloud server, and the method comprises the following steps:
receiving the name of an edge server sent by an Internet of things client;
sending a request message to the edge server through a long connection corresponding to the name of the edge server; the request message is used for requesting the target service from the edge server, and the long connection is used for connecting the cloud server and the edge server;
analyzing the processing result returned by the edge server to obtain response content;
and sending the response content to the client of the Internet of things.
According to one aspect of the present application, there is provided a service communication device based on the internet of things, the device including a cloud server, the device including:
the first receiving module is used for receiving the name of the edge server sent by the client of the Internet of things;
the first sending module is used for sending a request message to the edge server through a long connection corresponding to the name of the edge server; the request message is used for requesting the target service from the edge server, and the long connection is used for connecting the cloud server and the edge server;
The first analysis module is used for analyzing the processing result returned by the edge server to obtain response content;
the first sending module is further configured to send the response content to the client of the internet of things.
In an optional design of the present application, the first receiving module is further configured to receive a service request sent by the client of the internet of things.
The first analysis module is further configured to determine a type of the client of the internet of things according to the service request; extracting a service name from the service request under the condition that the client of the Internet of things is a local client of the Internet of things; determining the name of the edge server according to the service name; and extracting the name of the edge server from the service request under the condition that the Internet of things client is the cloud Internet of things client on the cloud server.
In an optional design of the present application, the first parsing module is further configured to determine a name of the edge server corresponding to the service name and the first correspondence, where the first correspondence includes a correspondence between the service name and the name of the edge server.
In an optional design of the present application, the first sending module is further configured to send a second correspondence between a name of the edge server and the service name to the cloud internet of things client.
In an optional design of the application, the first parsing module is further configured to extract the service name from the service request; determining target request contents corresponding to the name of the edge server and the service name from at least two candidate request contents; packaging the name of the edge server, the service name and the target request content to generate the request message; and the edge server generates the response content according to the target request content.
In an alternative design of the application, the apparatus further comprises a first registration module;
the first registration module is configured to record the long connection corresponding to the edge server when the edge server is connected to the cloud server through an address of the cloud server; deploying the target service to the edge server; and defining and recording a service path corresponding to the edge server, wherein the service path comprises the name of the edge server and the service name.
According to one aspect of the present application, there is provided a service communication method based on the internet of things, applied to an edge server, the method comprising:
responding to a request message sent by a cloud server through a long connection corresponding to the name of the edge server, and analyzing the request message to obtain a service name and target request content, wherein the long connection is used for connecting the cloud server and the edge server;
determining target service corresponding to the service name in at least two candidate service ends;
generating response content according to the target request content through the target service;
packaging the response content through the target service to generate a processing result;
and sending the processing result to the cloud server through long connection.
According to one aspect of the present application, there is provided a service communication device based on the internet of things, the device including an edge server, the device including:
the first receiving module is used for receiving the name of the edge server sent by the client of the Internet of things;
the first sending module is used for sending a request message to the edge server through a long connection corresponding to the name of the edge server; the request message is used for requesting the target service from the edge server, and the long connection is used for connecting the cloud server and the edge server;
The second analysis module is used for analyzing the processing result returned by the edge server to obtain response content;
the first sending module is further configured to send the response content to the client of the internet of things.
In an alternative design of the application, the device further comprises a second registration module.
The second registration module is used for connecting to the cloud server through the address of the cloud server; and under the condition that the cloud server deploys the target service, recording the target service and the service name of the target service.
In an optional design of the present application, the second parsing module is further configured to reconnect to the cloud server through an address of the cloud server in the event of the long connection interruption; and the cloud server establishes the long connection again.
According to another aspect of the present application, there is provided a computer apparatus comprising: the system comprises a processor and a memory, wherein at least one instruction, at least one section of program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by the processor to realize the service communication method based on the Internet of things.
According to another aspect of the present application, there is provided a computer storage medium having at least one program code stored therein, the program code being loaded and executed by a processor to implement the service communication method based on the internet of things as described in the above aspect.
According to another aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the service communication method based on the internet of things as described in the above aspect.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
the cloud server and the edge server are kept connected through long connection, so that the cloud server can directly initiate network connection to the edge server and access corresponding target content through the edge server. The cloud server is not required to acquire the address and the port of the edge server, so that the target content can be accessed, and the communication efficiency is high.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a computer system provided in accordance with an exemplary embodiment;
FIG. 2 is a flowchart of a service communication method based on the Internet of things, provided in accordance with an exemplary embodiment;
FIG. 3 is a flowchart of a service communication method based on the Internet of things, provided in accordance with an exemplary embodiment;
FIG. 4 is a flowchart of a service communication method based on the Internet of things, provided in accordance with an exemplary embodiment;
fig. 5 is a schematic structural diagram of a service communication device based on the internet of things according to an exemplary embodiment;
fig. 6 is a schematic structural diagram of a service communication device based on the internet of things according to an exemplary embodiment;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
First, the nouns involved in the embodiments of the present application will be described:
thing networking (Internet of Things, ioT): the intelligent sensing, identification and management device is characterized in that any object or process needing to be monitored, connected and interacted is collected in real time through various devices and technologies such as various information sensors, radio frequency identification technologies, global positioning systems, infrared sensors and laser scanners, various needed information such as sound, light, heat, electricity, mechanics, chemistry, biology and positions of the object or process is collected, and the object or the object is connected with people in a ubiquitous mode through various possible network access, so that intelligent sensing, identification and management of objects and processes are realized.
Cloud server: the computer cluster is used for providing data services such as monitoring, storage, analysis and the like and guaranteeing the business data security of clients and is provided with a public network IP. The public network IP refers to an IP address exposed on the Internet public network, and all terminals on the public network and the local area network can initiate a connection request through the public network IP.
Edge server: refers to computer devices in close proximity to the object or data source that only possess local area network IP. Wherein, the terminals in the same local area network can initiate connection requests through the local area network IP. Edge computing refers to an edge server on one side near the object or data source, which adopts an open platform integrating network, computing, storage and application core capabilities to provide nearest service nearby.
Long links: refers to a connection that can send multiple data packets in succession. The long link is not automatically disconnected after one data transmission is completed.
Websocket: is a protocol that performs full duplex communications over a single TCP (Transmission Control Protocol ) connection. The cloud server and the edge server can directly establish persistent connection and perform bidirectional data transmission only by completing one handshake.
Service request: the client of the Internet of things sends connection required by the request to the cloud server. For example, when the internet of things client is a local internet of things client, the service request may be expressed as < domain name of cloud server >/< service name >. When the internet of things client is a cloud internet of things client, the service request may be expressed as < domain name of cloud server >/< name of edge server >/< service name >.
FIG. 1 illustrates a schematic diagram of a computer system according to an exemplary embodiment of the present application. The computer system 100 includes: the internet of things client 120, the cloud server 140 and the edge server 160.
The internet of things client 120 is an application running on a terminal. The application may be an applet in an app, a specialized application, or a web client. The terminal is at least one of a smart phone, a tablet computer, an electronic book reader, an MP3 player, an MP4 player, a laptop portable computer, and a desktop computer.
The internet of things client 120 is connected to the cloud server 140 through a wireless network or a wired network.
The cloud server 140 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like.
The cloud server 140 is connected to the edge server 160 through a long connection.
Edge server 160 refers to a computer device on the side near the object or data source. The edge server 160 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like.
In a specific embodiment, the edge server 160 includes a gateway 161 and a candidate server 162, the gateway 161 is configured to implement interconnection between the cloud server 140 and the edge server 160, and the candidate server 162 is configured to provide edge computing services supported by the edge server.
Fig. 2 is a schematic flow chart of service communication based on the internet of things according to an exemplary embodiment of the present application. The method may be performed by the cloud server 140 shown in fig. 1, and the method includes the following steps:
step 202: and receiving the name of the edge server sent by the client of the Internet of things.
The client of the Internet of things can be a local client of the Internet of things and also can be a client of the Internet of things in the cloud. The local Internet of things client refers to a client located on a terminal held by a user, and the cloud Internet of things client refers to an application located on a cloud server.
When the clients of the Internet of things are different, the names of the acquired edge servers are also different. Illustratively, this step includes the sub-steps of:
1. and receiving a service request sent by the client of the Internet of things.
The service request is used for requesting the target service from the cloud server by the client of the Internet of things.
2. And determining the type of the client of the Internet of things according to the service request.
In an optional implementation manner of this embodiment, the type of the client of the internet of things is determined according to the sending path of the service request. The transmission path refers to an IP address (Internet Protocol Address ) when the internet of things client transmits a service request to the cloud server.
Optionally, in response to receiving a service request of the client of the internet of things, analyzing a sending path of the service request to obtain a sending address of the service path; and determining the type of the client of the Internet of things according to the sending address.
In an optional implementation manner of this embodiment, the type of the client of the internet of things is determined according to the carried content of the service request. For example, when the internet of things client is a local internet of things client, the service request may be expressed as < domain name of cloud server >/< service name >. When the internet of things client is a cloud internet of things client, the service request may be expressed as < domain name of cloud server >/< name of edge server >/< service name >. Therefore, responding to the service request carrying the name of the edge server, and determining that the client of the Internet of things is the client of the cloud Internet of things; and responding to the service request without carrying the name of the edge server, and determining that the client of the Internet of things is a client of the local Internet of things.
In the case that the internet of things client is a cloud internet of things client, in order to inform the corresponding relationship between the name of the edge server of the internet of things client and the service name, a second corresponding relationship between the name of the edge server and the service name may be sent to the cloud internet of things client in advance.
3. Under the condition that the client of the Internet of things is a local client of the Internet of things, extracting a service name from a service request; and determining the name of the edge server according to the service name.
For example, in the case where the internet of things client is a local internet of things client, the service request may be expressed as < domain name of cloud server >/< service name >, where the cloud server needs to learn the name of the edge server through other approaches. Optionally, the name of the edge server corresponding to the service name and the first correspondence is determined based on the first correspondence, where the first correspondence includes a correspondence between the service name and the name of the edge server. For example, the existing first correspondence is as follows: and when the service name carried by the service request is determined to be the service B, determining that the service B corresponds to the edge server 2.
Optionally, the first correspondence is stored on the cloud server in the form of a table.
4. And under the condition that the internet of things client is a cloud internet of things client on the cloud server, extracting the name of the edge server from the service request.
For example, in the case where the internet of things client is a cloud internet of things client, the service request may be expressed as < domain name of cloud server >/< name of edge server >/< service name >, and at this time, the service request already includes the name of edge server, so the name of edge server may be directly extracted from the service request.
Step 204: sending a request message to the edge server through a long connection corresponding to the name of the edge server; the request message is used for requesting the target service from the edge server, and the long connection is used for connecting the cloud server and the edge server.
The target service is determined by the user himself.
The names of different edge servers correspond to different long connections, e.g., edge server a corresponds to long connection 1 and edge server B corresponds to long connection 2.
Optionally, websocket is used to connect the cloud server and the edge server.
Step 206: and analyzing the processing result returned by the edge server to obtain response content.
In the embodiment of the application, the response content refers to a service result calculated by the edge server.
The processing result is sent to the cloud server through the long-connection edge server.
Illustratively, the processing result is expressed as < name of edge server >/< service name > + response content. The analysis processing result can directly obtain the response content.
Step 208: and sending the response content to the client of the Internet of things.
In an optional implementation manner of this embodiment, according to the name of the edge server in the processing result, determining the client of the internet of things; and sending the response content to the client of the Internet of things. When the cloud server receives a service request of the internet of things client, the cloud server can record the corresponding relation between the name of the edge client in the service request and the internet of things client, after the cloud server receives the processing result, the processing result is analyzed to obtain the name of the edge client, and the internet of things client corresponding to the processing result is determined according to the name of the edge server.
In an optional implementation manner of this embodiment, according to the service name in the processing result, determining the client of the internet of things; and sending the response content to the client of the Internet of things. When the cloud server receives a service request of the Internet of things client, the cloud server can record the corresponding relation between the service name in the service request and the Internet of things client, after receiving a processing result, the cloud server analyzes the processing result to obtain the service name, and determines the Internet of things client corresponding to the processing result according to the service name.
In an optional implementation manner of this embodiment, according to the name and the service name of the edge server in the processing result, determining the client of the internet of things; and sending the response content to the client of the Internet of things. When the cloud server receives a service request of the internet of things client, the cloud server can record the corresponding relation between the service name in the internet of things client and the service request and the name of the edge client, after receiving a processing result, the cloud server analyzes the processing result to obtain the service name and the name of the edge client, and determines the internet of things client corresponding to the processing result according to the service name and the name of the edge client.
In summary, in this embodiment, the cloud end server and the edge end server are kept connected through long connection, so that the cloud end server can directly initiate network connection to the edge end server, and access corresponding target content through the edge end server. The cloud server is not required to acquire the address and the port of the edge server, so that the target content can be accessed, and the communication efficiency is high.
Fig. 3 is a schematic flow chart of service communication based on the internet of things according to an exemplary embodiment of the present application. The method may be performed by the computer system shown in fig. 1, the method comprising the steps of:
Step 301: the edge server is connected to the cloud server through the address of the cloud server.
The edge end server is connected to the cloud end server through a public network address of the cloud end server, and is kept connected with the cloud end server through long connection or websocket.
Step 302: the cloud server records the long connection corresponding to the edge server.
Under the condition that the edge server is connected to the cloud server through the address of the cloud server, the cloud server records the long connection corresponding to the edge server. Or under the condition that the edge server is connected to the cloud server through the address of the cloud server, the cloud server records websocket corresponding to the edge server.
Illustratively, in an alternative implementation of the present application, a table is used to record the correspondence between edge servers and long connections, as shown in table 1:
table 1 correspondence between edge servers and long connections
Edge server Long connection
Edge server A Long connection 1
Edge server B Long connection 2
Edge server C Long connection 3
Edge server D Long connection 4
Step 303: the cloud server deploys the target service to the edge server.
Optionally, the cloud server deploys the candidate service into the candidate service end in the edge server. The target service is one of the candidate services.
Step 304: the cloud server defines and records a service path corresponding to the edge server.
The service path includes the name of the edge server and the service name.
Illustratively, in an alternative implementation of the present application, a table is used to record the correspondence between edge servers and service paths, as shown in table 2:
table 2 correspondence between edge servers and service paths
Edge server Service path Name of edge server Service name
Edge server A Service path 1 Name A Service alpha
Edge server B Service path 2 Name B Service beta
Edge server C Service path 3 Name C Service gamma
Edge server D Service path 4 Name D Service delta
Illustratively, the cloud server defines and records that the service path corresponding to the edge server is expressed as < name of the edge server >/< service name >.
Step 305: the edge server records the target service and the service name of the target service.
It should be noted that, step 304 and step 305 are not sequential, and step 304 may be performed first, and then step 305 may be performed; step 305 may be performed first, followed by step 304.
Step 306: and the client of the Internet of things sends a service request to the cloud server.
For example, in the case where the internet of things client is a cloud internet of things client on a cloud server, the internet of things client sends a service request to the cloud server through an address < cloud domain name >/< edge name >/< service name >.
Step 307: and the cloud server determines the name of the edge server according to the service request.
Under the condition that the client of the Internet of things is a local client of the Internet of things, extracting a service name from a service request; and determining the name of the edge server according to the service name.
And under the condition that the internet of things client is a cloud internet of things client on the cloud server, extracting the name of the edge server from the service request.
Step 308: the cloud server determines long connection corresponding to the name of the edge server.
The names of different edge servers correspond to different long connections, e.g., edge server a corresponds to long connection 1 and edge server B corresponds to long connection 2.
Optionally, websocket is used to connect the cloud server and the edge server.
Step 309: and the cloud server sends a request message to the edge client through the long connection.
Optionally, the cloud server sends the request message to the edge client through websocket.
Illustratively, this step includes the sub-steps of:
1. a service name is extracted from the service request.
For example, when the internet of things client is a local internet of things client, the service request may be expressed as < domain name of cloud server >/< service name >. When the internet of things client is a cloud internet of things client, the service request may be expressed as < domain name of cloud server >/< name of edge server >/< service name >.
2. And determining target request contents corresponding to the name and the service name of the edge server from at least two candidate request contents.
In an optional implementation manner of the present application, the cloud server stores target request content corresponding to the name and the service name of the edge server, and a correspondence relationship between the name, the service name, and the target request content of the edge server. For example, the cloud server stores the correspondence of "edge server 1-service name 1-request content 1", "edge server 1-service name 2-request content 2", "edge server 2-service name 3-request content 3", and the like, and the cloud server can determine the target request content according to the name of the edge server and the service name.
Optionally, the candidate request content includes instructions corresponding to the service provided by the edge server. For example, the cloud server stores "edge server 1-request content 1-instruction 1" and "edge server 2-request content 2-instruction 2", where instruction 1 is used for an edge server access device and instruction 2 is used for edge server synchronization data.
Optionally, the target request content is a data category. The data types of the candidate request content include time type data, temperature type data and type data, the time type data in the candidate request content is used as target request content, and after the edge server receives the target request content, the edge server obtains the time type data according to the target request content and selects the time type data from a memory of the edge server.
Optionally, the target request content is a functional formula. The cloud server sends the function formula corresponding to the target request content to the edge server, and the edge server calculates according to the function formula corresponding to the target request content after receiving the target request content.
Optionally, the target request content is a data combination. Illustratively, the candidate request content includes data combination a, data combination B, and data combination C, where data combination a includes data 1 and data 2, data combination B includes data 1 and data 3, and data combination C includes data 2 and data 4.
3. And packaging the name, the service name and the target request content of the edge server to generate a request message.
The edge server generates response content according to the target request content.
Illustratively, the cloud server generated request message is expressed as < name of edge server >/< service name > + request content.
Step 310: and the edge server analyzes the request message to obtain the service name and the target request content.
The edge server comprises a gateway and a candidate server.
Specifically, a gateway in the edge server analyzes the request message to obtain a service name and request content.
Step 311: and the edge server determines a target service corresponding to the service name in at least two candidate service ends.
Different candidate service ends in the edge end server can realize different services, for example, the candidate server end 1 can realize the service A, the candidate server end 2 can realize the service B, the edge end server analyzes the request message to obtain the service A, and the target service is determined to be the service on the candidate server end 1.
Step 312: the edge server generates response content according to the target request content through the target service.
The response content refers to the service result calculated by the edge server.
Step 313: and the edge server encapsulates the response content through the target service to generate a processing result.
Illustratively, the edge server encapsulates the response content, the name of the edge server, and the service name through the target service, and generates a processing result expressed as < name of the edge server >/< service name > + response content.
Step 314: and the edge server sends the processing result to the cloud server through long connection.
Reconnecting to the cloud server through the address of the cloud server under the condition of long connection interruption; and the cloud server establishes long connection again.
Step 315: the cloud server analyzes the processing result returned by the edge server to obtain response content.
The cloud server analyzes the processing result returned by the edge server to obtain response content, the name of the edge server and service name.
Step 316: and the cloud server sends the response content to the client of the Internet of things.
In an optional implementation manner of this embodiment, according to the name of the edge server in the processing result, determining the client of the internet of things; and sending the response content to the client of the Internet of things.
In an optional implementation manner of this embodiment, according to the service name in the processing result, determining the client of the internet of things; and sending the response content to the client of the Internet of things.
In an optional implementation manner of this embodiment, according to the name and the service name of the edge server in the processing result, determining the client of the internet of things; and sending the response content to the client of the Internet of things.
In summary, in this embodiment, the cloud end server and the edge end server are kept connected through long connection, so that the cloud end server can directly initiate network connection to the edge end server, and access corresponding target content through the edge end server. The cloud server is not required to acquire the address and the port of the edge server, so that the target content can be accessed, and the communication efficiency is high.
And the cloud server does not need to acquire the address and the port of the edge server in the mode of requesting the edge server, and the requests are all through the cloud server proxy, so that the services on different edge servers are requested according to different paths.
Fig. 4 is a schematic flow chart of service communication based on the internet of things according to an exemplary embodiment of the present application. The method may be performed by the edge server 160 shown in fig. 1, and includes the steps of:
Step 402: and responding to the request message sent by the cloud server through the long connection corresponding to the name of the edge server, and analyzing the request message to obtain the service name and the target request content, wherein the long connection is used for connecting the cloud server and the edge server.
The edge server comprises a gateway and a candidate server.
Specifically, a gateway in the edge server analyzes the request message to obtain a service name and request content.
Step 404: and determining a target service corresponding to the service name in the at least two candidate service ends.
Different candidate service ends in the edge end server can realize different services, for example, the candidate server end 1 can realize the service A, the candidate server end 2 can realize the service B, the edge end server analyzes the request message to obtain the service A, and the target service is determined to be the service on the candidate server end 1.
Step 406: and generating response content according to the target request content through the target service.
The response content refers to the service result calculated by the edge server. For example, the sum of the target request contents is calculated, and the response contents are generated.
Step 408: and encapsulating the response content through the target service to generate a processing result.
Illustratively, the edge server encapsulates the response content, the name of the edge server, and the service name through the target service, and generates a processing result expressed as < name of the edge server >/< service name > + response content.
Step 410: and sending the processing result to the cloud server through long connection.
Reconnecting to the cloud server through the address of the cloud server under the condition of long connection interruption; and the cloud server establishes long connection again.
In summary, the present embodiment provides a method for determining a target service in an edge server, where a cloud server and the edge server are kept connected through a long connection, so that the cloud server can directly initiate network connection to the edge server, and access corresponding target content through the edge server. The cloud server is not required to acquire the address and the port of the edge server, so that the target content can be accessed, and the communication efficiency is high.
The following is an embodiment of the apparatus according to the present application, and details of the embodiment of the apparatus that are not described in detail may be combined with corresponding descriptions in the embodiment of the method described above, which are not described herein again.
Fig. 5 illustrates a schematic structural diagram of service communication based on the internet of things according to an exemplary embodiment of the present application. The apparatus may be implemented as all or part of a computer device by software, hardware, or a combination of both, the apparatus 500 including a cloud server, the apparatus 500 including:
A first receiving module 501, configured to receive a name of an edge server sent by an internet of things client;
a first sending module 502, configured to send a request message to the edge server through a long connection corresponding to the name of the edge server; the request message is used for requesting the target service from the edge server, and the long connection is used for connecting the cloud server and the edge server;
a first parsing module 503, configured to parse a processing result returned by the edge server to obtain response content;
the first sending module 502 is further configured to send the response content to the client of the internet of things.
In an optional design of the present application, the first receiving module 501 is further configured to receive a service request sent by the client of the internet of things.
The first parsing module 503 is further configured to determine a type of the client of the internet of things according to the service request; extracting a service name from the service request under the condition that the client of the Internet of things is a local client of the Internet of things; determining the name of the edge server according to the service name; and extracting the name of the edge server from the service request under the condition that the Internet of things client is the cloud Internet of things client on the cloud server.
In an optional design of the present application, the first parsing module 503 is further configured to determine a name of the edge server corresponding to the service name and the first correspondence, where the first correspondence includes a correspondence between the service name and the name of the edge server.
In an optional design of the present application, the first sending module 502 is further configured to send a second correspondence between the name of the edge server and the service name to the cloud internet of things client.
In an alternative design of the present application, the first parsing module 503 is further configured to extract the service name from the service request; determining target request contents corresponding to the name of the edge server and the service name from at least two candidate request contents; packaging the name of the edge server, the service name and the target request content to generate the request message; and the edge server generates the response content according to the target request content.
In an alternative design of the application, the apparatus further comprises a first registration module 504;
The first registration module 504 is configured to record the long connection corresponding to the edge server when the edge server is connected to the cloud server through an address of the cloud server; deploying the target service to the edge server; and defining and recording a service path corresponding to the edge server, wherein the service path comprises the name of the edge server and the service name.
In summary, in this embodiment, the cloud end server and the edge end server are kept connected through long connection, so that the cloud end server can directly initiate network connection to the edge end server, and access corresponding target content through the edge end server. The cloud server is not required to acquire the address and the port of the edge server, so that the target content can be accessed, and the communication efficiency is high.
The following is an embodiment of the apparatus according to the present application, and details of the embodiment of the apparatus that are not described in detail may be combined with corresponding descriptions in the embodiment of the method described above, which are not described herein again.
Fig. 6 illustrates a schematic structural diagram of service communication based on the internet of things according to an exemplary embodiment of the present application. The apparatus may be implemented as all or part of a computer device by software, hardware, or a combination of both, the apparatus 600 comprising an edge server, the apparatus 600 comprising:
A second receiving module 601, configured to receive a name of an edge server sent by an internet of things client;
a second sending module 602, configured to send a request message to the edge server through a long connection corresponding to the name of the edge server; the request message is used for requesting the target service from the edge server, and the long connection is used for connecting the cloud server and the edge server;
a second parsing module 603, configured to parse the processing result returned by the edge server to obtain response content;
the second sending module 602 is further configured to send the response content to the client of the internet of things.
In an alternative design of the application, the device further comprises a second registration module 603.
The second registration module 603 is configured to connect to the cloud server through an address of the cloud server; and under the condition that the cloud server deploys the target service, recording the target service and the service name of the target service.
In an optional design of the present application, the second parsing module 603 is further configured to reconnect to the cloud server through the address of the cloud server in the event of the long connection interruption; and the cloud server establishes the long connection again.
In summary, the present embodiment provides a method for determining a target service in an edge server, where a cloud server and the edge server are kept connected through a long connection, so that the cloud server can directly initiate network connection to the edge server, and access corresponding target content through the edge server. The cloud server is not required to acquire the address and the port of the edge server, so that the target content can be accessed, and the communication efficiency is high.
Fig. 7 is a schematic diagram of a computer device, according to an example embodiment. The computer apparatus 700 includes a central processing unit (Central Processing Unit, CPU) 701, a system Memory 704 including a random access Memory (Random Access Memory, RAM) 702 and a Read-Only Memory (ROM) 703, and a system bus 705 connecting the system Memory 704 and the central processing unit 701. The computer device 700 also includes a basic Input/Output system (I/O) 706, which helps to transfer information between various devices within the computer device, and a mass storage device 707 for storing an operating system 713, application programs 714, and other program modules 715.
The basic input/output system 706 includes a display 708 for displaying information and an input device 709, such as a mouse, keyboard, or the like, for a user to input information. Wherein the display 708 and the input device 709 are coupled to the central processing unit 701 through an input output controller 710 coupled to a system bus 705. The basic input/output system 706 may also include an input/output controller 710 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input output controller 710 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 707 is connected to the central processing unit 701 through a mass storage controller (not shown) connected to the system bus 705. The mass storage device 707 and its associated computer device readable media provide non-volatile storage for the computer device 700. That is, the mass storage device 707 may include a computer device readable medium (not shown) such as a hard disk or a compact disk-Only (CD-ROM) drive.
The computer device readable medium may include computer device storage media and communication media without loss of generality. Computer device storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer device readable instructions, data structures, program modules or other data. Computer device storage media includes RAM, ROM, erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), electrically erasable programmable read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), CD-ROM, digital video disk (Digital Video Disc, DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer device storage medium is not limited to the ones described above. The system memory 704 and mass storage device 707 described above may be collectively referred to as memory.
According to various embodiments of the present disclosure, the computer device 700 may also operate through a network, such as the Internet, to remote computer devices on the network. I.e., the computer device 700 may be connected to the network 711 through a network interface unit 712 coupled to the system bus 705, or alternatively, the network interface unit 712 may be used to connect to other types of networks or remote computer device systems (not shown).
The memory further includes one or more programs stored in the memory, and the central processor 701 implements the service communication method based on the internet of things by executing the one or more programs.
In an exemplary embodiment, there is also provided a computer readable storage medium having stored therein at least one instruction, at least one program, a code set, or an instruction set, which is loaded and executed by a processor to implement the service communication method based on the internet of things provided in the above respective method embodiments.
The application also provides a computer readable storage medium, wherein at least one instruction, at least one section of program, code set or instruction set is stored in the storage medium, and the at least one instruction, the at least one section of program, the code set or instruction set is loaded and executed by the processor to realize the service communication method based on the internet of things provided by the embodiment of the method.
Optionally, the present application further provides a computer program product containing instructions, which when run on a computer device, cause the computer device to perform the service communication method based on the internet of things according to the above aspects.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the present application is not intended to limit the application, but rather, the application is to be construed as limited to the appended claims.

Claims (9)

1. The service communication method based on the Internet of things is characterized by being applied to a cloud server, and comprises the following steps:
receiving a service request sent by an Internet of things client; determining the type of the client of the Internet of things according to the service request; extracting a service name from the service request under the condition that the client of the Internet of things is a local client of the Internet of things; determining the name of an edge server according to the service name; extracting the name of the edge server from the service request under the condition that the internet of things client is a cloud internet of things client on the cloud server;
Sending a request message to the edge server through a long connection corresponding to the name of the edge server; the request message is used for requesting the target service from the edge server, and the long connection is used for connecting the cloud server and the edge server;
analyzing the processing result returned by the edge server to obtain response content;
and sending the response content to the client of the Internet of things.
2. The method of claim 1, wherein determining the name of the edge server from the service name comprises:
and determining the name of the edge server corresponding to the service name and the first corresponding relation based on the first corresponding relation, wherein the first corresponding relation comprises the corresponding relation between the service name and the name of the edge server.
3. The method according to claim 1, wherein the method further comprises:
extracting the service name from the service request;
determining target request contents corresponding to the name of the edge server and the service name from at least two candidate request contents;
Packaging the name of the edge server, the service name and the target request content to generate the request message;
and the edge server generates the response content according to the target request content.
4. A method according to any one of claims 1 to 3, wherein the method further comprises:
recording the long connection corresponding to the edge server under the condition that the edge server is connected to the cloud server through the address of the cloud server;
deploying the target service to the edge server;
and defining and recording a service path corresponding to the edge server, wherein the service path comprises the name of the edge server and the service name.
5. The service communication method based on the Internet of things is characterized by being applied to an edge server, and comprises the following steps:
responding to a request message sent by a cloud server through a long connection corresponding to the name of the edge server, and analyzing the request message to obtain a service name and target request content, wherein the long connection is used for connecting the cloud server and the edge server; the cloud server is further used for receiving a service request sent by the client of the Internet of things; determining the type of the client of the Internet of things according to the service request; extracting a service name from the service request under the condition that the client of the Internet of things is a local client of the Internet of things; determining the name of the edge server according to the service name; extracting the name of the edge server from the service request under the condition that the internet of things client is a cloud internet of things client on the cloud server;
Determining target service corresponding to the service name in at least two candidate service ends;
generating response content according to the target request content through the target service;
packaging the response content through the target service to generate a processing result;
and sending the processing result to the cloud server through long connection.
6. A service communication device based on the internet of things, the device comprising a cloud server, the device comprising:
the first receiving module is used for receiving a service request sent by the client of the Internet of things; determining the type of the client of the Internet of things according to the service request; extracting a service name from the service request under the condition that the client of the Internet of things is a local client of the Internet of things; determining the name of an edge server according to the service name; extracting the name of the edge server from the service request under the condition that the internet of things client is a cloud internet of things client on the cloud server;
the first sending module is used for sending a request message to the edge server through a long connection corresponding to the name of the edge server; the request message is used for requesting the target service from the edge server, and the long connection is used for connecting the cloud server and the edge server;
The analysis module is used for analyzing the processing result returned by the edge server to obtain response content;
the first sending module is further configured to send the response content to the client of the internet of things.
7. A service communication device based on the internet of things, the device comprising an edge server, the device comprising:
the second receiving module is used for responding to the received request message sent by the cloud server through the long connection corresponding to the name of the edge server, analyzing the request message to obtain a service name and request content, wherein the long connection is used for connecting the cloud server and the edge server; the cloud server is further used for receiving a service request sent by the client of the Internet of things; determining the type of the client of the Internet of things according to the service request; extracting a service name from the service request under the condition that the client of the Internet of things is a local client of the Internet of things; determining the name of the edge server according to the service name; extracting the name of the edge server from the service request under the condition that the internet of things client is a cloud internet of things client on the cloud server;
The processing module is used for determining target service corresponding to the service name in at least two candidate service ends;
the processing module is further used for generating response content according to the request content through the target service;
the processing module is further used for packaging the response content through the target service and generating a processing result;
and the second sending module is used for sending the processing result to the cloud server through long connection.
8. A computer device, the computer device comprising: a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to implement the internet of things-based service communication method of any one of claims 1 to 4 or the internet of things-based service communication method of claim 5.
9. A computer readable storage medium, wherein at least one program code is stored in the computer readable storage medium, the program code being loaded and executed by a processor to implement the service communication method based on internet of things according to any one of claims 1 to 4, or the service communication method based on internet of things according to claim 5.
CN202210337488.1A 2022-03-31 2022-03-31 Service communication method, device, equipment and medium based on Internet of things Active CN114827197B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210337488.1A CN114827197B (en) 2022-03-31 2022-03-31 Service communication method, device, equipment and medium based on Internet of things
PCT/SG2022/050248 WO2023191705A1 (en) 2022-03-31 2022-04-26 Method and apparatus for iot-based service communication, and computer device and storage medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210337488.1A CN114827197B (en) 2022-03-31 2022-03-31 Service communication method, device, equipment and medium based on Internet of things

Publications (2)

Publication Number Publication Date
CN114827197A CN114827197A (en) 2022-07-29
CN114827197B true CN114827197B (en) 2023-09-12

Family

ID=82532462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210337488.1A Active CN114827197B (en) 2022-03-31 2022-03-31 Service communication method, device, equipment and medium based on Internet of things

Country Status (2)

Country Link
CN (1) CN114827197B (en)
WO (1) WO2023191705A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104993980A (en) * 2015-08-11 2015-10-21 上海斐讯数据通信技术有限公司 Long connection application access safety control method and system
CN110166432A (en) * 2019-04-17 2019-08-23 平安科技(深圳)有限公司 The access method of internal net destination service provides the method for Intranet destination service
CN112261113A (en) * 2020-10-16 2021-01-22 易联众信息技术股份有限公司 Intelligent connection processing method, system and application based on edge calculation
CN112291238A (en) * 2020-10-29 2021-01-29 腾讯科技(深圳)有限公司 Data communication method, device, equipment and computer readable storage medium
CN112383416A (en) * 2020-11-02 2021-02-19 之江实验室 Kubeedge and EdgeX fountain based intelligent edge device control platform
CN112887433A (en) * 2021-04-12 2021-06-01 网络通信与安全紫金山实验室 Cloud access edge service method and system based on QUIC protocol
CN114006905A (en) * 2021-10-27 2022-02-01 远景智能国际私人投资有限公司 Information transmission method, device and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110389815B (en) * 2018-04-18 2023-09-12 阿里巴巴集团控股有限公司 Task processing method, device and system
US11303727B2 (en) * 2019-04-30 2022-04-12 Jio Platforms Limited Method and system for routing user data traffic from an edge device to a network entity
US11388054B2 (en) * 2019-04-30 2022-07-12 Intel Corporation Modular I/O configurations for edge computing using disaggregated chiplets
CN113556413B (en) * 2021-08-13 2023-07-25 中国互联网络信息中心 Message processing method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104993980A (en) * 2015-08-11 2015-10-21 上海斐讯数据通信技术有限公司 Long connection application access safety control method and system
CN110166432A (en) * 2019-04-17 2019-08-23 平安科技(深圳)有限公司 The access method of internal net destination service provides the method for Intranet destination service
CN112261113A (en) * 2020-10-16 2021-01-22 易联众信息技术股份有限公司 Intelligent connection processing method, system and application based on edge calculation
CN112291238A (en) * 2020-10-29 2021-01-29 腾讯科技(深圳)有限公司 Data communication method, device, equipment and computer readable storage medium
CN112383416A (en) * 2020-11-02 2021-02-19 之江实验室 Kubeedge and EdgeX fountain based intelligent edge device control platform
CN112887433A (en) * 2021-04-12 2021-06-01 网络通信与安全紫金山实验室 Cloud access edge service method and system based on QUIC protocol
CN114006905A (en) * 2021-10-27 2022-02-01 远景智能国际私人投资有限公司 Information transmission method, device and system

Also Published As

Publication number Publication date
WO2023191705A1 (en) 2023-10-05
CN114827197A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
CN110247784B (en) Method and device for determining network topology structure
CN111756674B (en) Network communication method, system, device and computer readable storage medium
CN110602445B (en) Video monitoring data acquisition method and device, computer equipment and storage medium
CN110932918B (en) Log data acquisition method and device and storage medium
CN112506755B (en) Log acquisition method, device, computer equipment and storage medium
CN111711533B (en) Fault diagnosis method, fault diagnosis device, electronic device and storage medium
WO2023109524A1 (en) Information leakage monitoring method and system, and electronic device
CN106549989A (en) A kind of data transmission method and its system, user terminal, application server
CN111427613B (en) Application program interface API management method and device
CN114827197B (en) Service communication method, device, equipment and medium based on Internet of things
CN114513552B (en) Data processing method, device, equipment and storage medium
CN108737350B (en) Information processing method and client
CN114595115A (en) Model data extraction method, system, electronic device and computer storage medium
US20190052681A1 (en) Shared terminal detection method and device therefor
CN113037848A (en) File uploading method and system
CN109462868B (en) Method and equipment for inquiring target information by wireless access point
CN113326060A (en) Service request processing method, device and system and service configuration method and device
CN114070824B (en) Registration method of Internet of things equipment, registration cloud server and medium
JP6577620B1 (en) Content determination apparatus and program
CN114547129B (en) Distributed satellite data receiving system and method based on big data storage platform
CN113707346B (en) Novel online inquiry system and method based on Internet hospital
CN114640522B (en) Firewall security policy processing method, device, equipment and storage medium
CN116866208A (en) Internet of things data monitoring method and device, electronic equipment and readable storage medium
CN117640469A (en) Method and device for testing network bandwidth
CN114238694A (en) Data processing method and device based on Linux, electronic equipment 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
GR01 Patent grant
GR01 Patent grant