Frame rate adjustment method, device, electronic device and storage medium
By using decision models to predict future alarm data of AI camera devices and dynamically calculate the detection frame rate, the problems of invalid performance and increased power consumption caused by fixed detection frame rates are solved, and more efficient detection and resource savings are achieved.
Patent Information
- Application Number
- CN202211009663.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-22
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-08-22
AI Technical Summary
Existing AI cameras use fixed detection frame rates, resulting in ineffective performance occupancy and increased power consumption, and are unable to effectively adapt to the needs of different scenarios.
By obtaining the target historical alarm data of the camera device, inputting a pre-trained decision model, predicting future alarm data, and calculating the future detection frame rate based on the future alarm data, and dynamically adjusting the detection frame rate of the camera device.
Dynamic adjustment of detection frame rate is realized, adapting to changes in different scenarios, avoiding ineffective performance and increasing power consumption, improving the accuracy of detection frame rate, and saving resources.
Smart Images

Figure CN115550545B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software technology, and in particular to a frame rate adjustment method, device, electronic device and storage medium. Background Art
[0002] With the development of the Internet of Things and deep learning, smart terminals have been applied in a wider range of scenarios, and AI (Artificial Intelligence) camera equipment is one of the best. AI camera equipment can collect images and perform AI detection on the collected images to detect whether there are risk events, etc.
[0003] In the prior art, AI camera equipment uses a fixed detection frame rate to perform AI detection on the collected images. However, the fixed detection frame rate will cause the performance of the AI camera equipment to be ineffectively occupied and increase power consumption. Therefore, how to reasonably adjust the detection frame rate of the AI camera equipment is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of the above problems, the embodiments of the present application propose a frame rate adjustment method, device, electronic device and storage medium, which can dynamically adjust the detection frame rate of a camera device.
[0005] According to one aspect of an embodiment of the present application, a frame rate adjustment method is provided, the method comprising:
[0006] Obtain target historical alarm data of camera equipment;
[0007] Inputting the target historical alarm data into a pre-trained decision model to obtain future alarm data of the camera device output by the decision model;
[0008] A future detection frame rate of the camera device is calculated based on the future warning data, and the frame rate of the camera device is adjusted according to the future detection frame rate.
[0009] Optionally, the future detection frame rate represents the number of frames processed per unit time when the camera device performs artificial intelligence detection on the captured images.
[0010] Optionally, there are multiple camera devices, each of which is configured with an adjustment time period; obtaining the target historical alarm data of the camera device includes: obtaining the target historical alarm data of the camera device according to the adjustment time period configured for the camera device.
[0011] Optionally, obtaining target historical alarm data of a camera device includes: obtaining candidate historical alarm data of the camera device; and performing statistics on the candidate historical alarm data to obtain the target historical alarm data.
[0012] Optionally, the candidate historical alarm data include: the historical alarm time and the historical alarm level of the camera device on each day in at least one day before the current time; the candidate historical alarm data are counted to obtain the target historical alarm data, including: for each day in at least one day before the current time, based on the historical alarm time and the historical alarm level of the day, the historical alarm number and the historical comprehensive alarm level of each alarm time period in the day are counted, and the alarm time period is obtained by dividing a day according to a preset rule; the historical alarm number and the historical comprehensive alarm level of each alarm time period in each day of the camera device on at least one day before the current time are used as the target historical alarm data.
[0013] Optionally, the future alarm data of the camera device includes: the future alarm number and the future comprehensive alarm level for each alarm time period in each day of the camera device in at least one day after the current time, wherein the alarm time period is obtained by dividing one day according to a preset rule; calculating the future detection frame rate of the camera device based on the future alarm data includes: for each alarm time period in each day of at least one day after the current time, based on the future alarm number and the future comprehensive alarm level of the alarm time period, calculating the future detection frame rate of the alarm time period.
[0014] Optionally, based on the future number of alarms in the alarm time period and the future comprehensive alarm level, the future detection frame rate of the alarm time period is calculated, including: according to the rule that the future detection frame rate is positively correlated with the future number of alarms and the future comprehensive alarm level, based on the future number of alarms in the alarm time period and the future comprehensive alarm level, the future detection frame rate of the alarm time period is calculated.
[0015] Optionally, the decision model is trained in the following manner: obtaining sample target historical alarm data and sample actual future alarm data of a sample camera device; inputting the sample target historical alarm data into the model to be trained to obtain sample predicted future alarm data of the sample camera device output by the model to be trained; after determining that the training is completed based on the sample actual future alarm data and the sample predicted future alarm data, the decision model is obtained.
[0016] According to another aspect of an embodiment of the present application, a frame rate adjustment device is provided, the device comprising:
[0017] An acquisition module is used to acquire target historical alarm data of a camera device;
[0018] A prediction module, used for inputting the target historical alarm data into a pre-trained decision model to obtain future alarm data of the camera device output by the decision model;
[0019] A calculation module is used to calculate a future detection frame rate of the camera device based on the future alarm data, and adjust the frame rate of the camera device according to the future detection frame rate.
[0020] Optionally, the future detection frame rate represents the number of frames processed per unit time when the camera device performs artificial intelligence detection on the captured images.
[0021] Optionally, there are multiple camera devices, each of which is configured with an adjustment time period; the acquisition module is specifically used to acquire the target historical alarm data of the camera device according to the adjustment time period configured for the camera device.
[0022] Optionally, the acquisition module includes: a candidate acquisition unit, used to acquire candidate historical alarm data of the camera device; and a data statistics unit, used to perform statistics on the candidate historical alarm data to obtain the target historical alarm data.
[0023] Optionally, the candidate historical alarm data obtains candidate historical alarm data of the camera device, including: obtaining the historical alarm time and the historical alarm level of the camera device for each day in at least one day before the current time as the candidate historical alarm data; the data statistics unit is specifically used to, for each day in at least one day before the current time, based on the historical alarm time and the historical alarm level of the day, obtain the number of historical alarms and the historical comprehensive alarm level for each alarm time period on the day, wherein the alarm time period is obtained by dividing one day according to a preset rule; and taking the number of historical alarms and the historical comprehensive alarm level for each alarm time period on each day of the camera device in at least one day before the current time as the target historical alarm data.
[0024] Optionally, the future alarm data of the camera device includes: the future alarm number and future comprehensive alarm level of each alarm time period in each day of the camera device in at least one day after the current time, and the alarm time period is obtained by dividing one day according to a preset rule; the calculation module includes: a frame rate calculation unit, which is used to calculate the future detection frame rate of each alarm time period in each day of at least one day after the current time based on the future alarm number and future comprehensive alarm level of the alarm time period.
[0025] Optionally, the frame rate calculation unit is specifically used to calculate the future detection frame rate of the alarm time period based on the future alarm number and the future comprehensive alarm level of the alarm time period according to the rule that the future detection frame rate is positively correlated with the future alarm number and the future comprehensive alarm level.
[0026] Optionally, the decision model is trained through the following modules: a sample acquisition module, used to acquire sample target historical alarm data and sample actual future alarm data of a sample camera device; a sample prediction module, used to input the sample target historical alarm data into the model to be trained, and obtain the sample predicted future alarm data of the sample camera device output by the model to be trained; a determination module, used to obtain the decision model after determining that the training is completed based on the sample actual future alarm data and the sample predicted future alarm data.
[0027] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; and one or more computer-readable storage media having instructions stored thereon; when the instructions are executed by the one or more processors, the processors execute the frame rate adjustment method as described in any one of the above items.
[0028] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the frame rate adjustment method as described in any one of the above items.
[0029] In an embodiment of the present application, the target historical alarm data of the camera device is obtained; the target historical alarm data is input into a pre-trained decision model to obtain the future alarm data of the camera device output by the decision model; the future detection frame rate of the camera device is calculated based on the future alarm data, and the frame rate of the camera device is adjusted according to the future detection frame rate. It can be seen that in an embodiment of the present application, the decision model can be used to predict the future alarm data based on the historical alarm data of the camera device, and the future detection frame rate is calculated based on the future alarm data, taking into account the association between the detection frame rate of the camera device and the alarm data, so that the detection frame rate can be dynamically adjusted according to the change of the alarm data, so that the detection frame rate is more adaptable to the change of the scene, avoiding the invalid occupation of the performance of the camera device and the increase of power consumption, improving the accuracy of the detection frame rate, and saving resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solution of the embodiment of the present application, the drawings required for use in the description of the embodiment of the present application will be briefly introduced below. Obviously, the drawings described below are only some drawings of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 It is a schematic diagram of a system interaction process of an embodiment of the present application.
[0032] Figure 2It is a step flow chart of a frame rate adjustment method according to an embodiment of the present application.
[0033] Figure 3 It is a structural diagram of a vector parameter of an embodiment of the present application.
[0034] Figure 4 It is a schematic diagram of a vector according to an embodiment of the present application.
[0035] Figure 5 It is a structural block diagram of a frame rate adjustment device according to an embodiment of the present application.
[0036] Figure 6 It is a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0038] The devices involved in the embodiments of the present application may include a camera device, a camera device platform and a configuration decision platform, wherein the camera device and the camera device platform can communicate bidirectionally, and the camera device platform and the configuration decision platform can communicate bidirectionally.
[0039] Reference Figure 1 , showing a schematic diagram of a system interaction process of an embodiment of the present application.
[0040] like Figure 1 As shown, the system interaction process may include:
[0041] 1. The camera device reports the alarm data to the camera device platform.
[0042] The camera device may be an AI camera device, such as an AI camera.
[0043] The camera device can capture images and perform AI detection on the captured images to detect whether there are risk events, etc. When the camera device detects the presence of a risk event, it will generate alarm data and report the alarm data to the camera platform.
[0044] Exemplarily, AI detection may include, but is not limited to: perimeter intrusion detection, fire detection, red light running detection, not wearing a helmet detection, and the like.
[0045] Exemplarily, the alarm data may include but is not limited to: alarm type, alarm time, alarm level, etc. Among them, the alarm type may correspond to the type of the above-mentioned AI detection algorithm. The alarm level can be divided according to the actual situation according to the preset level division rules.
[0046] 2. The camera device platform provides candidate historical alarm data of the camera device to the configuration decision platform.
[0047] The camera device platform can use the alarm data reported by the camera device as the historical alarm data of the camera device and store it in a storage medium. The camera device platform can also integrate and process the historical alarm data of the camera device according to the needs of the configuration decision platform, and provide the configuration decision platform with the candidate historical alarm data of the camera device required by it.
[0048] 3. The configuration decision platform returns the future detection frame rate of the camera device to the camera device platform.
[0049] The configuration decision platform predicts the future detection frame rate of the camera device based on the candidate historical alarm data provided by the camera device platform, and returns the future detection frame rate of the camera device to the configuration decision platform. This will be described in detail in the following embodiments.
[0050] 4. The camera device platform sends the future detection frame rate to the camera device.
[0051] The camera device sends the future detection frame rate of the camera device to the corresponding camera device. After receiving the future detection frame rate, the camera device can perform AI detection on the collected image according to the future detection frame rate.
[0052] Reference Figure 2 , shows a flow chart of the steps of a frame rate adjustment method according to an embodiment of the present application. For example, Figure 2 The frame rate adjustment method shown can be applied to the above configuration decision platform.
[0053] like Figure 2 As shown, the frame rate adjustment method may include the following steps:
[0054] Step 201, obtaining target historical alarm data of a camera device.
[0055] The alarm data of a camera device refers to the data generated after AI detection is performed on the images collected by the camera device and risk events are detected in the collected images. The alarm data is used to explain the detected risk events.
[0056] The historical alarm data of the camera device may be the alarm data before the current time. The target historical alarm data of the camera device may be obtained based on the historical alarm data. For example, it may be the data that meets the set conditions in the historical alarm data, or it may be the data after the historical alarm data is screened, counted, etc.
[0057] In an optional implementation, the process of obtaining the target historical alarm data of the camera device may include the following steps A1-A2:
[0058] Step A1, obtaining candidate historical alarm data of the camera device.
[0059] like Figure 1 As shown, the candidate historical alarm data of the camera device is integrated and packaged by the camera device platform and provided to the configuration decision platform. Therefore, the configuration decision platform can receive the candidate historical alarm data of the camera device sent by the camera device platform.
[0060] Exemplarily, the candidate historical alarm data of the camera device may include: the historical alarm time and historical alarm level of the camera device for each day in at least one day before the current time. It can be understood that in this embodiment, the alarm time in the historical alarm data is referred to as the historical alarm time, and the alarm level in the historical alarm data is referred to as the historical alarm level.
[0061] In the embodiment of the present application, the at least one day before the current time can be set as a few days before the current time according to the actual situation, and the present embodiment does not limit this. For example, if the historical alarm data of the 7 days before the current time is set to predict the future alarm data of 1 day after the current time, the candidate historical alarm data of the camera device is: the historical alarm time and historical alarm level of the camera device for each day in the 7 days before the current time.
[0062] For example, the current time may be the current time point, and the corresponding at least one day before the current time is: starting from the current time point, and moving forward to the time point of the last day of the at least one day before. For example, if the current time is 8:00 this Monday, then the 7 days before the current time are 8:00 last Monday to 8:00 this Monday. It should be noted that, for the convenience of statistics, if the current time point is not an hour, the nearest hour before the current time point can be used as the current time point.
[0063] Step A2: performing statistics on the candidate historical alarm data to obtain the target historical alarm data.
[0064] The candidate historical alarm data may be counted by counting the alarm time in the candidate historical alarm data according to the alarm time period, so as to obtain the number of alarms in the alarm time period as the target historical alarm data; the alarm level in the candidate historical alarm data may be counted according to the alarm time period, so as to obtain the comprehensive alarm level in the alarm time period as the target historical alarm data; the alarm type in the candidate historical alarm data may be counted according to the alarm time period, so as to obtain the number of occurrences of each alarm type in the alarm time period as the target historical alarm data, etc. Of course, multiple parameters in the candidate historical alarm data may also be counted at the same time to obtain the target historical alarm data.
[0065] Exemplarily, the process of collecting statistics on the candidate historical alarm data to obtain the target historical alarm data may include the following steps A21-A22:
[0066] Step A21, for each of at least one day before the current time, based on the historical alarm time and historical alarm level of the day, the number of historical alarms and the historical comprehensive alarm level of each alarm time period in the day are statistically obtained.
[0067] A day is divided into multiple alarm time periods according to preset rules.
[0068] The specific content of the preset rules can be set according to actual needs, and this embodiment does not limit this. For example, if you need to adjust the detection frame rate of the camera device in units of 1 hour, you can set the day to be divided into 24 alarm time periods in units of 1 hour, that is, each alarm time period corresponds to 1 hour. Specifically, it can be divided according to the hour, 0 o'clock to 1 o'clock is an alarm time period (the alarm time period is called 0 o'clock), 1 o'clock to 2 o'clock is an alarm time period (the alarm time period is called 1 o'clock), 2 o'clock to 3 o'clock is an alarm time period (the alarm time period is called 2 o'clock), and so on.
[0069] For each of at least one day before the current time, the historical alarm time and historical alarm level of the current day are counted according to the set alarm time period to obtain the number of historical alarms and the historical comprehensive alarm level of each alarm time period of the current day. It can be understood that in this embodiment, the number of alarms in the historical alarm data is referred to as the historical alarm number, and the comprehensive alarm level in the historical alarm data is referred to as the historical comprehensive alarm level.
[0070] Exemplarily, the alarm time period to which the alarm belongs can be determined based on the historical alarm time. The number of historical alarms for any alarm time period can be the total number of alarms that occurred in the alarm time period. The historical comprehensive alarm level for any alarm time period can be the average alarm level of the alarms that occurred in the alarm time period.
[0071] Step A22, taking the number of historical alarms and the historical comprehensive alarm levels of each alarm time period of each day of the camera device in at least one day before the current time as the target historical alarm data.
[0072] In the embodiment of the present application, since the decision model needs to be used for data analysis, after obtaining the target historical alarm data of the camera device, the target historical alarm data needs to be converted into a vector format that can be processed by the decision model. It should be noted that the information in the target historical alarm data is arranged in chronological order.
[0073] Reference Figure 3 , shows a schematic diagram of the structure of a vector parameter in an embodiment of the present application. Figure 3 As shown, the vector parameters include the alarm time period, alarm times and comprehensive alarm level.
[0074] Reference Figure 4 , showing a schematic diagram of a vector in an embodiment of the present application. Figure 4 For example, the total number of days before at least one day is 7, the total number of alarm time periods in one day is 24, and the starting time is 0 o'clock. Figure 4 As shown, the vector includes [0 o'clock 7 days ago, number of alarms, average alarm level], [0 o'clock 6 days ago, number of alarms, average alarm level], ..., [0 o'clock 1 day ago, number of alarms, average alarm level], [1 o'clock 7 days ago, number of alarms, average alarm level], [1 o'clock 6 days ago, number of alarms, average alarm level], ..., [1 o'clock 1 day ago, number of alarms, average alarm level], ..., [23 o'clock 7 days ago, number of alarms, average alarm level], [23 o'clock 6 days ago, number of alarms, average alarm level], ..., [23 o'clock 1 day ago, number of alarms, average alarm level]. Among them, the average alarm level is equivalent to the comprehensive alarm level in this embodiment. Figure 4 The vector dimensions shown are 24×7×3.
[0075] Therefore, according to Figure 3 and Figure 4In the format shown, the historical alarm count and historical comprehensive alarm level of each alarm time period of the camera device in at least one day before the current time are converted to obtain an input vector. The dimension of the input vector is the total number of alarm time periods in a day × the total number of days in at least one day before the current time × 3, where 3 corresponds to the alarm time period, the historical alarm count and the historical comprehensive alarm level. For example, if the total number of days in at least one day before the current time is 7 and the total number of alarm time periods in a day is 24, the dimension of the input vector is 24×7×3.
[0076] Step 202: input the target historical alarm data into a pre-trained decision model to obtain future alarm data of the camera device output by the decision model.
[0077] A decision model is pre-trained, and the decision model can analyze the input target historical alarm data of the camera device (that is, the above-mentioned input vector) to obtain the future alarm data of the camera device.
[0078] Exemplarily, the future alarm data of the camera device may include: the number of future alarms and the future comprehensive alarm level in each alarm time period of the camera device in each day in at least one day after the current time. It can be understood that in this embodiment, the number of alarms in the future alarm data is referred to as the future alarm number, and the comprehensive alarm level in the future alarm data is referred to as the future comprehensive alarm level.
[0079] In the embodiment of the present application, the at least one day after the current time can be set as a few days after the current time according to the actual situation, and the present embodiment does not limit this. For example, if the historical alarm data of the 7 days before the current time is set to predict the future alarm data of the day after the current time, the future alarm data of the camera device is: the number of future alarms and the future comprehensive alarm level of each alarm time period of the camera device in the day after the current time.
[0080] For example, the current time may be the current time point, and the day after the current time is: from the current time point to the last time point of the at least one day after the current time. For example, if the current time is 8:00 on Monday this week, the day after the current time is 8:00 on Monday last week to 8:00 on Tuesday this week.
[0081] Similar to the target historical alarm data of the camera device input into the decision model, the future alarm data of the camera device output by the decision model is also in a vector format that can be processed by the decision model, that is, the output vector of the decision model. The dimension of the output vector is the total number of alarm time periods of a day × the total number of days after at least one day × 3. For example, the total number of days after at least one day is 1, and the total number of alarm time periods of a day is 24, then the dimension of the output vector is 24 × 3. For the specific format of the output vector, please refer to the above description of the input vector, and this embodiment will not be discussed in detail here.
[0082] Next, the training process of the decision model is introduced.
[0083] In an optional implementation, the training process of the decision model includes the following steps B1-B3:
[0084] Step B1, obtaining sample target historical alarm data and sample actual future alarm data of a sample camera device.
[0085] The sample camera device may be any camera device used in history. By analyzing a large amount of historical alarm data of the sample camera device, sample target historical alarm data and sample actual future alarm data may be obtained.
[0086] The sample target historical alarm data includes: the number of alarms and the comprehensive alarm level in each alarm time period of the sample camera device every day in at least one day before a certain sample time. The structure of the sample target historical alarm data is similar to the structure of the above-mentioned target historical alarm data. The dimension of the vector corresponding to the sample target historical alarm data is the number of training samples (specifically the total number of samples in a batch) × the total number of alarm time periods × the total number of days in at least one day before a certain sample time × 3.
[0087] The sample actual future alarm data includes: the actual number of alarms and the actual comprehensive alarm level of each alarm time period of the sample camera device in each day in at least one day after the sample time. The sample actual future alarm data has a similar structure to the above-mentioned future alarm data. The dimension of the vector corresponding to the sample actual future alarm data is the number of training samples (specifically the total number of samples in a batch) × the total number of alarm time periods × the total number of days in at least one day after the sample time × 3.
[0088] Step B2: inputting the sample target historical alarm data into the model to be trained, and obtaining the sample predicted future alarm data of the sample camera device output by the model to be trained.
[0089] In the embodiment of the present application, the model to be trained can be any applicable deep neural network model. For example, a CNN (Convolutional Neural Network) model, etc. The sample set is randomly divided into a training set, a validation set, and a test set, a deep neural network model is constructed, and the learning rate, loss function, batch_size (batch size), epoch (1 epoch is equal to using all the samples in the training set for training once, that is, the value of epoch is the number of times the entire data set is polled) and other parameters are set for training.
[0090] The sample predicted future alarm data includes: the predicted alarm times and predicted comprehensive alarm levels for each alarm time period of the sample camera device in each day in at least one day after the sample time. The sample predicted future alarm data has a similar structure to the above-mentioned future alarm data. The dimension of the vector corresponding to the sample predicted future alarm data is the number of training samples (specifically the total number of samples in a batch) × the total number of alarm time periods × the total number of days in at least one day after the sample time × 3.
[0091] Step B3, after determining that the training is completed based on the sample actual future alarm data and the sample predicted future alarm data, the decision model is obtained.
[0092] A loss function may be calculated based on the sample actual future warning data and the sample predicted future warning data, and when the loss function converges, it may be determined that the training is completed.
[0093] Exemplarily, the loss function may include but is not limited to: a cross entropy loss function, an absolute value loss function, a square loss function, and the like.
[0094] For example, taking 8 consecutive days as a group, one day is divided into 24 alarm time periods, and the data of the first 7 days are used to predict the data of the 8th day. Therefore, the data of the first 7 days are used as the sample target historical alarm data, that is, the input of the decision model, specifically a vector of n×24×7×3 dimensions, which represents the number of alarms and the comprehensive alarm level of each of the 24 alarm time periods in the first 7 days. The data of the 8th day is used as the sample actual future alarm data, that is, the annotation information, specifically a vector of n×24×3 dimensions, which represents the actual number of alarms and the actual comprehensive alarm level of each of the 24 alarm time periods in the 8th day. The output of the decision model is a vector of n×24×3 dimensions, which represents the predicted number of alarms and the predicted comprehensive alarm level of each of the 24 alarm time periods in the 8th day.
[0095] Step 203: Calculate the future detection frame rate of the camera device based on the future alarm data, and adjust the frame rate of the camera device according to the future detection frame rate.
[0096] The method for calculating the future detection frame rate of the camera device based on the future alarm data may adopt a preset correspondence table between future alarm data and future detection frame rates, and realize the calculation by querying the correspondence table; or adopt a preset correspondence formula between future alarm data and future detection frame rates, and realize the calculation by calculating the correspondence formula; or adopt a preset model for predicting the future detection frame rate through future alarm data, and realize the calculation through prediction by the model.
[0097] The future alarm data of the camera device indicates the severity of the risk event. For example, the more alarm times and the higher the comprehensive alarm level, the more serious the risk event. The future detection frame rate of the camera device indicates the number of frames processed per unit time when the camera device performs AI detection on the captured images, which is related to the detection speed of risk events. Therefore, the future alarm data of the camera device is related to the future detection frame rate of the camera device. The more serious the risk event, the higher the detection speed of the risk event should be. Therefore, the future detection frame rate of the camera device can be calculated based on the future alarm data of the camera device.
[0098] In an optional embodiment, the process of calculating the future detection frame rate of the camera device based on the future alarm data may include: for each alarm time period in each of at least one day after the current time, based on the future number of alarms in the alarm time period and the future comprehensive alarm level, calculating the future detection frame rate of the alarm time period.
[0099] Exemplarily, the process of calculating the future detection frame rate of the alarm time period based on the future number of alarms in the alarm time period and the future comprehensive alarm level may include: calculating the future detection frame rate of the alarm time period based on the future number of alarms in the alarm time period and the future comprehensive alarm level according to the rule that the future detection frame rate is positively correlated with both the future number of alarms and the future comprehensive alarm level.
[0100] Exemplarily, the future detection frame rate of any alarm time period = α×future alarm times+β×future comprehensive alarm level. α and β may be a relationship obtained by combining the detection frame rate value range of the camera device with the boundary effect analysis, which is not limited in this embodiment.
[0101] The more alarms there are in the future and the higher the comprehensive alarm level is in the future (that is, the peak alarm period), the higher the detection frame rate will be, which can improve the risk detection rate; the fewer alarms there are in the future and the lower the comprehensive alarm level is in the future (that is, the trough alarm period), the lower the detection frame rate will be, which can release the computing resources of the camera equipment, reduce performance usage, and reduce power consumption.
[0102] After calculating the future detection frame rate of the camera device (the future detection frame rate of each alarm time period in each day of at least one day after the current time of the specific location), the configuration decision platform will adjust the frame rate of the camera device according to the future detection frame rate. Specifically, the configuration decision platform returns the future detection frame rate of the camera device to the camera device platform, and the camera device platform returns the future detection frame rate of the camera device to the camera device, and the camera device performs AI detection according to the received future detection frame rate.
[0103] In an optional implementation, when there are multiple camera devices, an adjustment time period can be configured in advance for each camera device. The frame rate of each camera device is adjusted according to the adjustment time period configured for each camera device. Therefore, the configuration decision platform can obtain the target historical alarm data of the camera device according to the adjustment time period configured for the camera device. In this way, the frame rate adjustment process of each camera device can be separated, thereby avoiding task accumulation in the configuration decision platform.
[0104] Among them, obtaining the target historical alarm data of the camera device according to the adjustment time period configured for the camera device means that, for a certain camera device, when the time reaches the adjustment time period configured for the camera device, the target historical alarm data of the camera device is obtained.
[0105] In an embodiment of the present application, a decision model can be used to predict future alarm data based on the historical alarm data of the camera device. Taking into account the correlation between the detection frame rate of the camera device and the alarm data, the future detection frame rate can be calculated based on the future alarm data. Therefore, the detection frame rate can be dynamically adjusted according to changes in the alarm data, so that the detection frame rate can be more adapted to changes in the scene, avoiding ineffective occupation of the performance of the camera device and increased power consumption, improving the accuracy of the detection frame rate, and saving resources.
[0106] Reference Figure 5 , shows a structural block diagram of a frame rate adjustment device in an embodiment of the present application.
[0107] like Figure 5 As shown, the frame rate adjustment device may include the following modules:
[0108] An acquisition module 501 is used to acquire target historical alarm data of a camera device;
[0109] A prediction module 502, configured to input the target historical alarm data into a pre-trained decision model to obtain future alarm data of the camera device output by the decision model;
[0110] The calculation module 503 is used to calculate the future detection frame rate of the camera device based on the future alarm data, and adjust the frame rate of the camera device according to the future detection frame rate.
[0111] Optionally, the future detection frame rate represents the number of frames processed per unit time when the camera device performs artificial intelligence detection on the captured images.
[0112] Optionally, there are multiple camera devices, each of which is configured with an adjustment time period; the acquisition module 501 is specifically used to acquire the target historical alarm data of the camera device according to the adjustment time period configured for the camera device.
[0113] Optionally, the acquisition module 501 includes: a candidate acquisition unit, configured to acquire candidate historical alarm data of the camera device; and a data statistics unit, configured to perform statistics on the candidate historical alarm data to obtain the target historical alarm data.
[0114] Optionally, the candidate historical alarm data obtains candidate historical alarm data of the camera device, including: obtaining the historical alarm time and the historical alarm level of the camera device for each day in at least one day before the current time as the candidate historical alarm data; the data statistics unit is specifically used to, for each day in at least one day before the current time, based on the historical alarm time and the historical alarm level of the day, obtain the number of historical alarms and the historical comprehensive alarm level for each alarm time period on the day, wherein the alarm time period is obtained by dividing one day according to a preset rule; and taking the number of historical alarms and the historical comprehensive alarm level for each alarm time period on each day of the camera device in at least one day before the current time as the target historical alarm data.
[0115] Optionally, the future alarm data of the camera device includes: the future alarm number and future comprehensive alarm level of each alarm time period of the camera device in each day in at least one day after the current time, and the alarm time period is obtained by dividing one day according to a preset rule; the calculation module 503 includes: a frame rate calculation unit, which is used to calculate the future detection frame rate of each alarm time period in each day in at least one day after the current time based on the future alarm number and future comprehensive alarm level of the alarm time period.
[0116] Optionally, the frame rate calculation unit is specifically used to calculate the future detection frame rate of the alarm time period based on the future alarm number and the future comprehensive alarm level of the alarm time period according to the rule that the future detection frame rate is positively correlated with the future alarm number and the future comprehensive alarm level.
[0117] Optionally, the decision model is trained through the following modules: a sample acquisition module, used to acquire sample target historical alarm data and sample actual future alarm data of a sample camera device; a sample prediction module, used to input the sample target historical alarm data into the model to be trained, and obtain the sample predicted future alarm data of the sample camera device output by the model to be trained; a determination module, used to obtain the decision model after determining that the training is completed based on the sample actual future alarm data and the sample predicted future alarm data.
[0118] In an embodiment of the present application, a decision model can be used to predict future alarm data based on the historical alarm data of the camera device. Taking into account the correlation between the detection frame rate of the camera device and the alarm data, the future detection frame rate can be calculated based on the future alarm data. Therefore, the detection frame rate can be dynamically adjusted according to changes in the alarm data, so that the detection frame rate can be more adapted to changes in the scene, avoiding ineffective occupation of the performance of the camera device and increased power consumption, improving the accuracy of the detection frame rate, and saving resources.
[0119] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0120] In an embodiment of the present application, an electronic device is also provided. The electronic device may include one or more processors, and one or more computer-readable storage media storing instructions thereon, the instructions being, for example, application programs. When the instructions are executed by the one or more processors, the processors execute the frame rate adjustment method of any of the above embodiments.
[0121] Reference Figure 6 , shows a schematic diagram of an electronic device structure according to an embodiment of the present application. Figure 6 As shown, the electronic device includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604. The processor 601, the communication interface 602 and the memory 603 communicate with each other through the communication bus 604.
[0122] The memory 603 is used to store computer programs.
[0123] The processor 601 is used to implement the frame rate adjustment method of any of the above embodiments when executing the program stored in the memory 603.
[0124] The communication interface 602 is used for communication between the electronic device and other devices.
[0125] The communication bus 604 mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0126] The processor 601 mentioned above may include but is not limited to: a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0127] The memory 603 mentioned above may include but is not limited to: Read Only Memory (ROM), Random Access Memory (RAM), Compact Disc Read Only Memory (CD-ROM), Electronic Erasable Programmable Read Only Memory (EEPROM), hard disk, floppy disk, flash memory, etc.
[0128] In an embodiment of the present application, a computer-readable storage medium is further provided, on which a computer program is stored. The program can be executed by a processor of an electronic device. When the computer program is executed by the processor, the processor executes the frame rate adjustment method described in any of the above embodiments.
[0129] The various embodiments in this specification are interrelated, and each embodiment is described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referenced to each other.
[0130] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0131] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0132] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0133] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0134] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0135] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0136] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0137] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0138] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0139] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. In summary, the content of this specification should not be understood as limiting the present application.
Claims
1. A frame rate adjustment method, characterized in that: The method comprises: Obtaining target historical alarm data of the camera device; the target historical alarm data includes: the number of historical alarms and the historical comprehensive alarm level of each alarm time period of the camera device in each day at least one day before the current time; Input the target historical alarm data into a pre-trained decision model to obtain future alarm data of the camera device output by the decision model; the future alarm data of the camera device includes: the number of future alarms and the future comprehensive alarm level of each alarm time period of the camera device in each day in at least one day after the current time, and the alarm time period is obtained by dividing a day according to a preset rule; Calculating a future detection frame rate of the camera device based on the future alarm data, and adjusting the frame rate of the camera device according to the future detection frame rate; The future detection frame rate represents the number of frames processed per unit time when the camera device performs artificial intelligence detection on the collected images; The decision model is trained in the following way: Obtaining sample target historical alarm data and sample actual future alarm data of a sample camera device; Inputting the sample target historical alarm data into the model to be trained, and obtaining the sample predicted future alarm data of the sample camera device output by the model to be trained; After the training is completed based on the sample actual future alarm data and the sample predicted future alarm data, the decision model is obtained.
2. The method according to claim 1, characterized in that There are multiple camera devices, each of which is configured with an adjustment time period; obtaining target historical alarm data of the camera device, including: According to the adjustment time period configured for the camera device, target historical alarm data of the camera device is obtained.
3. The method according to claim 1, characterized in that Obtain the target historical alarm data of the camera device, including: Acquire candidate historical alarm data of the camera device; The candidate historical alarm data are counted to obtain the target historical alarm data.
4. The method according to claim 3, characterized in that The candidate historical alarm data includes: the historical alarm time and historical alarm level of the camera device every day in at least one day before the current time; the candidate historical alarm data is counted to obtain the target historical alarm data, including: For each of at least one day before the current time, based on the historical alarm time and historical alarm level of the current day, the number of historical alarms and the historical comprehensive alarm level of each alarm time period of the current day are obtained by dividing the day according to a preset rule; The historical alarm times and historical comprehensive alarm levels of the camera device in each alarm time period of each day in at least one day before the current time are used as the target historical alarm data.
5. The method according to claim 1, characterized in that Calculating the future detection frame rate of the camera device based on the future warning data includes: For each alarm time period in each of at least one day after the current time, based on the future alarm times and the future comprehensive alarm level of the alarm time period, calculate the future detection frame rate of the alarm time period.
6. The method according to claim 5, characterized in that Calculating a future detection frame rate of the alarm time period based on the future alarm number and the future comprehensive alarm level of the alarm time period includes: According to the rule that the future detection frame rate is positively correlated with the future alarm times and the future comprehensive alarm level, the future detection frame rate of the alarm time period is calculated based on the future alarm times and the future comprehensive alarm level of the alarm time period.
7. A frame rate adjustment device, characterized in that: The device comprises: An acquisition module is used to acquire the target historical alarm data of the camera device; the target historical alarm data includes: the number of historical alarms and the historical comprehensive alarm level of each alarm time period of the camera device in each day at least one day before the current time; A prediction module, used for inputting the target historical alarm data into a pre-trained decision model to obtain future alarm data of the camera device output by the decision model; the future alarm data of the camera device includes: the number of future alarms and the future comprehensive alarm level of each alarm time period of the camera device in each day in at least one day after the current time, and the alarm time period is obtained by dividing a day according to a preset rule; a calculation module, configured to calculate a future detection frame rate of the camera device based on the future alarm data, and adjust the frame rate of the camera device according to the future detection frame rate; The future detection frame rate represents the number of frames processed per unit time when the camera device performs artificial intelligence detection on the collected images; The decision model is trained through the following modules: A sample acquisition module, used to acquire sample target historical alarm data and sample actual future alarm data of a sample camera device; A sample prediction module, used for inputting the sample target historical alarm data into the model to be trained, and obtaining the sample predicted future alarm data of the sample camera device output by the model to be trained; The determination module is used to obtain the decision model after determining that the training is completed based on the sample actual future alarm data and the sample predicted future alarm data.
8. An electronic device, characterized in that: include: one or more processors; and one or more computer-readable storage media having instructions stored thereon; When the instruction is executed by the one or more processors, the processors are enabled to perform the frame rate adjustment method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the processor executes the frame rate adjustment method as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Image information prediction method and device, computer equipment and storage medium
CN111950419A
Method and system for intelligent prediction and alarm of cloud computing platform
CN114095338A
KR20220050103A