CN111355642A - Distributed equipment condition judgment method and system - Google Patents
Distributed equipment condition judgment method and system Download PDFInfo
- Publication number
- CN111355642A CN111355642A CN201811582340.4A CN201811582340A CN111355642A CN 111355642 A CN111355642 A CN 111355642A CN 201811582340 A CN201811582340 A CN 201811582340A CN 111355642 A CN111355642 A CN 111355642A
- Authority
- CN
- China
- Prior art keywords
- slave
- condition
- host
- dimensional array
- equipment
- 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 65
- 230000005540 biological transmission Effects 0.000 claims abstract description 94
- 238000003491 array Methods 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 11
- 230000007704 transition Effects 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000001816 cooling Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2803—Home automation networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0823—Errors, e.g. transmission errors
- H04L43/0829—Packet loss
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Automation & Control Theory (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a distributed equipment condition judgment method and a distributed equipment condition judgment system, wherein the method specifically comprises the following steps: the method comprises the steps that a host judges a data packet based on a condition sent by the slave and marks a slave subscript of the slave in a condition judgment two-dimensional array, the data packet is formed by judging whether the equipment condition of the slave is achieved or not according to the equipment state of the host, the host acquires the equipment state of the host and judges whether the equipment condition of the host is achieved or not, if the equipment condition of the host is achieved, whether the equipment condition of the slave is achieved or not is judged based on the marking result of the host on the slave subscript, and if yes, the host transmits an execution packet to a target device in a preset data transmission mode. The invention can save computing resources, reduce the transmission of equipment running state data, improve the utilization rate of network bandwidth and maximize the quantity of the storage linkage equipment.
Description
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a distributed device condition determination method and system.
Background
With the development of smart homes, the linkage function among devices is the basis of future intelligent home scene application, and multi-condition judgment among multiple devices is the basic capability for realizing more intelligent home scenes. In the prior art, in order to realize multi-condition judgment of multiple devices, usually, a control center is used to collect operation state information of all home appliances, and then the operation state information is collected to the control center, and the state of the home appliances collecting the operation state information is judged, so as to judge conditions between the devices, and realize a linkage function between the devices, but the prior art mainly has the following technical disadvantages:
1. the computing resource requirement of the control center equipment is too high, a large amount of equipment operation state data needs to be processed quickly, and the chip cost for meeting the requirement is expensive;
2. because a large number of household appliances need to transmit the running state data in real time, the occupied network bandwidth resources are too large, and the transmission efficiency is low;
3. the running state data of all the household appliances are collected by the control center for condition judgment, so that the calculated logic expression is relatively complex.
Disclosure of Invention
The embodiment of the invention provides a distributed equipment condition judgment method and a distributed equipment condition judgment system, and mainly aims to solve the technical problems that in the prior art, the cost of chips of control center equipment is high, a large number of household electrical appliances need to transmit running state data in real time, the occupied network bandwidth resource is overlarge, the data transmission efficiency is low, and the running state data of all the household electrical appliances are collected by a control center to carry out condition judgment, so that the calculated logic expression is relatively complex.
In a first aspect, an embodiment of the present invention provides a distributed device condition determining method, which specifically includes:
the host marks the subscripts of the slaves in a condition judgment two-dimensional array based on a condition judgment data packet sent by the slaves, wherein the condition judgment two-dimensional array comprises a first dimension array and a second dimension array, wherein the elements in the first dimension array comprise device information and device conditions of the master and the slave, the elements have logical relation of AND, the second dimension array is composed of at least one first dimension array, the first dimension arrays have logical relation of OR, each first dimension array has a device as host, the other devices are slaves, the condition judgment data packet is a data packet formed by judging whether the device condition of the slave is achieved or not by the slave according to the device state of the slave, and the subscript of the slave is the position identification of the slave in the condition judgment two-dimensional array;
the host machine judges whether the equipment condition of the host machine is achieved according to the equipment state of the host machine;
the device condition of the host is met, and the host judges whether the device condition of the slave is completely met or not based on the marking result of the slave subscript;
and the master transmits an execution packet to the target equipment in a preset data transmission mode.
In a second aspect, the present invention further provides a distributed device condition determining method, where the method includes:
the slave machine acquires the equipment state of the slave machine;
the slave machine judges whether the equipment condition of the slave machine is achieved according to the equipment state of the slave machine;
the slave machine achieves the equipment condition, and the slave machine judges the achievement packet to the host machine through a preset data transmission mode transmission condition;
or, the slave machine does not achieve the equipment condition, and the slave machine transmits the condition judgment lost packet to the host machine through a preset data transmission mode.
In a third aspect, the present invention provides a distributed device condition determining system, including:
the first receiving module is used for receiving a condition judgment data packet sent by a slave, wherein the condition judgment data packet is a data packet formed by judging whether the equipment condition of the slave is achieved or not by the slave according to the equipment state of the slave;
the system comprises a marking module, a condition judging module and a judging module, wherein the marking module is used for marking a slave subscript of a slave in a condition judging two-dimensional array by a master based on a condition judging data packet sent by the slave, the condition judging two-dimensional array comprises a first dimensional array and a second dimensional array, elements in the first dimensional array comprise equipment information and equipment conditions of the master and the slave, an AND logical relation is formed between the elements, the second dimensional array is composed of at least one first dimensional array, an OR logical relation is formed between the first dimensional arrays, one equipment is a master in each first dimensional array, the rest equipment is a slave, and the slave subscript is a position identification of the slave in the condition judging two-dimensional array;
the first judgment module is used for judging whether the equipment condition of the host is achieved according to the equipment state of the host;
the second judgment module is used for judging whether the equipment conditions of the slave machines are all achieved or not by the host machine based on the marking result of the slave machine subscript;
and the first transmission module is used for completely achieving the equipment conditions of the slave machines, and the host machine transmits the execution packet to the target equipment in a preset data transmission mode.
In a fourth aspect, the present invention further provides a distributed device condition determining system, where the system includes:
the acquisition module is used for acquiring the equipment state;
the fourth judging module is used for judging whether the equipment condition of the slave machine is achieved according to the equipment state of the slave machine;
the second transmission module is used for achieving the equipment condition of the slave machine, and the slave machine transmits a condition judgment achievement packet to the host machine through a preset data transmission mode;
and the third transmission module is used for judging the lost packet to the host by the slave through a preset data transmission mode transmission condition when the equipment condition of the slave is not achieved.
In a fifth aspect, the present invention provides a distributed device condition determining apparatus, where the apparatus includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and is characterized in that the processor implements part or all of the steps of any one of the distributed device condition determining methods described in the above method embodiments when executing the computer program.
In a sixth aspect, the present invention further provides a computer-readable storage medium, which stores a computer program, wherein the computer program, when executed by a processor, implements part or all of the steps of any one of the distributed device condition determination methods described in the above method embodiments.
Has the advantages that: the method comprises the steps that a host judges a data packet based on a condition sent by a slave, marks a slave subscript of the slave in a condition judgment two-dimensional array, acquires the equipment state of the host and judges whether the equipment condition of the host is achieved, if the equipment condition of the host is achieved, the host judges whether the equipment condition of the slave is achieved completely based on the mark, and if the equipment condition of the slave is achieved, the host transmits an execution packet to target equipment in a preset data transmission mode. To sum up, compared with the prior art, each linkage device in the embodiment of the invention can complete the judgment only by paying attention to the device state and the device condition of the host and the subscript in the condition judgment two-dimensional array, and the host only needs to pay more attention to the number of the first-dimensional array elements corresponding to the host, and does not need to pay attention to the information of other devices, so that the computing resources can be saved, meanwhile, the slave sends a condition judgment achievement packet and a condition judgment loss packet by judging whether the device condition of the host is achieved, the host marks the subscript corresponding to the slave in the condition judgment two-dimensional array after receiving the condition judgment data packet, the host can judge whether the device condition is achieved completely based on the marking result, so that the transmission of the device operation state data can be reduced, the network bandwidth utilization rate can be improved, and in addition, the number of the linkage devices can be stored to the maximum through, there is no need to worry about the storage pressure of the device.
These and other aspects of the invention are apparent from and will be elucidated with reference to the embodiments described hereinafter.
Drawings
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, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a distributed device condition determining method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another distributed device condition determining method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a distributed device condition determining method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a distributed device condition determining system according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a distributed device condition determining system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a distributed device condition determining device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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 invention.
Embodiments of the present application will be described below with reference to the accompanying drawings, but the present invention is not limited thereto.
Example one
According to an aspect of the present invention, a distributed device condition determining method is provided, which specifically includes the following steps, as shown in fig. 1:
s1, the master machine marks the subscripts of the slave machines in the condition judgment two-dimensional array based on the condition judgment data packets sent by the slave machines, the condition judgment two-dimensional array comprises a first dimension array and a second dimension array, wherein the elements in the first dimension array comprise device information and device conditions of the master and the slave, the elements have logical relation of AND, the second dimension array is composed of at least one first dimension array, the first dimension arrays have logical relation of OR, each first dimension array has a device as host, the other devices are slaves, the condition judgment data packet is a data packet formed by judging whether the device condition of the slave is achieved or not by the slave according to the device state of the slave, and the subscript of the slave is the position identification of the slave in the condition judgment two-dimensional array;
the data configured for multi-device multi-condition determination is represented by a two-dimensional array of device information and device condition objects. The two-dimensional array comprises a first-dimensional array and a second-dimensional array, wherein each element in the first-dimensional array comprises equipment information and equipment conditions of a host and a slave, the equipment information can be the name, the label or the distinctive description of equipment, the equipment conditions can be the conditions for starting, closing or meeting other control instructions set for the equipment, and the elements in the first-dimensional array are in an AND logical relationship; the second dimension array is composed of at least one first dimension array, the object in the second dimension array is the first dimension array, and the plurality of first dimension arrays have an or logical relationship, for example, if the judgment condition of the multiple devices is: the judgment condition is fulfilled if the condition 1 and the condition 2 of the apparatus 1 are satisfied, and the condition 1 and the condition 2 of the apparatus 2 are satisfied, and the condition 1, the condition 2, and the condition 3 of the apparatus 3 are satisfied, or the condition 1 and the condition 2 of the apparatus 4 are satisfied, and the condition 1 of the apparatus 5 is satisfied, and the condition 2, the condition 3, and the condition 4 of the apparatus 1 are satisfied, or the condition 2 of the apparatus 2 is satisfied, and the condition 3 of the apparatus 3 is satisfied, and the condition 1, the condition 2, and the condition 3 of the apparatus 5 are satisfied. The two-dimensional array is expressed as follows:
[ { apparatus 1 (condition 1, condition 2) }, { apparatus 2 (condition 1, condition 2) }, { apparatus 3 (condition 1, condition 2, condition 3) } ], [ { apparatus 4 (condition 1, condition 2) }, { apparatus 5 (condition 1) }, { apparatus 1 (condition 2, condition 3, condition 4) } ], [ { apparatus 2 (condition 2) }, { apparatus 3 (condition 3) }, { apparatus 5 (condition 1, condition 2, condition 3) } ], [ { apparatus 1 (condition 5) } ] ], wherein { } denotes an object of the first dimension array, [ ] denotes an array, () denotes a judgment condition of the apparatus.
It should be noted that, in a two-dimensional array determined by a condition, one device needs to be selected from each first-dimensional array as a master, and the rest are slaves, for example, a device with the largest resource number may be selected as a master by calculating the resource number of each device and competing by multiple devices, and if there are multiple first-dimensional arrays in the two-dimensional array and one master in each first-dimensional array, there are multiple masters in the two-dimensional array. Since the objects in the second dimension array are the first dimension arrays and the logical relationship between the objects is the logical relationship of or, the judgment condition is achieved only if all the equipment conditions in one of the first dimension arrays are achieved. Therefore, for convenience of description, the embodiment of the present invention is illustrated with one of the first dimension arrays.
It should be noted that, no matter whether the device is a master or a slave, the array element corresponding to each device has a subscript in the condition-judging two-dimensional array, and the subscript of the slave is a position identifier of the array element corresponding to the slave in the condition-judging two-dimensional array, for example, the subscript of { device 2 (condition 1, condition 2) } in the first dimension array is int [1] [0], where [1] is a one-dimensional slave subscript and [0] is a two-dimensional slave subscript, which means that { device 2 (condition 1, condition 2) } is a second element in the first dimension array in the condition-judging two-dimensional array, and conversely, a device object in the condition-judging two-dimensional array can be correspondingly found through the subscript of the device in the condition-judging two-dimensional array.
When the host receives a condition judgment data packet sent by a slave, the subscripts of the slaves in the condition judgment two-dimensional array are marked based on the condition judgment data packet, specifically, the subscripts of the slaves corresponding to the condition judgment data packet can be marked according to the type of the condition judgment data packet, for example, the subscript int [1] [0] can be marked when the sent condition judgment data packet is the condition judgment achievement packet of the device 2 corresponding to the object { device 2 (condition 1, condition 2) }, the host only needs to mark the subscript of the slave corresponding to the condition judgment data packet in the condition judgment two-dimensional array, whether the conditions of all the slaves are achieved can be judged according to the marking result of the subscript of the slave, the network transmission of the device operation state data is reduced, the bandwidth is saved, the utilization rate of the network bandwidth is improved, and the device information and the device conditions of the host are respectively stored by the devices, whether equipment conditions are achieved or not is judged by utilizing the equipment states of the machine, so that the storage pressure of the equipment is reduced, and the number of the storage linkage equipment can be maximized.
S2, the host judges whether the device condition of the host is achieved according to the device state of the host;
the host computer obtains the equipment state of the host computer, judges the two-dimensional array to obtain the equipment condition of the host computer according to the condition, and judges whether the equipment condition of the host computer is achieved or not according to the equipment state of the host computer. For example, the air conditioner 1 is used as a host, and the condition 1 and the condition 2 are satisfied, then the condition of the equipment is determined to be fulfilled, wherein the condition 1 is used for cooling, the condition 2 is used for starting, if the equipment state of the air conditioner 1 is in the closed state, then the equipment condition of the air conditioner 1 is determined not to be fulfilled according to the equipment state, and if the condition 1 and the condition 2 are determined to be satisfied according to the current equipment state, then the equipment condition of the air conditioner 1 can be determined to be fulfilled.
S3, the device condition of the host is achieved, and the host judges whether the device condition of the slave is achieved based on the marking result of the slave subscript;
it should be noted that, the elements of the first dimension array corresponding to the host are in an and logical relationship, and therefore, it is necessary to achieve all the device conditions included in all the objects in the first dimension array to achieve the condition judgment. When the local device condition is already achieved, only the judgment of whether all the slave device conditions corresponding to the master are achieved is needed. The slave corresponding to the master is referred to herein as all the device objects except the master in the first dimension array in which the master is located. Because the objects of the second dimension arrays are in an OR logical relationship, condition judgment can be achieved only by judging that all equipment conditions in one first dimension array are achieved.
The method includes the steps that a host marks slave subscripts of slaves sending condition judgment data packets in a condition judgment two-dimensional array, whether all the slaves are in condition is judged according to marking results of the slave subscripts of the slaves, specifically, the slave subscripts of the slaves corresponding to the type of the condition judgment data packets can be marked according to the marking results of the slave subscripts of the slaves, for example, a device 2 corresponding to the object { device 2 (condition 1, condition 2) }, the sent condition judgment data packets are condition judgment achievement packets, the subscript int [1] [0] is marked as 1, after the marking is completed, the subscript marked as 1 is counted, the slave subscript corresponding to the host is found out, the slave subscript corresponding to the host is calculated, whether the number of elements except the host in a first dimension array corresponding to the host is equal to the number of the slaves corresponding to the mark 1, and if the number of the elements except the host in the first dimension array, otherwise the device conditions of the slaves are not fully fulfilled.
And S4, the device conditions of the slave machines are all achieved, and the master machine transmits an execution packet to the target device through a preset data transmission mode.
It should be noted that, when all the device conditions of the slave devices are met, the master device determines to judge the meeting conditions, and the master device needs to transmit an execution packet to the target device through a preset data transmission manner, where the target device may be specified by a user according to an actual situation, and the target device receives the execution packet, and by operating the execution packet, the linkage device may be controlled to execute an instruction according to a command in the preset execution packet, and a specific execution command of the execution packet may be customized according to an actual situation, and specific content is not limited. The preset data transmission mode comprises the following steps: the specific data transmission mode may be specified according to an actual application scenario, and the embodiment of the present invention is not limited in any way.
Has the advantages that: the method includes the steps that a condition judgment data packet sent by a slave is received by a master, the data packet is formed by judging whether the equipment condition of the slave is achieved or not according to the equipment state of the slave, the slave subscripts of the slave in a condition judgment two-dimensional array are marked by the master based on the data packet, the master acquires the equipment state of the master and judges whether the equipment condition of the master is achieved or not, if the equipment condition of the master is achieved, whether the equipment condition of the slave is achieved or not is judged based on the marking result of the subscripts of the slave by the master, and if the equipment condition of the slave is achieved, the master transmits an execution packet to a target device through a preset data transmission mode. To sum up, compared with the prior art, in the embodiment of the present invention, each linkage device only needs to pay attention to the device status and device condition of the host and the subscript in the condition determination two-dimensional array, and the device serving as the host only needs to pay more attention to the number of the first-dimensional array elements corresponding to the device status and subscript in the condition determination two-dimensional array, so as to complete the determination, and no need to pay attention to the information of other devices, so as to save computing resources, meanwhile, the slave machine sends the condition determination achievement packet and the condition determination loss packet by determining whether the device condition of the host is achieved, the host receives the condition determination data packet, marks the subscript of the slave machine corresponding to the slave machine in the condition determination two-dimensional array, and the host can determine whether the device condition is achieved completely based on the result of marking the subscript of the slave machine, so as to reduce the transmission of the device operation, the number of storage linkages can be maximized without worrying about the storage pressure of the equipment.
Example two
On the basis of the foregoing embodiment, the present invention further provides a distributed device condition determining method, as shown in fig. 2, before step S1, the method further includes:
s01, the host judges whether the condition judgment two-dimensional array has the equipment information of the host;
it should be noted that the condition determining two-dimensional array includes a first dimensional array, the element object in the first dimensional array includes device information and device conditions of the master and the slave, and when the master receives the condition determining two-dimensional array, the device information of the master is searched in the condition determining two-dimensional array to determine whether the device information of the master exists.
S02, recording a host subscript of the host in the condition judgment two-dimensional array, wherein the host subscript is a position identifier of the host in the condition judgment two-dimensional array;
it should be noted that, each array element corresponding to each device has a subscript in the conditional judgment two-dimensional array, where the array element includes a host and a slave, and the host subscript is a location identifier of the device in the conditional judgment two-dimensional array, for example, in the above embodiment, a subscript of { device 4 (condition 1, condition 2) } in a first dimensional array is int [0] [1], where [0] is a one-dimensional host subscript and [1] is a two-dimensional host subscript, which means that { device 4 (condition 1, condition 2) } is a 1 st element in a second first dimensional array in the conditional judgment two-dimensional array, otherwise, a device object in the conditional judgment two-dimensional array can be correspondingly found through the subscript of the device in the conditional judgment two-dimensional array.
And recording the position identification of the host in the two-dimensional array under the condition that the condition judges that the equipment information of the host exists in the two-dimensional array.
Preferably, if the device information of the host does not exist in the condition judgment two-dimensional array, the host deletes the condition judgment two-dimensional array. Which is advantageous for further reducing the storage pressure of the device.
And S03, if the host subscript meets the preset rule, determining the host as the host.
Specifically, the device corresponding to the position identifier satisfying the preset rule may be determined as the master, for example, the device corresponding to the last element in each first dimension array is determined as the master, and the condition judgment two-dimensional array includes a plurality of first dimension arrays, so that the condition judgment two-dimensional array may be used to determine a plurality of masters, and the plurality of first dimension arrays have an or logical relationship, and therefore, as long as any one of the masters judges that the device condition of the master is achieved and all slave device conditions corresponding to the master are achieved, and one of the masters which has the highest speed of achieving the condition is judged, the data packet may be sent, so that the efficiency of determining the plurality of devices and the plurality of conditions may be improved.
When the host subscript meets a preset rule, determining the host as the host, for example, when the host subscript in the condition judgment two-dimensional array is int [0] [1], the preset rule is: and determining the equipment corresponding to the subscript of the one-dimensional array as 0 as the host, and determining the equipment corresponding to the subscript as the host if the subscript int [0] [1] meets a preset rule.
Preferably, the subscript of the host in the two-dimensional array for condition judgment comprises a one-dimensional host subscript N1And a two-dimensional host subscript N2Wherein N is1And N2Is a natural number, if N1When the value is 0, the host is determined.
The one-dimensional host subscript indicates the location identification of the device in the first-dimensional array when N is1When the value is 0, namely the first device condition object in the first dimension array, the device corresponding to the first element in each first dimension array is determined as the host, so that the efficiency of determining the host can be improved.
And S04, recording the number M of the first dimension array elements corresponding to the host, wherein M is a positive integer.
And after the host is determined by the condition judgment two-dimensional array, recording the number of the first-dimensional array elements corresponding to the host.
S1, the master machine marks the subscripts of the slave machines in the condition judgment two-dimensional array based on the condition judgment data packets sent by the slave machines, the condition judgment two-dimensional array comprises a first dimension array and a second dimension array, wherein the elements in the first dimension array comprise device information and device conditions of the master and the slave, the elements have logical relation of AND, the second dimension array is composed of at least one first dimension array, the first dimension arrays have logical relation of OR, each first dimension array has a device as host, the other devices are slaves, the condition judgment data packet is a data packet formed by judging whether the device condition of the slave is achieved or not by the slave according to the device state of the slave, and the subscript of the slave is the position identification of the slave in the condition judgment two-dimensional array;
s2, the host judges whether the device condition of the host is achieved according to the device state of the host;
s3, the device condition of the host is achieved, and the host judges whether the device condition of the slave is achieved based on the marking result of the slave subscript;
the specific implementation of steps S1-S3 has been described in detail in the above embodiments, and will not be described herein again.
Preferably, when M is 1 and the device condition of the slave is achieved, it is directly determined that all the device conditions of the slave are achieved.
It should be noted that the number of the first dimension array elements corresponding to the master is at least one, but when only one element exists in a certain first dimension array, that is, an element corresponding to the master device, at this time, it is not necessary to determine whether the device conditions of the master device and the slave device are all achieved, but only whether the device conditions of the master device are achieved is determined, and under the condition that the device conditions of the master device are achieved, it can be determined that the device conditions of the slave device are all achieved. Therefore, when M is 1, the first dimension array corresponding to the master has no devices as slaves except the master, and it can be directly determined that all the device conditions of the slaves are met.
Preferably, when M >1, the master marks the slave subscript of the slave in the condition judgment two-dimensional array based on the condition judgment data packet sent by the slave.
Preferably, the master marks the slave subscripts of the slaves in the condition judgment two-dimensional array based on the condition judgment data packets sent by the slaves, and the method specifically includes:
the condition judgment data packet comprises a condition judgment achievement packet and a condition judgment missing packet, the subscript of the slave machine corresponding to the condition judgment achievement packet is marked as 1, and the subscript of the slave machine corresponding to the condition judgment missing packet is marked as 0.
It should be noted that, each array element corresponding to each device has a subscript in the conditional judging two-dimensional array, where the subscript includes a host and a slave, and the slave subscript is a position identifier of the slave in the conditional judging two-dimensional array, for example, in the above embodiment, a subscript of { device 2 (condition 1, condition 2) } in the first dimensional array is int [1] [0], where [1] is a one-dimensional slave subscript and [0] is a two-dimensional slave subscript, which means that { device 2 (condition 1, condition 2) } is a second element in the first dimensional array in the conditional judging two-dimensional array, otherwise, a device object in the conditional judging two-dimensional array can be correspondingly found through the subscript of the device in the conditional judging two-dimensional array.
For example, if the { device 2 (condition 1, condition 2) } in the first dimension array corresponds to the condition judgment data packet sent by the device 2, and if the { device 3 (condition 1, condition 2, condition 3) } in the first dimension array corresponds to the condition judgment data packet sent by the device 3, the slave subscript int [1] [0] is marked as 1, and the slave subscript int [2] [0] is marked as 0.
Preferably, the determining, by the master, whether all the device conditions of the slave have been met based on the result of marking the slave subscript includes:
when the equipment condition of the host is achieved, counting a first slave subscript marked as 1;
selecting a second slave subscript which is the same as the two-dimensional master subscript of the master from the first slave subscript;
and when the number of the slaves corresponding to the second slave index N satisfies N-1, determining that all the equipment conditions of the slaves are met, wherein N is a natural number.
The method includes that a master receives a condition judgment data packet sent by a slave, not all the condition judgment data packet are corresponding slaves in a first dimension array corresponding to the master, slaves corresponding to other masters may exist in the slaves sending the condition judgment data packet, and when the equipment condition of the master is achieved, a first slave subscript marked as 1 is counted, that is, all received condition judgment reach packet corresponding slave subscripts are counted, only one part of the first slave subscript is a slave subscript of an element in first dimension data corresponding to the master, so that a subscript identical to a two-dimensional master subscript of the master is selected according to a condition judgment two-dimensional array and is marked as a second slave subscript, for example, if the first slave subscript is marked as: the subscript of { device 2 (condition 1, condition 2) } is int [1] [0], { device 3 (condition 1, condition 2, condition 3) } is int [2] [0], { device 5 (condition 1) } is int [1] [1], { device 1 (condition 2, condition 3, condition 4) } is int [2] [1], { device 3 (condition 3) } is int [1] [2], { device 5 (condition 1, condition 2, condition 3) } is int [2] [2], { device 1 (condition 5) } is int [0] [3], and if the host is { device 1 (condition 1, condition 2) }, it corresponds to int [0] [0], and its two-dimensional host subscript is [0], therefore, the same subscript as the two-dimensional host is selected as: int [1] [0], int [2] [0], therefore, at this time, the number of slaves N corresponding to the second slave index is 2, the number of first dimension array elements M corresponding to the master { device 1 (condition 1, condition 2) } is 3, and N is M-1, it is determined that the device conditions of the slaves are all achieved, otherwise, the device conditions of the slaves are not all achieved, and the condition judgment is ended. By using the subscript marking method in the condition two-dimensional array, the transmission of equipment running state data can be saved, the network bandwidth utilization rate is improved, and the equipment condition judgment efficiency is improved.
And S4, the device conditions of the slave machines are all achieved, and the master machine transmits an execution packet to the target device through a preset data transmission mode.
It should be noted that, when all the device conditions of the slave devices corresponding to the master device are achieved, the master device determines to determine the achievement condition, and transmits an execution packet to the target device through a preset data transmission manner, where the target device is specified by a user, and the slave device corresponding to the master device receives the execution packet, and by operating the execution packet, the linkage device may be controlled to execute the command according to a command in the preset execution packet, and a specific execution command of the execution packet may be customized according to actual needs, and specific contents are not limited.
Has the advantages that: the method includes the steps that a host judges a data packet based on conditions sent by a slave, marks slave subscripts of the slave in a condition judgment two-dimensional array, acquires the equipment state of the host and judges whether the equipment conditions of the host are achieved, if yes, judges whether all the equipment conditions of the slave are achieved based on the marking result of the host on the slave subscripts, and if yes, transmits an execution packet to a target device in a preset data transmission mode. To sum up, compared with the prior art, each linkage device in the embodiment of the present invention only needs to pay attention to the device status and device condition of the host and the subscript in the condition determination two-dimensional array, and the device serving as the host only needs to pay more attention to the number of the first-dimensional array elements corresponding to the device status and device condition, and does not need to pay attention to the information of other devices, so as to save computing resources, meanwhile, the slave sends the condition determination achievement packet and the condition determination loss packet by determining whether the device condition of the host is achieved, the host marks the subscript of the slave in the condition determination two-dimensional array after receiving the condition determination data packet, and the subscript marking method in the condition two-dimensional array is used, so as to save the transmission of the device operation status data, improve the network bandwidth utilization rate, and improve the device condition determination efficiency, and in addition, through the distributed storage in the embodiment of, the number of storage linkages can be maximized without worrying about the storage pressure of the equipment. The condition judgment two-dimensional arrays can be used for determining a plurality of hosts, and the plurality of first-dimensional arrays are in an OR logic relationship, so that a data packet can be sent only when any one of the hosts judges that the equipment condition of the host is achieved and all the slave equipment conditions corresponding to the hosts are achieved, and the highest speed of the condition achievement is judged among the hosts, so that the efficiency of judging multiple equipment and multiple conditions can be improved.
EXAMPLE III
An embodiment of the present invention provides a distributed device condition determining method, as shown in fig. 3, specifically including:
s101, acquiring the equipment state of the slave machine;
the execution main body of the embodiment of the invention is slave equipment, and the slave equipment acquires the equipment running state of the slave equipment, such as the starting, closing, suspending and other states of an air conditioner.
S102, the slave machine judges whether the equipment condition of the slave machine is achieved according to the equipment state of the slave machine;
s103, the equipment condition of the slave is achieved, and the slave judges the achievement packet to the host through a preset data transmission mode transmission condition;
or, the slave machine does not achieve the equipment condition, and the slave machine transmits the condition judgment lost packet to the host machine through a preset data transmission mode.
When the device serving as the slave machine judges that the condition of the device is achieved, the slave machine judges that a packet is achieved to be sent to the host machine through a preset data transmission mode transmission condition, or when the condition of the device is not achieved, the slave machine judges that a packet is lost to be sent to the host machine through the preset data transmission mode transmission condition.
Preferably, in step S103, if the device condition of the slave is met, the slave determines that a packet is sent to the master through a preset data transmission mode;
or, the device condition of the slave is not met, and the slave determines that the lost packet is sent to the master by using a preset data transmission mode transmission condition, which may specifically include the following steps:
s1031, if the device condition of the slave is achieved, determining whether a transition occurs in the achieved state of the device condition of the slave;
s1032, if the achievement state of the device condition of the slave device is changed, the slave device determines an achievement packet to the master device through a preset data transmission mode transmission condition;
or,
s1033, if the device condition of the slave is not achieved, determining whether a transition occurs in the device condition of the slave that is not achieved;
s1034, if the device condition of the slave machine is not reached and the state is changed, the slave machine transmits a condition judgment lost packet to the host machine through a preset data transmission mode.
For example, the air conditioner 1 is used as a slave machine, and the conditions 1 and 2 are satisfied, then the condition is achieved, wherein the condition 1 is cooling, the condition 2 is on, if the equipment state of the air conditioner 1 is off, and the state of the air conditioner 1 is on and cooling before the equipment state, then the judgment condition of the air conditioner 1 is not achieved according to the current state of the equipment, and the state which is not achieved is changed from the achieved state to the lost state, when the state which is not achieved is changed, the slave machine transmits the condition lost packet through the preset data transmission mode, otherwise the data packet is not transmitted through the preset data transmission mode, of course, if the state of the air conditioner 1 is still on and cooling at the moment, the condition of the air conditioner 1 is achieved, but the state which is achieved with the previous condition is not changed, the condition achieved packet is not transmitted, and only when the achieved state is changed from the state which is not achieved to the achieved, the conditional attainment packet is sent. Therefore, the transmission quantity of data can be reduced, and the network bandwidth utilization rate can be further improved.
Preferably, before acquiring the device status in step S101, the method may further include:
s1001, the slave machine judges whether the condition judgment two-dimensional array has the equipment information of the slave machine, the condition judgment two-dimensional array comprises a first dimension array and a second dimension array, elements in the first dimension array comprise the equipment information and the equipment condition of the master machine and the slave machine, an AND logical relation is formed between the elements, the second dimension array is composed of at least one first dimension array, an OR logical relation is formed between the first dimension arrays, one equipment in each first dimension array is the master machine, and the rest equipment is the slave machine;
s1002, the device information of the slave machine exists in the condition judgment two-dimensional array, and a slave machine subscript of the local machine in the condition judgment two-dimensional array is recorded, wherein the slave machine subscript is a position identification of the slave machine in the condition judgment two-dimensional array;
the specific implementation method is the same as the implementation method of recording the subscript of the host in the condition judgment two-dimensional array, and details are not repeated here.
And if the local equipment information does not exist in the condition judgment two-dimensional array, deleting the condition judgment two-dimensional array. The device storage pressure can be further reduced.
And S1003, if the subscript of the slave machine meets a preset rule, determining the slave machine.
Preferably, the slave subscripts comprise a one-dimensional slave subscript N3And a two-dimensional slave subscript N4Wherein N is3And N4Is a natural number, if N3>And when 0, determining the slave machine.
Correspondingly, in the condition judgment two-dimensional array, the devices corresponding to the elements except the first element in each first-dimensional array are determined as slaves.
Has the advantages that: the method comprises the steps that a slave machine acquires equipment running state data of the machine, whether equipment conditions of the slave machine are achieved or not is judged, if the equipment conditions of the slave machine are achieved and the achieved states are changed, the slave machine transmits a condition judgment achievement packet to a host machine through a preset data transmission mode, and if the equipment conditions of the slave machine are achieved but the achieved states are not changed, the slave machine does not transmit the condition judgment data packet to the host machine through the preset data transmission mode; if the device condition of the slave is not achieved and the state of the slave is not transformed, the slave judges that a lost packet is sent to the host through a preset data transmission mode transmission condition, and if the device condition of the slave is not achieved and the state of the slave is not transformed, the slave does not judge that a data packet is sent to the host through the preset data transmission mode transmission condition, so that the transmission quantity of the device condition judgment data packet can be reduced, and the network bandwidth utilization rate can be further improved.
Example four
An embodiment of the present invention further provides a distributed device condition determining system, as shown in fig. 4, fig. 4 is a schematic structural diagram of a distributed device condition determining system 400, where the system specifically includes:
a first receiving module 410, configured to receive a condition determination packet sent by a slave, where the condition determination packet is a packet formed by the slave determining whether a device condition of the slave is achieved according to a device state of the slave;
a marking module 420, configured to mark, by a master, a slave subscript in a conditional judgment two-dimensional array of the slave based on a conditional judgment data packet sent by the slave, where the conditional judgment two-dimensional array includes a first dimensional array and a second dimensional array, where elements in the first dimensional array include device information and device conditions of the master and the slave, an and logical relationship is formed between the elements, the second dimensional array is composed of at least one first dimensional array, an or logical relationship is formed between the first dimensional arrays, one device in each first dimensional array is a master, the other devices are slaves, and the slave subscript is a position identifier of the slave in the conditional judgment two-dimensional array;
a first determining module 430, configured to determine whether a device condition of the host is met according to a device state of the host;
a second determination module 440, configured to determine that the device condition of the master is achieved, where the master determines whether all the device conditions of the slave are achieved based on a marking result of the slave subscript;
the first transmission module 450 is configured to transmit the execution packet to the slave device in a predetermined data transmission manner when all the device conditions of the slave device are met.
Preferably, the distributed device condition determining system 400 further includes:
the second receiving module is used for receiving the condition judgment two-dimensional array;
the third judging module is used for judging whether the condition judgment two-dimensional array has the equipment information of the host;
the first recording module is used for recording a host subscript of the host in the condition judgment two-dimensional array, wherein the host subscript is a position identifier of the host in the condition judgment two-dimensional array;
and the first determining module is used for determining the host as the host if the host subscript meets a preset rule.
Preferably, the native subscripts include a one-dimensional host subscript N1And two-dimensional masterSubscript N2Wherein N is1And N2The first determining module is a natural number, and specifically includes:
a first determination unit for determining if N is1When the value is 0, the host is determined.
Preferably, another distributed device condition determining system further includes:
and the deleting module is used for deleting the condition judgment two-dimensional array when the third judging module judges that the condition judgment two-dimensional array does not have the equipment information of the host.
Preferably, another distributed device condition determining system further includes:
and the second recording module is used for judging whether the two-dimensional array has the equipment information of the host under the condition and recording the number M of the first-dimensional array elements corresponding to the host, wherein the M is a positive integer.
Preferably, when M is equal to 1, the second determining module specifically includes:
and a second determination unit configured to directly determine that all the device conditions of the slave are achieved, if the device conditions of the master are achieved.
Preferably, when M >1, the marking module specifically includes:
a first marking unit, configured to mark a slave index of a slave corresponding to the condition judgment achievement packet in the condition judgment two-dimensional array as 1;
and a second marking unit, configured to mark, in the two-dimensional conditional access array, a slave index of a slave corresponding to the conditional access packet as 0, where the conditional access packet includes a conditional access packet and a conditional access packet.
Preferably, the second determining module specifically includes:
the counting unit is used for counting the subscript of the first slave machine marked as 1 when the first judging module judges that the equipment condition of the host machine is achieved;
the selection unit is used for selecting a second slave subscript which is the same as the two-dimensional array subscript of the master from the first slave subscript;
and a third determining unit configured to determine that all the device conditions of the slaves are met when the number N of slaves corresponding to the second slave index satisfies N-1, where N is a natural number.
Has the advantages that: the method comprises the steps that a host judges a data packet based on a condition sent by a slave, marks a slave subscript of the slave in a condition judgment two-dimensional array, acquires the equipment state of the host and judges whether the equipment condition of the host is achieved, if the equipment condition of the host is achieved, the host judges whether the equipment condition of the slave is achieved completely based on the mark, and if the equipment condition of the slave is achieved, the host transmits an execution packet to target equipment in a preset data transmission mode. To sum up, compared with the prior art, each linkage device in the embodiment of the present invention only needs to pay attention to the device state and the device condition of the host and the subscript in the condition determination two-dimensional array, and the host only needs to pay more attention to the number of the first-dimensional array elements corresponding to the host, and can complete the determination without paying attention to the information of other devices, so as to save the computing resources, meanwhile, the slave sends the condition determination achievement packet and the condition determination loss packet by determining whether the device condition of the host is achieved, the host marks the subscript of the slave corresponding to the slave in the condition determination two-dimensional array after receiving the condition determination data packet, and the host can determine whether the device condition is achieved completely based on the marking result of the subscript of the slave, so as to reduce the transmission of the device operation state data and improve the network bandwidth utilization rate, and in addition, through the distributed storage, the number of storage linkages can be maximized without worrying about the storage pressure of the equipment.
The distributed device condition determining system 400 according to the embodiment of the present invention is a distributed device condition determining method corresponding to the above embodiment, and the determining system 400 further includes a plurality of units for implementing corresponding functions corresponding to corresponding steps of the distributed device condition determining method. Since the steps of the distributed device condition determining method have been described in detail in the above embodiments, no further description is given in this system 400.
EXAMPLE five
An embodiment of the present invention further provides a distributed device condition determining system, as shown in fig. 5, fig. 5 is a schematic structural diagram of a distributed device condition determining system 500, where the system specifically includes:
an obtaining module 510, configured to obtain a device status;
a fourth judging module 520, configured to judge whether an equipment condition of a slave is achieved according to an equipment state of the slave;
a second transmission module 530, configured to enable the slave to achieve the device condition, where the slave transmits the condition judgment achievement packet to the master through a preset data transmission manner;
a third transmission module 540, configured to determine that the device condition of the slave is not met, where the slave transmits the condition determination loss packet to the master through a preset data transmission manner.
Preferably, another distributed device condition determining system further includes:
a third receiving module, configured to receive a condition-judging two-dimensional array, where the condition-judging two-dimensional array includes a first dimensional array and a second dimensional array, where elements in the first dimensional array include device information and device conditions of a host and a slave, an and logical relationship is formed between the elements, the second dimensional array is composed of at least one first dimensional array, an or logical relationship is formed between the first dimensional arrays, one device in each first dimensional array is a host, and the other devices are slaves;
the fifth judging module is used for judging whether the condition judgment two-dimensional array has the equipment information of the slave machine or not;
the third recording module is used for recording the slave subscript of the slave in the condition judgment two-dimensional array, wherein the slave subscript is the position identification of the slave in the condition judgment two-dimensional array;
and the second determining module is used for determining the slave machine if the slave machine subscript meets a preset rule.
Preferably, the slave subscripts comprise a one-dimensional slave subscript N3And a two-dimensional slave subscript N4Wherein N is3And N4The second determining module is a natural number, and specifically includes:
a fourth determination unit for determining if N is3>And when 0, determining the slave machine.
Preferably, the second transmission module specifically includes:
a first judgment unit, configured to judge whether a transition occurs in an achievement state of the device condition of the slave when the fourth judgment module judges that the device condition of the slave is achieved;
and the first transmission unit is used for transmitting the condition judgment achievement packet to the master machine by the slave machine through a preset data transmission mode when the first judgment unit judges that the achievement state of the equipment condition of the slave machine is changed.
Preferably, the third transmission module specifically includes:
a second determination unit, configured to determine whether a transition occurs in an unachieved state of the device condition of the slave when the fourth determination module determines that the device condition of the slave is not achieved;
and a second transmission unit, configured to, when the second determination unit determines that the device condition of the slave is changed from the unachieved state, transmit, by the slave, a condition-determined loss packet to the host in a preset data transmission manner.
Has the advantages that: the method comprises the steps that a slave machine acquires equipment running state data of the machine, whether equipment conditions of the slave machine are achieved or not is judged, if the equipment conditions of the slave machine are achieved and the achieved states are changed, the slave machine transmits a condition judgment achievement packet to a host machine through a preset data transmission mode, and if the equipment conditions of the slave machine are achieved but the achieved states are not changed, the slave machine does not transmit the condition judgment data packet to the host machine through the preset data transmission mode; if the device condition of the slave is not achieved and the state of the slave is not transformed, the slave judges that a lost packet is sent to the host through a preset data transmission mode transmission condition, and if the device condition of the slave is not achieved and the state of the slave is not transformed, the slave does not judge that a data packet is sent to the host through the preset data transmission mode transmission condition, so that the transmission quantity of the device condition judgment data packet can be reduced, and the network bandwidth utilization rate can be further improved.
The distributed device condition determining system 500 according to the embodiment of the present invention is a distributed device condition determining method corresponding to the above embodiment, and the determining system 500 further includes a plurality of units for implementing corresponding functions corresponding to corresponding steps of the distributed device condition determining method. Since the steps of the distributed device condition determining method have been described in detail in the above embodiments, no further description is given in the system 500.
As shown in fig. 6, the embodiment of the present invention further provides a distributed device condition determining device 6, where the distributed multi-device multi-condition determining device 6 includes a memory 61, a processor 62, and a computer program 63 stored in the memory 61 and executable on the processor 62, and the processor 62 implements the steps of the distributed device condition determining method when executing the computer program 63.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when executed by a processor, the computer program implements part or all of the steps of any one of the distributed device condition determination methods described in the above method embodiments.
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 invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. 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 by the invention.
In the foregoing embodiments, 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 addition, functional units in the embodiments of the present invention 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 above embodiments of the present invention are described in detail, and the principle and the implementation of the present invention are explained by applying specific embodiments, and the above description of the embodiments is only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (29)
1. A distributed device condition judgment method is characterized by comprising the following steps:
the host marks the subscripts of the slaves in a condition judgment two-dimensional array based on a condition judgment data packet sent by the slaves, wherein the condition judgment two-dimensional array comprises a first dimension array and a second dimension array, wherein the elements in the first dimension array comprise device information and device conditions of the master and the slave, the elements have logical relation of AND, the second dimension array is composed of at least one first dimension array, the first dimension arrays have logical relation of OR, each first dimension array has a device as host, the other devices are slaves, the condition judgment data packet is a data packet formed by judging whether the device condition of the slave is achieved or not by the slave according to the device state of the slave, and the subscript of the slave is the position identification of the slave in the condition judgment two-dimensional array;
the host machine judges whether the equipment condition of the host machine is achieved according to the equipment state of the host machine;
the device condition of the host is met, and the host judges whether the device condition of the slave is completely met or not based on the marking result of the slave subscript;
and the master transmits an execution packet to the target equipment in a preset data transmission mode.
2. The distributed apparatus condition judgment method according to claim 1, wherein the master marks the slave subscripts in the two-dimensional condition judgment array based on condition judgment data packets sent by the slaves, and before the method further comprises:
the host judges whether the condition judgment two-dimensional array has the equipment information of the host or not;
the device information of the host exists in the condition judgment two-dimensional array, and a host subscript of the host in the condition judgment two-dimensional array is recorded, wherein the host subscript is a position identification of the host in the condition judgment two-dimensional array;
and if the subscript of the host meets a preset rule, determining the host as the host.
3. The distributed device condition judgment method according to claim 2, wherein the host subscript satisfies a preset rule, and is determined as a host, specifically comprising:
the host subscript comprises a one-dimensional host subscript N1And a two-dimensional host subscript N2Wherein N is1And N2Is a natural number, if N1When the value is 0, the host is determined.
4. The method according to claim 3, wherein said if N is equal to1When the value is 0, the host is determined, and the following steps are included:
and recording the number M of the first-dimension array elements corresponding to the host, wherein M is a positive integer.
5. The distributed device condition judging method according to claim 4, wherein when M >1, the master marks the slave index of the slave in the condition judgment two-dimensional array based on a condition judgment packet sent by the slave.
6. The distributed device condition judgment method according to claim 5, wherein the marking, by the master, the slave subscripts of the slaves in the condition judgment two-dimensional array based on the condition judgment data packets sent by the slaves specifically comprises:
the condition judgment data packet comprises a condition judgment achievement packet and a condition judgment missing packet, the subscript of the slave machine corresponding to the condition judgment achievement packet is marked as 1, and the subscript of the slave machine corresponding to the condition judgment missing packet is marked as 0.
7. The distributed device condition determining method according to claim 6, wherein the device condition of the master is achieved, and the master determines whether all the device conditions of the slaves are achieved based on the result of marking the slave subscripts, specifically comprising:
when the equipment condition of the host is achieved, counting a first slave subscript marked as 1;
selecting a second slave subscript which is the same as the two-dimensional master subscript of the master from the first slave subscript;
and when the number of the slaves corresponding to the second slave index N satisfies N-1, determining that all the equipment conditions of the slaves are met, wherein N is a natural number.
8. The distributed device condition determining method according to claim 4, wherein when M is 1 and the device condition of the master is achieved, it is directly determined that all the device conditions of the slaves are achieved.
9. The distributed device condition determining method according to claim 2, wherein if the device information of the host does not exist in the condition determining two-dimensional array, the host deletes the condition determining two-dimensional array.
10. A distributed device condition judgment method is characterized by comprising the following steps:
the slave machine acquires the equipment state of the slave machine;
the slave machine judges whether the equipment condition of the slave machine is achieved according to the equipment state of the slave machine;
the slave machine achieves the equipment condition, and the slave machine judges the achievement packet to the host machine through a preset data transmission mode transmission condition;
or, the slave machine does not achieve the equipment condition, and the slave machine transmits the condition judgment lost packet to the host machine through a preset data transmission mode.
11. The distributed device condition determining method according to claim 10, wherein the slave computer obtains a device state of the slave computer, and further comprises:
the slave machine judges whether the condition judgment two-dimensional array has the equipment information of the slave machine, the condition judgment two-dimensional array comprises a first-dimensional array and a second-dimensional array, elements in the first-dimensional array comprise the equipment information and the equipment conditions of the master machine and the slave machine, an AND logical relation is formed between the elements, the second-dimensional array is composed of at least one first-dimensional array, an OR logical relation is formed between the first-dimensional arrays, one equipment in each first-dimensional array is the master machine, and the other equipment is the slave machine;
the device information of the slave machine exists in the condition judgment two-dimensional array, and a slave machine subscript of the slave machine in the condition judgment two-dimensional array is recorded, wherein the slave machine subscript is a position identification of the slave machine in the condition judgment two-dimensional array;
and if the subscript of the slave machine meets a preset rule, determining the slave machine as the slave machine.
12. The distributed device condition judging method according to claim 11, wherein if the slave subscript satisfies a preset rule, the slave is determined to be a slave, and specifically includes:
the slave subscripts comprise a one-dimensional slave subscript N3And a two-dimensional slave subscript N4Wherein N is3And N4Is a natural number, if N3>And when 0, determining the slave machine.
13. The method according to claim 12, wherein the achieving of the device condition of the slave device, and the transmitting of the condition judgment achievement packet from the slave device to the master device through a preset data transmission method, specifically comprise:
if the equipment condition of the slave is achieved, judging whether the achieved state of the equipment condition of the slave is changed or not;
and if the achievement state of the equipment condition of the slave machine is changed, the slave machine transmits a condition judgment achievement packet to the host machine through a preset data transmission mode.
14. The method according to claim 13, wherein the slave device has an unachieved device condition, and the slave device transmits the condition determination lost packet to the master device through a predetermined data transmission method, specifically comprising:
if the equipment condition of the slave is not achieved, judging whether the device condition of the slave is not achieved or not;
and if the unachieved state of the equipment condition of the slave machine is changed, the slave machine judges the lost packet to the host machine through a preset data transmission mode transmission condition.
15. A distributed device condition determination system, the system comprising:
the first receiving module is used for receiving a condition judgment data packet sent by a slave, wherein the condition judgment data packet is a data packet formed by judging whether the equipment condition of the slave is achieved or not by the slave according to the equipment state of the slave;
the system comprises a marking module, a condition judging module and a judging module, wherein the marking module is used for marking a slave subscript of a slave in a condition judging two-dimensional array by a master based on a condition judging data packet sent by the slave, the condition judging two-dimensional array comprises a first dimensional array and a second dimensional array, elements in the first dimensional array comprise equipment information and equipment conditions of the master and the slave, an AND logical relation is formed between the elements, the second dimensional array is composed of at least one first dimensional array, an OR logical relation is formed between the first dimensional arrays, one equipment is a master in each first dimensional array, the rest equipment is a slave, and the slave subscript is a position identification of the slave in the condition judging two-dimensional array;
the first judgment module is used for judging whether the equipment condition of the host is achieved according to the equipment state of the host;
the second judgment module is used for judging whether the equipment conditions of the slave machines are all achieved or not by the host machine based on the marking result of the slave machine subscript;
and the first transmission module is used for completely achieving the equipment conditions of the slave machines, and the host machine transmits the execution packet to the target equipment in a preset data transmission mode.
16. The distributed device condition determination system of claim 15, wherein the system further comprises:
the second receiving module is used for receiving the condition judgment two-dimensional array;
the third judging module is used for judging whether the condition judgment two-dimensional array has the equipment information of the host;
the first recording module is used for recording a host subscript of the host in the condition judgment two-dimensional array, wherein the host subscript is a position identifier of the host in the condition judgment two-dimensional array;
and the first determining module is used for determining the host as the host if the host subscript meets a preset rule.
17. The distributed device condition determining system of claim 16, wherein the host subscript comprises a one-dimensional host subscript N1And a two-dimensional host subscript N2Wherein N is1And N2The first determining module is a natural number, and specifically includes:
a first determination unit for determining if N is1When the value is 0, the host is determined.
18. The distributed device condition determination system of claim 17, wherein the system further comprises:
and the second recording module is used for judging whether the two-dimensional array has the equipment information of the host under the condition and recording the number M of the first-dimensional array elements corresponding to the host, wherein the M is a positive integer.
19. The distributed device condition determining system according to claim 18, wherein when M >1, the marking module specifically includes:
a first marking unit, configured to mark a slave index of a slave corresponding to the condition judgment achievement packet in the condition judgment two-dimensional array as 1;
and a second marking unit, configured to mark, in the two-dimensional conditional access array, a slave index of a slave corresponding to the conditional access packet as 0, where the conditional access packet includes a conditional access packet and a conditional access packet.
20. The distributed device condition determining system according to claim 19, wherein the second determining module specifically includes:
the counting unit is used for counting the subscript of the first slave machine marked as 1 when the first judging module judges that the equipment condition of the host machine is achieved;
a selection unit, configured to select a second slave subscript that is the same as the two-dimensional master subscript of the master from the first subscript;
and a third determining unit configured to determine that all the device conditions of the slaves are met when the number N of slaves corresponding to the second slave index satisfies N-1, where N is a natural number.
21. The distributed device condition determining system according to claim 18, wherein when M is 1, the second determining module specifically includes:
and a second determination unit configured to directly determine that all the device conditions of the slave are achieved, if the device conditions of the master are achieved.
22. The distributed device condition determination system of claim 16, further comprising:
and the deleting module is used for deleting the condition judgment two-dimensional array when the third judging module judges that the condition judgment two-dimensional array does not have the equipment information of the host.
23. A distributed device condition determination system, the system comprising:
the acquisition module is used for acquiring the equipment state;
the fourth judging module is used for judging whether the equipment condition of the slave machine is achieved according to the equipment state of the slave machine;
the second transmission module is used for achieving the equipment condition of the slave machine, and the slave machine transmits a condition judgment achievement packet to the host machine through a preset data transmission mode;
and the third transmission module is used for judging that the equipment condition of the slave is not achieved, and the slave transmits the condition to judge that the lost packet is sent to the host through a preset data transmission mode.
24. The distributed device condition determination system of claim 23, wherein the system further comprises:
a third receiving module, configured to receive a condition-judging two-dimensional array, where the condition-judging two-dimensional array includes a first dimensional array and a second dimensional array, where elements in the first dimensional array include device information and device conditions of a host and a slave, an and logical relationship is formed between the elements, the second dimensional array is composed of at least one first dimensional array, an or logical relationship is formed between the first dimensional arrays, one device in each first dimensional array is a host, and the other devices are slaves;
the fifth judging module is used for judging whether the condition judgment two-dimensional array has the equipment information of the slave machine or not;
the third recording module is used for recording the slave subscript of the slave in the condition judgment two-dimensional array, wherein the slave subscript is the position identification of the slave in the condition judgment two-dimensional array;
and the second determining module is used for determining the slave machine if the slave machine subscript meets a preset rule.
25. The distributed device condition determining system of claim 24, wherein the slave index comprises a one-dimensional slave index N3And a two-dimensional slave subscript N4Wherein N is3And N4The second determining module is a natural number, and specifically includes:
a fourth determination unit for determining if N is3>And when 0, determining the slave machine.
26. The distributed device condition determining system according to claim 25, wherein the second transmission module specifically includes:
a first judgment unit, configured to judge whether a transition occurs in an achievement state of the device condition of the slave when the fourth judgment module judges that the device condition of the slave is achieved;
and the first transmission unit is used for transmitting the condition judgment achievement packet to the master machine by the slave machine through a preset data transmission mode when the first judgment unit judges that the achievement state of the equipment condition of the slave machine is changed.
27. The distributed device condition determining system according to claim 26, wherein the third transmission module specifically includes:
a second determination unit, configured to determine whether a transition occurs in an unachieved state of the device condition of the slave when the fourth determination module determines that the device condition of the slave is not achieved;
and a second transmission unit, configured to, when the second determination unit determines that the device condition of the slave is changed from the unachieved state, transmit, by the slave, a condition-determined loss packet to the host in a preset data transmission manner.
28. A distributed device condition determining device, the device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of a distributed device condition determining method according to any one of claims 1 to 9 when executing the computer program.
29. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of a distributed device condition determination method according to any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811582340.4A CN111355642B (en) | 2018-12-24 | 2018-12-24 | Distributed equipment condition judgment method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811582340.4A CN111355642B (en) | 2018-12-24 | 2018-12-24 | Distributed equipment condition judgment method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111355642A true CN111355642A (en) | 2020-06-30 |
CN111355642B CN111355642B (en) | 2021-04-16 |
Family
ID=71198020
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811582340.4A Active CN111355642B (en) | 2018-12-24 | 2018-12-24 | Distributed equipment condition judgment method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111355642B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115374188A (en) * | 2022-10-24 | 2022-11-22 | 沐曦科技(成都)有限公司 | Resource state query method and device, electronic equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003152879A (en) * | 2001-11-08 | 2003-05-23 | Sharp Corp | Home automation system and its control method |
CN101222377A (en) * | 2007-11-23 | 2008-07-16 | 深圳国人通信有限公司 | Method and device for processing slave machine parameter in distributed master-salve machine communication |
CN102736599A (en) * | 2012-06-14 | 2012-10-17 | 华北电力大学(保定) | Real-time interaction intelligent terminal control system based on internet of things technology |
CN104238466A (en) * | 2013-06-08 | 2014-12-24 | 华北电力大学(保定) | Smart power and energy using system platform based on Cloud of Things |
CN105447570A (en) * | 2015-09-25 | 2016-03-30 | 东北大学 | PIR sensor layout method used for personnel position tracking in intelligent household |
CN106341432A (en) * | 2015-07-06 | 2017-01-18 | 天津九洲云物联科技有限公司 | Intelligent home system |
EP3158714A1 (en) * | 2014-06-23 | 2017-04-26 | Google, Inc. | Methods and apparatus for using smart environment devices via application program interfaces |
CN207571493U (en) * | 2017-12-20 | 2018-07-03 | 新动力(北京)建筑科技有限公司 | A kind of smart home security combined control system and intelligent home lamplight control system |
-
2018
- 2018-12-24 CN CN201811582340.4A patent/CN111355642B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003152879A (en) * | 2001-11-08 | 2003-05-23 | Sharp Corp | Home automation system and its control method |
CN101222377A (en) * | 2007-11-23 | 2008-07-16 | 深圳国人通信有限公司 | Method and device for processing slave machine parameter in distributed master-salve machine communication |
CN102736599A (en) * | 2012-06-14 | 2012-10-17 | 华北电力大学(保定) | Real-time interaction intelligent terminal control system based on internet of things technology |
CN104238466A (en) * | 2013-06-08 | 2014-12-24 | 华北电力大学(保定) | Smart power and energy using system platform based on Cloud of Things |
EP3158714A1 (en) * | 2014-06-23 | 2017-04-26 | Google, Inc. | Methods and apparatus for using smart environment devices via application program interfaces |
CN106341432A (en) * | 2015-07-06 | 2017-01-18 | 天津九洲云物联科技有限公司 | Intelligent home system |
CN105447570A (en) * | 2015-09-25 | 2016-03-30 | 东北大学 | PIR sensor layout method used for personnel position tracking in intelligent household |
CN207571493U (en) * | 2017-12-20 | 2018-07-03 | 新动力(北京)建筑科技有限公司 | A kind of smart home security combined control system and intelligent home lamplight control system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115374188A (en) * | 2022-10-24 | 2022-11-22 | 沐曦科技(成都)有限公司 | Resource state query method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111355642B (en) | 2021-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP4071620B1 (en) | Method and apparatus for transmitting data processing request | |
CN109271363B (en) | File storage method and device | |
CN110740164B (en) | Server determination method, regulation and control method, device, equipment and storage medium | |
CN112488563B (en) | A method and device for determining computing power parameters | |
CN108829510B (en) | Thread binding processing method and device | |
CN114187300A (en) | Image processing method, system and storage medium | |
CN111355642B (en) | Distributed equipment condition judgment method and system | |
CN109412865B (en) | A kind of virtual network resource allocation method, system and electronic device | |
CN115080771A (en) | Data processing method and device, medium and gateway device based on artificial intelligence | |
CN117332881B (en) | Distributed training method and electronic equipment | |
CN109871408A (en) | A multi-type database adaptation method, device, electronic device and storage medium | |
CN116089477B (en) | Distributed Training Method and System | |
CN111506921A (en) | Data processing method, system, device, terminal and storage medium | |
CN118708327A (en) | A method and corresponding device for data processing | |
CN110971532A (en) | Network resource management method, device and equipment | |
CN112214429B (en) | Data transmission device and method based on SRIO | |
CN115378938A (en) | Network resource scheduling method, gateway equipment, edge and cloud data center server | |
CN114172895A (en) | Routing method, routing device, computer equipment and storage medium | |
CN113971148A (en) | PCIE real-time network card data transmission method and device based on linux real-time operating system | |
CN118012576B (en) | Application file parallel read-write adaptation method and device based on asynchronous I/O process | |
CN110401723A (en) | Method, system, equipment and the storage medium of OVA file upload services device | |
CN111274228A (en) | Policy data migration storage method, system, equipment and readable storage medium | |
CN113419673B (en) | Method, system, medium and device for RBD access storage cluster | |
CN111930781B (en) | Method and device for processing data request of cache database | |
CN112653717A (en) | Multi-cloud cooperation distributed system and application distribution method |
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 | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230705 Address after: 201700 room 205, floor 2, building 9, No. 168, Yinggang East Road, Qingpu District, Shanghai Patentee after: Midea Group (Shanghai) Co.,Ltd. Patentee after: MIDEA GROUP Co.,Ltd. Address before: 528311, 26-28, B District, Mei headquarters building, 6 Mei Road, Beijiao Town, Shunde District, Foshan, Guangdong. Patentee before: MIDEA GROUP Co.,Ltd. |