CN114157725B - Method, device, server, electronic equipment and storage medium for equipment linkage - Google Patents

Method, device, server, electronic equipment and storage medium for equipment linkage Download PDF

Info

Publication number
CN114157725B
CN114157725B CN202111334014.3A CN202111334014A CN114157725B CN 114157725 B CN114157725 B CN 114157725B CN 202111334014 A CN202111334014 A CN 202111334014A CN 114157725 B CN114157725 B CN 114157725B
Authority
CN
China
Prior art keywords
message
equipment
linkage
response
logic condition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111334014.3A
Other languages
Chinese (zh)
Other versions
CN114157725A (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.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai, Zhuhai Lianyun Technology Co Ltd filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202111334014.3A priority Critical patent/CN114157725B/en
Publication of CN114157725A publication Critical patent/CN114157725A/en
Application granted granted Critical
Publication of CN114157725B publication Critical patent/CN114157725B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The application provides a method, a device, a server, electronic equipment and a storage medium for equipment linkage, wherein the method comprises the following steps: obtaining a first message and a second message, wherein the first message is an encapsulation message which is sent to first equipment and contains a triggering logic condition, and the second message is an encapsulation message which is sent to second equipment and contains a response logic condition; under the condition that the first equipment and the second equipment are associated through an intercommunication mechanism by a target protocol, determining that the second equipment subscribes to all state information of the first equipment; receiving state change information reported by first equipment; and synchronizing the state change information to the second equipment, so that the second equipment determines linkage response service to be executed according to the state change information and response logic conditions in the second message. The application solves the problems of passive linkage and poor response effect caused by excessively relying on middleware services in the related technology.

Description

Method, device, server, electronic equipment and storage medium for equipment linkage
Technical Field
The application relates to the field of intelligent home, in particular to a method and device for equipment linkage, a server, electronic equipment and a storage medium.
Background
At present, along with the continuous development of the times, we have started to walk into the smart home times, but in the process of walking into the smart home times, the level-up intelligent is realized, for example, the mutual linkage effect between devices can be realized currently, when the state of intelligent device A changes, the control instruction of device B can be triggered, and then the intelligent scene requirement of users is met, each intelligent device manufacturer of the universal design scheme has own realization scheme, but some problems exist, for example, the linkage effect between devices is influenced by different degrees due to different realization modes of each manufacturer, and the universal standardized realization scheme does not exist at the same time.
In order to unify linkage standardization among devices, some factories in the related art can adopt a P2S2P scheme to realize the linkage effect among the devices, and because the scheme is simple to realize and easy to maintain among services, the linkage between the devices can depend on middleware services in a simple way, so that the defect that the service performance of the middleware is influenced by the middleware services in the performance is overcome, and the scene linkage effect is completely determined.
Therefore, the related art has the problem of poor response effect due to the fact that middleware services are excessively relied on, so that linkage between devices is passive.
Disclosure of Invention
The application provides a method, a device, a server, electronic equipment and a storage medium for equipment linkage, which at least solve the problems that the linkage between the equipment is excessively dependent on middleware services, so that the linkage between the equipment is passive and the response effect is poor in the related technology.
According to an aspect of an embodiment of the present application, there is provided a method of device linkage, the method including:
obtaining a first message and a second message, wherein the first message is an encapsulation message which is sent to first equipment and contains a triggering logic condition, and the second message is an encapsulation message which is sent to second equipment and contains a response logic condition;
determining that the second device subscribes to all state information of the first device under the condition that the first device and the second device are associated through an intercommunication mechanism of a target protocol;
receiving state change information reported by the first equipment;
and synchronizing the state change information to the second equipment, so that the second equipment determines linkage response service to be executed according to the state change information and the response logic condition in the second message.
According to another aspect of the embodiment of the present application, there is also provided a server for device linkage, the server including:
the device comprises an obtaining unit, a receiving unit and a sending unit, wherein the obtaining unit is used for obtaining a first message and a second message, the first message is an encapsulation message which is sent to first equipment and contains a triggering logic condition, and the second message is an encapsulation message which is sent to second equipment and contains a response logic condition;
a first association unit, configured to determine that the second device subscribes to all state information of the first device, where the first device and the second device are associated by an interworking mechanism through a target protocol;
the first receiving unit is used for receiving the state change information reported by the first equipment;
and the first determining unit is used for synchronizing the state change information to the second equipment, so that the second equipment determines linkage response service to be executed according to the state change information and the response logic condition in the second message.
Optionally, the server further comprises:
the second receiving unit is used for receiving a target linkage logic condition before the first message and the second message are obtained, wherein the target linkage logic condition is used for representing a front-back execution relationship between the first device and the second device;
And the generating unit is used for generating the first message and the second message according to the target linkage logic condition.
Optionally, the generating unit includes:
the analysis module is used for analyzing the target linkage logic condition to obtain the trigger logic condition and the response logic condition, wherein the target linkage logic condition comprises the trigger logic condition and the response logic condition;
and the encapsulation module is used for carrying out message encapsulation on the triggering logic condition to obtain a first message, and carrying out message encapsulation on the response logic condition to obtain a second message.
Optionally, the server further comprises:
the subscription unit is used for subscribing the service type theme information respectively by the first equipment and the second equipment in an initialization stage before the first message and the second message are obtained;
and the second determining unit is used for determining the service type according to the service type theme information, wherein the service type comprises a triggering service and a response service.
According to yet another aspect of an embodiment of the present application, there is also provided an apparatus for equipment linkage, the apparatus including:
a subscription unit, configured to subscribe all state information of a first device under a condition that the subscription unit determines that the subscription unit performs association of an interworking mechanism with the first device through a target protocol;
The monitoring unit is used for monitoring the state information and judging whether the changed state information meets a response logic condition under the condition of determining that the state information is changed;
and the execution unit is used for executing the linkage response service indicated by the response logic condition under the condition that the state information after the change meets the response logic condition.
Optionally, the apparatus further comprises:
a third determining unit, configured to determine, according to the service type topic information subscribed in the initialization stage, a current service type to which the first device belongs before the association with the first device performs an interworking mechanism through a target protocol;
the searching unit is used for searching the equipment terminal to be subscribed under the condition that the current service type is determined to be the response service;
and the second association unit is used for carrying out association of the intercommunication mechanism with the equipment terminal to be subscribed through the target protocol.
According to still another aspect of the embodiments of the present application, there is provided an electronic device including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein the memory is used for storing a computer program; a processor for performing the method steps of any of the embodiments described above by running the computer program stored on the memory.
According to a further aspect of the embodiments of the present application there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the method steps of any of the embodiments described above when run.
In the embodiment of the application, a first message and a second message are obtained, wherein the first message is an encapsulation message which is sent to first equipment and contains a triggering logic condition, and the second message is an encapsulation message which is sent to second equipment and contains a response logic condition; under the condition that the first equipment and the second equipment are associated through an intercommunication mechanism by a target protocol, determining that the second equipment subscribes to all state information of the first equipment; receiving state change information reported by first equipment; and synchronizing the state change information to the second equipment, so that the second equipment determines linkage response service to be executed according to the state change information and response logic conditions in the second message. Because the first equipment and the second equipment are associated by the intercommunication mechanism, the second equipment can subscribe all state information of the first equipment, and can subscribe the change information as long as the state information reported by the first equipment changes, then determine whether the change information can meet the response logic condition of the second equipment, and then determine the linkage response service to be executed by the second equipment. Because the second equipment can automatically match the state of the first equipment needing to be subscribed, the related linkage effect is further realized, the performance execution and the linkage effect are very efficient, meanwhile, the middleware service is not relied on any more to process the scene service in a service scheduling manner, and the problems that the linkage between the equipment is passive and the response effect is poor due to the fact that the middleware service is relied excessively in the related technology are solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow diagram of an alternative method of device linkage according to an embodiment of the present application;
FIG. 2 is a flow diagram of an overall server architecture according to an embodiment of the application;
FIG. 3 is a flow chart of another alternative method of device linkage according to an embodiment of the application;
FIG. 4 is a schematic flow diagram of an inter-MQTT device linkage architecture according to an embodiment of the present application;
FIG. 5 is a block diagram of an alternative server for device linkage according to an embodiment of the present application;
FIG. 6 is a block diagram of an alternative arrangement for equipment linkage according to an embodiment of the present application;
Fig. 7 is a block diagram of an alternative electronic device in accordance with an embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the smart home age, the mutual linkage among all the devices can be realized, and the purpose of intellectualization is achieved. However, each intelligent equipment manufacturer has its own implementation scheme, which can cause the linkage effect between the equipment to be affected to different degrees; meanwhile, if the middleware is utilized to realize the linkage effect between the devices, the performance in the linkage process is easily influenced by the middleware service. In order to solve the above-mentioned problems, an embodiment of the present application provides a method for linking devices, as shown in fig. 1, the method includes:
step S101, a first message and a second message are obtained, wherein the first message is an encapsulation message which is sent to first equipment and contains a triggering logic condition, and the second message is an encapsulation message which is sent to second equipment and contains a response logic condition;
step S102, under the condition that the first equipment and the second equipment are associated through an intercommunication mechanism by a target protocol, determining that the second equipment subscribes to all state information of the first equipment;
step S103, receiving state change information reported by first equipment;
step S104, the state change information is synchronized to the second equipment, so that the second equipment determines linkage response service to be executed according to the state change information and response logic conditions in the second message.
Optionally, in the embodiment of the present application, an MQTT (Message Queuing Telemetry Transport, message queue telemetry transport protocol) server is used as an execution body, after a user custom defines a target linkage logic condition between devices on an APP or other client tools of a third party (for example, when the device 1 is in an on state, the device 2 is automatically turned on), the MQTT server (hereinafter referred to as a server) receives the target linkage logic condition, and generates a first message and a second message based on the target linkage logic condition, where the target linkage logic condition is used to characterize a front-back execution relationship between the first device and the second device, the first device is a trigger device, the second device is a response device, and the first message is a package message of the trigger logic condition, and when the second message is a package message of the response logic condition, the first device and the second device can be asynchronously triggered by the target protocol, for example, the MQTT protocol triggers association of the first device and the second device to perform an interworking mechanism, so that the second device subscribes to all state information of the first device.
It should be explained that the interworking mechanism: when the user performs inter-device linkage configuration on the APP or other third-party tools, the device can automatically perform asynchronous processing notification related MQTT devices so as to establish an intercommunication mechanism between the devices, and the device-side response device can be simply understood to automatically subscribe the state of the trigger-side device.
When the first device changes state, the changed state information is sent to the server, at this time, the server stores the changed state information and synchronizes the changed state information to the second device, or because the second device subscribes to all state information of the first device, as long as the first device changes state, the second device can directly obtain the changed state information, so that the second device can compare with the response logic condition in the second message according to the state change information, and under the condition that the state change information meets the response logic condition, the second device can execute the linked response service.
In the embodiment of the application, a first message and a second message are obtained, wherein the first message is an encapsulation message which is sent to first equipment and contains a triggering logic condition, and the second message is an encapsulation message which is sent to second equipment and contains a response logic condition; under the condition that the first equipment and the second equipment are associated through an intercommunication mechanism by a target protocol, determining that the second equipment subscribes to all state information of the first equipment; receiving state change information reported by first equipment; and synchronizing the state change information to the second equipment, so that the second equipment determines linkage response service to be executed according to the state change information and response logic conditions in the second message. Because the first equipment and the second equipment are associated by the intercommunication mechanism, the second equipment can subscribe all state information of the first equipment, and can subscribe the change information as long as the state information reported by the first equipment changes, then determine whether the change information can meet the response logic condition of the second equipment, and then determine the linkage response service to be executed by the second equipment. Because the second equipment can automatically match the state of the first equipment needing to be subscribed, the related linkage effect is further realized, the performance execution and the linkage effect are very efficient, meanwhile, the middleware service is not relied on any more to process the scene service in a service scheduling manner, and the problems that the linkage between the equipment is passive and the response effect is poor due to the fact that the middleware service is relied excessively in the related technology are solved.
As an alternative embodiment, generating the first message and the second message according to the target linkage logic condition includes:
analyzing the target linkage logic condition to obtain a trigger logic condition and a response logic condition, wherein the target linkage logic condition comprises the trigger logic condition and the response logic condition;
and carrying out message encapsulation on the triggering logic condition to obtain a first message, and carrying out message encapsulation on the response logic condition to obtain a second message.
Optionally, as shown in fig. 2, the overall server architecture in fig. 2 is divided into 3 modules altogether, and a detailed description will be made about specific module embodiments, so as to now make relevant descriptions:
the MQTT equipment module is divided into a linkage trigger end module and a linkage response end module, and one or more related equipment under each module can be provided;
MQTT proxy service module: the module is a proxy part realized by each manufacturer according to the service;
MQTT general service module: the module consists of a publish and subscribe module.
When the first device (i.e. the trigger end in the MQTT device) and the second device (i.e. the response end in the MQTT device) are communicated through an interworking mechanism, the MQTT server divides the target linkage logic condition into a trigger end service logic condition and a response end service logic condition according to the received target linkage logic condition.
And each business logic performs message encapsulation according to the own equipment upper computer protocol of each manufacturer, for example, performs message encapsulation on the trigger logic condition to obtain a first message, performs message encapsulation on the response logic condition, and then sends the first message to the MQTT general service.
In the embodiment of the application, the generation of the logic messages of different service levels is realized by dividing the target linkage logic conditions, and the preset conditions are provided for realizing automatic linkage between the trigger terminal equipment and the response terminal equipment.
As an alternative embodiment, before obtaining the first message and the second message, the method further includes:
the first equipment and the second equipment subscribe the service type theme information respectively in an initialization stage;
and determining the service type according to the service type subject information, wherein the service type comprises a triggering service and a response service.
Optionally, in the embodiment of the present application, each MQTT device end subscribes to its own theme in the initialization stage, that is, the device itself automatically determines whether it is a trigger device role or a response device role according to the subscribed message data, so that whether the first device or the second device determines whether the service type to which it belongs is a trigger service or a response service according to the subscribed service type theme information.
In the embodiment of the application, each device can know the service type of the device in advance, and if the device is the response device, the corresponding trigger terminal object to be subscribed can also be obtained in advance, so that the response terminal device and the trigger terminal device can be conveniently associated with each other by an intercommunication mechanism, and the error rate of subscription state information can be reduced.
According to another aspect of the embodiment of the present application, there is also provided a method for linking devices, as shown in fig. 3, the method including:
step S301, subscribing all state information of the first device under the condition that the first device is determined to be associated with an intercommunication mechanism through a target protocol;
step S302, monitoring state information, and judging whether the changed state information meets a response logic condition under the condition that the state information is determined to be changed;
step S303, when the state information after the change is determined to meet the response logic condition, the linkage response service indicated by the response logic condition is executed.
Optionally, in the embodiment of the present application, the responding device, that is, the second device, is used as an execution body, where the second device subscribes to all state information of the first device under the condition that the second device performs association of an interworking mechanism with the first device through a target protocol;
The second equipment automatically monitors the state information of the first equipment in real time, and under the condition that the state information of the first equipment is determined to change, the second equipment automatically judges whether the triggering condition is met, namely judges whether the changed state information meets the response logic condition, and if the response logic condition is met, the response service operation is automatically executed; if the trigger condition is not met, continuing to monitor until the signal transmission is canceled.
In the embodiment of the application, the first equipment and the second equipment are associated by an intercommunication mechanism, so that the second equipment can subscribe all state information of the first equipment, the second equipment can subscribe to the change information as long as the state information reported by the first equipment changes, then the change information is determined whether the response logic condition of the second equipment can be met or not, and then the linkage response service to be executed by the second equipment is determined. Because the second equipment can automatically match the state of the first equipment needing to be subscribed, the related linkage effect is further realized, the performance execution and the linkage effect are very efficient, meanwhile, the middleware service is not relied on any more to process the scene service in a service scheduling manner, and the problems that the linkage between the equipment is passive and the response effect is poor due to the fact that the middleware service is relied excessively in the related technology are solved.
As an alternative embodiment, the method further comprises:
before the association of the intercommunication mechanism with the first equipment through the target protocol, determining the current service type according to the subscribed service type theme information in the initialization stage;
searching a device terminal to be subscribed under the condition that the current service type is determined to be a response service;
and carrying out association of an intercommunication mechanism with the equipment terminal to be subscribed through a target protocol.
Optionally, the second device subscribes to own service type theme information, such as response service type, in the initialization stage, after determining that the second device is the response service type, searches for a device terminal to be subscribed to, such as the first device, and then performs association of an interworking mechanism with the first device through a target protocol (such as MQTT protocol), so that all state information of the first device can be subscribed to.
In the embodiment of the application, each device can know the service type of the device in advance, and if the device is the response device, the corresponding trigger terminal object to be subscribed can also be obtained in advance, so that the response terminal device and the trigger terminal device can be conveniently associated with each other by an intercommunication mechanism, and the error rate of subscription state information can be reduced.
As an alternative embodiment, as shown in fig. 4, fig. 4 is a schematic flow chart of an MQTT inter-device linkage architecture according to an embodiment of the present application, and specific steps are as follows:
the user self-defines inter-device linkage logic on the APP or other client tools of the third party;
the MQTT proxy server informs the logic analysis processing service;
acquiring trigger end service logic and response end service logic;
the trigger end service logic can issue a related trigger service message condition A1, and simultaneously, the asynchronous IO processes the MQTT equipment; the service logic of the response end can issue a relevant control service message condition A2, and simultaneously the asynchronous IO processes the MQTT equipment;
when the MQTT equipment C2 is a response equipment, the response equipment is associated with an MQTT equipment C1 triggering equipment intercommunication mechanism;
when the state of the MQTT equipment C1 is changed, the MQTT equipment C2 monitors the state of the C1 equipment in a MQTT subscription mode and judges whether the changed state reaches a trigger condition or not;
if the condition is met, automatically executing response business operation; continuing to monitor the state of the C1 device if the trigger condition is not reached.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM (Read-Only Memory)/RAM (Random Access Memory), magnetic disk, optical disk), comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the embodiments of the present application.
According to another aspect of the embodiment of the application, a server for implementing the method for linking the devices is also provided. Fig. 5 is a block diagram of an alternative server for device linkage according to an embodiment of the present application, and as shown in fig. 5, the apparatus may include:
an obtaining unit 501, configured to obtain a first packet and a second packet, where the first packet is an encapsulation packet sent to the first device and includes a trigger logic condition, and the second packet is an encapsulation packet sent to the second device and includes a response logic condition;
A first association unit 502, connected to the obtaining unit 501, configured to determine that, in a case where the first device and the second device are associated by an interworking mechanism through a target protocol, the second device subscribes to all state information of the first device;
the first receiving unit 503 is connected to the first associating unit 502, and is configured to receive status change information reported by the first device;
the first determining unit 504 is connected to the first receiving unit 503, and is configured to synchronize the state change information to the second device, so that the second device determines the linkage response service to be executed according to the state change information and the response logic condition in the second message.
It should be noted that, the obtaining unit 501 in this embodiment may be used to perform the above-mentioned step S101, the first associating unit 502 in this embodiment may be used to perform the above-mentioned step S102, the first receiving unit 503 in this embodiment may be used to perform the above-mentioned step S103, and the first determining unit 504 in this embodiment may be used to perform the above-mentioned step S104.
Through the module, because the first device and the second device are associated by the intercommunication mechanism in the embodiment of the application, the second device can subscribe all state information of the first device, and can subscribe to the change information as long as the state information reported by the first device changes, then determine whether the change information can meet the response logic condition of the second device, and then determine the linkage response service to be executed by the second device. Because the second equipment can automatically match the state of the first equipment needing to be subscribed, the related linkage effect is further realized, the performance execution and the linkage effect are very efficient, meanwhile, the middleware service is not relied on any more to process the scene service in a service scheduling manner, and the problems that the linkage between the equipment is passive and the response effect is poor due to the fact that the middleware service is relied excessively in the related technology are solved.
As an alternative embodiment, the server further comprises:
the second receiving unit is used for receiving target linkage logic conditions before the first message and the second message are obtained, wherein the target linkage logic conditions are used for representing a front-back execution relationship between the first equipment and the second equipment;
and the generating unit is used for generating a first message and a second message according to the target linkage logic condition.
As an alternative embodiment, the generating unit comprises:
the analysis module is used for analyzing the target linkage logic condition to obtain a trigger logic condition and a response logic condition, wherein the target linkage logic condition comprises the trigger logic condition and the response logic condition;
the encapsulation module is used for carrying out message encapsulation on the triggering logic condition to obtain a first message, and carrying out message encapsulation on the response logic condition to obtain a second message.
As an alternative embodiment, the server further comprises:
the subscription unit is used for subscribing the service type theme information in the initialization stage by the first equipment and the second equipment respectively before the first message and the second message are obtained;
and the second determining unit is used for determining the service type according to the service type theme information, wherein the service type comprises a triggering service and a response service.
According to another aspect of the embodiment of the present application, there is also provided an apparatus for implementing the above-mentioned linkage of devices. Fig. 6 is a block diagram of an alternative apparatus for equipment linkage, according to an embodiment of the present application, as shown in fig. 6, which may include:
a subscription unit 601, configured to subscribe all state information of the first device in a case where it is determined that the first device performs association of an interworking mechanism with the first device through a target protocol;
a monitoring unit 602, configured to monitor the status information, and determine, if the status information is determined to change, whether the changed status information meets a response logic condition;
and an execution unit 603, configured to execute the linkage response service indicated by the response logic condition when it is determined that the changed state information satisfies the response logic condition.
It should be noted that the subscription unit 601 in this embodiment may be used to perform the above step S201, the listening unit 602 in this embodiment may be used to perform the above step S202, and the executing unit 603 in this embodiment may be used to perform the above step S203.
Through the module, because the first device and the second device are associated by the intercommunication mechanism in the embodiment of the application, the second device can subscribe all state information of the first device, and can subscribe to the change information as long as the state information reported by the first device changes, then determine whether the change information can meet the response logic condition of the second device, and then determine the linkage response service to be executed by the second device. Because the second equipment can automatically match the state of the first equipment needing to be subscribed, the related linkage effect is further realized, the performance execution and the linkage effect are very efficient, meanwhile, the middleware service is not relied on any more to process the scene service in a service scheduling manner, and the problems that the linkage between the equipment is passive and the response effect is poor due to the fact that the middleware service is relied excessively in the related technology are solved.
As an alternative embodiment, the apparatus further comprises:
the third determining unit is used for determining the current service type according to the subscribed service type theme information in the initialization stage before the association of the intercommunication mechanism with the first equipment through the target protocol;
the searching unit is used for searching the equipment terminal to be subscribed under the condition that the current service type is determined to be the response service;
and the second association unit is used for carrying out association of an intercommunication mechanism with the equipment terminal to be subscribed through the target protocol.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device for implementing the method for device linkage described above, where the electronic device may be a server, a terminal, or a combination thereof.
Fig. 7 is a block diagram of an alternative electronic device, according to an embodiment of the application, as shown in fig. 7, comprising a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702 and the memory 703 communicate with each other via the communication bus 704, wherein,
a memory 703 for storing a computer program;
the processor 701 is configured to execute the computer program stored in the memory 703, and implement the following steps:
Obtaining a first message and a second message, wherein the first message is an encapsulation message which is sent to first equipment and contains a triggering logic condition, and the second message is an encapsulation message which is sent to second equipment and contains a response logic condition;
under the condition that the first equipment and the second equipment are associated through an intercommunication mechanism by a target protocol, determining that the second equipment subscribes to all state information of the first equipment;
receiving state change information reported by first equipment;
and synchronizing the state change information to the second equipment, so that the second equipment determines linkage response service to be executed according to the state change information and response logic conditions in the second message.
Alternatively, in the present embodiment, the above-described communication bus may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 7, but not only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The memory may include RAM or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
As an example, as shown in fig. 7, the memory 703 may include, but is not limited to, the obtaining unit 501, the first associating unit 502, the first receiving unit 503, and the first determining unit 504 in the server for device linkage. In addition, other module units in the server for device linkage may be included, but are not limited to, and are not described in detail in this example.
The processor may be a general purpose processor and may include, but is not limited to: CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but also DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In addition, the electronic device further includes: and the display is used for displaying the linkage result of the equipment.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments, and this embodiment is not described herein.
It will be understood by those skilled in the art that the structure shown in fig. 7 is only illustrative, and the device implementing the method of linking the devices may be a terminal device, and the terminal device may be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palmtop computer, a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 7 is not limited to the structure of the electronic device described above. For example, the terminal device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in fig. 7, or have a different configuration than shown in fig. 7.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing a terminal device to execute in association with hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, etc.
According to yet another aspect of an embodiment of the present application, there is also provided a storage medium. Alternatively, in the present embodiment, the above-described storage medium may be used for program codes for executing the method of device linkage.
Alternatively, in this embodiment, the storage medium may be located on at least one network device of the plurality of network devices in the network shown in the above embodiment.
Alternatively, in the present embodiment, the storage medium is configured to store program code for performing the steps of:
obtaining a first message and a second message, wherein the first message is an encapsulation message which is sent to first equipment and contains a triggering logic condition, and the second message is an encapsulation message which is sent to second equipment and contains a response logic condition;
under the condition that the first equipment and the second equipment are associated through an intercommunication mechanism by a target protocol, determining that the second equipment subscribes to all state information of the first equipment;
receiving state change information reported by first equipment;
and synchronizing the state change information to the second equipment, so that the second equipment determines linkage response service to be executed according to the state change information and response logic conditions in the second message.
Alternatively, specific examples in the present embodiment may refer to examples described in the above embodiments, which are not described in detail in the present embodiment.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, ROM, RAM, a mobile hard disk, a magnetic disk or an optical disk.
According to yet another aspect of embodiments of the present application, there is also provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium; the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method steps of the device linkage of any of the embodiments described above.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method for linking the devices of the various embodiments of the present application.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided by the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and are merely a logical functional division, and there may be other manners of dividing the apparatus in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units 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 purpose of the solution provided in the present embodiment.
In addition, each functional 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 implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (7)

1. A method of device linkage, applied to an MQTT server, the method comprising:
obtaining a first message and a second message, wherein the first message is an encapsulation message which is sent to first equipment and contains a triggering logic condition, the second message is an encapsulation message which is sent to second equipment and contains a response logic condition, and the encapsulation message is encapsulated according to an upper computer protocol of the equipment;
determining that the second device subscribes to all state information of the first device under the condition that the first device and the second device are associated through an intercommunication mechanism of a target protocol;
Receiving state change information reported by the first equipment;
synchronizing the state change information to the second device, so that the second device determines a linkage response service to be executed according to the state change information and the response logic condition in the second message;
before the first message and the second message are obtained, the method further includes:
the first equipment and the second equipment subscribe service type theme information respectively in an initialization stage;
determining the service type according to the service type subject information, wherein the service type comprises a triggering service and a response service;
before the first message and the second message are obtained, the method further includes:
receiving a target linkage logic condition, wherein the target linkage logic condition is used for representing a front-back execution relationship between the first equipment and the second equipment;
and generating the first message and the second message according to the target linkage logic condition.
2. The method of claim 1, wherein the generating the first message and the second message according to the target linkage logic condition comprises:
Analyzing the target linkage logic condition to obtain the trigger logic condition and the response logic condition, wherein the target linkage logic condition comprises the trigger logic condition and the response logic condition;
and carrying out message encapsulation on the triggering logic condition to obtain a first message, and carrying out message encapsulation on the response logic condition to obtain a second message.
3. A method of device linkage, applied to a second device, the method comprising:
subscribing all state information of the first equipment under the condition that the association of an intercommunication mechanism with the first equipment through a target protocol is determined;
monitoring the state information, and judging whether the changed state information meets a response logic condition under the condition that the state information is determined to be changed, wherein the response logic condition is determined based on a received encapsulation message, and the encapsulation message is encapsulated by an MQTT server according to an upper computer protocol of the device;
executing linkage response service indicated by the response logic condition under the condition that the changed state information meets the response logic condition;
Wherein prior to said association with the first device via the target protocol with the interworking mechanism, the method further comprises:
determining the current service type according to the subscribed service type theme information in the initialization stage;
searching a device terminal to be subscribed under the condition that the current service type is determined to be a response service;
and the device terminal to be subscribed is associated with the intercommunication mechanism through the target protocol.
4. An MQTT server for device linkage, the MQTT server comprising:
the device comprises an obtaining unit, a receiving unit and a processing unit, wherein the obtaining unit is used for obtaining a first message and a second message, the first message is an encapsulation message which is sent to first equipment and contains a triggering logic condition, the second message is an encapsulation message which is sent to second equipment and contains a response logic condition, and the encapsulation message is encapsulated according to an upper computer protocol of the equipment;
a first association unit, configured to determine that the second device subscribes to all state information of the first device, where the first device and the second device are associated by an interworking mechanism through a target protocol;
the first receiving unit is used for receiving the state change information reported by the first equipment;
The first determining unit is used for synchronizing the state change information to the second equipment, so that the second equipment determines linkage response service to be executed according to the state change information and the response logic condition in the second message;
wherein, the server is further used for:
the first equipment and the second equipment subscribe service type theme information respectively in an initialization stage;
determining the service type according to the service type subject information, wherein the service type comprises a triggering service and a response service;
wherein, the server is further used for:
receiving a target linkage logic condition, wherein the target linkage logic condition is used for representing a front-back execution relationship between the first equipment and the second equipment;
and generating the first message and the second message according to the target linkage logic condition.
5. An apparatus for device linkage, applied to a second device, the apparatus comprising:
a subscription unit, configured to subscribe all state information of a first device under a condition that the subscription unit determines that the subscription unit performs association of an interworking mechanism with the first device through a target protocol;
The monitoring unit is used for monitoring the state information, and judging whether the changed state information meets a response logic condition or not under the condition that the state information is determined to be changed, wherein the response logic condition is determined based on a received encapsulation message, and the encapsulation message is encapsulated by an MQTT server according to an upper computer protocol of the device;
the execution unit is used for executing linkage response service indicated by the response logic condition under the condition that the changed state information meets the response logic condition;
wherein the device is further for:
determining the current service type according to the subscribed service type theme information in the initialization stage;
searching a device terminal to be subscribed under the condition that the current service type is determined to be a response service;
and the device terminal to be subscribed is associated with the intercommunication mechanism through the target protocol.
6. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus, characterized in that,
The memory is used for storing a computer program;
the processor being adapted to perform the method steps of any of claims 1 to 2 or claim 3 by running the computer program stored on the memory.
7. A computer-readable storage medium, characterized in that the storage medium has stored therein a computer program, wherein the computer program is arranged to perform the method steps of any of claims 1 to 2 or claim 3 when run.
CN202111334014.3A 2021-11-11 2021-11-11 Method, device, server, electronic equipment and storage medium for equipment linkage Active CN114157725B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111334014.3A CN114157725B (en) 2021-11-11 2021-11-11 Method, device, server, electronic equipment and storage medium for equipment linkage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111334014.3A CN114157725B (en) 2021-11-11 2021-11-11 Method, device, server, electronic equipment and storage medium for equipment linkage

Publications (2)

Publication Number Publication Date
CN114157725A CN114157725A (en) 2022-03-08
CN114157725B true CN114157725B (en) 2023-09-12

Family

ID=80460152

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111334014.3A Active CN114157725B (en) 2021-11-11 2021-11-11 Method, device, server, electronic equipment and storage medium for equipment linkage

Country Status (1)

Country Link
CN (1) CN114157725B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159150A (en) * 2015-07-23 2015-12-16 北京章鱼智数科技有限公司 Intelligent equipment linkage control method
WO2018177121A1 (en) * 2017-03-27 2018-10-04 华为技术有限公司 Sensing device linkage method, apparatus and system
CN108733005A (en) * 2017-04-21 2018-11-02 北京京东尚科信息技术有限公司 A kind of method and device of control smart machine linkage
CN110034983A (en) * 2019-03-08 2019-07-19 佛山市云米电器科技有限公司 Home equipment interlock method and system based on Publish-subscribe message processing facility
CN111177214A (en) * 2019-12-19 2020-05-19 腾讯云计算(北京)有限责任公司 Event linkage processing method, device and system, electronic equipment and storage medium
CN111338220A (en) * 2020-02-19 2020-06-26 杭州涂鸦信息技术有限公司 Linkage control method and system between multiple heterogeneous devices
CN111614524A (en) * 2019-02-26 2020-09-01 华为技术有限公司 Multi-intelligent-device linkage control method, device and system
CN112230616A (en) * 2020-10-28 2021-01-15 腾讯科技(深圳)有限公司 Linkage control method and device and linkage middleware
CN112468527A (en) * 2019-09-06 2021-03-09 比亚迪股份有限公司 Linkage control system and linkage control method
CN113495491A (en) * 2021-06-24 2021-10-12 深圳市晨北科技有限公司 Method and device for displaying equipment linkage relationship, electronic equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159150A (en) * 2015-07-23 2015-12-16 北京章鱼智数科技有限公司 Intelligent equipment linkage control method
WO2018177121A1 (en) * 2017-03-27 2018-10-04 华为技术有限公司 Sensing device linkage method, apparatus and system
CN108733005A (en) * 2017-04-21 2018-11-02 北京京东尚科信息技术有限公司 A kind of method and device of control smart machine linkage
CN111614524A (en) * 2019-02-26 2020-09-01 华为技术有限公司 Multi-intelligent-device linkage control method, device and system
CN110034983A (en) * 2019-03-08 2019-07-19 佛山市云米电器科技有限公司 Home equipment interlock method and system based on Publish-subscribe message processing facility
CN112468527A (en) * 2019-09-06 2021-03-09 比亚迪股份有限公司 Linkage control system and linkage control method
CN111177214A (en) * 2019-12-19 2020-05-19 腾讯云计算(北京)有限责任公司 Event linkage processing method, device and system, electronic equipment and storage medium
CN111338220A (en) * 2020-02-19 2020-06-26 杭州涂鸦信息技术有限公司 Linkage control method and system between multiple heterogeneous devices
CN112230616A (en) * 2020-10-28 2021-01-15 腾讯科技(深圳)有限公司 Linkage control method and device and linkage middleware
CN113495491A (en) * 2021-06-24 2021-10-12 深圳市晨北科技有限公司 Method and device for displaying equipment linkage relationship, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114157725A (en) 2022-03-08

Similar Documents

Publication Publication Date Title
US10802906B2 (en) Monitoring method and apparatus of server, and storage medium
CN109347934B (en) Message pushing method and system, server, storage medium and electronic device
CN108712485B (en) Resource subscription method and device for Internet of things equipment
CN110908879A (en) Method, device, terminal and storage medium for reporting buried point data
CN113630372A (en) Cloud edge coordination system for edge computing
CN106470123B (en) Log collecting method, client, server and electronic equipment
CN111913818A (en) Method for determining dependency relationship between services and related device
CN112181677A (en) Service processing method and device, storage medium and electronic device
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN109041267B (en) Network connection fault processing method and device and electronic equipment
CN111736938B (en) Information display method and device, storage medium and electronic device
US20180176745A1 (en) M2m group and notification resource creation and information exchange methods therefor, and storage medium
CN114090388A (en) Information acquisition method, server cluster, server and equipment
CN112486707A (en) Redis-based message asynchronous consumption method and device
CN114157725B (en) Method, device, server, electronic equipment and storage medium for equipment linkage
KR101367265B1 (en) Push server, push service providing system and method of the same
CN112600842A (en) Cluster shell method and device, electronic equipment and computer readable storage medium
CN115567604A (en) Service calling method based on micro-service system and server
CN110830305B (en) Method and device for wireless device to access WIFI network, electronic device and storage medium
CN113901374A (en) Webpage refreshing method and device, electronic equipment and storage medium
CN107465751B (en) Communication method, device, client and computer storage medium
CN113965904A (en) Device registration method, device and storage medium
CN112118121A (en) Method and device for client device configuration management
CN117424638B (en) Network slice management method, device and storage medium based on satellite-ground fusion
CN114500660B (en) Request processing method, device, 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