CN114157725A - Equipment linkage method and device, server, electronic equipment and storage medium - Google Patents
Equipment linkage method and device, server, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114157725A CN114157725A CN202111334014.3A CN202111334014A CN114157725A CN 114157725 A CN114157725 A CN 114157725A CN 202111334014 A CN202111334014 A CN 202111334014A CN 114157725 A CN114157725 A CN 114157725A
- Authority
- CN
- China
- Prior art keywords
- equipment
- message
- response
- condition
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 230000004044 response Effects 0.000 claims abstract description 119
- 230000008859 change Effects 0.000 claims abstract description 45
- 230000007246 mechanism Effects 0.000 claims abstract description 38
- 238000004891 communication Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 13
- 238000005538 encapsulation Methods 0.000 claims description 12
- 238000012544 monitoring process Methods 0.000 claims description 7
- 230000000694 effects Effects 0.000 abstract description 23
- 238000005516 engineering process Methods 0.000 abstract description 8
- 238000012545 processing Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 6
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004806 packaging method and process Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 206010063385 Intellectualisation Diseases 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000008054 signal transmission Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Computer And Data Communications (AREA)
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 a package message which is sent to first equipment and contains a trigger logic condition, and the second message is a package 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 interworking mechanism through 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 the linkage response service to be executed according to the state change information and the response logic condition in the second message. Through the method and the device, the problems that in the related technology, the middleware service is excessively depended on, so that linkage between the devices is relatively passive and the response effect is relatively poor are solved.
Description
Technical Field
The application relates to the field of smart home, in particular to a method and a device for equipment linkage, a server, electronic equipment and a storage medium.
Background
At present, with the continuous development of the era, we have started to step into the smart home era, but in the process of stepping into the smart home era, the level-upgraded intelligence appears, for example, the mutual linkage effect among the devices can be realized currently, when the state of the intelligent device a changes, the control instruction of the device B is triggered, and further the intelligent scene requirement required by the user is met.
In order to unify linkage standardization among equipment, some manufacturers in the related art adopt a scheme of P2S2P to realize the linkage effect among the equipment, because the scheme is relatively simple to implement and easy to maintain among services, the linkage of the equipment and the equipment depends on middleware services, so that the defect that the performance is influenced by the middleware services, and the performance of the middleware services completely determines the scene linkage effect.
Therefore, the related technology has the problems that the middleware service is excessively relied on, so that the linkage between the devices is passive and the response effect is poor.
Disclosure of Invention
The application provides a method and a device for linkage of equipment, a server, electronic equipment and a storage medium, which are used for at least solving the problems that linkage between the equipment excessively depends on middleware service, so that linkage between the equipment is passive and 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 linking devices, the method including:
obtaining a first message and a second message, wherein the first message is a package message which is sent to first equipment and contains a trigger logic condition, and the second message is a package 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 interworking mechanism through a target protocol, determining that the second equipment subscribes to all state information of the first equipment;
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 the 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 embodiments of the present application, there is also provided a server for linking devices, the server including:
an obtaining unit, configured to obtain a first message and a second message, where the first message is a package message that is sent to a first device and contains a trigger logic condition, and the second message is a package message that is sent to a second device and contains a response logic condition;
a first associating unit, configured to determine that the second device subscribes to all state information of the first device when the first device and the second device are associated with each other through an interworking mechanism of a target protocol;
a first receiving unit, configured to receive state change information reported by the first device;
and the first determining unit is used for synchronizing the state change information to the second equipment, so that the second equipment determines the 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:
a second receiving unit, configured to receive a target linkage logic condition before the first packet and the second packet are obtained, where the target linkage logic condition is used to represent 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 trigger 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:
a subscription unit, configured to subscribe to service type topic information in an initialization stage respectively by the first device and the second device before the first message and the second message are obtained;
and the second determining unit is used for determining the business type according to the business type subject information, wherein the business type comprises a trigger business and a response business.
According to still another aspect of an embodiment of the present application, there is also provided an apparatus for linkage of equipment, the apparatus including:
the subscription unit is used for subscribing all state information of the first equipment under the condition of determining the association of an interworking mechanism with the first equipment 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;
and the execution unit is used for executing the linkage response service indicated by the response logic condition under the condition that the changed state information meets the response logic condition.
Optionally, the apparatus further comprises:
a third determining unit, configured to determine, before the first device performs association of an interworking mechanism through a target protocol, a service type to which the first device belongs currently according to service type topic information subscribed in an initialization stage;
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 associating the intercommunication mechanism with the equipment terminal to be subscribed through the target protocol.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein the memory is used for storing the computer program; a processor for performing the method steps in any of the above embodiments 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, in which a computer program is stored, wherein the computer program is configured to perform the method steps of any of the above embodiments when the computer program is executed.
In the embodiment of the application, a first message and a second message are obtained, wherein the first message is an encapsulated message which is sent to first equipment and contains a trigger logic condition, and the second message is an encapsulated 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 interworking mechanism through 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 the linkage response service to be executed according to the state change information and the response logic condition in the second message. According to the method and the device for processing the linkage response service, the first device and the second device are related through an intercommunication mechanism, so that the second device can subscribe all state information of the first device, the second device can subscribe the change information as long as the state information reported by the first device changes, then whether the change information can meet the response logic condition of the second device is determined, and then the linkage response service to be executed by the second device is determined. The second equipment can automatically match the state of the first equipment needing subscription, so that a related linkage effect is realized, the performance execution and the linkage effect are very efficient, meanwhile, the middleware service is not relied on to schedule the service for processing the scene service, and the problems that the middleware service is excessively relied on in the related technology, the linkage between the equipment is passive, and the response effect is poor are solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a schematic flow chart diagram of an alternative method of device linkage according to an embodiment of the present application;
FIG. 2 is a schematic overall server architecture flow diagram according to an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of an alternative method of device linkage according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a linkage architecture between MQTT devices according to an embodiment of the present application;
FIG. 5 is a block diagram of an alternative server for device linkage according to embodiments of the present application;
FIG. 6 is a block diagram of an alternative apparatus for linkage of equipment according to an embodiment of the present application;
fig. 7 is a block diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or 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 current smart home era, mutual linkage among all devices can be realized, and the purpose of intellectualization is achieved. However, each intelligent equipment manufacturer has its own implementation scheme, which may cause the effect of linkage between equipments to be affected to different degrees; meanwhile, if the middleware is used for realizing the linkage effect among the devices, the performance of the linkage process is easily influenced by the middleware service. In order to solve the above problem, an embodiment of the present application provides a method for linking devices, as shown in fig. 1, the method includes:
step S101, obtaining a first message and a second message, wherein the first message is a package message which is sent to first equipment and contains a trigger logic condition, and the second message is a package message which is sent to second equipment and contains a response logic condition;
step S102, under the condition that the first device and the second device are related through an intercommunication mechanism of a target protocol, determining that the second device subscribes all state information of the first device;
step S103, receiving state change information reported by the first equipment;
and step S104, synchronizing the state change information to the second equipment, so that the second equipment determines the linkage response service to be executed according to the state change information and the response logic condition in the second message.
Optionally, in this embodiment of the present application, an MQTT (Message Queuing Telemetry Transport) server is used as an execution main body, and after a user defines a target linkage logic condition between devices on an APP or other client tool of a third party (for example, after the device 1 is in an on state and 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 represent a front-back execution relationship between the first device and the second device, and when the first device is a trigger device, the second device is a response device, the first Message is an encapsulation Message of the trigger logic condition, and the second Message is an encapsulation Message of the response logic condition, the first device and the second device may pass through a target protocol, for example, the MQTT protocol asynchronously triggers the first device to associate with the second device via the interworking mechanism, so that the second device subscribes to all the state information of the first device.
It should be explained that the interworking mechanism: when a user performs linkage configuration among devices on an APP or other third-party tools, asynchronous processing is automatically performed to notify related MQTT devices, and then an intercommunication mechanism is established among the devices, which can be simply understood as that the device at the response device side automatically subscribes the state of the device at the trigger side.
When the state of the first device changes, the changed state information is sent to the server, and 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 the state information of the first device, as long as the first device changes the state, the second device can directly obtain the changed state information, so that the second device can compare the changed state information 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 encapsulated message which is sent to first equipment and contains a trigger logic condition, and the second message is an encapsulated 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 interworking mechanism through 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 the linkage response service to be executed according to the state change information and the response logic condition in the second message. According to the method and the device for processing the linkage response service, the first device and the second device are related through an intercommunication mechanism, so that the second device can subscribe all state information of the first device, the second device can subscribe the change information as long as the state information reported by the first device changes, then whether the change information can meet the response logic condition of the second device is determined, and then the linkage response service to be executed by the second device is determined. The second equipment can automatically match the state of the first equipment needing subscription, so that a related linkage effect is realized, the performance execution and the linkage effect are very efficient, meanwhile, the middleware service is not relied on to schedule the service for processing the scene service, and the problems that the middleware service is excessively relied on in the related technology, the linkage between the equipment is passive, and the response effect is poor are solved.
As an optional embodiment, generating the first message and the second message according to the target linkage logic condition includes:
analyzing the target linkage logic conditions to obtain trigger logic conditions and response logic conditions, wherein the target linkage logic conditions comprise the trigger logic conditions and the response logic conditions;
and performing message encapsulation on the trigger logic condition to obtain a first message, and performing 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, and detailed description is provided for specific module implementation, and related descriptions are now provided:
the MQTT equipment module is divided into a linkage trigger end module and a linkage response end module, and one or more pieces of equipment related to each module can be used;
MQTT agent service module: the module is an agent part which is realized by each manufacturer according to the service;
MQTT universal service module: the module consists of a publish and subscribe module.
When a first device (namely a trigger end in MQTT equipment) is communicated with a second device (namely a response end in the MQTT equipment) through an intercommunication mechanism, an MQTT server divides a 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 service logic can be subjected to message packaging according to the own equipment upper computer protocol of each manufacturer, for example, the triggering logic condition is subjected to message packaging to obtain a first message, the response logic condition is subjected to message packaging, and then the first message is sent to the MQTT general service.
In the embodiment of the application, the generation of the logic messages of different service layers is realized by dividing the target linkage logic conditions, and preset conditions are provided for realizing automatic linkage between the trigger-end equipment and the response-end equipment.
As an optional embodiment, before obtaining the first packet and the second packet, the method further includes:
the first equipment and the second equipment respectively subscribe the service type topic information in an initialization stage;
and determining the business type according to the business type subject information, wherein the business type comprises a trigger business and a response business.
Optionally, in this embodiment of the present application, each MQTT device terminal subscribes its own theme at an initialization stage, that is, the device itself automatically determines whether it is a trigger device role or a response device role according to subscribed message data, so that the first device or the second device can determine whether its service type is a trigger service or a response service according to the service type theme information subscribed by itself.
In the embodiment of the application, each device knows the service type to which it belongs in advance, and if it is a response device, the corresponding trigger end object to be subscribed can also be obtained in advance, so that the response device and the trigger end device are conveniently associated with each other through an interworking mechanism, and the error rate of subscription state information can be reduced.
According to another aspect of the embodiments of the present application, there is also provided a method for linking devices, as shown in fig. 3, the method including:
step S301, under the condition that the association of an interworking mechanism with the first equipment through a target protocol is determined, subscribing all state information of the first equipment;
step S302, monitoring state information, and judging whether the changed state information meets response logic conditions or not under the condition that the state information is changed;
step S303, in a case where it is determined that the changed state information satisfies the response logic condition, executing the linkage response service indicated by the response logic condition.
Optionally, in this embodiment of the present application, a response end device, that is, a second device is used as an execution subject, and in a case that the second device and a first device perform an association of an interworking mechanism through a target protocol, the second device subscribes to all state information of the first device;
the second device automatically monitors the state information of the first device in real time, and under the condition that the state information of the first device is determined to be changed, the second device can automatically judge whether a trigger condition is met, namely whether the changed state information meets a response logic condition, and if the response logic condition is met, the second device can automatically execute response service operation; if the trigger condition is not met, listening continues until the signal transmission is cancelled.
In the embodiment of the present application, the first device and the second device are associated with each other through an interworking mechanism, so that the second device can subscribe all status messages of the first device, and as long as the status information reported by the first device changes, the second device can subscribe to the change information, and then determine whether the change information can satisfy a response logic condition of the second device, and then determine a linkage response service to be executed by the second device. The second equipment can automatically match the state of the first equipment needing subscription, so that a related linkage effect is realized, the performance execution and the linkage effect are very efficient, meanwhile, the middleware service is not relied on to schedule the service for processing the scene service, and the problems that the middleware service is excessively relied on in the related technology, the linkage between the equipment is passive, and the response effect is poor are solved.
As an alternative embodiment, the method further comprises:
before the first device is associated with an interworking mechanism through a target protocol, determining the current business type according to the business type topic information subscribed in the initialization stage;
under the condition that the current service type is determined to be a response service, searching a device terminal to be subscribed;
and carrying out association of an interworking mechanism with the equipment terminal to be subscribed through a target protocol.
Optionally, the second device may subscribe to its own service type topic information in an initialization phase, for example, a response service type, and after determining that it is a response service type, search for a device terminal to be subscribed, for example, the first device, and then perform association of an interworking mechanism with the first device through a target protocol (for example, MQTT protocol), so that all state information of the first device may be subscribed.
In the embodiment of the application, each device knows the service type to which it belongs in advance, and if it is a response device, the corresponding trigger end object to be subscribed can also be obtained in advance, so that the response device and the trigger end device are conveniently associated with each other through an interworking 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 the embodiment of the present application, and the specific steps are as follows:
the user self-defines the linkage logic between the devices on the APP or other client tools of the third party;
the MQTT proxy server notifies the logic analysis processing service;
obtaining a trigger end service logic and a response end service logic;
the trigger end service logic issues a related trigger service message condition A1, and simultaneously, the asynchronous IO processes the MQTT equipment; the service logic of the response end issues a related control service message condition A2, and the asynchronous IO processes the MQTT equipment;
when the MQTT device C2 is a response device, the MQTT device C1 triggers the device intercommunication mechanism to be associated;
when the state of the MQTT device C1 is changed, the MQTT device C2 monitors the state of the C1 device in an MQTT subscription mode and judges whether the changed state reaches a trigger condition;
if the condition is met, the response business operation is automatically executed; if the trigger condition is not met, continue listening for the C1 device status.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., a ROM (Read-Only Memory)/RAM (Random Access Memory), a magnetic disk, an optical disk) and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the methods 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 equipment is further 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 message and a second message, where the first message is an encapsulation message that is sent to a first device and contains a trigger logic condition, and the second message is an encapsulation message that is sent to a second device and contains a response logic condition;
a first associating unit 502, connected to the obtaining unit 501, configured to determine that the second device subscribes to all state information of the first device when the first device and the second device are associated with each other through an interworking mechanism via a target protocol;
a first receiving unit 503, connected to the first associating unit 502, configured to receive the state 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 packet.
It should be noted that the obtaining unit 501 in this embodiment may be configured to execute the step S101, the first associating unit 502 in this embodiment may be configured to execute the step S102, the first receiving unit 503 in this embodiment may be configured to execute the step S103, and the first determining unit 504 in this embodiment may be configured to execute the step S104.
Through the modules, since the first device and the second device are associated through the interworking mechanism in the embodiment of the application, the second device can subscribe all state messages of the first device, the second device can subscribe the change information as long as the state information reported by the first device changes, then whether the change information can meet the response logic condition of the second device is determined, and then the linkage response service to be executed by the second device is determined. The second equipment can automatically match the state of the first equipment needing subscription, so that a related linkage effect is realized, the performance execution and the linkage effect are very efficient, meanwhile, the middleware service is not relied on to schedule the service for processing the scene service, and the problems that the middleware service is excessively relied on in the related technology, the linkage between the equipment is passive, and the response effect is poor are solved.
As an optional embodiment, 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 the front-back execution relation 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 includes:
the analysis module is used for analyzing the target linkage logic conditions to obtain trigger logic conditions and response logic conditions, wherein the target linkage logic conditions comprise the trigger logic conditions and the response logic conditions;
and the encapsulation module is used for encapsulating the message of the trigger logic condition to obtain a first message and encapsulating the message of the response logic condition to obtain a second message.
As an optional embodiment, the server further comprises:
the subscription unit is used for respectively subscribing the service type theme information 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 business type according to the business type subject information, wherein the business type comprises a trigger business and a response business.
According to another aspect of the embodiment of the application, a device for implementing the linkage of the equipment is also provided. Fig. 6 is a block diagram of an alternative apparatus for linkage of devices according to an embodiment of the present application, which may include, as shown in fig. 6:
a subscribing unit 601, configured to subscribe to all state information of the first device when determining that the first device performs association of an interworking mechanism through a target protocol;
a monitoring unit 602, configured to monitor the state information, and determine whether the changed state information satisfies a response logic condition when it is determined that the state information changes;
an executing 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 subscribing unit 601 in this embodiment may be configured to execute the step S201, the listening unit 602 in this embodiment may be configured to execute the step S202, and the executing unit 603 in this embodiment may be configured to execute the step S203.
Through the modules, since the first device and the second device are associated through the interworking mechanism in the embodiment of the application, the second device can subscribe all state messages of the first device, the second device can subscribe the change information as long as the state information reported by the first device changes, then whether the change information can meet the response logic condition of the second device is determined, and then the linkage response service to be executed by the second device is determined. The second equipment can automatically match the state of the first equipment needing subscription, so that a related linkage effect is realized, the performance execution and the linkage effect are very efficient, meanwhile, the middleware service is not relied on to schedule the service for processing the scene service, and the problems that the middleware service is excessively relied on in the related technology, the linkage between the equipment is passive, and the response effect is poor are solved.
As an alternative embodiment, the apparatus further comprises:
a third determining unit, configured to determine, before performing association of an interworking mechanism with the first device through a target protocol, a current service type according to service type subject information subscribed in an initialization stage;
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 performing association of an interworking mechanism with the equipment terminal to be subscribed through a target protocol.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, which may be a server, a terminal, or a combination thereof, for implementing the method for linking devices.
Fig. 7 is a block diagram of an alternative electronic device according to an embodiment of the present application, as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702 and the memory 703 complete communication with each other through the communication bus 704, where,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the following steps when executing the computer program stored in the memory 703:
obtaining a first message and a second message, wherein the first message is a package message which is sent to first equipment and contains a trigger logic condition, and the second message is a package 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 interworking mechanism through 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 the linkage response service to be executed according to the state change information and the response logic condition in the second message.
Alternatively, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The memory may include RAM, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
As an example, as shown in fig. 7, the memory 703 may include, but is not limited to, an obtaining unit 501, a first associating unit 502, a first receiving unit 503, and a first determining unit 504 in the server for device linkage. In addition, the device may further include, but is not limited to, other module units in the server for device linkage, which is not described in detail in this example.
The processor may be a general-purpose processor, and may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In addition, the electronic device further includes: and the display is used for displaying the result of the linkage of the equipment.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration, and the device implementing the method for device linkage may be a terminal device, and the terminal device may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 7 does not limit the structure of the electronic device. 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 skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where 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, and the like.
According to still another aspect of an embodiment of the present application, there is also provided a storage medium. Alternatively, in this embodiment, the storage medium may be a program code for executing the method for linking devices.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
obtaining a first message and a second message, wherein the first message is a package message which is sent to first equipment and contains a trigger logic condition, and the second message is a package 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 interworking mechanism through 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 the linkage response service to be executed according to the state change information and the response logic condition in the second message.
Optionally, the specific example in this embodiment may refer to the example described in the above embodiment, which is not described again in this embodiment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, a ROM, a RAM, a removable hard disk, a magnetic disk, or an optical disk.
According to yet another aspect of an embodiment of the present application, there is also provided a computer program product or a 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 in any of the above embodiments.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the method for device linkage according to the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in 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 illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, and may also be distributed on 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 embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.
Claims (10)
1. A method of linking devices, the method comprising:
obtaining a first message and a second message, wherein the first message is a package message which is sent to first equipment and contains a trigger logic condition, and the second message is a package 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 interworking mechanism through a target protocol, determining that the second equipment subscribes to all state information of the first equipment;
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 the linkage response service to be executed according to the state change information and the response logic condition in the second message.
2. The method of claim 1, wherein prior to said obtaining the first packet and the second packet, the method further comprises:
receiving a target linkage logic condition, wherein the target linkage logic condition is used for representing a front-back execution relation between the first equipment and the second equipment;
and generating the first message and the second message according to the target linkage logic condition.
3. The method of claim 2, 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 performing message encapsulation on the trigger logic condition to obtain a first message, and performing message encapsulation on the response logic condition to obtain a second message.
4. The method of claim 1, wherein prior to said obtaining the first packet and the second packet, the method further comprises:
the first equipment and the second equipment respectively subscribe the service type topic information in an initialization stage;
and determining the service type according to the service type subject information, wherein the service type comprises a trigger service and a response service.
5. A method of linking devices, the method comprising:
under the condition that the association of an interworking mechanism with a first device through a target protocol is determined, subscribing all state information of the first device;
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;
and under the condition that the changed state information meets the response logic condition, executing the linkage response service indicated by the response logic condition.
6. The method of claim 5, wherein prior to the associating with the first device of the interworking mechanism over the target protocol, the method further comprises:
determining the current business type according to the business type topic information subscribed in the initialization stage;
under the condition that the current service type is determined to be a response service, searching a device terminal to be subscribed;
and the device terminal to be subscribed is associated with the intercommunication mechanism through the target protocol.
7. A server for device linkage, the server comprising:
an obtaining unit, configured to obtain a first message and a second message, where the first message is a package message that is sent to a first device and contains a trigger logic condition, and the second message is a package message that is sent to a second device and contains a response logic condition;
a first associating unit, configured to determine that the second device subscribes to all state information of the first device when the first device and the second device are associated with each other through an interworking mechanism of a target protocol;
a first receiving unit, configured to receive state change information reported by the first device;
and the first determining unit is used for synchronizing the state change information to the second equipment, so that the second equipment determines the linkage response service to be executed according to the state change information and the response logic condition in the second message.
8. An apparatus for linking devices, the apparatus comprising:
the subscription unit is used for subscribing all state information of the first equipment under the condition of determining the association of an interworking mechanism with the first equipment 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;
and the execution unit is used for executing the linkage response service indicated by the response logic condition under the condition that the changed state information meets the response logic condition.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein said processor, said communication interface and said memory communicate with each other via said communication bus,
the memory for storing a computer program;
the processor for performing the method steps of any one of claims 1 to 4 or 5 to 6 by running the computer program stored on the memory.
10. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to carry out the method steps of one of claims 1 to 4 or 5 to 6 when executed.
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 true CN114157725A (en) | 2022-03-08 |
CN114157725B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117827191A (en) * | 2024-01-10 | 2024-04-05 | 广东赛意信息科技有限公司 | Execution method, device, equipment and storage medium based on visual modeling |
Citations (10)
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 |
-
2021
- 2021-11-11 CN CN202111334014.3A patent/CN114157725B/en active Active
Patent Citations (10)
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 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117827191A (en) * | 2024-01-10 | 2024-04-05 | 广东赛意信息科技有限公司 | Execution method, device, equipment and storage medium based on visual modeling |
Also Published As
Publication number | Publication date |
---|---|
CN114157725B (en) | 2023-09-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3605323B1 (en) | Method for generating network slice template and for applying network slice template, and apparatus | |
US10802906B2 (en) | Monitoring method and apparatus of server, and storage medium | |
CN106850402B (en) | Message transmission method and device | |
CN108712485B (en) | Resource subscription method and device for Internet of things equipment | |
US10635436B2 (en) | Compatibility method based on hybrid, adapter, operation device, system and computer-readable storage medium | |
EP2429225A1 (en) | Method for provisioning parameters of terminal, system thereof, and terminal management device | |
CN111064626B (en) | Configuration updating method, device, server and readable storage medium | |
CN110933075B (en) | Service calling method and device, electronic equipment and storage medium | |
CN112181677A (en) | Service processing method and device, storage medium and electronic device | |
EP3091712B1 (en) | Smart device for realizing multiple-device collaboration and working method for multiple-device collaboration | |
CN107526584B (en) | Data access method and device | |
CN114157725A (en) | Equipment linkage method and device, server, electronic equipment and storage medium | |
CN114691390A (en) | User mode program processing method and device, storage medium and processor | |
CN109343970B (en) | Application program-based operation method and device, electronic equipment and computer medium | |
CN116418791A (en) | Firmware upgrading method, firmware upgrading system, server and storage medium | |
CN111381824A (en) | Method, system, device and medium for synchronizing user data in multi-architecture | |
CN115695497A (en) | Diagnostic data remote transmission method and device, electronic equipment and medium | |
CN115016779A (en) | Audio and video function processing method and device, storage medium and processor | |
CN113504981A (en) | Task scheduling method and device, storage medium and electronic equipment | |
CN107465751B (en) | Communication method, device, client and computer storage medium | |
CN107612805B (en) | Internet of things communication method and internet of things gateway | |
CN107612715B (en) | Data backup method and device for Internet of things repeater | |
CN112651523A (en) | Event determination method and device, storage medium and electronic device | |
CN112423068A (en) | Smart television debugging method and device, mobile terminal and readable storage medium | |
CN107231244B (en) | System, method and device for initializing encryption machine |
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 |