CN116668211A - Communication method and device - Google Patents

Communication method and device Download PDF

Info

Publication number
CN116668211A
CN116668211A CN202211329866.8A CN202211329866A CN116668211A CN 116668211 A CN116668211 A CN 116668211A CN 202211329866 A CN202211329866 A CN 202211329866A CN 116668211 A CN116668211 A CN 116668211A
Authority
CN
China
Prior art keywords
terminal device
terminal equipment
server
terminal
state information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211329866.8A
Other languages
Chinese (zh)
Inventor
肖利军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211329866.8A priority Critical patent/CN116668211A/en
Publication of CN116668211A publication Critical patent/CN116668211A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)
  • Communication Control (AREA)

Abstract

The application provides a communication method and a device, wherein the method is applied to terminal equipment, a communication link is arranged between the terminal equipment and a server, and the method comprises the following steps: determining whether state information to be sent to a server exists in the terminal equipment in the first time; and if the state information to be sent to the server does not exist in the terminal equipment in the first time, disconnecting the communication link. It can be seen that, because the state information to be sent to the server does not exist in the terminal equipment in the first time, the terminal equipment breaks the communication link, so that the problem of high energy consumption of the terminal equipment caused by the maintenance of the communication link by the terminal equipment can be solved.

Description

Communication method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a communications method and apparatus.
Background
Currently, the terminal device may interact with the server through a Message queue telemetry transmission (Message Queuing TelemetryTransport, MQTT) connection. In general, the MQTT connection between the terminal device and the server relies on the terminal device and the server maintaining periodic heartbeat packets, such as the terminal device sending heartbeat packets to the server every 1 minute interval. This results in a high power consumption of the terminal device.
Disclosure of Invention
The application provides a communication method and a communication device, which can reduce the energy consumption of terminal equipment.
In a first aspect, a communication method is provided, the method being applied to a terminal device, the terminal device and a server having a communication link therebetween, the method comprising: determining whether state information to be sent to a server exists in the terminal equipment in the first time; and if the state information to be sent to the server does not exist in the terminal equipment in the first time, disconnecting the communication link. It can be seen that, because the state information to be sent to the server does not exist in the terminal equipment in the first time, the terminal equipment breaks the communication link, so that the problem of high energy consumption of the terminal equipment caused by the maintenance of the communication link by the terminal equipment can be solved.
Optionally, with reference to the first aspect, the method further includes: starting a first timer at a first time, wherein the first time is the time when the terminal equipment sends first state information to the server through the communication link, and the first time is the running time of the first timer; determining whether there is status information to be sent to the server in the terminal device in a first time includes: it is determined whether there is status information to be sent to the server in the terminal device before the first timer expires. This defines the moment when the terminal device starts the first timer, and thus it can be determined whether there is status information to be sent to the server in the terminal device before the first timer expires.
Optionally, with reference to the first aspect, the method further includes: determining the power consumption of the terminal equipment; the first time is determined based on the power consumption of the terminal device. This means that the first time can be determined in dependence of the power consumption of the terminal device, enabling a dynamic adjustment of the first time.
Optionally, with reference to the first aspect, the method further includes: acquiring a plurality of historical time intervals, wherein each historical time interval in the plurality of historical time intervals is a time interval for the terminal equipment to send historical state information to the server through the communication link twice; the first time is determined based on a plurality of historical time intervals. This means that the first time can be determined from a plurality of historical time intervals, enabling dynamic adjustment of the first time.
Optionally, with reference to the first aspect, determining the first time according to the plurality of historical time intervals includes: the first time is determined based on an average, a maximum, a minimum, or a median of the plurality of historical time intervals. This shows that the first time can be determined in different ways, increasing the flexibility in determining the first time.
Optionally, with reference to the first aspect, the method further includes: reestablishing a communication link when detecting that second state information to be sent to a server exists in the terminal equipment; the second status information is sent to the server over the communication link. This means that upon detection of the presence of second status information in the terminal device to be sent to the server, the communication link can be re-established so that the status information of the terminal device can still be sent to the server.
In a second aspect, a communication method is provided, the method being applied to a first server, the first server and a first terminal device having no communication link therebetween, the method comprising: receiving a first message sent by a second terminal device through a first communication link, wherein the first message comprises first state information of the second terminal device, and the first communication link is a communication link between a first server and the second terminal device; and sending a second message to the first terminal equipment through the second server, wherein the second message comprises the first state information. It can be seen that in the case that the first server and the first terminal device do not have a communication link, the first server may send the second message to the first terminal device through the second server, so that the first terminal device may still receive the data of the first server, and the problem of data loss caused by the fact that the first server and the first terminal device do not have a communication link is reduced.
Optionally, with reference to the second aspect, the first message further includes a cloud identifier of the second terminal device, and sending, by the second server, the second message to the first terminal device includes: according to the cloud identification of the second terminal equipment, acquiring the cloud identification of at least one terminal equipment under the same account associated with the second terminal equipment, wherein the identification of the at least one terminal equipment comprises the cloud identification of the first terminal equipment; acquiring an association relationship between a cloud identifier of a first terminal device and a device identifier of the first terminal device, and determining the device identifier of the first terminal device according to the cloud identifier of the first terminal device and the association relationship between the cloud identifier of the first terminal device and the device identifier of the first terminal device; and sending a second message to the first terminal equipment through the second server according to the equipment identifier of the first terminal equipment. It can be seen that the first server can obtain, according to the cloud identifier of the second terminal device, the cloud identifier of at least one terminal device associated with the same account number as the second terminal device, where the identifier of the at least one terminal device includes the cloud identifier of the first terminal device, so that the first server can obtain, according to the cloud identifier of the first terminal device, the device identifier of the first terminal device, and further can obtain, according to the device identifier of the first terminal device, to which device the second message needs to be pushed.
Optionally, with reference to the second aspect, the second message further includes a device identifier of the first terminal device.
Optionally, with reference to the second aspect, the device identifier of the first terminal device is a token of the first application running on the first terminal device.
Optionally, with reference to the second aspect, the second message further includes an identifier of the first application, where the identifier of the first application is determined by the first server according to the cloud identifier of the second terminal device and an association relationship between the plurality of cloud identifiers and the identifier of the first application.
In a third aspect, a communication method is provided, the method being applied to a first terminal device, the first terminal device and a first server not having a communication link therebetween, the method comprising: receiving, by the second server, a second message sent by the first server, where the second message includes first state information of the second terminal device; and updating the state information of the second terminal equipment according to the first state information. It can be seen that in the case that the first server and the first terminal device do not have a communication link, the first server may send the second message to the first terminal device through the second server, so that the first terminal device may still receive the data of the first server, and the problem of data loss caused by the fact that the first server and the first terminal device do not have a communication link is reduced.
Optionally, with reference to the third aspect, the receiving, by the second server, the second message sent by the first server includes: and when the first terminal equipment is in the awakening state or the first terminal equipment enters the awakening state from the sleep state, receiving a second message sent by the first server through the second server. This indicates that the first terminal device is in the awake state or that the first terminal device may acquire the second message when it enters the awake state from the sleep state.
Optionally, with reference to the third aspect, the second message further includes a device identifier of the first terminal device, and the method further includes: carrying out validity check on the second message according to the equipment identifier of the first terminal equipment; updating the state information of the second terminal device according to the first state information, including: and when the validity check is passed, updating the state information of the second terminal equipment according to the first state information. It can be seen that by performing validity check on the second message according to the device identifier of the first terminal device, when the validity check passes, the state information of the second terminal device is updated according to the first state information, which can effectively check the forged data for attacking the first terminal device, thereby improving the security of the first terminal device.
Optionally, with reference to the third aspect, the device identifier of the first terminal device is a token of the first application running on the first terminal device.
In a fourth aspect, there is provided a terminal device comprising means for performing the method according to any of the first or third aspects.
In a fifth aspect, a server is provided, the server comprising means for performing the method according to any of the second aspects.
In a sixth aspect, there is provided an electronic device comprising at least one processor and a communication interface, the at least one processor being configured to invoke a computer program stored in the at least one memory to perform the module of the method according to any of the first, second or third aspects.
A seventh aspect provides a communication system comprising a terminal device for implementing the method of any of the first aspects.
An eighth aspect provides a communication system comprising a first terminal device for implementing the method according to any of the third aspects and a first server for implementing the method according to any of the second aspects.
A ninth aspect provides a computer readable storage medium having a computer program stored therein, which when run on one or more processors, implements the method of any of the first, second or third aspects.
In a tenth aspect, there is provided a computer program product which, when run on one or more processors, implements the method of any of the first, second or third aspects.
In an eleventh aspect, there is provided a chip system comprising at least one processor, a memory and interface circuitry for providing information input/output to the at least one processor, the memory having stored therein a computer program for implementing a method according to any of the first, second or third aspects when the computer program is run on one or more processors.
Drawings
The drawings that are necessary for use in the description of the embodiments will be briefly described below.
Fig. 1 is a schematic diagram of a communication system according to an embodiment of the present application;
FIG. 2 is a schematic view of a scenario provided in an embodiment of the present application;
fig. 3 is a schematic flow chart of a communication method according to an embodiment of the present application;
fig. 4 is a flow chart of another communication method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device 50 according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device 60 according to an embodiment of the application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Wherein the terms "system" and "network" in embodiments of the application may be used interchangeably. Unless otherwise indicated, "/" indicates that the associated object is an "or" relationship, e.g., A/B may represent A or B; the "and/or" in the present application is merely an association relationship describing the association object, and indicates that three relationships may exist, for example, a and/or B may indicate: there are three cases, a alone, a and B together, and B alone, wherein a, B may be singular or plural. Also, in the description of the present application, unless otherwise indicated, "a plurality" means two or more than two. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be one or more. In addition, in order to facilitate the clear description of the technical solution of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the network element from the same item or similar items having substantially the same effect. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The following detailed description is provided for further details of the objects, technical solutions and advantages of the present application, and it should be understood that the following description is only a specific embodiment of the present application, and is not intended to limit the scope of the present application, and any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of the present application.
In various embodiments of the application, where no special description or logic conflict exists, terms and/or descriptions between the various embodiments are consistent and may reference each other, and features of the various embodiments may be combined to form new embodiments based on their inherent logic.
The system architecture and the service scenario of the embodiment of the present application are described below. It should be noted that, the system architecture and the service scenario described in the present application are for more clearly describing the technical solution of the present application, and do not constitute a limitation on the technical solution provided by the present application, and those skilled in the art can know that, with the evolution of the system architecture and the appearance of the new service scenario, the technical solution provided by the present application is applicable to similar technical problems.
Referring to fig. 1, fig. 1 is a schematic diagram of a communication system according to an embodiment of the present application. As shown in fig. 1, in 1-1 of fig. 1, the communication system includes a terminal device 10 and a device cloud 11, and a specific communication link between the terminal device 10 and the device cloud 11. In the present application, the communication link may also be referred to as a communication channel. Alternatively, the communication link between the terminal device and the device cloud may be, for example, a message queue telemetry transport (message queue telemetry transport, MQTT) communication link, i.e., an MQTT long connection. The terminal device 10 may send status information to the device cloud 11 via the communication link. In the present application, the status information is used to indicate the status of the function provided by the terminal device, for example, the status information may be used to indicate whether the function provided by the terminal device is in an on state or an off state. The functions provided by the terminal device may for example comprise one of the following: and applying a connection function and a call sharing function. The application connection may be understood as that when a user uses an application in one terminal device, the user may connect the use state of the application in another terminal device that meets the connection condition, and continue to use the application. In the present application, an application may also be referred to as an application program (APP), which may be a computer program that performs one or more specific functions. It may have a visual display interface that can interact with the user; alternatively, the user may not be able to interact with the display interface without being visually displayed. By way of example, applications may be divided into third party applications and system applications, wherein the third party applications may be understood as applications installed by a user on a terminal device, such as one or more of applications with navigation functions, applications with instant messaging functions, etc.; a system application may be understood as an application preset by the operating system, such as an application with a dialing function, etc. Call sharing can be understood as: different users can realize real-time conversation, content sharing, message interaction and the like through the terminal equipment. Generally, when detecting that the state information in the terminal device 10 changes, the state information to be sent to the device cloud 11 exists in the terminal device 10, so that new state information may be sent to the device cloud 11, or when detecting that the position of the terminal device 10 changes, the state information to be sent to the device cloud 11 exists in the terminal device 10, so that current state information may be sent to the device cloud 11. Referring to fig. 2, fig. 2 is a schematic view of a scene provided by an embodiment of the present application. As shown in fig. 2, in 2-1 of fig. 2, when the user clicks a button 201A of an application continuation function on the screen of the terminal device 200A, the application continuation function provided by the terminal device is turned on. In addition, it can be seen that the button 202A of the call sharing function on the screen of the terminal device 200 is in an off state. That is, when it is detected that the state information in the terminal device 200 changes, the state information to be transmitted to the device cloud 203A exists in the terminal device 200A, and thus new state information may be transmitted to the device cloud 203A, which may be used to indicate that the application continuation function provided by the terminal device is in an on state and the call sharing function provided by the terminal device is in an off state. In fig. 2-2, when the terminal device 201B moves from the left side of the large screen device 200B to the right side of the large screen device 200B, state information to be transmitted to the device cloud 202B exists in the terminal device 201B, and the terminal device 201B may transmit the current state information to the device cloud 202B.
In 1-2 of fig. 1, the communication system includes a terminal device 20, a terminal device 21, a device cloud 22, and a push (push) cloud 23, where a communication link between the terminal device 21 and the device cloud 22 is disconnected, that is, the terminal device 21 and the device cloud 22 do not have a communication link, at this time, after the terminal device 20 sends status information to the device cloud 22, the device cloud 22 may send the status information to the terminal device 21 through the push cloud 23. Wherein, a communication link is provided between the device cloud 22 and the push cloud 23, and the communication link between the device cloud 22 and the push cloud 23 may be referred to as a push channel. Alternatively, the communication link between the device cloud 22 and the push cloud 23 may be a unidirectional communication link, that is, the device cloud 22 may send data to the push cloud 23, but the push cloud 23 cannot send data to the device cloud 22.
In the present application, the terminal device is an electronic device having data processing capability or data transmitting/receiving capability. The terminal device may be, for example, a mobile phone, a tablet (Pad), a Personal Computer (PC), a large screen device, a smart television, etc. The embodiment of the application does not limit the specific equipment form of the terminal equipment. The terminal device can be used as a master control device or a controlled device. The master device is usually an electronic device that can provide services including calls, videos, music and various other application software, and often serves as a device that is directly perceived and used by a user, and can control and modify the provision of a controlled device under the same account number associated with the master device. The master control device cannot be modified by other devices, so that the state information cannot be changed, and the state information cannot be reported to the device cloud through a communication link between the master control device and the device cloud. Further, when the communication link between the master control device and the device cloud is disconnected, the communication connection cannot be restored, and all messages need to be sent to the master control device through the communication link between the device cloud and the push cloud, but because the number of services carried by the push cloud is far greater than that of the device cloud, if the messages depend on the communication link between the device cloud and the push cloud completely, the timeliness of arrival of the messages is reduced greatly, so that the master control device can continue to use the MQTT long connection to meet the data transmission requirement. The controlled device generally refers to a terminal device that can provide a specific single function, service. The user can select to directly operate the controlled device to modify the state information, change the working state of the controlled device, and also can control the controlled device to modify the state information through the main control device. A common controlled device may be an internet of things (internet of things, ioT) device, including a router, an air conditioner, a washing machine, a desk lamp, and the like.
In the present application, a device cloud or push cloud may be used to receive status information. The device cloud and the push cloud may be referred to as a device cloud server and a push cloud server, respectively. The server mentioned in the embodiments of the present application may be one server, or may be a server cluster formed by a plurality of servers. Specifically, the server may include a server that centrally stores the state information, or may include a server cluster that is distributed and configured to store the state information in a distributed manner. For example, the distributed server may be a server cluster formed by a plurality of servers, where the cluster may include a cloud computing server, a content delivery network (Content Delivery Network, CDN) server, a network time protocol (Network Time Protocol, NTP), a domain name resolution system (Domain Name System, DNS) server, and the like, where the servers may coordinate with each other to perform functions of computing, data storage, communication, and the like, and for convenience of description, the individual servers, the distributed servers, and the server cluster are collectively referred to as a server in the embodiment of the present application.
Referring to fig. 3, fig. 3 is a flow chart of a communication method according to an embodiment of the present application. The server of the embodiment shown in fig. 3 is a device cloud server. The method includes, but is not limited to, the steps of:
301. The terminal device determines whether state information to be sent to the device cloud server exists in the terminal device in a first time, and a communication link is arranged between the terminal device and the device cloud server.
In the embodiment shown in fig. 3, the terminal device is not normally powered, i.e. the terminal device is a device that is not continuously powered by a power source, i.e. the terminal device is a device that requires various forms of power supply, such as batteries, solar energy, etc.
Wherein the terminal device may determine the first time by any one of the following means. What way is specifically adopted depends on the implementation of the terminal device, the definition of a pre-defined agreement or standard.
The method comprises the steps that firstly, terminal equipment determines power consumption of the terminal equipment; the terminal device determines a first time according to the power consumption of the terminal device. The determining, by the terminal device, the power consumption of the terminal device may include, for example: the terminal equipment determines the power consumption of the terminal equipment according to the time that each process in the terminal equipment occupies the central processing unit (central processing unit, CPU). Alternatively, the respective processes in the terminal device may be, for example, one or more processes of the first application running at the terminal device. The number of first applications may be one or more, and the first applications may be applications determined by the terminal device according to one or more of a frequency used by a user, a type of application, and the like, for example. One process of the first application may be, for example, one process of an application having a navigation function, one process of an application having an instant messaging function, or the like. The types of applications may include, for example, one or more of instant messaging, position location, entertainment, and the like. This means that the first time can be determined in dependence of the power consumption of the terminal device, enabling a dynamic adjustment of the first time.
The method comprises the steps that a terminal device obtains a plurality of historical time intervals, wherein each historical time interval in the plurality of historical time intervals is a time interval in which the terminal device sends historical state information to a device cloud server through a communication link twice; the terminal device determines a first time according to the plurality of historical time intervals. Optionally, the terminal device obtains a plurality of historical time intervals, including: the terminal device receives a plurality of historical time intervals transmitted by the device cloud server through a communication link. Optionally, the determining, by the terminal device, the first time according to the plurality of historical time intervals includes: the terminal device determines the first time according to an average value, a maximum value, a minimum value or a median of the plurality of historical time intervals. This means that the first time can be determined from a plurality of historical time intervals, enabling dynamic adjustment of the first time.
The third mode and the first time can be preconfigured in the terminal equipment.
The first time may be, for example, 5 minutes.
Optionally, the method may further include: the method comprises the steps that a terminal device starts a first timer at a first moment, wherein the first moment is the moment when the terminal device sends first state information to a device cloud server through a communication link, and the first moment is the running time of the first timer; the terminal device determining whether state information to be sent to the device cloud server exists in the terminal device in a first time, including: and determining whether state information to be sent to the device cloud server exists in the terminal device before the first timer is overtime. This defines the moment when the terminal device starts the first timer, and thus it can be determined whether there is status information to be sent to the device cloud server in the terminal device before the first timer expires.
Optionally, the method may further include: and when the first condition is met, the terminal equipment starts a communication connection disconnection mode. Wherein the first condition comprises at least one of: the terminal equipment detects a mode setting instruction, wherein the mode setting instruction is used for starting a communication connection disconnection mode; the terminal device detects that the power consumption of the terminal device is lower than the preset power consumption. The terminal device starts the communication connection disconnection mode, which can be understood as the terminal device performing steps 301-302. This indicates that the terminal device can open the communication connection disconnection mode when a certain condition is satisfied, and flexibility of the terminal device in opening the communication connection disconnection mode is improved.
Optionally, the method may further include: the method comprises the steps that terminal equipment sends a first registration request message to an equipment cloud server, wherein the first registration request message comprises equipment identification and account numbers of the terminal equipment, and the equipment identification and account numbers of the terminal equipment are used for establishing a communication link with the equipment cloud server; the terminal equipment receives a response message of a first registration request message sent by the equipment cloud server through a communication link between the terminal equipment and the equipment cloud server, wherein the response message of the first registration request message is used for indicating that the communication link between the terminal equipment and the equipment cloud server is successfully established. The device identifier of the terminal device may be, for example, a token (token) of a second application running on the terminal device, where the second application is an application having one or more of an application connection function, a call sharing function, and the like. The account number can be associated with other devices except the terminal device, that is, one account number can be associated with a plurality of terminal devices, and different terminal devices can be registered to the device cloud server by using the same account number, so that the master control device can discover and acquire other controlled devices under the account number, and further, the master control device can control and modify the state information of the controlled devices.
The first registration request message may further include a type identifier to which the terminal device belongs, and the type to which the terminal device belongs may include, for example, a super terminal device, a master device, or a controlled device. It should be understood that the type identifier to which the terminal device belongs may be, for example, a device type code, and the type identifier to which the terminal device belongs may be preconfigured in the terminal device. The response message of the first registration request message may further include a cloud identifier allocated by the device cloud server to the terminal device, that is, a cloud identifier of the terminal device. It should be understood that in the present application, the cloud identification of the terminal device may be used to uniquely identify the terminal device.
In a possible implementation manner, the response message of the first registration request message may further include a type identifier to which all terminal devices under the account belong, and the method further includes: if the controlled equipment identifier exists in the type identifiers of all the terminal equipment under the account, and the type identifier of the terminal equipment is the super terminal equipment identifier, the terminal equipment sends a second registration request message to the equipment cloud server through a communication link between the terminal equipment and the equipment cloud server, the second registration request message is used for registering the terminal equipment as the main control equipment, the terminal equipment receives a response message of the second registration request message sent by the equipment cloud server through the communication link, and the response message of the second registration request message is used for indicating that the terminal equipment is successfully registered as the main control equipment. The second registration request message may further include a cloud identifier of the terminal device. When the controlled equipment appears in the networking, namely, the controlled equipment appears in all terminal equipment under the same account, the terminal equipment can register an equipment role again according to the current requirement, and further, different service requirements can be better met. Meanwhile, it can be seen that the terminal device is a super terminal device and a master control device at the moment.
It should be noted that, when the controlled device identifier exists in the type identifiers to which all the terminal devices belong under the account, other super terminal devices except the terminal device under the account may also be registered as the master device, and the specific registration process is not repeated herein.
Optionally, the method may further include: the terminal equipment receives type identifiers of all terminal equipment under the updated account sent by the equipment cloud server through the communication link; if the controlled equipment identifier does not exist in the type identifiers of all the terminal equipment under the updated account, the terminal equipment sends an equipment role deleting message to the equipment cloud server through the communication link, the equipment role deleting message is used for deleting the main control equipment role of the terminal equipment, the terminal equipment receives a response message of the equipment role deleting message sent by the equipment cloud server through the communication link, and the response message of the equipment role deleting message is used for indicating that the main control equipment role of the terminal equipment is successfully deleted. The delete device role message may also include a cloud identification of the terminal device. The method indicates that when the last controlled device in the networking is off line, namely, when the controlled device does not exist in all the terminal devices under the same account, the terminal device can cancel the role of the main control device according to the current requirement, only the role of the super terminal device is reserved, and further different service requirements can be better met.
In another possible implementation manner, if the super terminal device identifier exists in the type identifiers to which all the terminal devices belong under the account, and the type identifier to which the terminal device belongs is the super terminal device identifier, the terminal device is still the super terminal device and is not registered as the master control device. Of course, other super terminal devices except the terminal device under the account number are not registered as the master control device. This may meet the interaction requirements between different superterminal devices.
Optionally, the method may further comprise step 302.
302. If the state information to be sent to the equipment cloud server does not exist in the terminal equipment in the first time, the terminal equipment breaks the communication link.
Optionally, the method may further include: when the existence of second state information to be sent to the equipment cloud server in the terminal equipment is detected, reestablishing a communication link between the terminal equipment and the equipment cloud server; and sending the second state information to the device cloud server through the communication link. This means that when it is detected that there is second status information within the terminal device to be sent to the device cloud server, the communication link may be re-established so that the status information of the terminal device may still be sent to the device cloud server.
It can be seen that, because the state information to be sent to the equipment cloud server does not exist in the terminal equipment in the first time, the terminal equipment breaks the communication link, so that the problem of high energy consumption of the terminal equipment caused by the maintenance of the communication link by the terminal equipment can be solved.
Referring to fig. 4, fig. 4 is a flow chart of another communication method according to an embodiment of the present application. The first server in the embodiment shown in fig. 4 is a device cloud server, and the second server is a push cloud server. The method includes, but is not limited to, the steps of:
401. the second terminal equipment sends a first message to the equipment cloud server through a first communication link, wherein the first message comprises first state information of the second terminal equipment, the first communication link is a communication link between the equipment cloud server and the second terminal equipment, and no communication link exists between the equipment cloud server and the first terminal equipment.
Correspondingly, the device cloud server receives a first message sent by the second terminal device through the first communication link.
The process of establishing the first communication link between the device cloud server and the second terminal device may refer to the process of establishing the communication link in fig. 3, which is not described herein.
It should be noted that, there is no communication link between the device cloud server and the first terminal device, for example, it may be understood that: the communication link between the device cloud server and the first terminal device has been broken.
Optionally, the first message further includes a cloud identifier of the second terminal device, and sending, by pushing the cloud server, the second message to the first terminal device includes: according to the cloud identification of the second terminal equipment, acquiring the cloud identification of at least one terminal equipment under the same account associated with the second terminal equipment, wherein the identification of the at least one terminal equipment comprises the cloud identification of the first terminal equipment; determining the equipment identifier of the first terminal equipment according to the cloud identifier of the first terminal equipment and the association relationship between the cloud identifier of the first terminal equipment and the equipment identifier of the first terminal equipment; and sending a second message to the first terminal equipment through the pushing cloud server according to the equipment identifier of the first terminal equipment. It can be seen that the device cloud server can obtain, according to the cloud identifier of the second terminal device, the cloud identifier of at least one terminal device associated with the same account number as the second terminal device, where the identifier of the at least one terminal device includes the cloud identifier of the first terminal device, so that the device cloud server can obtain, according to the cloud identifier of the first terminal device, the device identifier of the first terminal device, and further can obtain, according to the device identifier of the first terminal device, to which device the second message needs to be pushed.
In the application, the cloud identifier of the terminal equipment is the cloud identifier distributed by the equipment cloud server for the terminal equipment, and the cloud identifier of the terminal equipment can be used for uniquely identifying the terminal equipment.
The device identifier of the terminal device may be, for example, a token (token) of a first application running on the terminal device, where the first application is an application having one or more of an application connection function, a call sharing function, and the like.
The association relationship between the cloud identifier of the first terminal device and the device identifier of the first terminal device can be understood as: the cloud identification of the first terminal device and the device identification of the first terminal device. The cloud identification of the first terminal device and the device identification of the first terminal device may be stored in association by the device cloud server in the device cloud server.
402. And the equipment cloud server sends a second message to the first terminal equipment through the pushing cloud server, wherein the second message comprises the first state information.
Correspondingly, the first terminal device receives a second message sent by the device cloud server through the push cloud server.
Optionally, the receiving, by the first terminal device through the push cloud server, the second message sent by the device cloud server may include, for example: and when the first terminal equipment is in the awakening state or the first terminal equipment enters the awakening state from the sleep state, the first terminal equipment receives a second message sent by the equipment cloud server through the push cloud server. This indicates that the first terminal device is in the awake state or that the first terminal device may acquire the second message when it enters the awake state from the sleep state.
In the present application, the awake state refers to a state in which the terminal device can receive one or more of signaling, data, information, etc., whereas the sleep state refers to a state in which the terminal device cannot receive one or more of signaling, data, information, etc.
Optionally, the second message further comprises a device identification of the first terminal device.
Optionally, the second message further includes an identifier of the first application, where the identifier of the first application is determined by the device cloud server according to the cloud identifier of the second terminal device and an association relationship between the plurality of cloud identifiers and the identifier of the first application. The association relationship between the plurality of cloud identifications and the identification of the first application can be understood as follows: correspondence between the plurality of cloud identifications and the identification of the first application. Illustratively, cloud identification 1 corresponds to the identification of the first application, cloud identification 2 corresponds to the identification of the first application, and cloud identification 3 corresponds to the identification of the first application.
403. The first terminal device updates the state information of the second terminal device according to the first state information.
Optionally, the method further comprises: the first terminal equipment performs validity check on the second message according to the equipment identifier of the first terminal equipment; the first terminal device updates the state information of the second terminal device according to the first state information, and the method comprises the following steps: and when the validity check is passed, the first terminal equipment updates the state information of the second terminal equipment according to the first state information. It can be seen that by performing validity check on the second message according to the device identifier of the first terminal device, when the validity check passes, the state information of the second terminal device is updated according to the first state information, which can effectively check the forged data for attacking the first terminal device, thereby improving the security of the first terminal device.
The validity check of the second message by the first terminal device according to the device identifier of the first terminal device can be, for example, understood as: and the push service process in the first terminal equipment performs validity check on the second message according to the equipment identifier of the first terminal equipment. The push service process in the first terminal device compares the device identifier of the first terminal device with the device identifier stored in the first terminal device, so as to perform validity check on the second message. And when the validity check is not passed, the push service process in the first terminal equipment does not process the second message.
The first terminal device updates the state information of the second terminal device according to the first state information, for example, it can be understood that: and the push service process in the first terminal equipment sends the first state information to the process of the first application running on the first terminal equipment according to the identification of the first application, and the process of the first application running on the first terminal equipment updates the state information of the second terminal equipment into the first state information.
It can be seen that, under the condition that the device cloud server and the first terminal device do not have a communication link, the device cloud server can send the second message to the first terminal device by pushing the cloud server, so that the first terminal device can still receive the data of the device cloud server, and the problem of data loss caused by the fact that the device cloud server and the first terminal device do not have a communication link is solved.
The foregoing details of the method according to the embodiments of the present application and the apparatus according to the embodiments of the present application are provided below.
The embodiment of the application also provides a device for implementing any of the above methods, for example, an electronic device is provided, which includes a module (or means) for implementing each step executed by a terminal device or a device cloud server in any of the above methods.
For example, referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device 50 according to an embodiment of the present application, where the electronic device 50 includes a processing module 501, a sending module 502, and a receiving module 503, such as the communication method of any one of the embodiments shown in fig. 3 or fig. 4.
It should be understood that the division of the modules in the above apparatus is only a division of a logic function, and may be fully or partially integrated into one physical entity or may be physically separated when actually implemented. Furthermore, modules in the apparatus may be implemented in the form of processor-invoked software; the device comprises, for example, a processor, the processor being connected to a memory, the memory having instructions stored therein, the processor invoking the instructions stored in the memory to perform any of the above methods or to perform the functions of the modules of the device, wherein the processor is, for example, a general purpose processor, such as a central processing module (central processing unit, CPU) or microprocessor, and the memory is either internal to the device or external to the device. Alternatively, the modules in the apparatus may be implemented in the form of hardware circuitry, some or all of which may be implemented by the design of hardware circuitry, which may be understood as one or more processors; for example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), and the functions of some or all of the above modules are implemented by the design of the logic relationships of elements within the circuit; for another example, in another implementation, the hardware circuit may be implemented by a programmable logic device (programmable logic device, PLD), for example, a field programmable gate array (field programmable gate array, FPGA), which may include a large number of logic gates, and the connection relationship between the logic gates is configured by a configuration file, so as to implement the functions of some or all of the above modules. All modules of the above device may be realized in the form of processor calling software, or in the form of hardware circuits, or in part in the form of processor calling software, and in the rest in the form of hardware circuits.
In an embodiment of the present application, the processor is a circuit with signal processing capability, and in an implementation, the processor may be a circuit with instruction reading and running capability, such as a central processing module, a microprocessor, a graphics processor (graphics processing unit, GPU) (which may be understood as a microprocessor), or a digital signal processor (digital singnal processor, DSP), etc.; in another implementation, the processor may perform a function through a logical relationship of hardware circuitry that is fixed or reconfigurable, e.g., a hardware circuit implemented by the processor as an ASIC or PLD, such as an FPGA. In the reconfigurable hardware circuit, the processor loads the configuration document, and the process of implementing the configuration of the hardware circuit can be understood as a process of loading instructions by the processor to implement the functions of some or all of the above modules. Furthermore, a hardware circuit designed for artificial intelligence may be used, which may be understood as an ASIC, such as a neural network processing module (neural network processing unit, NPU) tensor processing module (tensor processing unit, TPU), deep learning processing module (deep learning processing unit, DPU), etc.
It will be seen that each module in the above apparatus may be one or more processors (or processing circuits) configured to implement the above methods, for example: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
Furthermore, the modules in the above apparatus may be all or part integrated together or may be implemented independently. In one implementation, these modules are integrated together and implemented in the form of a system-on-a-chip (SOC). The SOC may include at least one processor for implementing any of the methods or implementing the functions of the modules of the apparatus, where the at least one processor may be of different types, including, for example, a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, and the like.
The general flow performed by the electronic device 50 during display is the same whether the functional blocks are subdivided or combined. For example, the receiving module 503 and the transmitting module 502 in the electronic device 50 may be combined into a communication module. Typically, each module corresponds to a respective program code (or program instruction), which when executed on a processor causes the module to perform a respective flow to thereby implement a respective function. It should be noted that the implementation of the respective modules described below may correspond to the respective descriptions of the embodiments shown in fig. 3 or fig. 4.
In a possible implementation, the electronic device 50 may be a terminal device in the embodiment shown in fig. 3, or a module in a terminal device, such as a chip or an integrated circuit. The device comprises a processing module 501 and a sending module 502, wherein the description of each module is as follows:
a processing module 501, configured to: determining whether state information to be sent to a device cloud server exists in terminal devices in first time, wherein a communication link is arranged between the terminal devices and the server; and if the state information to be sent to the equipment cloud server does not exist in the terminal equipment in the first time, disconnecting the communication link.
Optionally, the processing module 501 is further configured to start a first timer at a first time, where the first time is a time when the terminal device sends first state information to the device cloud server through the communication link, and the first time is an operation time of the first timer; in determining whether there is status information to be sent to the device cloud server in the terminal device in the first time, the processing module 501 is configured to determine whether there is status information to be sent to the device cloud server in the terminal device before the first timer expires.
Optionally, the processing module 501 is further configured to: determining the power consumption of the terminal equipment; the first time is determined based on the power consumption of the terminal device.
Optionally, the processing module 501 is further configured to: acquiring a plurality of historical time intervals, wherein each historical time interval in the plurality of historical time intervals is a time interval for the terminal equipment to send historical state information to the equipment cloud server through a communication link twice; the first time is determined based on a plurality of historical time intervals.
Optionally, in determining the first time according to the plurality of historical time intervals, the processing module 501 is configured to determine the first time according to an average, a maximum, a minimum, or a median of the plurality of historical time intervals.
Optionally, the processing module 501 is further configured to reestablish a communication link when it is detected that there is second status information to be sent to the device cloud server in the terminal device; the sending module 502 is further configured to send the second status information to the device cloud server through a communication link.
In a possible implementation, the electronic device 50 may be a device cloud server in the embodiment shown in fig. 4, or a module in the device cloud server, such as a chip or an integrated circuit, for example. The device comprises a sending module 502 and a receiving module 503, wherein the description of each module is as follows:
A receiving module 503, configured to receive a first message sent by a second terminal device through a first communication link, where the first message includes first status information of the second terminal device, the first communication link is a communication link between a device cloud server and the second terminal device, and no communication link exists between the device cloud server and the first terminal device;
the sending module 502 is configured to send, by using the push cloud server, a second message to the first terminal device, where the second message includes the first status information.
Optionally, the first message further includes a cloud identifier of the second terminal device, and when the second message is sent to the first terminal device by pushing the cloud server, the sending module 502 is configured to: according to the cloud identification of the second terminal equipment, acquiring the cloud identification of at least one terminal equipment under the same account associated with the second terminal equipment, wherein the identification of the at least one terminal equipment comprises the cloud identification of the first terminal equipment; acquiring an association relationship between a cloud identifier of a first terminal device and a device identifier of the first terminal device, and determining the device identifier of the first terminal device according to the cloud identifier of the first terminal device and the association relationship between the cloud identifier of the first terminal device and the device identifier of the first terminal device; and sending a second message to the first terminal equipment through the pushing cloud server according to the equipment identifier of the first terminal equipment.
Optionally, the second message further comprises a device identification of the first terminal device.
Optionally, the device identifier of the first terminal device is a token of the first application running on the first terminal device.
Optionally, the second message further includes an identifier of the first application, where the identifier of the first application is determined by the device cloud server according to the cloud identifier of the second terminal device and an association relationship between the plurality of cloud identifiers and the identifier of the first application.
In a possible implementation, the electronic device 50 may be the first terminal device in the embodiment shown in fig. 4, or a module in the first terminal device, such as a chip or an integrated circuit. The apparatus includes a processing module 501 and a receiving module 503, where each module is described as follows:
a receiving module 503, configured to receive, by using a push cloud server, a second message sent by a device cloud server, where the second message includes first status information of a second terminal device, and no communication link exists between the first terminal device and the device cloud server;
the processing module 501 is configured to update the state information of the second terminal device according to the first state information.
Optionally, when receiving, by the push cloud server, the second message sent by the device cloud server, and when the first terminal device is in the awake state or the first terminal device enters the awake state from the sleep state, the receiving module 503 is configured to receive, by the push cloud server, the second message sent by the device cloud server.
Optionally, the second message further includes an equipment identifier of the first terminal equipment, and the processing module 501 is further configured to perform validity check on the second message according to the equipment identifier of the first terminal equipment; when the state information of the second terminal device is updated according to the first state information, the processing module 501 is configured to update the state information of the second terminal device according to the first state information when the validity check passes.
Optionally, the device identifier of the first terminal device is a token of the first application running on the first terminal device.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device 60 according to an embodiment of the present application, where the electronic device 60 may include at least one memory 601 and at least one processor 602. Optionally, a bus 603 may also be included. Further optionally, a communication interface 604 may be included, wherein the memory 601, the processor 602 and the communication interface 604 are connected by a bus 603.
The memory 601 is used to provide a storage space, and data such as an operating system and a computer program may be stored in the storage space. The memory 601 may be one or more of a random access memory (random access memory, RAM), a read-only memory (ROM), an erasable programmable read-only memory (erasable programmable read only memory, EPROM), or a portable read-only memory (compact disc read-only memory, CD-ROM), etc.
The processor 602 is a module that performs arithmetic and/or logical operations, and may specifically be one or more of a CPU, GPU, microprocessor (microprocessor unit, MPU), ASIC, FPGA, complex programmable logic device (Complex programmable logic device, CPLD), and other processing modules.
The communication interface 604 is used to receive data transmitted from outside and/or transmit data to outside, and may be a wired link interface including an ethernet cable or the like, or may be a wireless link (Wi-Fi, bluetooth, general wireless transmission, or the like) interface. Optionally, the communication interface 604 may also include a transmitter (e.g., radio frequency transmitter, antenna, etc.) or a receiver, etc. coupled to the interface.
The processor 602 in the electronic device 60 is configured to read the computer program stored in the memory 601 for performing the display method described above, such as the method described in any one of the embodiments of fig. 3 or fig. 4.
In some possible implementations, the electronic device 60 may be a terminal device in the embodiment shown in fig. 3, or a module in a terminal device, such as a chip or an integrated circuit. The processor 602 in the electronic device 60 is configured to read the computer program stored in the memory 601 to perform the following operations:
Determining whether state information to be sent to the equipment cloud server exists in the terminal equipment in the first time, wherein a communication link is arranged between the terminal equipment and the equipment cloud server; and if the state information to be sent to the equipment cloud server does not exist in the terminal equipment in the first time, disconnecting the communication link.
Optionally, the processor 602 is further configured to perform the following operations: starting a first timer at a first moment, wherein the first moment is the moment when the terminal equipment sends first state information to the equipment cloud server through a communication link, and the first moment is the running time of the first timer; in determining whether there is status information in the terminal device to be sent to the device cloud server within a first time, the processor 602 is configured to: and determining whether state information to be sent to the device cloud server exists in the terminal device before the first timer is overtime.
Optionally, the processor 602 is further configured to perform the following operations: determining the power consumption of the terminal equipment; the first time is determined based on the power consumption of the terminal device.
Optionally, the processor 602 is further configured to perform the following operations: acquiring a plurality of historical time intervals, wherein each historical time interval in the plurality of historical time intervals is a time interval for the terminal equipment to send historical state information to the equipment cloud server through a communication link twice; the first time is determined based on a plurality of historical time intervals.
Optionally, in determining the first time from the plurality of historical time intervals, the processor 602 is configured to: the first time is determined based on an average, a maximum, a minimum, or a median of the plurality of historical time intervals.
Optionally, the processor 602 is further configured to perform the following operations: reestablishing a communication link when detecting that second state information to be sent to a server exists in the terminal equipment; the second status information is sent to the server over the communication link via the communication interface.
In some possible implementations, the electronic device 60 may be a device cloud server in the embodiment shown in fig. 4, or a module in a device cloud server, such as a chip or an integrated circuit, for example. The processor 602 in the electronic device 60 is configured to read the computer program stored in the memory 601 to perform the following operations:
receiving a first message sent by a second terminal device through a first communication link by a communication interface, wherein the first message comprises first state information of the second terminal device, the first communication link is a communication link between a device cloud server and the second terminal device, and no communication link exists between the device cloud server and the first terminal device; and sending a second message to the first terminal equipment through the push cloud server, wherein the second message comprises the first state information.
Optionally, the first message further includes a cloud identifier of the second terminal device, and when the second message is sent to the first terminal device through the communication interface by pushing the cloud server, the processor 602 is further configured to perform the following operations: according to the cloud identification of the second terminal equipment, acquiring the cloud identification of at least one terminal equipment under the same account associated with the second terminal equipment, wherein the identification of the at least one terminal equipment comprises the cloud identification of the first terminal equipment; acquiring an association relationship between a cloud identifier of a first terminal device and a device identifier of the first terminal device, and determining the device identifier of the first terminal device according to the cloud identifier of the first terminal device and the association relationship between the cloud identifier of the first terminal device and the device identifier of the first terminal device; and sending a second message to the first terminal equipment through the pushing cloud server by the communication interface according to the equipment identifier of the first terminal equipment.
Optionally, the second message further comprises a device identification of the first terminal device.
Optionally, the device identifier of the first terminal device is a token of the first application running on the first terminal device.
Optionally, the second message further includes an identifier of the first application, where the identifier of the first application is determined by the device cloud server according to the cloud identifier of the second terminal device and an association relationship between the plurality of cloud identifiers and the identifier of the first application.
In some possible implementations, the electronic device 60 may be the first terminal device in the embodiment shown in fig. 4, or a module in the first terminal device, such as a chip or an integrated circuit. The processor 602 in the electronic device 60 is configured to read the computer program stored in the memory 601 to perform the following operations:
receiving a second message sent by the equipment cloud server through the pushing cloud server through the communication interface, wherein the second message comprises first state information of second terminal equipment, and a communication link is not arranged between the first terminal equipment and the equipment cloud server; and updating the state information of the second terminal equipment according to the first state information.
Optionally, when receiving, through the push cloud server, the second message sent by the device cloud server through the communication interface, the processor 602 is configured to: and when the first terminal equipment is in the awakening state or the first terminal equipment enters the awakening state from the sleep state, receiving a second message sent by the equipment cloud server through the pushing cloud server through the communication interface.
Optionally, the second message further includes a device identifier of the first terminal device, and the processor 602 is further configured to perform the following operations: carrying out validity check on the second message according to the equipment identifier of the first terminal equipment; and when the validity check passes, updating the state information of the second terminal equipment according to the first state information.
Optionally, the device identifier of the first terminal device is a token of the first application running on the first terminal device.
Embodiments of the present application provide a computer readable storage medium having a computer program stored therein, which when run on one or more processors, implements a method as described in any of the embodiments shown in fig. 3 or 4.
Embodiments of the present application provide a computer program product which, when run on one or more processors, implements a method as described in any of the embodiments shown in fig. 3 or 4.
An embodiment of the present application provides a chip system, the chip system including at least one processor, a memory and an interface circuit, the interface circuit being for providing information input/output to the at least one processor, the memory having a computer program stored therein, the computer program implementing a method according to any of the embodiments shown in fig. 3 or 4 when run on one or more processors.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present application. In addition, each network element unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be realized in the form of hardware or in the form of software network element units.
The integrated units described above, if implemented in the form of software network element units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be a contributing part in essence, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a terminal device, a cloud server, or a network device, etc.) to perform all or part of the steps of the above-mentioned method of the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes. While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (22)

1. A communication method, wherein the method is applied to a terminal device, the terminal device and a server having a communication link therebetween, the method comprising:
determining whether state information to be sent to the server exists in the terminal equipment in the first time;
and if the state information to be sent to the server does not exist in the terminal equipment in the first time, disconnecting the communication link.
2. The method according to claim 1, wherein the method further comprises:
starting a first timer at a first time, wherein the first time is the time when the terminal equipment sends first state information to the server through the communication link, and the first time is the running time of the first timer;
the determining whether the state information to be sent to the server exists in the terminal equipment in the first time includes:
determining whether state information to be sent to the server exists in the terminal equipment before the first timer is overtime.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
determining the power consumption of the terminal equipment;
And determining the first time according to the power consumption of the terminal equipment.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
acquiring a plurality of historical time intervals, wherein each historical time interval in the plurality of historical time intervals is a time interval of the terminal equipment for sending historical state information to the server through the communication link twice;
the first time is determined from the plurality of historical time intervals.
5. The method of claim 4, wherein said determining said first time from said plurality of historical time intervals comprises:
and determining the first time according to the average value, the maximum value, the minimum value or the median of the historical time intervals.
6. The method according to any one of claims 1-5, further comprising:
reestablishing the communication link when detecting that second state information to be sent to a server exists in the terminal equipment;
and sending the second state information to the server through the communication link.
7. A method of communication, the method being applied to a first server, the first server having no communication link with a first terminal device, the method comprising:
Receiving a first message sent by a second terminal device through a first communication link, wherein the first message comprises first state information of the second terminal device, and the first communication link is a communication link between the first server and the second terminal device;
and sending a second message to the first terminal equipment through a second server, wherein the second message comprises the first state information.
8. The method of claim 7, wherein the first message further comprises a cloud identification of the second terminal device, and wherein sending, by the second server, the second message to the first terminal device comprises:
according to the cloud identification of the second terminal equipment, acquiring the cloud identification of at least one terminal equipment under the same account associated with the second terminal equipment, wherein the identification of the at least one terminal equipment comprises the cloud identification of the first terminal equipment;
acquiring an association relationship between the cloud identification of the first terminal equipment and the equipment identification of the first terminal equipment, and determining the equipment identification of the first terminal equipment according to the cloud identification of the first terminal equipment and the association relationship between the cloud identification of the first terminal equipment and the equipment identification of the first terminal equipment;
And sending the second message to the first terminal equipment through the second server according to the equipment identifier of the first terminal equipment.
9. The method according to claim 7 or 8, characterized in that the second message further comprises a device identification of the first terminal device.
10. The method according to claim 8 or 9, characterized in that the device identification of the first terminal device is a token of a first application running on the first terminal device.
11. The method according to any one of claims 7-10, wherein the second message further comprises an identification of a first application, the identification of the first application being determined by the first server according to the cloud identification of the second terminal device and an association between a plurality of cloud identifications and the identification of the first application.
12. A communication method, wherein the method is applied to a first terminal device, the first terminal device having no communication link with a first server, the method comprising:
receiving a second message sent by the first server through a second server, wherein the second message comprises first state information of second terminal equipment;
And updating the state information of the second terminal equipment according to the first state information.
13. The method of claim 12, wherein the second message further comprises a device identification of the first terminal device, the method further comprising:
carrying out validity check on the second message according to the equipment identifier of the first terminal equipment;
the updating the state information of the second terminal device according to the first state information includes:
and when the validity check is passed, updating the state information of the second terminal equipment according to the first state information.
14. The method of claim 13, wherein the device identification of the first terminal device is a token of a first application running on the first terminal device.
15. A terminal device, characterized in that the terminal device comprises means for performing the method according to any of claims 1-6 or any of claims 12-14.
16. A server, characterized in that it comprises means for performing the method according to any of claims 7-11.
17. An electronic device comprising at least one processor and a communication interface, the at least one processor configured to invoke a computer program stored in at least one memory to perform the modules of the method of any of claims 1-14.
18. A communication system comprising terminal equipment for implementing the method according to any of claims 1-6.
19. A communication system comprising a first terminal device for implementing the method according to any of claims 12-14 and a first server for implementing the method according to any of claims 7-11.
20. A computer readable storage medium, in which a computer program is stored which, when run on one or more processors, implements the method of any of claims 1-14.
21. A computer program product, characterized in that it implements the method according to any of claims 1-14 when run on one or more processors.
22. A chip system comprising at least one processor, a memory and interface circuitry for providing information input/output to the at least one processor, the memory having a computer program stored therein, the computer program implementing the method of any of claims 1-14 when run on one or more processors.
CN202211329866.8A 2022-10-25 2022-10-25 Communication method and device Pending CN116668211A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211329866.8A CN116668211A (en) 2022-10-25 2022-10-25 Communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211329866.8A CN116668211A (en) 2022-10-25 2022-10-25 Communication method and device

Publications (1)

Publication Number Publication Date
CN116668211A true CN116668211A (en) 2023-08-29

Family

ID=87714149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211329866.8A Pending CN116668211A (en) 2022-10-25 2022-10-25 Communication method and device

Country Status (1)

Country Link
CN (1) CN116668211A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112492020A (en) * 2020-11-24 2021-03-12 杭州萤石软件有限公司 Message pushing method, system, device and storage medium
CN113747346A (en) * 2021-05-10 2021-12-03 荣耀终端有限公司 Standby method of terminal equipment and terminal equipment
CN113810264A (en) * 2021-01-15 2021-12-17 北京京东拓先科技有限公司 Information transmission method and device, electronic equipment and storage medium
WO2022143070A1 (en) * 2020-12-31 2022-07-07 华为技术有限公司 Communication method and communication system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112492020A (en) * 2020-11-24 2021-03-12 杭州萤石软件有限公司 Message pushing method, system, device and storage medium
WO2022143070A1 (en) * 2020-12-31 2022-07-07 华为技术有限公司 Communication method and communication system
CN113810264A (en) * 2021-01-15 2021-12-17 北京京东拓先科技有限公司 Information transmission method and device, electronic equipment and storage medium
CN113747346A (en) * 2021-05-10 2021-12-03 荣耀终端有限公司 Standby method of terminal equipment and terminal equipment

Similar Documents

Publication Publication Date Title
CN107148787B (en) Discovery method and electronic equipment thereof
CN109347934B (en) Message pushing method and system, server, storage medium and electronic device
CN105847168B (en) data transmission method, network server, user terminal and system
CN109672708B (en) Communication method, device and system
EP3255953B1 (en) Data transmission method and device
US20090068989A1 (en) Method for exchanging requests between the computer application of a mobile terminal and an instantaneous messaging server
CN106028266B (en) Information transmission method, device and system
CN110583048A (en) D2D communication method, remote user equipment and relay user equipment
CN115242805B (en) Distributed MQTT message transmission method, transmission system and storage medium based on gossip
CN106209769A (en) Data interactive method, cloud server and intelligent terminal
EP2949083B1 (en) Receiving a communication event
CN113282410A (en) Resource allocation method and device
CN101572764B (en) Method and system for sending pictures between electronic picture frames and electronic picture frame
CN116668211A (en) Communication method and device
CN110545539B (en) Self-adaptive link establishment method and system based on big data
CN112245906B (en) Data synchronization method, device, electronic equipment and storage medium
CN114697339A (en) Load balancing method and device under centralized architecture
CN110661697B (en) Message synchronization method, device, readable storage medium, electronic device and system
CN112165531A (en) Communication method, device and storage medium realized based on port of monitoring device
CN112888029A (en) Communication method, computer equipment and computer readable storage medium
CN111565476A (en) Communication method, device and system
CN111434100A (en) Apparatus, method, and program for data transceiving with IoT device
CN114745153B (en) Link tracking method combining WCF and log4net
CN111654294B (en) Antenna sharing method and device, storage medium and electronic equipment
WO2022237616A1 (en) Resource pool configuration method and apparatus, and terminal and network side device

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