Network group control method
By comparing the identification code of the controlled device, generating control object codes and flags, reducing the packet length, solving the network burden and delay caused by excessive group control packets, and improving the packet transmission efficiency.
Patent Information
- Application Number
- CN202310604729.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-26
- Publication Date
- 2024-11-26
AI Technical Summary
In the existing group control method, the data volume of the group control data packet is too large, resulting in an increase in the network load burden and delay in data packet transmission, affecting control efficiency.
By comparing certain bytes of the identification code of the controlled device, generating control object codes and flags, reducing the packet length, transmitting it to the controlled device to execute control instructions, reducing the length of the identification codes, and reducing the packet size.
It effectively reduces the amount of data in group control data packets, reduces the burden on the communication network, improves the packet transmission efficiency, and avoids delays caused by excessive data packets.
Smart Images

Figure CN119031014A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network group control, and in particular to a network group control method, which is used to simplify and reduce the data volume of data packets during group control and reduce the network load during group control. Background Art
[0002] With the rapid development of Internet of Things technology, various devices are interconnected and interact with each other through the network. In order to efficiently control each device and issue precise instructions to different devices, group control technology plays a vital role.
[0003] A current group control method is that a master control device transmits a group control data packet to multiple controlled devices through a network, each controlled device has an independent identification code, and the master control device records the identification code of each controlled device to be controlled and the corresponding control instruction in the group control data packet. When each controlled device receives the group control data packet, each controlled device identifies whether the group control data packet contains its own identification code. When the group control data packet contains its own identification code, each controlled device uses this to determine that it is the control object of this instruction and executes the corresponding operation.
[0004] Taking a master control device controlling the first to third controlled devices as an example, when the master control device needs to issue control instructions to the first controlled device, the second controlled device and the third controlled device, the group control data packet issued by the master control device, in addition to recording the corresponding instruction requirements, must at least include the identification codes of the first controlled device, the second controlled device and the third controlled device. However, the address length of the commonly used network identification codes, such as Internet Protocol Address (IP Address), Media Access Control Address (MAC Address) and other identification codes, is at least 8 bytes, which means that the group control data packet contains at least 24 bytes, that is, when the number of controlled devices to be controlled is n, the group control data packet contains at least 8n bytes. The larger the value of n, the larger the data volume of the data packet, and the burden on the communication network during data packet transmission also increases accordingly, which may even cause delays in data packet transmission, affecting the efficiency of group control.
[0005] This shows that the current group control method still has room for further improvement. Summary of the invention
[0006] In view of this, the present application provides a network group control method, in order to reduce the data volume of the group control data packet, thereby alleviating the bandwidth burden of the communication network and improving the efficiency and accuracy of the group control.
[0007] To achieve the above-mentioned purpose, the network group control method described in the present application is executed by a main control device, and the network group control method includes:
[0008] Select at least one control object from a plurality of controlled devices, and set a first reference value as M, each controlled device having an identification code, the identification code having N bytes, wherein M≦N;
[0009] Comparing the values of the Mth bytes of the identification codes of the multiple controlled devices, and determining whether the values of the Mth bytes of the identification codes of any two controlled devices are the same;
[0010] When the values of the Mth bytes of the identification codes of the plurality of controlled devices are different, a control object code is generated according to the values of the Mth bytes of the identification codes of the at least one controlled object, a corresponding flag is generated according to the first reference value, and a group control data packet is transmitted to the plurality of controlled devices to control the at least one controlled object, wherein the group control data packet includes the flag, the control object code and a control instruction;
[0011] When it is determined that the values of the Mth bytes of the identification codes of any two controlled devices are the same, determining whether M is less than N;
[0012] When M is less than N, the count of M is increased and the process returns to step A2.
[0013] The present application provides another network group control method, which is executed by a main control device. The network group control method includes:
[0014] At least one control object is selected from a plurality of controlled devices, and a first reference value is set to M and a second reference value is set to D, each controlled device has an identification code, the identification code has N bytes, wherein M≦N, M is 1, and D is 0;
[0015] Comparing the values composed of the first D bytes and the Mth byte of the identification codes of the multiple controlled devices, and determining whether the values composed of the first D bytes and the Mth byte of the identification codes of any two controlled devices are the same;
[0016] When the values composed of the first D bytes and the Mth byte of each of the identification codes of the plurality of controlled devices are different, a control object code is generated according to the values composed of the first D bytes and the Mth byte of each of the identification codes of the at least one controlled object, and a corresponding flag is generated according to the first reference value and the second reference value, and a group control data packet is transmitted to the plurality of controlled devices to control the at least one controlled object, wherein the group control data packet includes the flag, the control object code and a control instruction;
[0017] When it is determined that the values composed of the first D bytes and the Mth byte of the identification codes of any two controlled devices are the same, determining whether M is less than N;
[0018] When M is less than N, the count of M is increased and the process returns to step B2.
[0019] In the network group control method provided by the present application, the master control device determines by comparing the identification codes of the multiple controlled devices, excludes the existence of numerical combinations with the same numerical values, and generates the control object code with the numerical combination of the identification codes that can represent the corresponding controlled devices, and then generates the group control data packet with the flag, the control object code and the control instruction. The present application shortens the lengthy identification codes with the control object code, reduces the data volume of the group control data packet, can reduce the transmission burden of the group control data packet on the communication network during transmission, helps to improve the efficiency of data packet transmission, and avoids delays in data packet transmission due to excessive data volume of the data packet. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 A schematic diagram of a network group control method provided by the present application and its application environment;
[0022] Figure 2 A schematic diagram of the first step of a network group control method provided by the present application;
[0023] Figure 3 A block diagram of an embodiment provided for the present application;
[0024] Figure 4 A schematic diagram of the second step of a network group control method provided by the present application;
[0025] Figure 5 A block diagram of a single-unit control provided for this application;
[0026] Figure 6 A block diagram of a network group control method provided by the present application for executing group control. DETAILED DESCRIPTION
[0027] Group control, also known as group control, refers to treating one or more devices as a group and collectively controlling multiple devices in a group.
[0028] like Figure 1 As shown, the network group control method provided by the present application can be applied to a main control device 10 and multiple controlled devices 20, and the multiple controlled devices 20 are respectively connected to the main control device 10 for communication, and the main control device 10 sends a group control data packet P to the multiple controlled devices 20 to perform group control on the multiple controlled devices 20. Each controlled device 20 has its own identification code, and the main control device 10 stores the identification code of each controlled device 20, wherein the main control device 10 and the multiple controlled devices 20 can be electronic devices such as servers, hosts, computers, mobile phones, sensors, etc. that can use a communication network; the identification code can be an Internet Protocol Address (IP Address), a Media Access Control Address (MAC Address), etc.
[0029] like Figure 2 As shown, the network group control method provided by the present application is executed by a main control device 10, and the network group control method includes:
[0030] S11: Select at least one control object from a plurality of controlled devices 20, and set a first reference value as M, each of the controlled devices 20 having an identification code, and the identification code having N bytes. The main control device 10 defines at least one controlled device 20 to be controlled among the plurality of controlled devices 20 as the at least one control object, and retrieves the identification codes of the plurality of controlled devices 20, wherein M≦N.
[0031] S12: Compare the values of the Mth bytes of the identification codes of the multiple controlled devices 20 to determine whether the values of the Mth bytes of the identification codes of any two controlled devices 20 are the same. The main control device 10 compares the identification codes of each controlled device 20 to determine whether the values of the bytes at the same byte position between the identification codes are the same. For example, when M is 1, the main control device 10 compares the bit values of the identification codes of each controlled device 20 at the first byte position (i.e., the first byte) to determine whether the values of the bytes at the same byte position in the identification codes of the multiple controlled devices 20 are the same.
[0032] S13: When the values of the Mth bytes of the identification codes of the multiple controlled devices 20 are different, a control object code is generated according to the value combination of the Mth bytes of the identification codes of the at least one control object, and a corresponding flag is generated according to the value M of the first reference value, and a group control data packet P is transmitted to the multiple controlled devices 20 to control the at least one control object, wherein the group control data packet P includes the flag, the control object code and a control instruction. Among them, the main control device 10 combines the values of the Mth bytes of each identification code of the at least one control object in series to generate the control object code. After receiving the group control data packet P, the multiple controlled devices 20 compare their own identification codes with the group control data packet P to determine whether each of the controlled devices 20 is the at least one control object and needs to execute the control instruction. The flag recorded in the group control data packet P can be used by the multiple controlled devices 20 to determine and compare the values of the byte positions corresponding to the flag in each identification code with the control object code of the group control data packet P. When each of the controlled devices 20 determines that the control object code in the group control data packet P includes a value that is the same as the value of the byte position corresponding to the flag in its own identification code, the controlled device 20 executes the control instruction.
[0033] S14: When it is determined that the Mth byte values of the identification codes of any two controlled devices 20 are the same, determine whether M is less than N.
[0034] S15: When M is less than N, increase the count of M and return to execute step S12.
[0035] S16: When M is greater than or equal to N, M is set to 1 and the process returns to step S12.
[0036] like Figure 3As shown, the following takes the multiple controlled devices 20 including a first controlled device 201, a second controlled device 202, a third controlled device 203, a fourth controlled device 204, a fifth controlled device 205 and a sixth controlled device 206, the identification code of each controlled device 20 has 8 bytes (i.e., N=8), the first reference value is M, and M=1 as an example, and steps S11 to S16 are described in detail.
[0037] As shown in Table 1, when the main control device 10 wants to perform group control on the first controlled device 201, the second controlled device 202, the third controlled device 203, the fourth controlled device 204 and the fifth controlled device 205, the main control device 10 executes step S11, selects the first to fifth controlled devices 205 as the at least one control object, and the main control device 10 stores the identification codes of the first to sixth controlled devices 201~206.
[0038] Table 1
[0039] Since M is 1, the main control device 10 executes step S12 to compare the first byte of each of the identification codes of the first to sixth controlled devices 201-206 to determine whether the values of the first byte of each of the identification codes of the first to sixth controlled devices 201-206 are the same.
[0040] As shown in Table 1, the value of the first byte of the fourth controlled device 204 is the same as the value of the first byte of the sixth controlled device 206. Therefore, the main control device 10 executes step S14 to determine whether M is less than N. Since M=1 and N=8, the main control device 10 executes step S15, increases the count of M to make M=2, and returns to execute step S12.
[0041] At this time, since M has become 2, the main control device 10 executes step S12 to compare the second bytes of the identification codes of the first to sixth controlled devices 201~206 to determine whether the values of the second bytes of the identification codes of the first to sixth controlled devices 201~206 are the same.
[0042] As shown in Table 1, the values of the second bytes of the identification codes of the first to sixth controlled devices 201-206 are all different. The main control device 10 executes step S13 to generate a control object code according to the value of the second bytes of the identification codes of the at least one controlled object (in this embodiment, the first to fifth controlled devices 201-205), and generates a flag with a value of 2 according to M. The main control device 10 generates a group control data packet P with the flag, the control object code and the control instruction, and transmits the group control data packet P to the first to sixth controlled devices 201-206.
[0043] In this embodiment, the control object code includes the value 0x32 of the second byte of the identification code of the first controlled device 201, the value 0x77 of the second byte of the identification code of the second controlled device 202, the value 0x92 of the second byte of the identification code of the third controlled device 203, the value 0x23 of the second byte of the identification code of the fourth controlled device 204, and the value 0x76 of the second byte of the identification code of the fifth controlled device 205. When the first to sixth controlled devices 201-206 receive the group control data packet P, since the value of the flag in the group control data packet P is 2, each of the controlled devices 20 adds the value of the second byte of its own identification code to the group control data packet P. The control object code of P is compared, and when each controlled device 20 determines that the control code contains a value that is the same as the value of the second byte of its own identification code, each controlled device 20 executes the control instruction; for example, after the first controlled device 201 receives the group control data packet P, it determines that the control code contains a value that is the same as the value 0x32 of the second byte of its own identification code, so the first controlled device 201 executes the control instruction; and after the sixth controlled device 206 receives the group control data packet P, it determines that the control code does not contain a value that is the same as the value 0xA9 of the second byte of its own identification code, so the sixth controlled device 206 does not execute the control instruction.
[0044] It should be noted that the value M of the first reference value in step S11 can be any real number not greater than N. In other words, in step S12, the identification codes of the plurality of controlled devices 20 can be numerically compared from any byte position. In this embodiment, if the value M of the first reference value is initially 8, the main control device 10 starts to compare the values from the 8th byte of each identification code to determine whether the values of the 8th bytes of the identification codes of the first to sixth controlled devices 201 to 206 are the same. If the main control device 10 determines that the values of the 8th bytes of the identification codes of the first to sixth controlled devices 201 to 206 are the same, since M is equal to N, the main control device 10 executes step S16, sets M to 1, and returns to execute step S12, so that the main control device 10 starts to compare the values from the 1st byte of each identification code in sequence.
[0045] In the present application, when the main control device 10 executes step S12, it compares the value of the Mth byte of the identification code of all controlled devices 20. When it is confirmed that the values of the Mth byte of the identification codes of all controlled devices 20 are different, the complete identification code of each controlled device 20 is replaced by the value of the Mth byte of the identification code of all controlled devices 20, which serves as a basis for each controlled device 20 to determine whether it is selected as the at least one control object.
[0046] In addition, when the main control device 10 generates the control object code, the control object code only includes the value of the Mth byte of the corresponding identification code selected as the at least one control object. When the multiple controlled devices 20 receive the group control data packet P, they can determine whether they are selected as the at least one control object based on the control object code and need to execute the control instruction.
[0047] like Figure 4 As shown, another network group control method in the present application is executed by a main control device 10, and the network group control method includes:
[0048] S21: Select at least one control object from a plurality of controlled devices 20, and set a first reference value M and a second reference value D, each of the controlled devices 20 having an identification code, the identification code having N bytes, wherein M≦N, M is 1, and D is 0.
[0049] S22: Compare the values composed of the first D bytes and the Mth byte of the identification codes of the multiple controlled devices 20 to determine whether the values composed of the first D bytes and the Mth byte of the identification codes of any two controlled devices 20 are the same.
[0050] S23: When the values composed of the first D bytes and the Mth byte of each of the identification codes of the multiple controlled devices 20 are different, a control object code is generated according to the values of the first D bytes and the Mth byte of each of the identification codes of the at least one control object, and a corresponding flag is generated according to the value M of the first reference value and the value D of the second reference value, and a group control data packet P is transmitted to the multiple controlled devices 20 to control the at least one control object, wherein the group control data packet P includes a flag, the control object code and a control instruction.
[0051] S24: When it is determined that the values composed of the first D bytes and the Mth byte of the identification codes of any two controlled devices 20 are the same, determine whether M is less than N.
[0052] S25: When M is less than N, increase the count of M and return to execute step S22.
[0053] S26: When M is greater than or equal to N, increase the count of D and set M to D+1.
[0054] S27: Determine whether D is less than N. When D is less than N, return to step S22; when D is equal to or greater than N, end the process.
[0055] like Figure 3 As shown, the multiple controlled devices 20 include a first controlled device 201, a second controlled device 202, a third controlled device 203, a fourth controlled device 204, a fifth controlled device 205 and a sixth controlled device 206, and the identification code of each controlled device 20 has 8 bytes (i.e., N=8), and steps S21 to S27 are described in detail.
[0056] As shown in Table 2, when the main control device 10 wants to perform group control on the first controlled device 201, the second controlled device 202, the third controlled device 203, the fourth controlled device 204 and the fifth controlled device 205, the main control device 10 executes step S21, selects the first to fifth controlled devices 205 as the at least one control object, and the main control device 10 stores the identification codes of the first to sixth controlled devices 201~206.
[0057] Table 2
[0058] Since M is 1 and D is 0, the main control device 10 executes step S22 to compare the first byte of each of the identification codes of the first to sixth controlled devices 201-206 to determine whether the values of the first byte of each of the identification codes of the first to sixth controlled devices 201-206 are the same.
[0059] As shown in Table 2, the value of the first byte of the third controlled device 203 is the same as the value of the first byte of the fifth controlled device 205. Therefore, the main control device 10 executes step S24 to determine whether M is less than N. Since M=1 and N=8, the main control device 10 executes step S25, increases the count of M to make M=2, and returns to execute step S22.
[0060] Since the values of the first to eighth bytes of the identification codes of the first to sixth controlled devices 201-206 are all the same, the master control device 10 repeatedly executes steps S22, S24 and S25. When the master control device 10 continuously increases the count of M to make M 8, M is equal to N at this time, the master control device 10 executes step S26, increases the count of D to make D 1, and sets M to 2, and the master control device 10 determines that D is less than N, so the master control device 10 returns to execute step S22.
[0061] Since M is 2 and D is 1, the main control device 10 executes step S22 to compare the first byte and the second byte of each of the identification codes of the first to sixth controlled devices 201~206 to determine whether the values of the first byte and the second byte of each of the identification codes of the first to sixth controlled devices 201~206 are the same.
[0062] For example, the main control device 10 determines whether the first byte and the second byte value 0x33-0x32 of the identification code of the first controlled device 201, the first byte and the second byte value 0x34-0x77 of the identification code of the second controlled device 202, the first byte and the second byte value 0x88-0x92 of the identification code of the third controlled device 203, the first byte and the second byte value 0x75-0xA9 of the identification code of the fourth controlled device 204, the first byte and the second byte value 0x88-0x76 of the identification code of the fifth controlled device 205, and the first byte and the second byte value 0x75-0xA9 of the identification code of the sixth controlled device 206 have the same component values.
[0063] As shown in Table 2, the first byte of the identification code of the fourth controlled device 204 and the value 0x75-0xA9 of the second byte are the same as the value 0x75-0xA9 of the first byte of the identification code of the sixth controlled device 206. Therefore, the main control device 10 executes step S24 to determine whether M is less than N; since M=2 and N=8, the main control device 10 executes step S25, increases the count of M to make M=3, and returns to execute step S22.
[0064] Since the values formed by the first byte and the second byte to the first byte and the eighth byte in each of the identification codes of the first to sixth controlled devices 201-206 are all the same, the master control device 10 repeatedly executes steps S22, S24 and S25. When the master control device 10 continuously increases the count of M to make M 8, M is equal to N at this time, the master control device 10 executes step S26, increases the count of D to make D 2, and sets M to 3, and the master control device 10 determines that D is less than N, so the master control device 10 returns to execute step S22.
[0065] Similarly, since M is 3 and D is 2, the main control device 10 executes step S22 to compare the first 2 bytes and the third byte of each of the identification codes of the first to sixth controlled devices 201~206, and determine whether the values of the first 2 bytes and the third byte of each of the identification codes of the first to sixth controlled devices 201~206 are the same.
[0066] For example, the main control device 10 determines whether the first two bytes and the third byte value 0x33-0x32-0xFF of the identification code of the first controlled device 201, the first two bytes and the third byte value 0x34-0x77-0xFF of the identification code of the second controlled device 202, the first two bytes and the third byte value 0x88-0x92-0xFF of the identification code of the third controlled device 203, the first two bytes and the third byte value 0x75-0xA9-0xFF of the identification code of the fourth controlled device 204, the first two bytes and the third byte value 0x88-0x76-0xFF of the identification code of the fifth controlled device 205, and the first two bytes and the third byte value 0x75-0xA9-0xFF of the identification code of the sixth controlled device 206 have the same component values.
[0067] As shown in Table 2, the first two bytes of the identification code of the fourth controlled device 204 and the value of the third byte 0x75-0xA9-0xFF are the same as the value of the first two bytes of the identification code of the sixth controlled device 206 and the value of the third byte 0x75-0xA9-0xFF. Therefore, the main control device 10 executes step S24 to determine whether M is less than N; since M=3 and N=8, the main control device 10 executes step S25, increases the count of M to make M=4, and returns to execute step S22.
[0068] At this time, since M is 4 and D is 2, the main control device 10 executes step S22 to compare the first 2 bytes and the 4th byte of each of the identification codes of the first to sixth controlled devices 201~206, and determines whether the values of the first 2 bytes and the 4th byte of each of the identification codes of the first to sixth controlled devices 201~206 are the same.
[0069] As shown in Table 2, the first two bytes and the fourth byte of each identification code of the first to sixth controlled devices 201-206 have different component values. The main control device 10 executes step S23 to generate a control object code according to the first two bytes and the fourth byte of each identification code of the at least one control object (in this embodiment, the first to fifth controlled devices 201-205), and generates a corresponding flag according to M and D. The main control device 10 generates a group control data packet P with the flag, the control object code and the control instruction, and transmits the group control data packet P to the first to sixth controlled devices 201-206.
[0070] In this embodiment, the control object code includes the first 2 bytes and the fourth byte of the identification code of the first controlled device 201, which are composed of the numerical values 0x33-0x32-0xDA, the first 2 bytes and the fourth byte of the identification code of the second controlled device 202, which are composed of the numerical values 0x34-0x77-0x8E, the first 2 bytes and the fourth byte of the identification code of the third controlled device 203, which are composed of the numerical values 0x88-0x92-0xCB, the first 2 bytes and the fourth byte of the identification code of the fourth controlled device 204, which are composed of the numerical values 0x75-0xA9-0x99, and the first 2 bytes and the fourth byte of the identification code of the fifth controlled device 205, which are composed of the numerical values 0x88-0x76-0xCB. When the first to sixth controlled devices 201-206 receive the group control data packet P, each of the controlled devices 20 replaces the first 2 bytes and the fourth byte of its own identification code with the numerical value 0x88-0x76-0xCB according to the value of the flag. The component value of the 4th byte is compared with the control object code of the group control data packet P. When each controlled device 20 determines that the control code contains a value that is the same as the component value of the first 2 bytes and the 4th byte of its own identification code, each controlled device 20 executes the control instruction; for example, after the first controlled device 201 receives the group control data packet P, it determines that the control code contains a value that is the same as the component value 0x33-0x32-0xDA of the first 2 bytes and the 4th byte of its own identification code, so the first controlled device 201 executes the control instruction; and after the sixth controlled device 206 receives the group control data packet P, it determines that the control code does not contain a value that is the same as the component value 0x75-0xA9-0x32 of the first 2 bytes and the 4th byte of its own identification code, so the sixth controlled device 206 does not execute the control instruction.
[0071] In the present application, the main control device 10 can transmit a flag data for storage by the multiple controlled devices 20, and the flag data includes the byte position relationship of each of the identification codes corresponding to different flag values. When a controlled device 20 receives the group control data packet P, the controlled device 20 can determine the byte position corresponding to the flag value in its own identification code based on the flag data, and then compare the value of the byte position corresponding to the flag in the identification code with the control object code to determine whether the controlled device 20 needs to execute the control instruction, wherein the value of each flag in the flag data can correspond to one or more byte positions of each of the identification codes.
[0072] like Figure 1 and Figure 5As shown, in the existing control method, when a main control device 10 wants to perform single-unit control on one of the multiple controlled devices 20, the main control device 10 transmits a control instruction to the controlled device 20 to be controlled via the shortest transmission path based on the communication connection relationship between the main control device 10 and the multiple controlled devices 20. For example, when a main control device 10 wants to perform single-unit control on a fifth controlled device 205, since a first controlled device 201 and a third controlled device 203 are communicatively connected on the shortest transmission path between the main control device 10 and the fifth controlled device 205, the main control device 10 will only transmit the control instruction to the fifth controlled device 205 via the first controlled device 201 and the third controlled device 203; however, when the first controlled device 201 or the third controlled device 203 transmits the control instruction, packet loss occurs, and the fifth controlled device 205 cannot receive the control instruction, making the single-unit control of the fifth controlled device 205 by the main control device 10 invalid.
[0073] like Figure 1 and Figure 6 As shown, compared with the existing control method, the network group control method provided by the present application can also control a single controlled device 20. The main control device 10 and the multiple controlled devices 20 are connected and transmitted through network communication. If the main control device 10 only selects one of the controlled devices 20 as a control object, when the main control device 10 transmits the group control data packet P to the multiple controlled devices 20, each of the controlled devices 20 not only receives the group control data packet P, but also further transmits the group control data packet P to other controlled devices 20 through the network; for example If the main control device 10 selects a fifth controlled device 205 as the control object, the main control device 10 transmits a group control data packet P to the first to sixth controlled devices 201~206, and the fifth controlled device 205 not only receives the group control data packet P through the transmission of the first controlled device 201 and the third controlled device 203, but the second controlled device 202, the fourth controlled device 204 and the sixth controlled device 206 will also transmit the received group control data packet P to the adjacent controlled device 20 that is connected in series with them through network communication.
[0074] It can be seen that the network group control method provided by the present application can be applied to control one or more objects, and compared with the existing control method, since the main control device 10 in the present application transmits the group control data packet P to the multiple controlled devices 20, and each controlled device 20 further transmits the received group control data packet P to other controlled devices 20 through the communication network, it can ensure the multi-directional transmission of the group control data packet P, rather than only transmitting instructions through the shortest transmission path between the object to be controlled. Even if the group control data packet P transmitted by the main control device 10 to any controlled device 20 or the group control data packet P transmitted by any controlled device 20 is dropped or damaged, each of the controlled devices 20 can still receive the group control data packet P through other controlled devices 20, which helps to improve the problem that the device cannot receive the control instruction due to packet drop when the device is controlled individually, reduce the impact of packet drop on the transmission of control instructions, and improve the stability of device control.
[0075] In summary, the network group control method provided by the present application generates the control object code by comparing the identification codes of the multiple controlled devices 20, according to the numerical combination in each identification code that can represent the corresponding controlled device 20, and replaces the lengthy complete identification code with the control object code, and uses the flag for each controlled device 20 to compare the numerical value of the byte position corresponding to the flag in its own identification code with the control object code, so as to determine whether to execute the control instruction in the group control data packet P. Compared with the prior art, the present application effectively reduces the length of the identification code, thereby reducing the data volume of the group control data packet P, and reducing the transmission burden caused by the group control data packet P on the communication network during transmission, which helps to improve the efficiency of data packet transmission and avoid data packet transmission delays.
Claims
1. A network group control method, characterized in that: Executed by a main control device, including: Step A1: selecting at least one control object from a plurality of controlled devices, and setting a first reference value as M, each controlled device having an identification code, the identification code having N bytes, wherein M≦N; Step A2: comparing the values of the Mth bytes of the identification codes of the plurality of controlled devices, and determining whether the values of the Mth bytes of the identification codes of any two controlled devices are the same; Step A3: when the values of the Mth bytes of the identification codes of the plurality of controlled devices are different, generating a control object code according to the values of the Mth bytes of the identification codes of the at least one controlled object, generating a corresponding flag according to the first reference value, and transmitting a group control data packet to the plurality of controlled devices to control the at least one controlled object, wherein the group control data packet includes the flag, the control object code and a control instruction; Step A4: when it is determined that the values of the Mth bytes of the identification codes of any two controlled devices are the same, determining whether M is less than N; Step A5: When M is less than N, increase the count of M and return to execute step A2.
2. The network group control method according to claim 1, characterized in that: Also includes: Step A6: When M is greater than or equal to N, M is set to 1 and the process returns to step A2.
3. The network group control method according to claim 1, characterized in that: After the multiple controlled devices receive the group control data packet, each of the controlled devices compares the value of the byte position corresponding to the flag in its own identification code with the control object code. When one of the controlled devices determines that the control object code includes a value that is the same as the value of the byte position corresponding to the flag in its own identification code, the controlled device executes the control instruction.
4. The network group control method according to claim 1, characterized in that: When the main control device selects multiple controlled devices as multiple control objects to perform group control, the main control device transmits the group control data packet to the multiple controlled devices respectively, and after receiving the group control data packet, each of the controlled devices further transmits the group control data packet to the multiple control objects via other adjacent controlled devices in the communication network.
5. The network group control method according to claim 1, characterized in that: When the master control device selects only one of the controlled devices as a control object to perform single-unit control, the master control device transmits the group control data packet to the multiple controlled devices respectively, and after receiving the group control data packet, each controlled device further transmits the group control data packet to the control object via other adjacent controlled devices in the communication network.
6. A network group control method, characterized in that: Executed by a main control device, including: Step B1: selecting at least one control object from a plurality of controlled devices, and setting a first reference value M and a second reference value D, each controlled device having an identification code, the identification code having N bytes, wherein M≦N, M is 1, and D is 0; Step B2: comparing the values composed of the first D bytes and the Mth byte of the identification codes of the plurality of controlled devices, and determining whether the values composed of the first D bytes and the Mth byte of the identification codes of any two controlled devices are the same; Step B3: when the values composed of the first D bytes and the Mth byte of each of the identification codes of the plurality of controlled devices are different, a control object code is generated according to the values composed of the first D bytes and the Mth byte of each of the identification codes of the at least one controlled object, and a corresponding flag is generated according to the first reference value and the second reference value, and a group control data packet is transmitted to the plurality of controlled devices to control the at least one controlled object, wherein the group control data packet includes the flag, the control object code and a control instruction; Step B4: when it is determined that the values composed of the first D bytes and the Mth byte of the identification codes of any two controlled devices are the same, determining whether M is less than N; Step B5: When M is less than N, increase the count of M and return to execute step B2.
7. The network group control method according to claim 6, characterized in that: Also includes: Step B6: When M is greater than or equal to N, increase the count of D and set M to D+1; Step B7: Determine whether D is less than N; Step B8: When D is less than N, return to execute step B2.
8. The network group control method according to claim 6, characterized in that: After the multiple controlled devices receive the group control data packet, each of the controlled devices compares the numerical combination of the byte position corresponding to the flag in its own identification code with the control object code. When one of the controlled devices determines that the control object code includes a numerical value that is the same as the numerical combination of the byte position corresponding to the flag in its own identification code, the controlled device executes the control instruction.
9. The network group control method according to claim 6, characterized in that: When the main control device selects multiple controlled devices as multiple control objects to perform group control, the main control device transmits the group control data packet to the multiple controlled devices respectively, and after each of the controlled devices receives the group control data packet, the main control device further transmits the group control data packet to the multiple control objects via other adjacent controlled devices in the communication network.
10. The network group control method according to claim 6, characterized in that: When the master control device selects only one of the controlled devices as a control object to perform single-unit control, the master control device transmits the group control data packet to the multiple controlled devices respectively, and after receiving the group control data packet, each controlled device further transmits the group control data packet to the control object via other adjacent controlled devices in the communication network.
