Device control method, device control apparatus, device, and storage medium

By obtaining motion information from multiple frames and predicting the number of existing frames, calculating the power consumption adjustment coefficient, and adjusting the device hardware parameters and strategies, the problem of high device energy consumption is solved and a balance between performance and power consumption is achieved.

CN119653028BActive Publication Date: 2025-10-24HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411767510.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-10-24
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

Existing device control methods aim to improve processing performance, resulting in high energy consumption and an imbalance between performance and power consumption.

Method used

By obtaining the motion information of the target object from multiple frames of images detected by the target device, predicting the number of frames and processing time, calculating the power consumption adjustment coefficient, and adjusting the hardware parameters and execution strategies of the computing unit and functional components to meet the time consumption required by the user.

Benefits of technology

It achieves the balance between performance and power consumption by adjusting device power consumption while ensuring that device performance meets user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119653028B_ABST
    Figure CN119653028B_ABST
Patent Text Reader

Abstract

The application discloses a device control method and device, equipment and a storage medium. The method comprises the following steps: obtaining a plurality of target objects and motion information of each target object from a plurality of images detected by a target device; predicting the number of frames in which each target object exists in a detection area corresponding to the target device according to the motion information; obtaining the execution time of a complete process required by the target device for processing a single image; calculating the predicted time consumption of the target device for processing each target object according to the number of existing frames and the execution time of the complete process; calculating the average time consumption required by the target device for processing a single target object according to the predicted time consumption; calculating a power consumption adjustment coefficient according to the average time consumption and target time consumption; and controlling the target device according to the power consumption adjustment coefficient, wherein the target time consumption is the time consumption required to meet the user demand corresponding to the target device, so that the device power consumption can be adjusted under the premise that the device performance can meet the user demand, and the balance between the device performance and the device power consumption is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and particularly relates to a device control method and device, a device and a storage medium. BACKGROUND

[0002] At present, for low-power processing devices, task processing is not the faster the better, but needs to reduce the power consumption of the device as much as possible on the premise of meeting user needs. However, the related device control mode usually takes improving the processing performance of the processing device as the control target when controlling the processing device, thereby there is the defect that the device energy consumption is high, and the device performance and the device power consumption are unbalanced. SUMMARY

[0003] The main purpose of the present application is to provide a device control method and device, a device and a storage medium, which aims to solve the technical problem that the related device control mode takes improving the processing performance of the processing device as the control target, resulting in high device energy consumption, and unbalanced device performance and device power consumption.

[0004] To achieve the above purpose, the present application provides a device control method, which comprises:

[0005] obtaining a plurality of target objects and motion information of each target object from a plurality of images detected by a target device;

[0006] predicting the number of existing frames of each target object in the detection area corresponding to the target device according to the motion information;

[0007] obtaining the complete process execution time required by the target device to process a single frame of image;

[0008] calculating the predicted time consumption of the target device processing each target object according to the number of existing frames and the complete process execution time, and calculating the average time consumption required by the target device to process a single target object according to the predicted time consumption;

[0009] calculating a power consumption adjustment coefficient according to the average time consumption and a target time consumption, and controlling the target device according to the power consumption adjustment coefficient, wherein the target time consumption is the time consumption required to meet the user needs corresponding to the target device.

[0010] Optionally, the controlling the target device according to the power consumption adjustment coefficient comprises:

[0011] obtaining the hardware parameters of each calculation unit and / or the execution strategy of each functional component, wherein the target device comprises a plurality of calculation units and a plurality of functional components;

[0012] adjusting the hardware parameters of each calculation unit and / or the execution strategy of each functional component according to the power consumption adjustment coefficient.

[0013] Optionally, the execution strategy of each functional component includes a calculation frequency of each functional component;

[0014] The adjusting the execution strategy of each functional component according to the power consumption adjustment coefficient includes:

[0015] When the power consumption adjustment coefficient is greater than a preset threshold, selecting a secondary functional component from a plurality of functional components according to the importance of each functional component to the target device, and reducing the calculation frequency of the secondary functional component;

[0016] When the power consumption adjustment coefficient is equal to a preset threshold, controlling each functional component to maintain the current calculation frequency;

[0017] When the power consumption adjustment coefficient is less than a preset threshold, a target functional component whose calculation frequency is lower than a preset normal value is selected from each functional component, and the calculation frequency of the target functional component is increased.

[0018] Optionally, the execution strategy of each functional component includes a working mode of each functional component;

[0019] The adjusting the execution strategy of each functional component according to the power consumption adjustment coefficient includes:

[0020] When the power consumption adjustment coefficient is greater than a preset threshold, the operating mode of at least one functional component is switched to a high-performance mode, and the functional component switched to the high-performance mode is migrated to a first computing unit for execution, wherein the first computing unit is the computing unit with the strongest performance among the multiple computing units;

[0021] When the power consumption adjustment coefficient is equal to a preset threshold, controlling each functional component to maintain a current working mode;

[0022] When the power consumption adjustment coefficient is less than a preset threshold, the working mode of at least one functional component is switched to a low energy consumption mode, and the functional component switched to the low energy consumption mode is migrated to a second computing unit for execution, wherein the second computing unit is the computing unit with the lowest energy consumption among multiple computing units.

[0023] Optionally, adjusting the hardware parameters of each computing unit according to the power consumption adjustment coefficient includes:

[0024] Obtaining current hardware parameters of each computing unit, and calculating parameter adjustment values ​​according to the power consumption adjustment coefficient and the current hardware parameters;

[0025] The current hardware parameters of each computing unit are adjusted according to the parameter adjustment value, wherein the current hardware parameters include a current computing frequency and / or a current voltage.

[0026] Optionally, the step of predicting the number of frames in which each target object exists in the detection area corresponding to the target device according to the motion information comprises:

[0027] predicting a set of motion position points of each target object according to the motion information;

[0028] predicting a time in which each target object exists in the detection area corresponding to the target device according to the set of motion position points;

[0029] calculating the number of frames in which each target object exists in the detection area corresponding to the target device based on the time and the number of image frames processed by the target device per second.

[0030] Optionally, the step of obtaining the complete process execution time required by the target device for processing a single frame of image comprises:

[0031] obtaining an execution time of each computing unit when each functional component processes a single frame of image, wherein the target device comprises a plurality of computing units with heterogeneous computing;

[0032] summing the execution times to obtain the complete process execution time required by the target device for processing a single frame of image.

[0033] Optionally, the step of calculating the power consumption adjustment coefficient according to the average time and the target time comprises:

[0034] calculating the power consumption adjustment coefficient according to an adjustment coefficient calculation formula based on the average time and the target time; the adjustment coefficient calculation formula is:

[0035]

[0036] wherein k is the power consumption adjustment coefficient, T ave is the average time, and T ue is the target time.

[0037] In addition, to achieve the above object, the application further provides a device control apparatus, which comprises:

[0038] an information obtaining module, configured to obtain a plurality of target objects and motion information of each target object from a plurality of frames of image detected by a target device;

[0039] a frame number predicting module, configured to predict the number of frames in which each target object exists in the detection area corresponding to the target device according to the motion information;

[0040] a time obtaining module, configured to obtain a complete process execution time required by the target device for processing a single frame of image;

[0041] a time calculation module configured to calculate a predicted time consumption of the target device for processing each target object according to the number of existing frames and the complete procedure execution time consumption, and calculate an average time consumption of the target device for processing a single target object according to the predicted time consumption;

[0042] a device control module configured to calculate a power consumption adjustment coefficient according to the average time consumption and a target time consumption, and control the target device according to the power consumption adjustment coefficient, wherein the target time consumption is a time consumption meeting a user demand corresponding to the target device.

[0043] In addition, to achieve the above object, the present application further provides a device control device, which comprises a memory, a processor, and a device control program stored in the memory and executable on the processor, and the device control program is configured to implement the device control method as described above.

[0044] In addition, to achieve the above object, the present application further provides a storage medium, which stores a device control program, and the device control program is executable on a processor to implement the device control method as described above.

[0045] The one or more technical solutions provided by the present application have at least the following technical effects:

[0046] In the present application, a plurality of target objects and motion information of each target object are acquired from a plurality of images detected by a target device, the number of existing frames of each target object in a detection area corresponding to the target device is predicted according to the motion information, a complete procedure execution time consumption of the target device for processing a single frame of image is acquired, a predicted time consumption of the target device for processing each target object is calculated according to the number of existing frames and the complete procedure execution time consumption, an average time consumption of the target device for processing a single target object is calculated according to the predicted time consumption, a power consumption adjustment coefficient is calculated according to the average time consumption and a target time consumption, and the target device is controlled according to the power consumption adjustment coefficient, wherein the target time consumption is a time consumption meeting a user demand corresponding to the target device; since the present application analyzes a plurality of images detected by a target device to predict an average time consumption of the target device for processing a single target object, and controls power consumption of the target device according to the average time consumption and real-time demand, the power consumption of the device can be adjusted under the premise that the performance of the device can meet the user demand, and the balance between the performance of the device and the power consumption of the device is achieved. BRIEF DESCRIPTION OF DRAWINGS

[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and serve to explain the principles of the present application together with the specification.

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

[0049] Figure 1 Flowchart of a first embodiment of the device control method of the present application;

[0050] Figure 2 Flowchart of a second embodiment of the device control method of the present application;

[0051] Figure 3 Flowchart of a specific embodiment of the device control method of the present application;

[0052] Figure 4 Flowchart of a third embodiment of the device control method of the present application;

[0053] Figure 5 Scenario diagram of an embodiment of the device control method of the present application;

[0054] Figure 6 Module structure diagram of the device control apparatus of the embodiments of the present application;

[0055] Figure 7 Device structure diagram of the hardware running environment involved in the device control method of the embodiments of the present application.

[0056] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the drawings. DETAILED DESCRIPTION

[0057] It should be understood that the specific embodiments described herein are merely intended to explain the technical solutions of the present application, and are not used to limit the present application.

[0058] In order to better understand the technical solutions of the present application, the drawings in the specification and the specific embodiments will be described in detail.

[0059] In the field of intelligent analysis, often includes target detection, filtering, scoring, identification and other post-processing function components, wherein, scoring, identification and other post-processing function components are associated with the number of targets, especially AI intelligence. The complexity of different scenarios is quite different, and the number of targets is quite different, so the demand for computing power is different in different scenarios, and the time consumption is also different in different scenarios. But for the user, when the performance reaches a certain value, the user experience is no different, and the actual value is not great. For example, in the attendance scene based on feature recognition, the whole process of 200ms can basically achieve good experience effect, and the experience difference between 100ms and 200ms is not great. However, the related device control mode usually takes improving the processing performance of the processing device as the control target when controlling the processing device, so there is a defect that the device energy consumption is high, and the device performance and device power consumption are not balanced.

[0060] Therefore, in order to overcome the above defects, the present application provides a solution, which comprises: obtaining a plurality of target objects and motion information of each target object from a plurality of images detected by a target device, predicting the number of existing frames of each target object in the detection area corresponding to the target device according to the motion information, obtaining the complete process execution time required by the target device to process a single frame of image, calculating the predicted time consumption of the target device processing each target object according to the number of existing frames and the complete process execution time, and calculating the average time consumption required by the target device to process a single target object according to the predicted time consumption, calculating the power consumption adjustment coefficient according to the average time consumption and the target time consumption, and controlling the target device according to the power consumption adjustment coefficient, wherein the target time consumption is the time consumption that meets the user demand corresponding to the target device.

[0061] Since the present application analyzes the plurality of images detected by the target device to predict the average time consumption required by the target device to process a single target object, and calculates the power consumption adjustment coefficient according to the average time consumption and the target time consumption, and controls the target device according to the power consumption adjustment coefficient, the device performance can meet the user demand, and the device power consumption can be adjusted to achieve the balance between device performance and device power consumption.

[0062] It should be noted that the execution subject of the embodiment of the present application can be a device control device with data processing, network communication and program running functions, such as a controller of the target device, or other electronic devices that can achieve the same or similar functions, and the present embodiment does not limit this.

[0063] Based on this, the present application provides a device control method, which refers to Figure 1 , Figure 1 The flowchart of the first embodiment of the device control method of the present application.

[0064] In a first embodiment, the device control method comprises:

[0065] Step S10: obtaining a plurality of target objects and motion information of each target object from a plurality of images detected by the target device.

[0066] It should be understood that the application scenario of the embodiments of the present application can be to control the target device according to the power consumption adjustment coefficient in the intelligent analysis scenario. In specific implementation, the intelligent analysis scenario can be an image analysis scenario (such as a feature recognition-based attendance scenario), and the target device can be an image acquisition device (such as an attendance machine with a camera). The image acquisition device can continuously capture images to obtain a series of time-adjacent multiple images.

[0067] It can be understood that the target object can be a detection target of the target device. For example, in a feature recognition-based attendance scenario, the target object can be an employee. Of course, in other scenarios, the target object can also be set to other objects according to actual needs, such as vehicles, animals, specific articles, etc. The embodiments are not limited in this regard. The plurality of target objects obtained from the plurality of images detected by the target device can be obtained from the plurality of images detected by the target device through a target detection algorithm, wherein the target detection algorithm can be pre-set. In specific implementation, the target detection algorithm can be based on a traditional computer vision technology algorithm (such as edge detection, template matching, etc.), or based on a deep learning algorithm (such as CNN (Convolutional Neural Network), YOLO, Faster R-CNN (Faster Region-based Convolutional Neural Network), etc.). The embodiments are not limited in this regard.

[0068] It should be understood that the motion information of each target object can be a motion vector of each target object, which is used to represent the motion speed and motion direction of each target object. The motion information of each target object obtained from the plurality of images detected by the target device can be obtained by analyzing the position changes of each target object between the plurality of images to obtain the calculation speed, direction and other motion information of each target object.

[0069] Further, in order to reduce interference information and improve the accuracy of the target object, in the embodiments, the plurality of target objects obtained from the plurality of images detected by the target device can be a plurality of initial objects obtained from the plurality of images detected by the target device, and objects appearing for a short time and repeatedly appearing in the plurality of initial objects are filtered to obtain the target objects, wherein the objects appearing for a short time can refer to objects appearing for less than a preset frame number threshold, and the preset frame number threshold can be pre-set. The embodiments are not limited in this regard.

[0070] Step S20: predicting, according to the motion information, the existing frame number of each target object in the detection region corresponding to the target device.

[0071] It should be noted that the detection region corresponding to the target device can be a region set to be detected in the image collected by the target device. For example, in the attendance scene based on feature recognition, the detection region can be a region that can be photographed by the attendance machine.

[0072] It should be understood that predicting the existing frame number of each target object in the detection region corresponding to the target device according to the motion information can be predicting the existing frame number of each target object in the detection region corresponding to the target device according to the motion information by using a preset prediction model, wherein the preset prediction model can be a prediction model pre-trained according to the extracted motion information sample using a machine learning or deep learning algorithm, and the target of the preset prediction model can be to predict the probability of each target object being in the detection region in the future frame according to the motion information of each target object, and to calculate the existing frame number of each target object in the detection region corresponding to the target device according to the probability.

[0073] Step S30: obtaining the complete process execution time required by the target device to process a single frame of image.

[0074] It can be understood that the complete process execution time can be the execution time required by the target device to completely execute a plurality of functional components for processing a single frame of image, wherein in the attendance scene based on feature recognition, the plurality of functional components can include a target detection component, an object filtering component, a target recognition component, an attribute recognition component, and a trigger event component, etc., wherein the target detection component is used to obtain a plurality of initial objects from a plurality of frames of image detected by the target device; the object filtering component is used to filter objects appearing for a short time and repeatedly appearing in the plurality of initial objects, to obtain target objects, and to obtain the motion information of the target objects from the plurality of frames of image; the target recognition component is used to identify the identity information of the target objects to complete the attendance opening; the attribute recognition component is used to identify the attributes (such as age, gender, etc.) of the target objects; and the trigger event component is used to execute a specific operation when a specific event is triggered, for example, to alarm when it is detected that the target object does not wear a work uniform. In a specific implementation, the complete process execution time required by the target device to process a single frame of image can be directly obtained from the target device, which is not limited in the embodiment.

[0075] Step S40: calculating the predicted time consumption of the target device to process each target object according to the existing frame number and the complete process execution time, and calculating the average time consumption required by the target device to process a single target object according to the predicted time consumption.

[0076] For ease of understanding, the following is illustrated by way of example, but does not limit the present application. As an example, assume that the number of frames in which the mth target object exists in the detection area corresponding to the target device is OTK m , and the complete process execution time required by the target device to process a single frame of image is TE, then the average time required by the target device to process a single target object can be calculated by the following formula:

[0077]

[0078] In the formula, T ave represents the average time required by the target device to process a single target object, N is the total number of target objects, OTK m is the number of frames in which the mth target object exists in the detection area corresponding to the target device, and TE is the complete process execution time required by the target device to process a single frame of image. Wherein, OTK m * TE represents the predicted time required by the target device to process the mth target object.

[0079] Step S50: calculating a power consumption adjustment coefficient according to the average time and a target time, and controlling the target device according to the power consumption adjustment coefficient, wherein the target time is a time that meets the user demand corresponding to the target device.

[0080] It should be noted that the target time can be a time that meets the user real-time demand, and the target time can be set by the user in advance or can be obtained by analyzing the user real-time demand, and the present embodiment does not limit this. For example, in an attendance scene based on feature recognition, if the entire process time is 200 ms, it will not affect the user experience, but if the entire process time is 300 ms, it may make some users feel that the recognition is slow. Therefore, in this scene, 200 ms can be set as the target time.

[0081] For ease of understanding, the following is illustrated by way of example, but does not limit the present application. As an example, assume that the average time required by the target device to process a single target object is T ave , and the target time is T ue , then the power consumption adjustment coefficient can be calculated by the adjustment coefficient calculation formula, and the adjustment coefficient calculation formula is:

[0082]

[0083] In the formula, k represents the power consumption adjustment coefficient, T ave represents the average time required by the target device to process a single target object, and T ue represents the target time.

[0084] It can be understood that the target device can compare the power consumption adjustment coefficient with a preset threshold according to the power consumption adjustment coefficient control target device, and control the target device according to the comparison result. In a specific implementation, the preset threshold can be set to 1, when k>1, T ave >T ue , the device performance of the target device is insufficient, and the device performance of the target device needs to be improved; when k<1, T ave <T ue , the device performance of the target device is redundant, and the device power consumption of the target device needs to be reduced; when k=1, the device performance and the device power consumption are balanced, and the target device does not need to be adjusted.

[0085] The embodiment can predict the average time consumption required by the target device to process a single target object by analyzing the multiple frames of images detected by the target device, and control the power consumption of the target device according to the average time consumption and the real-time requirement, so as to adjust the device power consumption under the premise that the device performance can meet the user requirement, and realize the balance between the device performance and the device power consumption.

[0086] Referring to Figure 2 , Figure 2 The flowchart of the second embodiment of the device control method of the present application is shown in the above Figure 1 The second embodiment of the device control method of the present application is proposed based on the first embodiment shown in the above.

[0087] In the second embodiment, the step S50 comprises:

[0088] Step S501: calculating the power consumption adjustment coefficient according to the average time consumption and the target time consumption.

[0089] It should be understood that, in order to improve the device control effect, in the embodiment, the target device can be controlled from the hardware and / or software dimensions, that is, the hardware parameters of each calculation unit and / or the execution strategy of each functional component are adjusted.

[0090] For the sake of understanding, the following is illustrated by way of example, but does not limit the present application. As an example, assuming that the average time consumption required by the target device to process a single target object is T ave , the target time consumption is T ue , the power consumption adjustment coefficient can be calculated by the following formula:

[0091]

[0092] In the formula, k represents the power consumption adjustment coefficient, T ave represents the average time consumption required by the target device to process a single target object, and T ue represents the target time consumption.

[0093] Step S502: Obtain the hardware parameters of each computing unit and / or the execution strategy of each functional component, wherein the target device comprises a plurality of computing units and a plurality of functional components.

[0094] It should be noted that the hardware parameters can be parameters affecting the device performance of the target device, for example, frequency, voltage, etc., which are not limited in the embodiment; the execution strategy of each functional component can be an execution strategy affecting the device performance of the target device, for example, the calculation frequency of each functional component, the working mode, etc., which are not limited in the embodiment.

[0095] Step S503: Adjust the hardware parameters of each computing unit and / or the execution strategy of each functional component according to the power consumption adjustment coefficient.

[0096] It can be understood that adjusting the hardware parameters of each computing unit and / or the execution strategy of each functional component according to the power consumption adjustment coefficient can compare the power consumption adjustment coefficient with a preset threshold, and adjust the hardware parameters of each computing unit and / or the execution strategy of each functional component according to the comparison result.

[0097] In a specific implementation, the preset threshold can be set to 1, when k = 1, the device performance and the device power consumption reach a balance, and the target device does not need to be adjusted.

[0098] When k > 1, T ave > T ue , the device performance of the target device is insufficient, and the device performance of the target device needs to be improved. Therefore, the hardware parameters of each computing unit can be increased, the execution strategy of each functional component can be adjusted to a high performance mode, or the above two adjustment methods can be combined to further increase the computing capacity, which are not limited in the embodiment.

[0099] When k < 1, T ave < T ue , the device performance is redundant, and the device power consumption of the target device needs to be reduced. Therefore, the hardware parameters of each computing unit can be reduced, the execution strategy of each functional component can be adjusted to a low power consumption mode, or the above two adjustment methods can be combined to further reduce the device power consumption, which are not limited in the embodiment.

[0100] The embodiment controls the target device from the hardware and / or software dimensions, that is, adjusts the hardware parameters of each computing unit and / or the execution strategy of each functional component, so as to improve the device control effect, and further better balance the device performance and the device power consumption.

[0101] Further, the execution strategy of each functional component comprises a calculation frequency of each functional component; and the adjusting the execution strategy of each functional component according to the power consumption adjustment coefficient comprises: when the power consumption adjustment coefficient is greater than a preset threshold, selecting a secondary functional component from the multiple functional components according to the importance of each functional component to the target device, and reducing the calculation frequency of the secondary functional component; when the power consumption adjustment coefficient is equal to the preset threshold, controlling each functional component to maintain the current calculation frequency; and when the power consumption adjustment coefficient is less than the preset threshold, selecting a target functional component with a calculation frequency lower than a preset normal value from each functional component, and increasing the calculation frequency of the target functional component.

[0102] It should be understood that in the embodiment, when the power consumption adjustment coefficient is greater than the preset threshold (i.e., the device performance of the target device is insufficient), the secondary functional component can be selected from the multiple functional components according to the importance of each functional component to the target device, and the calculation frequency of the secondary functional component is reduced to ensure the normal operation of the core functional component; and when the power consumption adjustment coefficient is less than the preset threshold (i.e., the device performance of the target device is redundant), the target functional component with the calculation frequency lower than the preset normal value is selected from each functional component, and the calculation frequency of the target functional component is increased to restore the normal operation of the secondary functional component.

[0103] For the convenience of understanding, the following is illustrated by way of example, but does not limit the present application. As an example, it is assumed that the scene involved in the method is a feature recognition-based attendance scene, and the multiple functional components of the target device comprise a target recognition component, an attribute recognition component, and a trigger event component, etc. Since the main target of the current scene is target recognition, the importance of the target recognition component to the target device is greater than that of the attribute recognition component. When k>1, the device performance of the target device is insufficient, and the calculation frequency of the attribute recognition component can be reduced to ensure the normal operation of the target recognition component. When k<1, the device performance of the target device is redundant, and if it is detected that the calculation frequency of the attribute recognition component is lower than the preset normal value, the calculation frequency of the attribute recognition component can be increased to restore the normal operation of the attribute recognition component.

[0104] Furthermore, the execution strategy of each functional component includes the working mode of each functional component; the execution strategy of each functional component is adjusted according to the power consumption adjustment coefficient, including: when the power consumption adjustment coefficient is greater than a preset threshold, the working mode of at least one functional component is switched to a high-performance mode, and the functional component switched to the high-performance mode is migrated to the first computing unit for execution, wherein the first computing unit is the computing unit with the strongest performance among multiple computing units; when the power consumption adjustment coefficient is equal to the preset threshold, each functional component is controlled to maintain the current working mode; when the power consumption adjustment coefficient is less than the preset threshold, the working mode of at least one functional component is switched to a low-energy mode, and the functional component switched to the low-energy mode is migrated to the second computing unit for execution, wherein the second computing unit is the computing unit with the lowest energy consumption among multiple computing units.

[0105] It should be understood that when the power consumption adjustment coefficient is greater than the preset threshold (i.e., when the device performance of the target device is insufficient), the working mode of at least one functional component can be switched to the high-performance mode first, and the functional component switched to the high-performance mode can be migrated to the computing unit with the strongest performance for execution, so as to improve the device performance of the target device; when the power consumption adjustment coefficient is less than the preset threshold (i.e., when the device performance of the target device is redundant), the working mode of at least one functional component can be switched to the low-energy mode first, and the functional component switched to the low-energy mode can be migrated to the computing unit with the lowest energy consumption for execution, so as to reduce the device energy consumption of the target device.

[0106] For ease of understanding, the following examples are given, but this application is not limited. As an example, it is assumed that the scenario involved in the method is an attendance scenario based on feature recognition, and the multiple functional components of the target device include a target recognition component, an attribute recognition component, and a trigger event component, etc. The multiple computing units of the target device include a DSP and an NPU. The power consumption of the DSP is lower than that of the NPU, and the performance of the NPU is stronger than that of the DSP. Therefore, when k>1, the device performance of the target device is insufficient. The working mode of the target recognition component can be switched to a high-performance mode, and the target recognition component can be migrated to the NPU for execution to improve the device performance of the target device. When k<1, the device performance of the target device is redundant. The working mode of the attribute recognition component can be switched to a low-energy mode, and the attribute recognition component can be migrated to the DSP for execution to reduce the device energy consumption of the target device.

[0107] Furthermore, adjusting the hardware parameters of each computing unit according to the power consumption adjustment coefficient includes:

[0108] Obtaining current hardware parameters of each computing unit, and calculating parameter adjustment values ​​according to the power consumption adjustment coefficient and the current hardware parameters;

[0109] adjust the current hardware parameter of each computing unit according to the parameter adjustment value, wherein the current hardware parameter comprises a current computing frequency and / or a current voltage.

[0110] It should be understood that, in order to improve the accuracy of the adjustment of the hardware parameter, in the embodiment, the parameter adjustment value is calculated according to the power consumption adjustment coefficient and the current hardware parameter, and the current hardware parameter of each computing unit is adjusted according to the parameter adjustment value.

[0111] For the convenience of understanding, the following is illustrated by way of example, but does not limit the present application. As an example, the parameter adjustment value is calculated according to the power consumption adjustment coefficient and the current hardware parameter, and the specific calculation formula is: Ah = (k-1)*h, wherein Ah represents the parameter adjustment value, k represents the power consumption adjustment coefficient, and h represents the current hardware parameter. The current hardware parameter of each computing unit is adjusted according to the parameter adjustment value Ah. In a specific implementation, when k>1, the device performance of the target device is insufficient, and the device performance of the target device needs to be improved. Since Ah>0 is obtained by calculation, the current hardware parameter of each computing unit is increased to improve the device performance of the target device. When k<1, the device performance of the target device is redundant, and the device power consumption of the target device needs to be reduced. Since Ah<0 is obtained by calculation, the current hardware parameter of each computing unit is reduced to reduce the device power consumption of the target device.

[0112] For the convenience of understanding, reference Figure 3 is made to the description, but does not limit the present application. Figure 3 is an embodiment of the device control method of the present application, and the device control method comprises:

[0113] 1. obtaining a plurality of initial objects from a plurality of images detected by the target device;

[0114] 2. filtering objects appearing for a short time and repeatedly appearing in the plurality of initial objects to obtain target objects, wherein the objects appearing for a short time can refer to objects appearing for less than a preset frame number threshold;

[0115] 3. obtaining motion information of the plurality of target objects from a plurality of images detected by the target device;

[0116] 4. calculating the average time required by the target device to process a single target object, and the specific steps are: predicting the number of frames in which each target object exists in the detection area corresponding to the target device according to the motion information; obtaining the complete process execution time required by the target device to process a single image; calculating the predicted time required by the target device to process each target object according to the number of existing frames and the complete process execution time, and calculating the average time required by the target device to process a single target object according to the predicted time;

[0117] 5. Calculate the power consumption adjustment coefficient according to the average time consumption and the target time consumption, and the specific steps are: power consumption adjustment coefficient = average time consumption / target time consumption;

[0118] 6. Adjust the hardware parameters of each computing unit and / or the execution strategy of each functional component according to the power consumption adjustment coefficient, and the specific steps are: adjust the current frequency and / or the current voltage of each computing unit according to the power consumption adjustment coefficient; adjust the working mode or the calculation frequency of each functional component according to the power consumption adjustment coefficient.

[0119] Referring to Figure 4 , Figure 4 is a flowchart of a third embodiment of the device control method of the present application, and the third embodiment of the device control method of the present application is proposed based on the above embodiments.

[0120] In the third embodiment, the step S20 comprises:

[0121] Step S201: Predict a set of motion position points of each target object according to the motion information.

[0122] It should be understood that, in order to improve the accuracy of the existing frame number, in the present embodiment, a set of motion position points of each target object is first predicted according to the motion information of each target object, then the existing time of each target object in the detection area corresponding to the target device is predicted according to the set of motion position points, and then the existing frame number of each target object in the detection area corresponding to the target device is calculated according to the existing time and the image frame number processed by the target device per second.

[0123] It can be understood that predicting a set of motion position points of each target object according to the motion information can be predicting a set of motion position points of each target object according to the motion information through a preset motion model, wherein the preset motion model is used to estimate the position of the target object in the future frame based on the motion information, and the preset motion model can be a linear model, a polynomial model, a Kalman filter, etc., and the present embodiment does not limit this.

[0124] Step S202: Predict the existing time of each target object in the detection area corresponding to the target device according to the set of motion position points.

[0125] For ease of understanding, reference Figure 5 is made for illustration, but the present application is not limited thereto. Figure 5This is a scene diagram of an embodiment of the device control method of the present application. As an example, in the figure, the square patterns are the target objects, the lines with arrows are the sets of motion position points of the target objects, and the dotted box area is the detection area corresponding to the target device. Predicting the existence time of each target object in the detection area corresponding to the target device based on the motion position point set can be determining the time when each target object enters the detection area and the time when it leaves the detection area based on the motion position point set, and calculating the time difference from the target object entering the detection area to leaving the detection area, which is the existence time of the target object in the detection area.

[0126] Step S203: Calculate the number of frames in which each target object exists in the detection area corresponding to the target device based on the existence time and the number of image frames processed per second by the target device.

[0127] For ease of understanding, the following examples are given, but are not intended to limit the present application. As an example, assume that the existence time of the mth target object in the detection area corresponding to the target device is T m , the number of image frames processed per second by the target device is FPS, then the number of frames in which each target object exists in the detection area corresponding to the target device can be calculated by the following formula:

[0128] OTK m =T m *FPS

[0129] Where, OTK m Indicates the number of frames in which the mth target object exists in the detection area corresponding to the target device, T m It indicates the existence time of the mth target object in the detection area corresponding to the target device, and FPS indicates the number of image frames processed per second by the target device.

[0130] This embodiment first predicts the set of motion position points of each target object based on the motion information of each target object, then predicts the existence time of each target object in the detection area corresponding to the target device based on the set of motion position points, and then calculates the number of existence frames of each target object in the detection area corresponding to the target device based on the existence time and the number of image frames processed by the target device per second, thereby improving the accuracy of the number of existence frames, and further improving the accuracy of power consumption adjustment.

[0131] In the third embodiment, the step S30 includes:

[0132] Step S301: obtaining the execution time consumed by each computing unit when executing each functional component to process a single frame of image, wherein the target device includes a plurality of computing units for heterogeneous computing.

[0133] It should be understood that in the embodiment, the computing unit of heterogeneous computing can be used in the target device, that is, when the target device needs to execute a certain functional component, the functional component is allocated to the most suitable computing unit for processing according to the type and characteristics of the functional component, so as to achieve the best computing performance and efficiency. For example, in the attendance scene based on feature recognition, the target device can simultaneously use DSP (Digital Signal Processor) and NPU (Neural-network Process Units) to process multiple frames of images.

[0134] Considering that different computing units have different execution times when executing different functions, in order to improve the accuracy of the execution time of the complete process, in the embodiment, the execution time of each computing unit when executing each functional component to process a single frame of image is obtained first, and then the execution times are summed to obtain the execution time of the complete process required by the target device to process a single frame of image.

[0135] For the sake of understanding, the following is illustrated by way of example, but does not limit the present application. As an example, it is assumed that the execution time of the i th computing unit when executing the j th functional component to process a single frame of image is represented as TD i,j , the first computing unit is DSP, the second computing unit is NPU, the first functional component is a target detection component, and the second functional component is an object filtering component. The execution time of the DSP when executing the target detection component to process a single frame of image is TD 1,1 , the execution time of the NPU when executing the target detection component to process a single frame of image is TD 2,1 , the execution time of the DSP when executing the object filtering component to process a single frame of image is TD 1,2 , and the execution time of the NPU when executing the object filtering component to process a single frame of image is TD 2,2 .

[0136] Step S302: Summing the execution times to obtain the execution time of the complete process required by the target device to process a single frame of image.

[0137] For the sake of understanding, the following is illustrated by way of example, but does not limit the present application. As an example, it is assumed that the execution time of the i th computing unit when executing the j th functional component to process a single frame of image is represented as TD i,j , the execution time of the complete process required by the target device to process a single frame of image can be calculated by the following formula:

[0138]

[0139] In the formula, TD i,jTEij represents the execution time when the i th computing unit executes the j th functional component to process a single frame of image, and TE represents the complete flow execution time required by the target device to process a single frame of image.

[0140] The embodiment first acquires the execution time when each computing unit executes each functional component to process a single frame of image, and then sums the execution time to obtain the complete flow execution time required by the target device to process a single frame of image, thereby improving the accuracy of the complete flow execution time and further improving the accuracy of the power consumption adjustment.

[0141] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the device control method of the present application. More forms of simple transformation based on this technical concept are within the protection scope of the present application.

[0142] The present application also provides a device control apparatus, which refers to Figure 6 , and the device control apparatus comprises:

[0143] An information acquisition module 10 is configured to acquire a plurality of target objects and motion information of each target object from a plurality of frames of image detected by a target device;

[0144] A frame number prediction module 20 is configured to predict the existing frame number of each target object in a detection region corresponding to the target device according to the motion information;

[0145] An execution time acquisition module 30 is configured to acquire the complete flow execution time required by the target device to process a single frame of image;

[0146] A time calculation module 40 is configured to calculate the predicted execution time of the target device for processing each target object according to the existing frame number and the complete flow execution time, and calculate the average execution time required by the target device for processing a single target object according to the predicted execution time;

[0147] A device control module 50 is configured to calculate a power consumption adjustment coefficient according to the average execution time and a target execution time, and control the target device according to the power consumption adjustment coefficient, wherein the target execution time is an execution time meeting the user demand corresponding to the target device.

[0148] The device control apparatus provided by the present application adopts the device control method in the above embodiment, and can solve the technical problem that the related device control method takes improving the processing performance of a processing device as a control target, resulting in high energy consumption of the device and imbalance between the performance and power consumption of the device. Compared with the related art, the device control apparatus provided by the present application has the same beneficial effects as the device control method provided by the above embodiment, and other technical features in the device control apparatus are the same as the features disclosed in the above embodiment, which will not be repeated here.

[0149] The present application provides a device control device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the device control method in the above embodiment one.

[0150] Reference will now be made to the following description Figure 7 which shows a structural schematic diagram of a device control device suitable for implementing embodiments of the present application. The device control device in embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, as well as fixed terminals such as digital TVs, desktop computers, and the like. Figure 7 The device control device shown is merely an example and should not impose any limitation on the functions and use range of embodiments of the present application.

[0151] As shown in Figure 7 , the device control device can include a processing apparatus 1001 (such as a central processor, a graphics processor, or the like) that can perform various appropriate actions and processes according to programs stored in a ROM (Read Only Memory) 1002 or programs loaded from a storage apparatus 1003 into a RAM (Random Access Memory) 1004. Various programs and data required for operation of the device control device are also stored in the RAM 1004. The processing apparatus 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: input apparatuses 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, and the like; output apparatuses 1008 including, for example, an LCD (Liquid Crystal Display), a speaker, a vibrator, and the like; the storage apparatus 1003 including, for example, a magnetic tape, a hard disk, and the like; and a communication apparatus 1009. The communication apparatus 1009 can allow the device control device to communicate wirelessly or by wire with other devices to exchange data. Although a device control device having various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be alternatively implemented or had.

[0152] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program codes for executing the method shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiments disclosed in the present application are executed.

[0153] The device control device provided by the present application adopts the device control method in the above-mentioned embodiments, and can solve the technical problem that the related device control method takes improving the processing performance of the processing device as the control target, resulting in high energy consumption of the device, and imbalance between the performance of the device and the energy consumption of the device. Compared with the related art, the device control device provided by the present application has the same beneficial effects as the device control method provided by the above-mentioned embodiments, and other technical features in the device control device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0154] It should be understood that various parts of the present application can be realized by hardware, software, firmware or a combination thereof. In the description of the above-mentioned embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0155] The above is merely specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0156] The present application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e. computer program) for executing the device control method in the above-mentioned embodiments.

[0157] The computer readable storage medium provided in the present application may, for example, be a U disk, but is not limited to an electrical, magnetic, optical, electromagnetic, or infrared system, system, or device, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more conductive wires, a portable computer diskette, a hard disk, a RAM (Random Access Memory), a ROM (Read Only Memory), an EPROM (Erasable Programmable Read Only Memory), an optical fiber, a CD-ROM (CD-ReadOnly Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted in any suitable medium, including but not limited to an electrical wire, an optical cable, an RF (Radio Frequency) cable, etc., or any suitable combination of the above.

[0158] The above computer readable storage medium can be contained in the device control device, or can exist separately without being assembled into the device control device.

[0159] The above computer readable storage medium carries one or more programs, which, when executed by the device control device, cause the device control device to perform the device control method in the above embodiment.

[0160] Computer program code for carrying out operations of the present application can be written in one or more programming languages or combinations of languages including object oriented programming languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a LAN (Local Area Network) or a WAN (Wide Area Network), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0161] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0162] The modules involved in the embodiments of the present application can be implemented in the form of software or in the form of hardware. In some cases, the name of the module does not constitute a limitation on the module itself.

[0163] The computer readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e. computer program) for executing the device control method described above, and can solve the technical problem of high energy consumption of the device and imbalance between the performance of the device and the energy consumption of the device as the control target of the related device control method to improve the processing performance of the device. Compared with the related art, the computer readable storage medium provided by the present application has the same beneficial effects as the device control method provided by the above embodiments, and will not be described here.

[0164] The above only describes some embodiments of the present application, and does not limit the patent scope of the present application. Any equivalent structural transformation made by using the content of the present application specification and drawings, or direct / indirect application in other related technical fields is included in the patent protection scope of the present application.

Claims

1. A device control method characterized by, The device control method comprises: obtaining a plurality of target objects and motion information of each target object from a plurality of images detected by a target device; predicting a number of existing frames of each target object in a detection area corresponding to the target device according to the motion information; obtaining a complete process execution time required by the target device to process a single image; calculating a predicted time consumption of the target device for processing each target object according to the number of existing frames and the complete process execution time, and calculating an average time consumption required by the target device for processing a single target object according to the predicted time consumption; calculating a power consumption adjustment coefficient according to the average time consumption and a target time consumption, and controlling the target device according to the power consumption adjustment coefficient, wherein the target time consumption is a time consumption meeting a user demand corresponding to the target device.

2. The device control method according to Claim 1, wherein The controlling the target device according to the power consumption adjustment coefficient comprises: obtaining hardware parameters of each calculation unit and / or execution strategies of each functional component, wherein the target device comprises a plurality of calculation units and a plurality of functional components; adjusting the hardware parameters of each calculation unit and / or the execution strategies of each functional component according to the power consumption adjustment coefficient.

3. The device control method according to Claim 2, wherein The execution strategy of each functional component comprises a calculation frequency of each functional component. The adjusting the execution strategy of each functional component according to the power consumption adjustment coefficient comprises: when the power consumption adjustment coefficient is greater than a preset threshold, selecting a secondary functional component from the plurality of functional components according to an importance of each functional component to the target device, and reducing the calculation frequency of the secondary functional component; when the power consumption adjustment coefficient is equal to the preset threshold, controlling each functional component to maintain a current calculation frequency; when the power consumption adjustment coefficient is less than the preset threshold, selecting a target functional component from each functional component, the target functional component having a calculation frequency lower than a preset normal value, and increasing the calculation frequency of the target functional component.

4. The device control method according to Claim 2, wherein The execution strategy of each functional component comprises a working mode of each functional component. The adjusting the execution strategy of each functional component according to the power consumption adjustment coefficient comprises: when the power consumption adjustment coefficient is greater than a preset threshold, switching a working mode of at least one functional component to a high-performance mode, and migrating the functional component switched to the high-performance mode to a first calculation unit for execution, wherein the first calculation unit is a calculation unit with the strongest performance in the plurality of calculation units; when the power consumption adjustment coefficient is equal to the preset threshold, controlling each functional component to maintain a current working mode; when the power consumption adjustment coefficient is less than the preset threshold, switching a working mode of at least one functional component to a low-energy-consumption mode, and migrating the functional component switched to the low-energy-consumption mode to a second calculation unit for execution, wherein the second calculation unit is a calculation unit with the lowest energy consumption in the plurality of calculation units.

5. The device control method according to Claim 2, wherein The adjusting the hardware parameters of each calculation unit according to the power consumption adjustment coefficient comprises: obtaining a current hardware parameter of each calculation unit, and calculating a parameter adjustment value according to the power consumption adjustment coefficient and the current hardware parameter; adjusting the current hardware parameter of each calculation unit according to the parameter adjustment value, wherein the current hardware parameter comprises a current calculation frequency and / or a current voltage.

6. The device control method according to any one of claims 1 to 5, wherein, The presence frame number of each target object in the detection area corresponding to the target device is predicted according to the motion information, and the presence frame number of each target object in the detection area corresponding to the target device is predicted according to the motion information. A set of motion position points of each target object is predicted according to the motion information. A presence time of each target object in the detection area corresponding to the target device is predicted according to the set of motion position points. The presence frame number of each target object in the detection area corresponding to the target device is calculated based on the presence time and the number of image frames processed by the target device per second.

7. The device control method according to any one of claims 1 to 5, wherein, The complete process execution time required by the target device for processing a single frame of image is obtained, and the complete process execution time required by the target device for processing a single frame of image is obtained. Execution time of each calculation unit when processing a single frame of image by each functional component is obtained, wherein the target device includes a plurality of calculation units for heterogeneous calculation. The execution time is summed to obtain the complete process execution time required by the target device for processing a single frame of image.

8. The device control method according to any one of claims 1 to 5, wherein, The power consumption adjustment coefficient is calculated according to the average execution time and the target execution time, and the power consumption adjustment coefficient is calculated according to the average execution time and the target execution time. The power consumption adjustment coefficient is calculated according to the average execution time and the target execution time. The device control apparatus comprises: where k is a power consumption adjustment coefficient, T ave is the average time consumption, T ue is the target time consumption.

9. An apparatus control device characterized by comprising: An information acquisition module is configured to acquire a plurality of target objects and motion information of each target object from a plurality of frames of image detected by a target device. A frame number prediction module is configured to predict a presence frame number of each target object in a detection area corresponding to the target device according to the motion information. A time consumption acquisition module is configured to obtain a complete process execution time required by the target device for processing a single frame of image. A time calculation module is configured to calculate a predicted execution time of the target device for processing each target object according to the presence frame number and the complete process execution time, and calculate an average execution time of the target device for processing a single target object according to the predicted execution time. A device control module is configured to calculate a power consumption adjustment coefficient according to the average execution time and a target execution time, and control the target device according to the power consumption adjustment coefficient, wherein the target execution time is an execution time meeting a user demand corresponding to the target device. The device control apparatus comprises a memory, a processor, and a device control program stored on the memory and executable on the processor, and the device control program implements the device control method of any one of claims 1 to 8 when executed by the processor.

10. An apparatus control device, characterized by comprising: The storage medium stores a device control program, and the device control program implements the device control method of any one of claims 1 to 8 when executed by the processor.

11. A storage medium, characterized by ​

Citation Information

Patent Citations

  • Power consumption regulation method and video analysis system based on battery life

    CN107239131A

  • Video processing method and device, electronic equipment and storage medium

    CN113038222A