CN114556891A - Method, device, equipment and storage medium for determining equipment state - Google Patents

Method, device, equipment and storage medium for determining equipment state Download PDF

Info

Publication number
CN114556891A
CN114556891A CN202080071391.XA CN202080071391A CN114556891A CN 114556891 A CN114556891 A CN 114556891A CN 202080071391 A CN202080071391 A CN 202080071391A CN 114556891 A CN114556891 A CN 114556891A
Authority
CN
China
Prior art keywords
server
status
information
indication information
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.)
Granted
Application number
CN202080071391.XA
Other languages
Chinese (zh)
Other versions
CN114556891B (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN114556891A publication Critical patent/CN114556891A/en
Application granted granted Critical
Publication of CN114556891B publication Critical patent/CN114556891B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Abstract

The embodiment of the application provides a method, a device, equipment and a storage medium for determining equipment state, and belongs to the technical field of Internet of things. The method for determining the equipment state provided by the embodiment of the application comprises the following steps: sending state acquisition information to OCF resource equipment; the OCF resource equipment comprises a server and a cloud, and the state acquisition information is used for acquiring the connection state of D2D communication of the server or the connection state of D2C communication of the server; determining whether the server side is online or not based on the acquired connection state of the D2D communication and/or the connection state of the D2C communication and the receiving state of the current client side; the method for determining the equipment state provided by the embodiment of the application can determine whether the server capable of simultaneously performing D2D communication and D2C communication is online or not, and then determine whether the service provided by the server can be effectively used or not according to whether the server is online or not, so that the adaptation flexibility of the client can be improved.

Description

Method, device, equipment and storage medium for determining equipment state Technical Field
The present application relates to the field of internet of things technology, and in particular, to a method, an apparatus, a device, and a storage medium for determining a device status.
Background
The OCF (open Connectivity foundation) is an internet of things application layer technical standard organization, and establishes a service framework for realizing interconnection and intercommunication among internet of things devices, and in the OCF service framework, the internet of things devices are described by a device resource model, where the internet of things devices providing resources are called OCF service terminals (hereinafter referred to as service terminals), and the internet of things devices accessing the resources are called OCF clients (hereinafter referred to as clients). For example, in an OCF service framework, a control terminal that acquires indoor environment data may be referred to as a client, and a sensor device that monitors indoor environment data may be referred to as a server.
The communication protocol provided by the OCF supports D2D (device and device) communication and D2C (device and cloud) communication, wherein the client and the server can implement local data interaction in the same OCF local area network based on D2D communication, and the client and the server can implement remote data interaction via cloud relay based on D2C communication.
Currently, it is generally difficult for a client to determine whether the client can effectively use the service provided by the server, which affects the flexibility of use of the client.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for determining equipment state.
In a first aspect, a method for determining a device status is provided, and is used in a client, and the method includes:
sending state acquisition information to OCF resource equipment; the OCF resource equipment comprises a server and a cloud, and the state acquisition information is used for acquiring the connection state of D2D communication of the server or the connection state of D2C communication of the server;
determining whether the server side is online or not based on the acquired connection state of the D2D communication and/or the connection state of the D2C communication and the receiving state of the current client side; the receiving state includes that the client receives information of the OCF resource equipment or the client does not receive the information of the OCF resource equipment.
In a second aspect, an apparatus for determining a device status is provided, and is used in a client, the apparatus includes:
the sending module is used for sending the state acquisition information to the OCF resource equipment; the OCF resource equipment comprises a server and a cloud, and the state acquisition information is used for acquiring the connection state of D2D communication of the server or the connection state of D2C communication of the server;
the determining module is used for determining whether the server side is online or not based on the acquired connection state of the D2D communication and/or the connection state of the D2C communication and the receiving state of the current client side; the receiving state includes that the client receives information of the OCF resource equipment or the client does not receive the information of the OCF resource equipment.
In a third aspect, a computer device is provided, comprising a memory storing a computer program and a processor implementing the steps of the method of the first aspect when the processor executes the computer program.
In a fourth aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of the first aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
by sending state acquisition information to an OCF resource device, where the OCF resource device includes a server and a cloud, the state acquisition information is used to acquire a connection state of D2D communication of the server or a connection state of D2C communication of the server, and then, a client may determine whether the server is online based on the acquired connection state of D2D communication and/or the connection state of D2C communication, and based on a current receiving state of the client, where the receiving state includes that the client receives information of an OCF resource device or that the client does not receive information of an OCF resource device, and by the method for determining a device state provided in this embodiment of the application, the client may determine whether a server capable of performing D2D communication and D2C communication simultaneously is online, and then determine whether a service provided by the server can be effectively used by determining whether the server is online or not, in this way, the adaptation flexibility of the client can be improved.
Drawings
Fig. 1 is a schematic application scenario diagram of a method for determining a device state according to an embodiment of the present application;
fig. 2 is a flowchart of a method for determining a device status according to an embodiment of the present application;
fig. 3 is a flowchart of another method for determining a device status according to an embodiment of the present disclosure;
fig. 4 is a flowchart of another method for determining a device status according to an embodiment of the present application;
fig. 5 is a block diagram of an apparatus for determining a device status according to an embodiment of the present disclosure;
FIG. 6 is a block diagram of another apparatus for determining a device status according to an embodiment of the present disclosure;
fig. 7 is a block diagram of a computer device provided in an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
An Open Connectivity Foundation (OCF) is an internet of things application layer technical standard organization, in a service framework established by the OCF, internet of things devices can maintain resources, and data interaction among the internet of things devices can be realized through various operations such as creation, reading, updating, deleting or subscribing aiming at the resources.
For example, an ambient temperature resource may be maintained in the server, and if the client needs to obtain ambient temperature data, the client may send a subscription request or a reading request for the ambient temperature resource to the server, where the subscription request may be: SUBSCRIBE/environment temperature, the read request may be: RETRIEVE/environmental temperature.
The/environment temperature is a URI (Uniform Resource Identifier) of an environment temperature Resource, the SUBSCRIBE is a type Identifier of a subscription request, and the RETRIEVE is a type Identifier of a read request.
After receiving the subscription request, the server may send the changed ambient temperature data to the client when the ambient temperature data in the ambient temperature resource changes. After receiving the read request, the server may directly send the ambient temperature data in the ambient temperature resource to the client.
The OCF also provides a communication protocol for interconnection and intercommunication among the Internet of things devices, wherein the OCF communication protocol can support D2D communication and D2C communication, the D2D communication can support a client and a server to carry out local communication in an OCF local area network, and the D2C communication can support the client and the server to carry out remote communication through a cloud.
It should be noted that in practical applications, the client and the server can perform D2D communication only if the client and the server are located in the same OCF lan.
It should be further noted that, in a general case, a configuration tool may be deployed in the client, and the client may configure its D2D communication and the D2D communication of the server through the configuration tool, and at the same time, the client may also configure its D2C communication and communicate with the D2C of the server through the configuration tool.
In practical application, a user corresponding to a client has a need to know whether a server is online or not. For example, if the server is an intelligent door lock, the server can output alarm information to the client when the server is violently damaged, and a user corresponding to the client wants to know whether the intelligent door lock is online or not so as to determine whether the alarm information sent by the intelligent door lock can be received or not. For another example, if the server is a health monitoring device, it may output alarm information to the client when monitoring that a problem occurs in the health state of the user, and a user corresponding to the client wants to know whether the health monitoring device is online, so as to determine whether the alarm information sent by the health monitoring device can be received.
However, currently, for a server capable of performing D2D communication and D2C communication simultaneously, there is no mechanism for determining whether the server is online, which makes it difficult for a client to determine whether the service provided by the server can be effectively used, thereby affecting the flexibility of use of the client.
In view of this, the present application provides a method for determining a device status, in which a client may send status acquisition information to an OCF resource device, where the OCF resource device includes a server and a cloud, the status acquisition information is used to acquire a connection status of D2D communication of the server or a connection status of D2C communication of the server, and then, the client may determine whether the server is online based on the acquired connection status of D2D communication and/or the acquired connection status of D2C communication, and based on a current receiving status of the client, where the receiving status includes that the client receives information of the OCF resource device or that the client receives information of the OCF resource device, and with the method for determining a device status provided in this application, the client may determine whether a server capable of performing D2D communication and D2C communication simultaneously is online, and then, whether the service provided by the server side can be effectively used is determined by whether the server side is on line or not, so that the adaptation flexibility of the client side can be improved.
In the following, a brief description will be given of an implementation environment related to the method for determining the device status provided in the embodiment of the present application.
As shown in fig. 1, the implementation environment may include a server 101, a client 102, and a cloud 103, where for convenience of description, the server in the implementation environment shown in fig. 1 is hereinafter collectively referred to as a target server, and the client in the implementation environment shown in fig. 1 is referred to as a target client.
The target server 101 and the target client 102 are bound to each other, the target server 101 can establish communication connection with the target client 102 through D2D communication, meanwhile, the target server 101 can also establish communication connection with the cloud 103 through D2C communication, and in addition, the target client 102 can establish communication connection with the cloud 103 through D2C communication.
In this embodiment, optionally, the target server 101 may be an electronic device such as an intelligent door lock, an intelligent camera, a television, or a temperature sensor. The target client 102 may be an electronic device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, or a wearable device. The cloud 103 may be one server or a server cluster including a plurality of servers.
Referring to fig. 2, a flowchart of a method for determining a device status provided by an embodiment of the present application is shown, where the method for determining a device status may be applied to the target client 102 in the implementation environment shown in fig. 1. As shown in fig. 2, the method of determining the device status may include the steps of:
step 201, the target client sends state acquisition information to the OCF resource device.
The OCF resource device may include the target server and the cloud in the implementation environment shown in fig. 1, where the state obtaining information is used to obtain a connection state of D2D communication of the target server or a connection state of D2C communication of the target server.
The connection state of D2D communication of the target server refers to: the connection state of D2D communication between the target server and the target client, that is, the state of local connection of the target server in the OCF lan. Wherein the connection state of the D2D communication of the target server may include one of a disconnected state and an un-disconnected state.
The connection state of D2C communication of the target server may refer to: the connection state of D2C communication between the target server and the cloud end, that is, the state of the remote connection between the target server and the cloud end. Wherein the connection state of the D2C communication of the target server may include one of a disconnected state and an un-disconnected state.
In step 202, the target client determines whether the target server is online or not based on the acquired connection state of the D2D communication and/or the connection state of the D2C communication and based on the receiving state of the current client.
The receiving state includes that the client receives information of the OCF resource equipment or the client does not receive the information of the OCF resource equipment.
In one possible implementation, the target client may determine whether the target server is online based on the connection status of the D2D communication and based on the reception status of the current client.
In another possible implementation, the target client may determine whether the target server is online based on the connection status of the D2C communication and based on the reception status of the current client.
In yet another possible implementation, the target client may determine whether the target server is online based on the connection status of the D2C communication and the connection status of the D2C communication and based on the reception status of the current client.
On the basis of the embodiment shown in fig. 2, the embodiment of the present application provides two implementation manners for sending the status acquisition information to the OCF resource device, and one of the implementation manners will be described in the following.
Referring to fig. 3, a first implementation manner for sending status acquisition information to an OCF resource device according to an embodiment of the present application may include the following steps:
step 301, the target client sends a first D2C state acquisition request to the cloud.
The first D2C status obtaining request is used to instruct the cloud to send first D2C status indication information to the target client, where the first D2C status indication information is used to indicate a connection status of D2C communication of the target server. The first D2C status indication information may include first disconnection indication information indicating that the connection status of the D2C communication of the target server is a disconnected status.
Optionally, a server connection state resource may be maintained in the cloud, and an exemplary server connection state resource is shown below:
Figure PCTCN2020070156-APPB-000001
Figure PCTCN2020070156-APPB-000002
as indicated above, the exemplary server connection state resource may include a resource type attribute rt and a server information list serverlist.
The attribute value of the resource type attribute rt is used to indicate the type of the connection status resource of the server, for example, the attribute value of the resource type attribute rt is "oic.
The server information list serverlist may include at least one piece of server information, where only two pieces of server information are exemplarily shown above, and are:
Figure PCTCN2020070156-APPB-000003
wherein, each server information corresponds to a server which establishes D2C communication connection with the cloud. For example, if the cloud and 10 servers establish a D2C communication connection, the server information list serverlist may include 10 server information corresponding to the 10 servers one to one.
Each server information may include a device identification attribute di and a connection state attribute status.
The attribute value of the device identifier attribute di in a certain server information is used to indicate the device identifier of the server corresponding to the server information, for example, the attribute value of the device identifier attribute di in the first server information in the server information list serverlist is e61c3e6b-9c54-4b81-8ce5-f9039c1d04d9, which may be the device identifier of the server corresponding to the first server information.
An attribute value of a connection state attribute status in certain server information is used to indicate a connection state of D2C communication of a server corresponding to the server information, and the attribute value of the connection state attribute status may be one of an online and an offline, where the online indicates that the connection state of D2C communication of the server is an un-disconnected state, and the offline indicates that the connection state of D2C communication of the server is a disconnected state.
In this embodiment of the application, a long connection can be maintained between the cloud and the server that establishes D2C communication connection with the cloud, and in the process of maintaining the long connection, the cloud and the server can send heartbeat information periodically, wherein, the device that receives the heartbeat information feeds back response heartbeat information to the device that sends the heartbeat information.
If the cloud does not receive response heartbeat information fed back by a certain service end establishing D2C communication connection with the cloud within a first preset receiving duration (for example, consecutive 3 heartbeat interval periods), the cloud may determine that the D2C communication connection between the cloud and the service end is disconnected, and at this time, the cloud may switch an attribute value of a connection state attribute status in the service end information corresponding to the service end within the service end information list serverlist from online to offline.
An exemplary server connection state resource after switching of the attribute value of the connection state attribute status is shown below:
Figure PCTCN2020070156-APPB-000004
Figure PCTCN2020070156-APPB-000005
the server information list serverlist may include server information (hereinafter, referred to as target server information for convenience of description) corresponding to a target server in the implementation environment shown in fig. 1, and an attribute value of the connection state attribute status in the target server information may be referred to as second connection state indication information indicating a connection state of D2C communication of the target server.
In an embodiment of the present application, the first D2C status acquisition request may be a request for the server connection status resource.
In a possible implementation manner, the first D2C status obtaining request may be a subscription request for the server connection status resource, for example, the URI of the server connection status resource may be/oic/sec/serverConnectionStatus, and then the first D2C status obtaining request may be SUBSCRIBE/oic/sec/serverConnectionStatus, where SUBSCRIBE is used to indicate that the type of the first D2C status obtaining request is a subscription request type.
The subscription request for the server connection state resource is used for indicating that the cloud sends first D2C state indication information to the target client when the second connection state indication information changes. For example, when the second connection status indication information is switched from online to offline, the cloud may send the first D2C status indication information to the target client. Optionally, the first D2C status indication information may include the changed second connection status indication information and the identifier of the target server, and optionally, the first D2C status indication information may further include a resource type of the server connection status resource.
In another possible implementation manner, the first D2C status obtaining request may be a read request for the server connection status resource, for example, the URI of the server connection status resource may be/oic/sec/serverConnectionStatus, and the first D2C status obtaining request may be RETRIEVE/oic/sec/serverConnectionStatus, where RETRIEVE is used to indicate that the type of the first D2C status obtaining request is a read request type.
The read request for the server connection status resource is used for instructing the cloud to send first D2C status indication information to the target client based on the second connection status indication information. Optionally, the first D2C status indication information may include the second connection status indication information and an identifier of the target server, and optionally, the first D2C status indication information may further include a resource type of the server connection status resource.
The following is an exemplary first D2C status indication:
Figure PCTCN2020070156-APPB-000006
as shown above, the first D2C status indication information may include the second connection status indication information, ofline, and the identifier e61c3e6b-9c54-4b81-8ce5-f9039c1D04D9 of the target server, and optionally, the first D2C status indication information may further include a resource type of the server connection status resource oic.
It should be noted that, in an actual application, the number of the target servers bound to the target client may be multiple, and when the cloud end needs to send the first D2C status indication information to the target client for at least two target servers in the multiple target servers, optionally, the cloud end may send separate first D2C status indication information for each target server, at this time, each first D2C status indication information is used to indicate a connection status of D2C communication of one target server, the cloud end may also send the same first D2C status indication information for the at least two target servers, and at this time, the first D2C status indication information is used to indicate a connection status of D2C communication of the at least two target servers.
It should be noted that, in this embodiment of the application, the target client may separately send a subscription request for the server connection state resource to the cloud, and the target client may also separately send a read request for the server connection state resource to the cloud, and in order to improve the probability that the target client can successfully receive the first D2C state indication information, the target client may also send both the subscription request for the server connection state resource and the read request for the server connection state resource to the cloud.
It should also be noted that, in order to ensure that the target client can timely acquire the connection status of the D2C communication of the target server, the target client may periodically send a read request for the server connection status resource to the cloud.
Since the server information list serverlist may include multiple pieces of server information, in order to enable the cloud to locate the target server information in the multiple pieces of server information, and send the first D2C status indication information to the target client based on the second connection status indication information in the target server information, it is optional:
in a possible implementation manner, the first D2C status obtaining request may carry an identifier of a target server (the identifier of the target server may be a device identifier of the target server), for example, the first D2C status obtaining request may be SUBSCRIBE/oic/sec/serviceconnectionstatdi ═ e61c3e6b-9c54-4b81-8ce5-f9039c1D04D9, where,/oic/sec/serviceconnectionstatus is a URI of a server connection status resource, and the SUBSCRIBE is used to indicate that the type of the first D2C status obtaining request is a subscription request type, and e61c3e6b-9c54-4b81-8ce5-f9039c1D04D9 is the device identifier of the target server. After receiving the first D2C status acquisition request, the cloud may locate target server information in the plurality of server information based on the identifier of the target server, and send first D2C status indication information to the target client based on second connection status indication information in the target server information.
In another possible implementation manner, the first D2C status obtaining request may carry an identifier of a target client (the identifier of the target client may be a device identifier of the target client or a user identifier of the target client). After receiving the first D2C status obtaining request, the cloud may query a device binding database, which stores binding relationships between multiple clients and servers, based on the identifier of the target client, and by querying the device binding database, the cloud may obtain an identifier of the target server (e.g., a device identifier of the target server) bound to the target client. The cloud end can locate target server information in the plurality of server information based on the identification of the target server, and send first D2C state indication information to the target client based on second connection state indication information in the target server information;
in yet another possible implementation manner, the first D2C state obtaining request may carry an access token, where the access token is a token issued by the cloud to the target client and used for characterizing a legal access identity of the target client. After receiving the first D2C state obtaining request, the cloud may query a token database based on the access token, where the token database stores a corresponding relationship between the token and the device to which the token belongs, and obtain the identifier of the target client by querying the token database. Then, the cloud may query the device binding database described above based on the identifier of the target client, and by querying the device binding database, the cloud may obtain an identifier of the target server (e.g., a device identifier of the target server) bound to the target client, and the cloud may locate, based on the identifier of the target server, information of the target server in the plurality of pieces of server information, and send, based on second connection status indication information in the information of the target server, first D2C status indication information to the target client.
Step 302, the target client sends D2D status acquisition information to the target server.
Wherein the D2D status acquisition information is used to instruct the target server to send response information for the D2D status acquisition information to the target client based on D2D communication. Since the D2D status acquisition information may instruct the target server to send response information for the D2D status acquisition information to the target client based on D2D communication, the target client may not receive the response information sent by the target server when the connection status of the D2D communication of the target server is in the disconnected status, and the target client may receive the response information sent by the target server when the connection status of the D2D communication of the target server is in the non-disconnected status. Therefore, the D2D status acquisition information can be used to enable the target client to acquire the connection status of the D2D communication of the target server.
Optionally, the D2D status acquisition information may be heartbeat information, and the response information for the D2D status acquisition information may be response heartbeat information.
Alternatively, the D2D status acquisition information may be a device discovery request, and the response information for the D2D status acquisition information may be information in response to the device discovery request.
In a possible implementation manner, the target client may send the device discovery request to the target server in a unicast manner.
In another possible implementation manner, the target client may send a device discovery request to a device in the OCF local area network where the target client is located in a multicast manner, where the device discovery request may carry an identifier of the target server.
Next, the embodiment of the present application will briefly describe the sequence of execution of step 301 and step 302.
In one possible implementation (for convenience of description, this implementation is hereinafter referred to as implementation S1), the target client may first periodically send D2D status acquisition information to the target server to obtain the connection status of the D2D communication of the target server by using the D2D status acquisition information.
For example, after establishing a D2D communication connection with a target server, the target client may maintain a long connection with the target server, in the process of maintaining the long connection, the target client may periodically send heartbeat information to the target server, and after receiving the heartbeat information, the target server may send response heartbeat information for the heartbeat information to the target client based on D2D communication.
When the target client obtains the connection state of the D2D communication of the target server based on the D2D state obtaining information, for example, when the target client does not receive response heartbeat information fed back by the target server within a second preset receiving duration (for example, consecutive 3 heartbeat interval cycles), the target client may send the first D2C state obtaining request to the cloud, where the first D2C state obtaining request may be a read request for a server connection state resource, and by sending the first D2C state obtaining request, the target client may obtain the connection state of the D2C communication of the target server.
In another possible implementation manner (for convenience of description, this implementation manner is hereinafter referred to as implementation manner S2), the target client may send the first D2C state obtaining request to the cloud, where the first D2C state obtaining request may be a subscription request for a server connection state resource, and by sending the first D2C state obtaining request, the target client may obtain a connection state of D2C communication of the target server, and further, the target client may also periodically send D2D state obtaining information to the target server, so as to obtain a connection state of D2D communication of the target server by using the D2D state obtaining information.
In this implementation manner, the embodiment of the present application does not limit the sequence of sending the first D2C status acquisition request and periodically sending the D2D status acquisition information to the target server.
In yet another possible implementation manner (for convenience of description, this implementation manner is hereinafter referred to as implementation manner S3), the target client may first send a first D2C status acquisition request to the cloud, where the first D2C status acquisition request may be a subscription request or a read request for a server connection status resource, and after receiving first disconnection indication information sent by the cloud based on the first D2C status acquisition request, the target client may send D2D status acquisition information to the target server, so as to obtain a connection status of the D2D communication of the target server by using the D2D status acquisition information.
In this implementation, optionally, before sending the D2D status acquisition information to the target server, the target client may determine whether the target client and the target server access the same OCF local area network.
If the target client and the target server do not access the same OCF local area network, D2D communication between the target server and the target client is not possible, at this time, the connection state of the D2D communication of the target server is definitely a disconnection state, and at this time, the target client may not execute the technical process of sending the D2D state acquisition information to the target server.
If the target client and the target server access the same OCF local area network, the target server and the target client may perform D2D communication, and at this time, the target client may execute a technical process of sending D2D state acquisition information to the target server, so as to obtain the connection state of D2D communication of the target server by using the D2D state acquisition information.
Optionally, the target client may determine whether the target client and the target server access the same OCF local area network according to at least one of the geographic location of the target client, network information of the OCF local area network accessed by the target client, and security domain information of the target client.
The target client side and the target server side are bound with each other, so that a target geographic range covered by an OCF local area network accessed by the target server side can be stored in the target client side, after the target client side obtains the geographic position of the target client side, whether the geographic position of the target client side is within the target geographic range or not can be judged, and if the geographic position of the target client side is not within the target geographic range, the target client side and the target server side can be determined not to be accessed into the same OCF local area network.
Similarly, as the target client and the target server are bound with each other, the network information of the OCF lan accessed by the target client may be stored in the target client, and after the target client acquires the network information of the OCF lan accessed by itself, the network information of the OCF lan accessed by the target client and the network information of the OCF lan accessed by the target server may be compared, and if the comparison result is inconsistent, it is determined that the target client and the target server are not accessed to the same OCF lan, otherwise, if the comparison result is consistent, it is determined that the target client and the target server are accessed to the same OCF lan.
Similarly to the above, since the target client and the target server are bound to each other, the security domain information of the target client may be stored in the target client, and since the security domain information of all the devices in the same OCF local area network is the same, after the target client acquires the security domain information of itself, the security domain information of the target client may be compared with the security domain information of the target server, if the comparison result is inconsistent, it is determined that the target client and the target server do not access the same OCF local area network, otherwise, if the comparison result is consistent, it is determined that the target client and the target server access the same OCF local area network.
Corresponding to the first implementation manner described above for sending the status acquisition information to the OCF resource device, the target client may implement the technical process of step 202 based on the following determination logic to determine whether the target server is online.
A1, when the target client receives the first disconnection instruction information, if it receives the response information, it determines that the target server is online.
In correspondence with the above-described implementation S3, when the target client receives the first disconnection instruction information, it is described that the connection state of the D2C communication of the target server is the disconnected state, and when the target client receives the response information of the D2D state acquisition information sent by the target server based on the D2D communication when receiving the first disconnection instruction information, it is described that the connection state of the D2D communication of the target server is the non-disconnected state, and at this time, the target server cannot perform data interaction with the target client based on the D2C communication, but the target server can perform data interaction with the target client based on the D2D communication, and thus, it can be determined that the target server is online.
B1, when the target client receives the first disconnection indication information, if the target client does not receive the response information, determining that the target server is offline.
Similarly to the above-mentioned determination logic a1, if the target client receives the first disconnection indication information, it indicates that the connection state of the D2C communication of the target server is the disconnected state, and if the target client does not receive the response information of the D2D state acquisition information sent by the target server based on the D2D communication when receiving the first disconnection indication information, it indicates that the connection state of the D2D communication of the target server is the disconnected state, at this time, the target server cannot perform data interaction with the target client based on the D2C communication or the D2D communication, and thus, it can be determined that the target server is offline.
In addition, in an embodiment of the present application, if the target client receives the first disconnection indication information and the target client and the target server do not access the same OCF lan, it is indicated that the target server cannot perform data interaction with the target client based on the D2C communication or cannot perform data interaction with the target client based on the D2D communication, and therefore, it may be determined that the target server is offline.
Corresponding to the first implementation manner described above for sending the status acquisition information to the OCF resource device, the target client may further implement the technical process of step 202 based on the following determination logic to determine whether the target server is online.
And A2, when the target client does not receive the response information, if the target client receives the first disconnection indication information, determining that the target server is offline.
As described in the foregoing implementation manners S1 and S2, correspondingly, if the target client does not receive the response information, it indicates that the connection state of the D2D communication of the target server is the disconnected state, and then, if the target client receives the first disconnection indication information sent by the cloud based on the first D2C state acquisition request, it indicates that the connection state of the D2C communication of the target server is also the disconnected state, in this case, the target server cannot perform data interaction with the target client based on the D2C communication or cannot perform data interaction with the target client based on the D2D communication, and thus, it can be determined that the target server is offline.
Optionally, in this embodiment of the application, the target client may start a timer when not receiving the response information, and if the target client receives the first disconnection indication information before the timer expires when not receiving the response information, it may be determined that the server is offline.
B2, when the target client does not receive the response information, if the target client does not receive the first disconnection indication information, determining that the target server is online.
Similarly to the above-mentioned determination logic a2, if the target client does not receive the response information, it indicates that the connection state of the D2D communication of the target server is in the disconnected state, and then, if the target client does not receive the first disconnection indication information sent by the cloud based on the first D2C state acquisition request, it indicates that the connection state of the D2C communication of the target server is in the undisrupted state, in this case, although the target server cannot perform data interaction with the target client based on the D2D communication, it may perform data interaction with the target client based on the D2C communication, and thus, it may be determined that the target server is online.
Optionally, in this embodiment of the application, the target client may start a timer when not receiving the response information, and if the target client does not receive the first disconnection indication information before the timer expires, it may be determined that the server is online.
Referring to fig. 4, a second implementation manner for sending status acquisition information to an OCF resource device according to the embodiment of the present application may include the following steps:
step 401, the target client sends a first D2C state obtaining request to the cloud.
The first D2C status obtaining request is used to instruct the cloud to send first D2C status indication information to the target client, where the first D2C status indication information is used to indicate a connection status of D2C communication of the target server.
The technical process of step 401 is the same as that of step 301, and the embodiment of the present application is not described herein again.
Step 402, the target client sends a second D2C state obtaining request to the target server.
The second D2C status obtaining request is used to instruct the target server to send second D2C status indication information to the target client based on D2D communication, and the second D2C status indication information is used to instruct the connection status of D2C communication of the target server. The second D2C status indication information includes second disconnection indication information indicating that the connection status of the D2C communication of the target server is a disconnected status.
Optionally, a cloud access configuration resource (english) is maintained in the target server, and the cloud access configuration resource may be:
Figure PCTCN2020070156-APPB-000007
as shown above, the cloud access configuration resource may include a resource type attribute rt, an authorized provider name attribute apn, an OCF cloud access URI attribute cis, an OCF cloud identification attribute sid, a server connection status attribute cps, and an error handling attribute clec.
The attribute value of the resource type attribute rt is used to indicate the type of the cloud access configuration resource, for example, the attribute value of the resource type attribute rt is "oic. The attribute value of the authorized provider name attribute apn is used to indicate the name of the authorized provider, e.g., the attribute value of the authorized provider name attribute apn is "githu" above, which may indicate the name of the authorized provider. The attribute value of the OCF cloud access URI attribute cis is used to indicate the access URI of the cloud, for example, the attribute value of the OCF cloud access URI attribute cis is "maps + tcp:// example. com: 443", which may indicate the access URI of the cloud. The OCF cloud identifier attribute sid is used to indicate the identifier of the cloud, for example, the attribute value of the OCF cloud identifier attribute sid is "987 e6543-a21f-10d1-a 112-421345746237", which may indicate the identifier of the cloud. The attribute value of the server connection state attribute cps may indicate whether the target server is successfully registered in the cloud, and the attribute value of the server connection state attribute cps may be registered and unregistered, where the attribute value registered indicates that the target server is successfully registered in the cloud, and the attribute value unregistered indicates that the target server is not successfully registered in the cloud. The attribute value of the error handling attribute clec is used for indicating an error occurring in the process of accessing the cloud end by the target server end, and the attribute values of the error handling attribute clec include 0, 1, 2 and 3, wherein the attribute value 0 indicates that no error occurs in the process of accessing the cloud end by the target server end, the attribute value 1 indicates that a cloud error response occurs in the process of accessing the cloud end by the target server end, the attribute value 2 indicates that an error of connecting the cloud end occurs in the process of accessing the cloud end by the target server end, and the attribute value 3 indicates that an error of failing to update the security parameters occurs in the process of accessing the cloud end by the target server end.
In this embodiment, the cloud access configuration resource may include first connection status indication information, where the first connection status indication information is used to indicate a connection status of D2C communication of the target server. Alternatively, the first connection status indication information may be an attribute value of the error handling attribute clec. Optionally, in this embodiment of the application, a new attribute value may be added to the server connection state attribute cps in the cloud access configuration resource, for example, the new attribute value in the server connection state attribute cps may include disconnected and connected, where the attribute value disconnected is used to indicate that the connection state of the D2C communication of the target server is a disconnected state, the attribute value connected is used to indicate that the connection state of the D2C communication of the target server is an unbroken state, and the first connection state indication information may be the new attribute value. Optionally, in this embodiment of the application, the first connection status indication information may include an attribute value of the error handling attribute clec, and may also include an attribute value newly added in the server connection status attribute cps.
In this embodiment, the target server and the cloud may maintain long connection after establishing D2C communication connection, and in the process of maintaining long connection, the cloud and the target server may send heartbeat information periodically, where the device that receives the heartbeat information feeds back response heartbeat information to the device that sends the heartbeat information.
If the target server does not receive the response heartbeat information fed back by the cloud within a third preset receiving duration (for example, consecutive 3 heartbeat interval periods), the target server may determine that the D2C communication connection between the target server and the cloud is disconnected, and at this time, the target server may switch the first connection state indication information, so that the switched first connection state indication information indicates that the connection state of the D2C communication of the target server is the disconnected state.
An exemplary cloud access configuration resource after switching of the first connection state indication information is shown below:
Figure PCTCN2020070156-APPB-000008
in the cloud access configuration resource shown above, the attribute value of the server connection state attribute cps is switched to disconnected, and the attribute value of the error handling attribute clec is switched to 4.
In an embodiment of the present application, the second D2C status obtaining request may be a request for the cloud access configuration resource.
In a possible implementation manner, the second D2C state obtaining request may be a subscription request for the cloud access configuration resource, for example, the URI of the cloud access configuration resource may be/coapcoudconf, and the second D2C state obtaining request may be SUBSCRIBE/coapcoudconf, where SUBSCRIBE is used to indicate that the type of the second D2C state obtaining request is a subscription request type.
The subscription request for the cloud access configuration resource is used for indicating the target server to send second D2C status indication information to the target client when the first connection status indication information changes. For example, the attribute value of the server connection state attribute cps is switched from connected to disconnected, and the target server may send the second D2C state indication information to the target client. Optionally, the second D2C status indication information may include the changed first connection status indication information, and optionally, the second D2C status indication information may further include an identifier of the target server.
In another possible implementation manner, the second D2C status obtaining request may be a read request for a cloud access configuration resource, for example, the URI of the cloud access configuration resource may be/coapcoudconf, and the second D2C status obtaining request may be RETRIEVE/coapcoudconf, where RETRIEVE is used to indicate that the type of the second D2C status obtaining request is a read request type.
The read request for the cloud access configuration resource is used for instructing the target server to send second D2C status indication information to the target client based on the first connection status indication information. Optionally, the second D2C status indication information may include the first connection status indication information, and optionally, the second D2C status indication information may further include an identifier of the target server.
The following is an exemplary second D2C status indication:
Figure PCTCN2020070156-APPB-000009
as described above, the second D2C status indication information may include the attribute value disconnected of the server connection status attribute cps and the attribute value 4 of the error handling attribute clec, that is, the second D2C status indication information may include the first connection status indication information.
It should be noted that, in this embodiment of the application, the target client may separately send a subscription request for the cloud access configuration resource to the target server, and the target client may also separately send a reading request for the cloud access configuration resource to the target server, and in addition, in order to improve the probability that the target client can successfully receive the second D2C status indication information, the target client may also send both the subscription request for the cloud access configuration resource and the reading request for the cloud access configuration resource to the target server.
It should be further noted that, in order to ensure that the target client can timely acquire the connection state of the D2C communication of the target server, the target client may periodically send a read request for the cloud access configuration resource to the target server.
It should be noted that, in the embodiment of the present application, the order of execution of step 401 and step 402 is not limited. Optionally, the target client may first execute step 401 and then execute step 402, may also first execute step 402 and then execute step 401, and may also execute step 401 and step 402 at the same time.
Corresponding to the second implementation manner described above for sending the status acquisition information to the OCF resource device, the target client may implement the technical process of step 202 based on the following determination logic to determine whether the target server is online.
And A3, when the target client receives the second disconnection indication information, determining that the target server is online.
Since the second disconnection indication information indicates that the connection state of the D2C communication of the target server is the disconnected state, when the target client receives the second disconnection indication information, it may be determined that the connection state of the D2C communication of the target server is the disconnected state. Meanwhile, since the second disconnection indication information is transmitted by the target server to the target client based on the D2D communication, if the target client can receive the second disconnection indication information, it is described that the connection state of the D2D communication of the target server is an un-disconnected state. At this time, although the target server cannot perform data interaction with the target client based on the D2C communication, the target server can perform data interaction with the target client based on the D2D communication, and thus, it can be determined that the target server is online.
Corresponding to the second implementation manner of sending the status acquisition information to the OCF resource device, the target client may further implement the technical process of step 202 based on the following determination logic to determine whether the target server is online.
A4, when the target client receives the first disconnection instruction information, if the target client also receives the second disconnection instruction information, determining that the target server is online.
Since the first disconnection indication information indicates that the connection state of the D2C communication of the target server is the disconnected state, when the target client receives the first disconnection indication information, it may be determined that the connection state of the D2C communication of the target server is the disconnected state. Meanwhile, since the second disconnection indication information is transmitted by the target server to the target client based on the D2D communication, if the target client receives the first disconnection indication information and also receives the second disconnection indication information, it is described that the connection state of the D2D communication of the target server is an undisrupted state. At this time, although the target server cannot perform data interaction with the target client based on the D2C communication, the target server can perform data interaction with the target client based on the D2D communication, and thus, it can be determined that the target server is online.
Optionally, in this embodiment of the application, the target client may start a timer when receiving the first disconnection indication information, and may determine that the server is online when the target client receives the second disconnection indication information before the timer expires when receiving the first disconnection indication information.
B4, when the target client receives the first disconnection indication information, if the target client does not receive the second disconnection indication information, determining that the target server is offline.
Similarly to the judgment logic a4, since the first disconnection indication information indicates that the connection status of the D2C communication of the target server is the disconnected status, when the target client receives the first disconnection indication information, it may be determined that the connection status of the D2C communication of the target server is the disconnected status. Meanwhile, since the second disconnection indication information is transmitted by the target server to the target client based on the D2D communication, if the target client cannot receive the second disconnection indication information when receiving the first disconnection indication information, it is described that the connection state of the D2D communication of the target server is a disconnected state. At this time, the target server cannot perform data interaction with the target client based on the D2C communication or the D2D communication, and thus it can be determined that the target server is offline.
Optionally, in this embodiment of the application, the target client may start a timer when receiving the first disconnection indication information, and determine that the target server is offline if the target client does not receive the second disconnection indication information before the timer expires when receiving the first disconnection indication information.
Referring to fig. 5, a block diagram of an apparatus 500 for determining a device status according to an embodiment of the present application is shown, where the apparatus 500 for determining a device status may be configured in the target client described above. As shown in fig. 5, the apparatus 500 for determining the device status may include: a sending module 501 and a determining module 502.
The sending module 501 is configured to send status acquisition information to an OCF resource device; the OCF resource equipment comprises a server and a cloud, and the state acquisition information is used for acquiring the connection state of D2D communication of the server or the connection state of D2C communication of the server.
The determining module 502 is configured to determine whether the server is online based on the acquired connection state of the D2D communication and/or the connection state of the D2C communication, and based on the receiving state of the current client; the receiving state includes that the client receives information of the OCF resource equipment or the client does not receive the information of the OCF resource equipment.
In an embodiment of the present application, the sending module 501 is specifically configured to: sending a first D2C status acquisition request to the cloud, wherein the first D2C status acquisition request is used for indicating the cloud to send first D2C status indication information to a client, and the first D2C status indication information is used for indicating the connection status of D2C communication of the server.
In an embodiment of the present application, the sending module 501 is further configured to: and sending D2D state acquisition information to the server, wherein the D2D state acquisition information is used for instructing the server to send response information aiming at the D2D state acquisition information to the client based on the D2D communication.
In an embodiment of the application, the first D2C status indication information includes first disconnection indication information, where the first disconnection indication information is used to indicate that the connection status of the D2C communication of the server is a disconnected status, and the determining module 502 is specifically configured to: under the condition that the first disconnection indication information is received, if the response information is received, the server side is determined to be on line; and under the condition of receiving the first disconnection indication information, if the response information is not received, determining that the server side is offline.
In an embodiment of the present application, the determining module 502 is specifically configured to: under the condition that the response information is not received, if the first disconnection indicating information is received, determining that the server side is offline; and under the condition that the response information is not received, if the first disconnection indication information is not received, determining that the server side is online.
In an embodiment of the present application, the determining module 502 is specifically configured to: and under the condition that the response information is not received, a timer is started, under the condition that the response information is not received, if the first disconnection indication information is received before the timer is overtime, the server is determined to be offline, and under the condition that the response information is not received, if the first disconnection indication information is not received before the timer is overtime, the server is determined to be online.
In one embodiment of the present application, the D2D status acquisition information is heartbeat information, and the response information is response heartbeat information.
In one embodiment of the present application, the D2D status acquisition information is a device discovery request, and the response information is information in response to the device discovery request.
In an embodiment of the present application, the sending module 501 is specifically configured to: and sending the device discovery request to the server side in a unicast mode.
In an embodiment of the present application, the sending module 501 is specifically configured to: and sending the equipment discovery request to equipment in the OCF local area network where the client is located in a multicast mode, wherein the equipment discovery request carries the identifier of the server.
In an embodiment of the present application, the sending module 501 is specifically configured to: and sending a second D2C state acquisition request to the server, wherein the second D2C state acquisition request is used for indicating the server to send second D2C state indication information to the client based on D2D communication, and the second D2C state indication information is used for indicating the connection state of D2C communication of the server.
In an embodiment of the application, the second D2C status indication information includes second disconnection indication information, where the second disconnection indication information is used to indicate that the connection status of the D2C communication of the server is a disconnected status, and the determining module 502 is specifically configured to: and when the second disconnection indicating information is received, determining that the server side is on line.
In an embodiment of the present application, the determining module 502 is specifically configured to: under the condition that the first disconnection indication information is received, if the second disconnection indication information is received, the server side is determined to be on line; and under the condition of receiving the first disconnection indication information, if the second disconnection indication information is not received, determining that the server side is offline.
In an embodiment of the present application, the determining module 502 is specifically configured to: starting a timer under the condition that the first disconnection indication information is received; under the condition that the first disconnection indicating information is received, if the second disconnection indicating information is received before the timer is overtime, the server is determined to be on line; and under the condition of receiving the first disconnection indication information, if the second disconnection indication information is not received before the timer is overtime, determining that the server side is offline.
In one embodiment of the application, the server includes a cloud access configuration resource, where the cloud access configuration resource includes first connection status indication information, and the first connection status indication information is used to indicate a connection status of D2C communication of the server; the second D2C status get request is a request for the cloud access configuration resource.
In an embodiment of the application, the first connection status indication information is at least one of an attribute value of a server connection status attribute and an attribute value of an error handling attribute of the cloud access configuration resource.
In one embodiment of the present application, the second D2C status indication information includes the first connection status indication information.
In an embodiment of the present application, the second D2C status indication information further includes an identifier of the server.
In an embodiment of the present application, the second D2C status acquisition request is a subscription request for the cloud access configuration resource.
In an embodiment of the present application, the second D2C status obtaining request is a read request for the cloud access configuration resource.
In an embodiment of the present application, the sending module 501 is specifically configured to: and periodically sending a reading request aiming at the cloud access configuration resource to the server.
In an embodiment of the present application, the first D2C status indication information is used for indicating a connection status of D2C communication of one of the servers; alternatively, the first and second electrodes may be,
the first D2C status indication information is used for indicating the connection status of D2C communication of at least two of the servers.
In one embodiment of the present application, the cloud includes a server connection status resource, where the server connection status resource includes second connection status indication information, and the second connection status indication information is used to indicate a connection status of D2C communication of the server;
the first D2C status acquisition request is a request for the server connection status resource.
In one embodiment of the present application, the first D2C status indication information includes the second connection status indication information and an identifier of the server.
In an embodiment of the present application, the first D2C status indication information further includes a resource type of the server connection status resource.
In an embodiment of the present application, the first D2C status acquisition request carries an identifier of the server.
In an embodiment of the present application, the first D2C status obtaining request carries an identifier of the client.
In an embodiment of the present application, the first D2C state acquisition request carries an access token, and the access token is a token issued by the cloud to the client for representing a legal access identity of the client.
In an embodiment of the present application, the first D2C status acquisition request is a subscription request for the server connection status resource.
In an embodiment of the present application, the first D2C status obtaining request is a read request for the server connection status resource.
In an embodiment of the present application, the sending module 501 is specifically configured to: and periodically sending a reading request aiming at the server side connection state resource to the cloud side.
In an embodiment of the application, the server connection state resource includes a resource type attribute and a server information list, an attribute value of the resource type attribute is used to indicate a type of the server connection state resource, the server information list includes at least one piece of server information, each piece of server information corresponds to a server that establishes D2C communication connection with the cloud, each piece of server information includes a device identifier attribute and a connection state attribute, an attribute value of the device identifier attribute is used to indicate a device identifier of the corresponding server, and an attribute value of the connection state attribute is used to indicate a connection state of D2C communication of the corresponding server.
The embodiment of the present application further provides another apparatus 600 for determining a device status, where the apparatus 600 for determining a device status may be configured in the target client as described above, as shown in fig. 6, and in addition to the modules included in the apparatus 500 for determining a device status, optionally, the apparatus 600 for determining a device status may further include a determining module 503.
The determining module 503 is configured to: and judging whether the client and the server access the same OCF local area network or not.
The sending module 501 is specifically configured to send the D2D status acquisition information to the server if the client and the server access the same OCF local area network.
In an embodiment of the present application, the determining module 502 is further configured to: and when the first disconnection indication information is received and the client and the server do not access the same OCF local area network, determining that the server is offline.
In an embodiment of the present application, the determining module 503 is specifically configured to: and judging whether the client and the server access the same OCF local area network or not according to at least one of the geographic position of the client, the network information of the OCF local area network accessed by the client and the security domain information of the client.
The implementation principle and technical effect of the apparatus for determining a device state provided by the above embodiment are similar to those of the above method embodiment, and are not described herein again.
For specific limitations of the means for determining the device status, reference may be made to the above limitations of the method for determining the device status, which are not described herein again. The various modules in the above means for determining the state of the device may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing resource query processing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of determining a state of a device.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or fewer components than those shown, or may combine certain components, or have a different arrangement of components.
In an embodiment of the present application, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the method as shown in any of the above method embodiments when executing the computer program.
For example, the processor, when executing the computer program, implements the steps of:
sending state acquisition information to OCF resource equipment; the OCF resource equipment comprises a server and a cloud, and the state acquisition information is used for acquiring the connection state of D2D communication of the server or the connection state of D2C communication of the server;
determining whether the server is online or not based on the acquired connection state of the D2D communication and/or the connection state of the D2C communication and the receiving state of the current client; the receiving state includes that the client receives the information of the OCF resource equipment or the client does not receive the information of the OCF resource equipment.
The implementation principle and technical effect of the computer device provided by the above embodiment are similar to those of the above method embodiment, and are not described herein again.
In an embodiment of the application, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the method as shown in any one of the above-mentioned method embodiments.
For example, the computer program, when executed by a processor, may implement the steps of:
sending state acquisition information to OCF resource equipment; the OCF resource equipment comprises a server and a cloud, and the state acquisition information is used for acquiring the connection state of D2D communication of the server or the connection state of D2C communication of the server;
determining whether the server is online or not based on the acquired connection state of the D2D communication and/or the connection state of the D2C communication and the receiving state of the current client; the receiving state includes that the client receives the information of the OCF resource equipment or the client does not receive the information of the OCF resource equipment.
The implementation principle and technical effect of the computer-readable storage medium provided by the above embodiments are similar to those of the above method embodiments, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Reference to "and/or" in the embodiments of the present application may characterize 3 possible cases, where a and/or B may characterize the presence of a alone, the presence of B alone, and the presence of both a and B.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-described embodiments are merely illustrative of several implementations of the present application, which are described in more detail and detail, but not limiting
And are not to be construed as limitations on the scope of the claims. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (35)

  1. A method for determining a device status, the method being used in a client, the method comprising:
    sending state acquisition information to OCF resource equipment; the OCF resource equipment comprises a server and a cloud, and the state acquisition information is used for acquiring the connection state of D2D communication of the server or the connection state of D2C communication of the server;
    determining whether the server side is online or not based on the acquired connection state of the D2D communication and/or the connection state of the D2C communication and the current receiving state of the client side; the receiving state includes that the client receives the information of the OCF resource equipment or the client does not receive the information of the OCF resource equipment.
  2. The method of claim 1, wherein the sending the status acquisition information to the OCF resource device comprises:
    sending a first D2C status acquisition request to the cloud, wherein the first D2C status acquisition request is used for indicating the cloud to send first D2C status indication information to a client, and the first D2C status indication information is used for indicating the connection status of D2C communication of the server.
  3. The method of claim 2, wherein the sending the status acquisition information to the OCF resource device further comprises:
    sending D2D status acquisition information to the server, wherein the D2D status acquisition information is used for instructing the server to send response information aiming at the D2D status acquisition information to the client based on D2D communication.
  4. The method according to claim 3, wherein the first D2C status indication information includes first disconnection indication information, the first disconnection indication information is used for indicating that the connection status of the D2C communication of the server is a disconnection status, and the determining whether the server is online based on the acquired connection status of the D2D communication and/or the connection status of the D2C communication and based on the current receiving status of the client comprises:
    under the condition that the first disconnection indication information is received, if the response information is received, the server side is determined to be on line;
    and under the condition of receiving the first disconnection indication information, if the response information is not received, determining that the server side is offline.
  5. The method according to claim 3, wherein the first D2C status indication information includes first disconnection indication information, the first disconnection indication information is used for indicating that the connection status of the D2C communication of the server is a disconnection status, and the determining whether the server is online based on the acquired connection status of the D2D communication and/or the connection status of the D2C communication and based on the current receiving status of the client comprises:
    under the condition that the response information is not received, if the first disconnection indicating information is received, determining that the server side is offline;
    and under the condition that the response information is not received, if the first disconnection indication information is not received, determining that the server side is online.
  6. The method of claim 5, further comprising:
    starting a timer under the condition that the response information is not received;
    determining that the server is offline if the first disconnection indication information is received under the condition that the response information is not received, including:
    under the condition that the response information is not received, if the first disconnection indication information is received before the timer is overtime, determining that the server side is offline;
    determining that the server is online if the first disconnection indication information is not received under the condition that the response information is not received, including:
    and under the condition that the response information is not received, if the first disconnection indication information is not received before the timer is overtime, determining that the server is online.
  7. The method according to any one of claims 3 to 6, wherein the D2D status acquisition information is heartbeat information, and the response information is response heartbeat information; alternatively, the first and second electrodes may be,
    the D2D status acquisition information is a device discovery request, and the response information is information in response to the device discovery request.
  8. The method according to claim 7, wherein the sending D2D status acquisition information to the server comprises:
    and sending the device discovery request to the server side in a unicast mode.
  9. The method according to claim 7, wherein the sending D2D status acquisition information to the server comprises:
    and sending the equipment discovery request to equipment in the OCF local area network where the client is located in a multicast mode, wherein the equipment discovery request carries the identifier of the server.
  10. The method according to any one of claims 3 to 6, wherein before sending the D2D status acquisition information to the server, the method further comprises:
    judging whether the client and the server access the same OCF local area network or not;
    correspondingly, the sending D2D status acquisition information to the server includes:
    and if the client and the server access the same OCF local area network, sending the D2D state acquisition information to the server.
  11. The method of claim 10, wherein the first D2C status indication information comprises first disconnection indication information indicating that the connection status of the D2C communication of the server is a disconnected status, and wherein the method further comprises:
    and if the first disconnection indication information is received and the client and the server do not access the same OCF local area network, determining that the server is offline.
  12. The method of claim 10, wherein the determining whether the client and the server access the same OCF local area network comprises:
    and judging whether the client and the server access the same OCF local area network or not according to at least one of the geographic position of the client, the network information of the OCF local area network accessed by the client and the security domain information of the client.
  13. The method of claim 2, wherein the sending the status acquisition information to the OCF resource device further comprises:
    and sending a second D2C state acquisition request to the server, wherein the second D2C state acquisition request is used for indicating the server to send second D2C state indication information to the client based on D2D communication, and the second D2C state indication information is used for indicating the connection state of D2C communication of the server.
  14. The method according to claim 13, wherein the second D2C status indication information includes second disconnection indication information, the second disconnection indication information is used to indicate that the connection status of the D2C communication of the server is a disconnected status, and the determining whether the server is online based on the acquired connection status of the D2D communication and/or the connection status of the D2C communication and based on the current receiving status of the client includes:
    and when the second disconnection indicating information is received, determining that the server side is on line.
  15. The method of claim 13, wherein the first D2C status indication information includes first disconnection indication information, the first disconnection indication information is used to indicate that the connection status of the D2C communication of the server is a disconnected status, the second D2C status indication information includes second disconnection indication information, the second disconnection indication information is used to indicate that the connection status of the D2C communication of the server is a disconnected status, the determining whether the server is online based on the acquired connection status of the D2D communication and/or the connection status of the D2C communication, and the current reception status of the client includes:
    under the condition of receiving the first disconnection indicating information, if the second disconnection indicating information is received, determining that the server side is on line;
    and under the condition of receiving the first disconnection indication information, if the second disconnection indication information is not received, determining that the server side is offline.
  16. The method of claim 15, further comprising:
    starting a timer under the condition that the first disconnection indication information is received;
    the determining that the server is online if the second disconnection indication information is received under the condition that the first disconnection indication information is received includes:
    under the condition that the first disconnection indicating information is received, if the second disconnection indicating information is received before the timer is overtime, the server is determined to be on line;
    the determining that the server is offline if the second disconnection indication information is not received under the condition that the first disconnection indication information is received includes:
    and under the condition of receiving the first disconnection indication information, if the second disconnection indication information is not received before the timer is overtime, determining that the server side is offline.
  17. The method according to any one of claims 13 to 16, wherein the server includes a cloud access configuration resource, and the cloud access configuration resource includes first connection status indication information, and the first connection status indication information is used to indicate a connection status of D2C communication of the server;
    the second D2C status acquisition request is a request for the cloud access configuration resource.
  18. The method of claim 17, wherein the first connection status indication information is at least one of an attribute value of a server connection status attribute and an attribute value of an error handling attribute of the cloud access configuration resource.
  19. The method according to claim 17 or 18, wherein the second D2C status indication information comprises the first connection status indication information.
  20. The method of claim 19, wherein the second D2C status indication information further includes an identification of the server.
  21. The method according to any one of claims 17 to 20, wherein the second D2C status acquisition request is a subscription request for the cloud access configuration resource; alternatively, the first and second electrodes may be,
    the second D2C status acquisition request is a read request for the cloud access configuration resource.
  22. The method according to claim 21, wherein the sending a second D2C status acquisition request to the server comprises:
    and periodically sending a reading request aiming at the cloud access configuration resource to the server.
  23. The method according to any one of claims 2 to 22, wherein the first D2C status indication information is used for indicating a connection status of D2C communication of one of the service terminals; alternatively, the first and second electrodes may be,
    the first D2C status indication information is used for indicating the connection status of D2C communication of at least two of the servers.
  24. The method according to any one of claims 2 to 22, wherein the cloud includes a server connection status resource, and the server connection status resource includes second connection status indication information, where the second connection status indication information is used to indicate a connection status of D2C communication of the server;
    the first D2C status acquisition request is a request for the server connection status resource.
  25. The method of claim 24, wherein the first D2C status indication information comprises the second connection status indication information and an identity of the server.
  26. The method of claim 25, wherein the first D2C status indication information further includes a resource type of the server side connection status resource.
  27. The method according to any of claims 2 to 26, wherein the first D2C status acquisition request carries an identifier of the server.
  28. The method according to any of claims 2 to 26, wherein the first D2C status acquisition request carries an identity of the client.
  29. The method according to any one of claims 2 to 26, wherein the first D2C state acquisition request carries an access token, and the access token is a token issued by the cloud to the client for characterizing a legitimate access identity of the client.
  30. The method of claim 24, wherein the first D2C status acquisition request is a subscription request for the server side connection status resource; alternatively, the first and second electrodes may be,
    the first D2C status acquisition request is a read request for the server connection status resource.
  31. The method of claim 30, wherein sending a first D2C status acquisition request to the cloud comprises:
    and periodically sending a reading request aiming at the server side connection state resource to the cloud side.
  32. The method of claim 24, wherein the server connection status resource comprises a resource type attribute and a server information list, an attribute value of the resource type attribute is used for indicating a type of the server connection status resource, the server information list comprises at least one piece of server information, each piece of server information corresponds to a server that establishes a D2C communication connection with the cloud, each piece of server information comprises a device identifier attribute and a connection status attribute, an attribute value of the device identifier attribute is used for indicating a device identifier of the corresponding server, and an attribute value of the connection status attribute is used for indicating a connection status of D2C communication of the corresponding server.
  33. An apparatus for determining device status, wherein the apparatus is used in a client, the apparatus comprising
    The sending module is used for sending the state acquisition information to the OCF resource equipment; the OCF resource equipment comprises a server and a cloud, and the state acquisition information is used for acquiring the connection state of D2D communication of the server or the connection state of D2C communication of the server;
    the determining module is used for determining whether the server side is online or not based on the acquired connection state of the D2D communication and/or the connection state of the D2C communication and the current receiving state of the client side; the receiving state includes that the client receives the information of the OCF resource equipment or the client does not receive the information of the OCF resource equipment.
  34. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program performs the steps of the method according to any of claims 1 to 32.
  35. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 32.
CN202080071391.XA 2020-01-02 2020-01-02 Method, device, equipment and storage medium for determining equipment state Active CN114556891B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/070156 WO2021134766A1 (en) 2020-01-02 2020-01-02 Method, apparatus and device for determining device state, and storage medium

Publications (2)

Publication Number Publication Date
CN114556891A true CN114556891A (en) 2022-05-27
CN114556891B CN114556891B (en) 2024-01-30

Family

ID=76685819

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202080071391.XA Active CN114556891B (en) 2020-01-02 2020-01-02 Method, device, equipment and storage medium for determining equipment state

Country Status (2)

Country Link
CN (1) CN114556891B (en)
WO (1) WO2021134766A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114339839A (en) * 2022-01-05 2022-04-12 深圳华芯信息技术股份有限公司 Equipment 3G or 4G network configuration method, system, equipment end and APP end

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106792023A (en) * 2016-12-19 2017-05-31 Tcl集团股份有限公司 A kind of mobile terminal controls the method and system of intelligent television application
CN107493294A (en) * 2017-09-04 2017-12-19 上海润欣科技股份有限公司 A kind of secure accessing and management control method of the OCF equipment based on rivest, shamir, adelman
CN108702389A (en) * 2016-02-18 2018-10-23 相信环球有限公司 For being remotely controlled IOT(Internet of Things)The framework of equipment
CN108848159A (en) * 2018-06-14 2018-11-20 电子科技大学 A kind of internet of things equipment interoperability dispatching method
US20190260707A1 (en) * 2016-07-01 2019-08-22 Intel IP Corporation Communications in internet-of-things devices

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018208287A1 (en) * 2017-05-09 2018-11-15 Intel Corporation Device discovery
KR20190069284A (en) * 2017-12-11 2019-06-19 한국전자통신연구원 Method of converting and interworking ocf resourse of internet service, and an apparatus performing the same
CN109547524B (en) * 2018-09-30 2022-07-05 青岛海尔科技有限公司 User behavior storage method, device, equipment and storage medium based on Internet of things
CN110035058B (en) * 2019-02-28 2021-07-06 Oppo广东移动通信有限公司 Resource request method, device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108702389A (en) * 2016-02-18 2018-10-23 相信环球有限公司 For being remotely controlled IOT(Internet of Things)The framework of equipment
US20190260707A1 (en) * 2016-07-01 2019-08-22 Intel IP Corporation Communications in internet-of-things devices
CN106792023A (en) * 2016-12-19 2017-05-31 Tcl集团股份有限公司 A kind of mobile terminal controls the method and system of intelligent television application
CN107493294A (en) * 2017-09-04 2017-12-19 上海润欣科技股份有限公司 A kind of secure accessing and management control method of the OCF equipment based on rivest, shamir, adelman
CN108848159A (en) * 2018-06-14 2018-11-20 电子科技大学 A kind of internet of things equipment interoperability dispatching method

Also Published As

Publication number Publication date
CN114556891B (en) 2024-01-30
WO2021134766A1 (en) 2021-07-08

Similar Documents

Publication Publication Date Title
CN109525990B (en) Wireless screen projection method and device, computer equipment and storage medium
US20210337046A1 (en) Intelligent scheduling method, terminal device, edge node cluster and intelligent scheduling system
CN110602169B (en) Service calling method and device, computer equipment and storage medium
CN111343236A (en) Method, device and communication system for communication between server and client
CN108595280B (en) Interface adaptation method and device, computer equipment and storage medium
CN111107176A (en) Data transmission method and device, computer equipment and storage medium
CN111343286A (en) Network access system and network access method
CN115023919A (en) Firewall rule updating method and device, server and storage medium
CN114556891A (en) Method, device, equipment and storage medium for determining equipment state
CN112448845B (en) Internet of things network distribution method based on IGRS standard, intelligent terminal and storage medium
CN112492004B (en) Method, device, system and storage medium for establishing local communication link
CN112202795A (en) Data processing method, gateway equipment and medium
WO2014015525A1 (en) Method and device for querying for user online state
CN116489762A (en) Access registration method, device, system, communication equipment and storage medium
CN112733051A (en) Websocket-based information push management system and method
CN111901395A (en) Multi-cluster switching method and device
WO2023098233A1 (en) Device connection switching method and apparatus, electronic device, and computer readable storage medium
CN108632355B (en) Routing method for household appliance network, control terminal, readable storage medium and equipment
US20140189012A1 (en) Communication System, Non-Transitory Computer-Readable Medium Storing Communicaton Program and Communication Device
WO2019067892A1 (en) Service registration based on service capabilities requirements and preferences
CN111385324A (en) Data communication method, device, equipment and storage medium
CN111641664B (en) Crawler equipment service request method, device and system and storage medium
CN111385371B (en) MAC address acquisition method, device and equipment
CN110753921B (en) Query request processing method, device, computer equipment and storage medium
CN113746909A (en) Network connection method, device, electronic equipment and computer readable 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