Equipment control method in bandwidth limited scene
By defining the status group and control policy in the bandwidth-constrained scenario, and using default and incremental format status group reporting, the problem of large bandwidth consumption in the traditional polling method is solved, and equipment control with low bandwidth occupancy is realized, suitable for multiple devices Control the scene.
Patent Information
- Application Number
- CN202411201324.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-06
AI Technical Summary
In scenarios where bandwidth is limited, the traditional timed polling method consumes a large amount of bandwidth, resulting in the inability to support the control of a large number of devices at the same time, and the real-time requirements of different control parameters are different, resulting in an increase in bandwidth consumption.
The status group is defined by the upper computer and sent to the controlled device, and the control strategy is determined based on the controlled device information. The status group reporting is adopted in the default format and incremental format, and incremental reporting is performed only when the status changes to reduce bandwidth consumption. Optimize data transmission through compression algorithms.
It greatly reduces bandwidth usage, is compatible with traditional polling control logic, provides better adaptability and flexibility, supports multi-device control, and reduces bandwidth consumption of device control.
Smart Images

Figure CN119094354A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of device control, and in particular relates to a device control method in a bandwidth-limited scenario. Background Art
[0002] Traditional device control often uses a timed polling method to continuously query all the control parameters of interest from the controlled device and perform corresponding control processing based on the query results. In bandwidth-limited scenarios such as low-power Bluetooth technology, if all controlled devices use the traditional timed polling method, it will often consume a lot of bandwidth, resulting in the inability to support simultaneous control of a large number of devices.
[0003] In addition, different control parameters have different requirements for real-time performance. For control parameters with high real-time performance, the polling method requires increasing the polling frequency, which in turn increases bandwidth consumption. Therefore, optimizing the control logic as much as possible and reducing bandwidth usage has become an important issue.
[0004] In addition, the host computer system needs to ensure that the controlled device is in the expected working state. The working state (control parameters) of the controlled device can be divided into two types: (1) generally does not change: for example, for the acquisition device, once the sampling rate is successfully set, it remains unchanged; (2) may change at any time: such as ambient temperature, battery power, etc.
[0005] For controlled devices, the states that need to be monitored generally include both types, but the real-time requirements for monitoring may vary depending on the specific parameters. For example, the battery power status requires reporting every few minutes; while the device operating temperature may rise rapidly in a short period of time, requiring a smaller collection interval. In view of the above situation, the present invention designs a device state control method to reduce the bandwidth occupation of the control logic. Summary of the invention
[0006] The present invention provides a device control method in a bandwidth-limited scenario, which solves the problem that a traditional timed polling method consumes a large amount of bandwidth and cannot support simultaneous control of a large number of devices.
[0007] In order to solve the above technical problems, the technical solution of the present invention is: a device control method in a bandwidth-limited scenario, comprising the following steps:
[0008] S1. Define the state group through the host computer and send the state group to the controlled device to obtain the control strategy of different controlled devices;
[0009] S2. Query the controlled device information through the host computer, and determine the control strategy of the controlled device according to the controlled device information;
[0010] S3, query all status group information of the controlled device through the host computer;
[0011] S4. Based on the control strategy of the controlled device, all status group information of the controlled device is checked by the host computer to obtain the reported status information of the controlled device;
[0012] S5, receiving the reporting status information through the host computer, and determining the reporting format of the reporting status information, if it is the default format, proceeding to step S6, if it is the incremental format, proceeding to step S7;
[0013] S6. Check the reported status information based on the control strategy and complete the equipment control;
[0014] S7. Check the reported status information based on the control strategy, send a command to the controlled device, save the current status through the controlled device, and complete the device control.
[0015] Furthermore, the state group in step S1 includes a state group ID, ordered state values, a reporting format, a reporting interval, and a compression algorithm;
[0016] The reporting format includes a default format and an incremental format.
[0017] Furthermore, the control strategy in step S1 includes multiple state groups of the controlled device.
[0018] Furthermore, the default format will return all status values in the order defined in the status group, and return a summary information calculated from all status values;
[0019] The incremental format returns status information that the current status is different from the previous status.
[0020] Furthermore, the specific steps of step S4 are: comparing the control strategy of the controlled device with all status group information, retaining the status groups in all status group information that comply with the control strategy, deleting the status groups in all status group information that do not comply with the control strategy, and adding status groups that do not exist in the controlled device to all status group information, ensuring that all status group information of the controlled device is completely consistent with the control strategy, and obtaining the reported status information of the controlled device.
[0021] Furthermore, the specific steps of step S5 are:
[0022] S51, receiving the reporting status information through the host computer;
[0023] S52, based on the reported status information, determine whether compression is required according to the status group ID, if so, compress the reported status information through a compression algorithm and proceed to step S53, otherwise, directly proceed to step S53;
[0024] S53. Determine the reporting format according to the status group ID. If it is the default format, proceed to step S6. If it is the incremental format, proceed to step S7.
[0025] Furthermore, the specific steps of step S6 are: based on the control strategy, each state value in the reported state information is checked in turn, and the state value that does not comply with the control strategy is processed to complete the device control.
[0026] Furthermore, the specific steps of step S7 are:
[0027] S71. Based on the control strategy, check each incremental state value in the reported state information in turn, and process the incremental state value that does not comply with the control strategy;
[0028] S72, querying all status information of the state group based on the controlled device, checking whether all status information of the state group conforms to the control strategy of the controlled device, if so, proceeding to step S73, otherwise, returning to step S71;
[0029] S73, sending a command for accepting the incremental state of the specified state group to the controlled device through the host computer, wherein the command includes summary information calculated based on all state information of the state group;
[0030] S74. Based on the command, the controlled device calculates summary information in the current state;
[0031] S75. Determine whether the summary information in the current state is the same as the summary information contained in the command in step S73. If so, the controlled device will save the current state and return success to the host computer to complete this round of device control. Otherwise, it will return failure to the host computer and return to step S72.
[0032] Furthermore, the summary information is calculated by connecting each state value according to a fixed separator to obtain a summary string, and calculating the summary information through the string.
[0033] The beneficial effects of the present invention are as follows: (1) in a bandwidth-limited scenario, the method of the present invention provides extremely small bandwidth occupancy, and the bandwidth consumption caused by the traditional polling method can be greatly reduced through the incremental format state group, that is, the incremental report is only performed when the control parameters in the current state group change compared with the previous state, and the default format state group is well compatible with the traditional polling control logic, and it is easy to realize the reconstruction of the old host computer control system;
[0034] (2) The method of the present invention not only ensures that different controlled devices have a unified control logic, but also brings better adaptability and flexibility by customizing different state groups for different controlled devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 The figure is a flow chart of a device control method in a bandwidth-limited scenario of the present invention.
[0036] Figure 2 This is the returned content in the default format of the present invention.
[0037] Figure 3 This is the returned content in the incremental format of the present invention.
[0038] Figure 4 This is the status data format under the default format of the present invention.
[0039] Figure 5 This is the status data format in the incremental format of the present invention. DETAILED DESCRIPTION
[0040] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
[0041] Example 1
[0042] like Figure 1 As shown, the present invention provides a device control method in a bandwidth-limited scenario, comprising the following steps:
[0043] S1. Define the state group through the host computer and send the state group to the controlled device to obtain the control strategy of different controlled devices;
[0044] S2. Query the controlled device information through the host computer, and determine the control strategy of the controlled device according to the controlled device information;
[0045] S3, query all status group information of the controlled device through the host computer;
[0046] S4. Based on the control strategy of the controlled device, all status group information of the controlled device is checked by the host computer to obtain the reported status information of the controlled device;
[0047] S5, receiving the reporting status information through the host computer, and determining the reporting format of the reporting status information, if it is the default format, proceeding to step S6, if it is the incremental format, proceeding to step S7;
[0048] S6. Check the reported status information based on the control strategy and complete the equipment control;
[0049] S7. Check the reported status information based on the control strategy, send a command to the controlled device, save the current status through the controlled device, and complete the device control.
[0050] In this embodiment 1, the host computer can perform the following operations on a state group:
[0051] (1) Add or delete state groups to controlled devices and query state group information. Each state group information should at least include the state group ID, ordered state name information, reporting format, reporting interval, and compression algorithm.
[0052] (2) Configuring the working mode of the status group in the controlled device should include at least the following functions: such as reporting interval (i.e., reporting frequency), compression algorithm, and reporting format.
[0053] (3) Send an incremental status notification to the controlled device to accept the specified status group.
[0054] The controlled device should also have the following functions: (1) add and delete state groups; (2) modify the working mode of the state group; (3) query the state group information; (4) query the state information according to the state name, that is, query the state information of each state separately; (5) accept incremental state changes and save all state values in the current state.
[0055] And the status information can be queried according to the status group ID, wherein the returned status information can be in at least two formats: a default format and an incremental format, and the status format is controlled by the command parameter. The incremental format can minimize the bandwidth occupied by the device control function when the transmission bandwidth is limited.
[0056] like Figure 2 and Figure 3 As shown, the returned contents of the status query in the default format and the incremental format are respectively, wherein n is the total number of states of the status group in the default format, and m is the total number of states of the status group in the incremental format.
[0057] The state group in step S1 includes a state group ID, ordered state values, a reporting format, a reporting interval, and a compression algorithm;
[0058] The reporting format includes a default format and an incremental format.
[0059] In this embodiment 1, the state group ID is generated by the host computer and added to the controlled device to uniquely identify different state groups in the same controlled device. The reporting interval is in milliseconds, and the state group actively reports state information to the host computer at a fixed frequency. When set to 0, it will not be actively reported. The compression algorithm is used to perform lossless compression on the reported information to reduce bandwidth usage. If it is empty, it will not be compressed.
[0060] The reporting format is used to configure the format in which the status group reports the status information. It includes two formats: default format and incremental format. In the default format, all status values will be reported in the status order defined by the status group; in the incremental format, only the status values that are different from the previous one will be reported. The status random ID in the incremental format is a random ID automatically generated by the controlled device after detecting a status change, which is used to distinguish different states. Figure 4 and Figure 5 As shown in the figure, the status data formats in the default format and the incremental format are shown respectively.
[0061] The control strategy in step S1 includes multiple state groups of the controlled device.
[0062] In this embodiment 1, the host computer queries the information of the controlled device and determines the corresponding control strategy. The control strategy includes how many state groups the controlled device is divided into and how the working mode of each state group should be set. The control strategy is generally pre-defined by the host computer, such as defining different control strategies according to the device model. Of course, it is also allowed to define a special control strategy for each specific device.
[0063] The default format will return all status values in the order defined in the status group, and return a summary information calculated from all status values;
[0064] The incremental format returns status information that the current status is different from the previous status.
[0065] The specific steps of step S4 are: comparing the control strategy of the controlled device with all status group information, retaining the status groups that comply with the control strategy in all status group information, deleting the status groups that do not comply with the control strategy in all status group information, and adding status groups that do not exist in the controlled device to all status group information, ensuring that all status group information of the controlled device is completely consistent with the control strategy, and obtaining the reported status information of the controlled device.
[0066] The specific steps of step S5 are:
[0067] S51, receiving the reporting status information through the host computer;
[0068] S52, based on the reported status information, determine whether compression is required according to the status group ID, if so, compress the reported status information through a compression algorithm and proceed to step S53, otherwise, directly proceed to step S53;
[0069] S53. Determine the reporting format according to the status group ID. If it is the default format, proceed to step S6. If it is the incremental format, proceed to step S7.
[0070] The specific steps of step S6 are: based on the control strategy, checking each state value in the reported state information in turn, processing the state value that does not comply with the control strategy, and completing the equipment control.
[0071] In this embodiment 1, there are multiple ways to process, and the device is controlled according to the specific state. For example, if the state is that the temperature value of the device processor is 95 degrees, which is too high, then the processing method may be to increase the CPU fan speed.
[0072] The specific steps of step S7 are:
[0073] S71. Based on the control strategy, check each incremental state value in the reported state information in turn, and process the incremental state value that does not comply with the control strategy;
[0074] S72, querying all status information of the state group based on the controlled device, checking whether all status information of the state group conforms to the control strategy of the controlled device, if so, proceeding to step S73, otherwise, returning to step S71;
[0075] S73, sending a command for accepting the incremental state of the specified state group to the controlled device through the host computer, wherein the command includes summary information calculated based on all state information of the state group;
[0076] S74. Based on the command, the controlled device calculates summary information in the current state;
[0077] S75. Determine whether the summary information in the current state is the same as the summary information contained in the command in step S73. If so, the controlled device will save the current state and return success to the host computer to complete this round of device control. Otherwise, it will return failure to the host computer and return to step S72.
[0078] In this embodiment 1, the current state group in step S72 refers to the state group of the current sending state change, and only the state group with the state change needs to be processed. The state group with no state change does not need to be processed (that is, there is no need to query the state information of the state group with no state change).
[0079] The method for calculating the summary information is: connecting each state value according to a fixed separator to obtain a summary string, and calculating the summary information through the string.
[0080] In this embodiment 1, the control process of the controlled device state group in incremental format is also described, which is as follows: Get all the state values saved in the previous state. If the previous state does not exist, it means that the device has just been initialized, and all the states of the current state group are considered to be incremental information, that is, all state information is pushed to the host computer. If the previous state exists, each state is compared in turn, and the state values that have changed are pushed to the host computer. If it is exactly the same as the previous state, no operation is required. This logic ensures that no additional bandwidth is required when the state does not change, which minimizes bandwidth consumption.
[0081] Therefore, when the host computer receives the incremental status information, it will perform the corresponding control logic, and finally make the corresponding status of the controlled device conform to the control strategy. After that, the controlled device will receive a command from the host computer to accept the incremental status notification, which contains the summary information obtained by the query. At this time, the controlled device will immediately calculate the summary information under the current state. If the two are completely consistent, the controlled device will save these states and return success to the host computer. If they are not completely consistent, failure will be returned to the host computer. The summary is calculated by concatenating all state values in order, connecting each value with a fixed separator (such as |), and calculating the summary of this string.
[0082] Example 2
[0083] In this embodiment 2, taking the EEG acquisition module as an example (hereinafter referred to as), the host computer needs to control the EEG acquisition module to collect EEG data through Bluetooth communication, wherein the state group of the acquisition module is defined as:
[0084] State group 1: The ordered states include sampling rate (its value is 1000HZ), reporting state (its value is stop reporting), battery power (its value is 0), reporting format is incremental format, reporting interval is 1 second, and compression algorithm is none
[0085] Status group 2: The ordered status includes connection status, signal strength, and data packets collected by the acquisition module. The reporting format is the default format, the reporting interval is 100ms, and the compression algorithm is lzma.
[0086] The various statuses are described as follows:
[0087] Sampling rate: The sampling rate of EEG module signal acquisition.
[0088] Reporting status: The EEG module reporting status is either stopped or in progress.
[0089] Connection status: The connection status of the EEG module refers to whether it is successfully connected to the host computer, including two values: connected and not connected.
[0090] Signal strength: The signal strength of the Bluetooth connection established between the EEG module and the host computer.
[0091] Data packets collected by the acquisition module: raw data collected by the EEG module, expressed in the form of a floating-point number sequence.
[0092] In this embodiment 2, if the host computer receives an incremental format data packet of state group 1, the data packet includes a sampling rate (its value is 250HZ), a reporting state (its value is reporting), and a battery level (its value is 98%). At this time, the device processes each state separately, as follows:
[0093] Sampling rate: Send a sampling rate setting command to the device, which sets the sampling rate to 1000HZ as expected by the status group.
[0094] Reporting status: Send a stop transmission command to the device, which will change the reporting status to the expected stop reporting.
[0095] Battery power: Battery power is special. The power is an objective value. The host computer modifies the expected value of power in state group 1 to 98%. At the same time, it sends instructions to modify the expected value of power in the corresponding state group in the EEG module to 98%.
[0096] After completing the above series of control logic, the host computer sends a command to the controlled device to accept the incremental state of the specified state group, where the command contains a summary information calculated through all the state information of the state group. After receiving the command, the EEG module will calculate whether the summary information of its current state is the same as the summary information in the command sent by the host computer. If so, the controlled device will save the current state and return success to the host computer to complete this round of device control. Otherwise, it will return failure to the host computer.
[0097] In this embodiment 2, if the host computer receives the default format data packet of state group 2, the data packet includes the connection status and signal strength, and the data packet collected by the acquisition module needs to be decompressed first because the state group sets a compression algorithm, and then the state information is obtained, as follows:
[0098] Connection Status: Its value should always be Connected, because if it is not connected, the entire packet will not be received.
[0099] Signal strength: Once the reported signal strength is lower than -70dbm, the host computer will issue a command to increase the transmission power of the acquisition module; once the reported signal strength is higher than -30dbm, the host computer will issue a command to reduce the transmission power of the acquisition module, thereby achieving the effect of power saving.
[0100] Data packets collected by the acquisition module: The host computer is responsible for receiving and saving this data packet to form the collected data file.
[0101] Therefore, through the above control logic, the host computer can realize the function of collecting EEG data for a specified period of time according to the specified sampling rate.
[0102] In summary, the method of the present invention provides extremely small bandwidth occupancy in bandwidth-constrained scenarios, and the bandwidth consumption caused by the traditional polling method can be greatly reduced through the incremental format state group, that is, only when the control parameters in the current state group change compared with the previous state, the incremental report will be made, and the default format state group can be well compatible with the traditional polling control logic, and it is easy to realize the reconstruction of the old host control system. In addition, while ensuring that different controlled devices have a unified control logic, the method of the present invention brings better adaptability and flexibility by customizing different state groups for different controlled devices.
Claims
1. A device control method in a bandwidth-limited scenario, characterized in that: The following steps are involved: S1. Define the state group through the host computer and send the state group to the controlled device to obtain the control strategy of different controlled devices; S2. Query the controlled device information through the host computer, and determine the control strategy of the controlled device according to the controlled device information; S3, query all status group information of the controlled device through the host computer; S4. Based on the control strategy of the controlled device, all status group information of the controlled device is checked by the host computer to obtain the reported status information of the controlled device; S5, receiving the reporting status information through the host computer, and determining the reporting format of the reporting status information, if it is the default format, proceeding to step S6, if it is the incremental format, proceeding to step S7; S6. Check the reported status information based on the control strategy and complete the equipment control; S7. Check the reported status information based on the control strategy, send a command to the controlled device, save the current status through the controlled device, and complete the device control.
2. The device control method in a bandwidth-limited scenario according to claim 1, characterized in that: The state group in step S1 includes a state group ID, ordered state values, a reporting format, a reporting interval, and a compression algorithm; The reporting format includes a default format and an incremental format.
3. The device control method in a bandwidth-limited scenario according to claim 1, characterized in that: The control strategy in step S1 includes multiple state groups of the controlled device.
4. The device control method in a bandwidth-limited scenario according to claim 2, characterized in that: The default format will return all status values in the order defined in the status group, and return a summary information calculated from all status values; The incremental format returns status information that the current status is different from the previous status.
5. The device control method in a bandwidth-limited scenario according to claim 1, characterized in that: The specific steps of step S4 are: comparing the control strategy of the controlled device with all status group information, retaining the status groups that comply with the control strategy in all status group information, deleting the status groups that do not comply with the control strategy in all status group information, and adding status groups that do not exist in the controlled device to all status group information, ensuring that all status group information of the controlled device is completely consistent with the control strategy, and obtaining the reported status information of the controlled device.
6. The device control method in a bandwidth-limited scenario according to claim 2, characterized in that: The specific steps of step S5 are: S51, receiving the reporting status information through the host computer; S52, based on the reported status information, determine whether compression is required according to the status group ID, if so, compress the reported status information through a compression algorithm and proceed to step S53, otherwise, directly proceed to step S53; S53. Determine the reporting format according to the status group ID. If it is the default format, proceed to step S6. If it is the incremental format, proceed to step S7.
7. The device control method in a bandwidth-limited scenario according to claim 2, characterized in that: The specific steps of step S6 are: based on the control strategy, checking each state value in the reported state information in turn, processing the state value that does not comply with the control strategy, and completing the equipment control.
8. The device control method in a bandwidth-limited scenario according to claim 4, characterized in that: The specific steps of step S7 are: S71. Based on the control strategy, check each incremental state value in the reported state information in turn, and process the incremental state value that does not comply with the control strategy; S72, querying all status information of the state group based on the controlled device, checking whether all status information of the state group conforms to the control strategy of the controlled device, if so, proceeding to step S73, otherwise, returning to step S71; S73, sending a command for accepting the incremental state of the specified state group to the controlled device through the host computer, wherein the command includes summary information calculated based on all state information of the state group; S74. Based on the command, the controlled device calculates summary information in the current state; S75. Determine whether the summary information in the current state is the same as the summary information contained in the command in step S73. If so, the controlled device will save the current state and return success to the host computer to complete this round of device control. Otherwise, it will return failure to the host computer and return to step S72.
9. The device control method in a bandwidth-limited scenario according to claim 8, characterized in that: The method for calculating the summary information is: connecting each state value according to a fixed separator to obtain a summary string, and calculating the summary information through the string.
