Camera data reading method and device, electronic equipment and storage medium
By acquiring and analyzing the load status information of the target system, dynamically adjusting the read frame rate of camera data, solving the system overload problem caused by camera data processing in the kitchen cooking system, and improving the stability and processing efficiency of the system.
Patent Information
- Application Number
- CN202510033822.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-16
AI Technical Summary
When the cameras in the kitchen cooking system process high frame rate video, due to hardware performance limitations, the system may overload, instability or even crash.
By obtaining the central processor and memory occupancy information of the target system, as well as the temperature value of the central processor, the load status information of the system is determined, and the read frame rate of the camera data is dynamically adjusted according to the load status to match the system's processing capabilities.
It effectively avoids the instability and collapse caused by overload operation of the system, and improves the processing efficiency and stability of the system.
Smart Images

Figure CN120017979A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a camera data reading method, device, electronic equipment and storage medium. Background Art
[0002] Cameras in kitchen cooking systems usually use a fixed frame rate mode to record video. No matter how the processing power of the device fluctuates, the camera data is processed in the same way. Such systems are mainly used to monitor the cooking process, identify cooking ingredients, or interact with users. However, during use, due to the limited hardware performance of the system, especially when multitasking or under high load, the system's processing performance will decrease. In this case, if the high frame rate camera footage continues to be processed, the system may become unstable due to overload or even crash. Summary of the invention
[0003] In order to solve at least one of the technical problems mentioned above, the present disclosure proposes a camera data reading method, device, electronic device and storage medium.
[0004] In one aspect, the present invention provides a method for reading camera data, comprising:
[0005] Obtain first occupancy information, target temperature information, and second occupancy information corresponding to a target system, where the target system is a system that reads data from a target camera, the first occupancy information represents an occupancy corresponding to a central processing unit of the target system, the target temperature information is a temperature value corresponding to the central processing unit, and the second occupancy information represents an occupancy corresponding to a memory of the target system;
[0006] Determining load state information corresponding to the target system based on the first occupancy rate information, the target temperature information, and the second occupancy rate information;
[0007] Determine a target frame rate corresponding to the load status information, where the target frame rate represents a camera data reading frame rate that matches the load status information;
[0008] Based on the target frame rate, read the data from the target camera.
[0009] In an optional embodiment, determining load state information corresponding to the target system based on the first occupancy rate information, the target temperature information, and the second occupancy rate information includes:
[0010] Determine a first occupancy rate threshold, a target temperature threshold, and a second occupancy rate threshold, wherein the first occupancy rate threshold represents an occupancy rate threshold corresponding to the central processing unit when a preset working requirement is met, the target temperature threshold represents an operating temperature threshold corresponding to the central processing unit, and the second occupancy rate threshold represents an occupancy rate threshold corresponding to the memory of the target system when the preset working requirement is met;
[0011] Determine first load information based on the first occupancy threshold and the first occupancy information, where the first load information represents a load state corresponding to the central processing unit;
[0012] Determine second load information based on the second occupancy threshold and the second occupancy information, where the first load information represents a load state corresponding to the memory of the target system;
[0013] Determine third load information based on the target temperature threshold and the target temperature information, where the third load information represents a temperature load state corresponding to the target system;
[0014] Load state information is determined based on the first load information, the second load information, and the third load information.
[0015] In an optional embodiment, the first occupancy threshold includes a maximum processor occupancy and a minimum processor occupancy, and determining the first load information based on the first occupancy threshold and the first occupancy information includes:
[0016] determining a difference between the first occupancy information and the minimum processor occupancy as a first target difference;
[0017] determining a difference between the maximum processor occupancy rate and the minimum processor occupancy rate as a second target difference value;
[0018] determining a ratio between the first target difference and the second target difference as an initial processor parameter;
[0019] Determine the minimum value between the initial processor parameter and the first upper limit value as the target processor parameter, the first upper limit value representing the upper limit corresponding to the initial processor parameter;
[0020] The maximum value between the target processor parameter and the first lower limit value is determined as the first load information, the first lower limit value represents the lower limit corresponding to the target processor parameter, and the first lower limit value is less than the first upper limit value.
[0021] In an optional embodiment, the second occupancy threshold includes a maximum memory occupancy and a minimum memory occupancy, and determining the second load information based on the second occupancy threshold and the second occupancy information includes:
[0022] Determine a difference between the second occupancy information and the minimum memory occupancy as a third target difference;
[0023] Determine a difference between the maximum memory occupancy rate and the minimum memory occupancy rate as a fourth target difference value;
[0024] determining a ratio between the third target difference value and the fourth target difference value as an initial memory parameter;
[0025] Determine the minimum value between the initial memory parameter and the second upper limit value as the target memory parameter, the second upper limit value representing the upper limit corresponding to the initial memory parameter;
[0026] The maximum value between the target memory parameter and the second lower limit value is determined as the second load information, the second lower limit value represents the lower limit corresponding to the target memory parameter, and the second lower limit value is less than the second upper limit value.
[0027] In an optional embodiment, the target temperature threshold includes a maximum operating temperature value and a minimum operating temperature value corresponding to the central processing unit, and based on the target temperature threshold and the target temperature information, determining the third load information includes:
[0028] determining a difference between the target temperature information and the minimum operating temperature value as a fifth target difference;
[0029] determining a difference between the maximum operating temperature value and the minimum operating temperature value as a sixth target difference;
[0030] determining a ratio between the fifth target difference and the sixth target difference as an initial temperature parameter;
[0031] Determine the minimum value between the initial temperature parameter and the third upper limit value as the target temperature parameter, the third upper limit value representing the upper limit corresponding to the initial temperature parameter;
[0032] The maximum value between the target temperature parameter and the third lower limit value is determined as the third load information, the third lower limit value represents the lower limit corresponding to the target temperature parameter, and the third lower limit value is less than the third upper limit value.
[0033] In an optional embodiment, determining a target frame rate corresponding to the load status information includes:
[0034] determining a difference between a preset load factor and the load status information as a target factor;
[0035] The target frame rate is obtained by adding the product of the target coefficient and the first preset frame rate to the second preset frame rate.
[0036] In an optional embodiment, based on the target frame rate, reading the data of the target camera includes:
[0037] Based on the target frame rate, determining interval time information, the interval time information represents the time interval between two adjacent picture frame reading operations;
[0038] Based on the interval time information, the data of the target camera is read.
[0039] In a second aspect, the present invention further provides a camera data reading device, comprising:
[0040] an acquisition module, used to acquire first occupancy information, target temperature information and second occupancy information corresponding to a target system, wherein the target system is a system that reads data from a target camera, the first occupancy information represents an occupancy corresponding to a central processing unit of the target system, the target temperature information is a temperature value corresponding to the central processing unit, and the second occupancy information represents an occupancy corresponding to a memory of the target system;
[0041] A load status module, configured to determine load status information corresponding to a target system based on the first occupancy rate information, the target temperature information, and the second occupancy rate information;
[0042] A target frame rate determination module is used to determine a target frame rate corresponding to the load status information, where the target frame rate represents a camera data reading frame rate that matches the load status information;
[0043] The reading module is used to read the data of the target camera based on the target frame rate.
[0044] In a third aspect, the present invention further provides an electronic device, comprising:
[0045] processor;
[0046] a memory for storing processor-executable instructions;
[0047] The processor is used to execute instructions to implement the above-mentioned camera data reading method.
[0048] In a fourth aspect, the present invention further provides a storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the above-mentioned camera data reading method.
[0049] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
[0050] The implementation of this disclosure has the following beneficial effects:
[0051] Obtain first occupancy information, target temperature information and second occupancy information corresponding to the target system, where the target system is a system for reading data from a target camera, the first occupancy information represents the occupancy corresponding to a central processing unit of the target system, the target temperature information is a temperature value corresponding to the central processing unit, and the second occupancy information represents the occupancy corresponding to a memory of the target system; determine load status information corresponding to the target system based on the first occupancy information, the target temperature information and the second occupancy information; determine a target frame rate corresponding to the load status information, the target frame rate represents a camera data reading frame rate that matches the load status information; and read data from the target camera based on the target frame rate.
[0052] The present disclosure obtains the occupancy rates of the central processing unit and the memory in the system that reads the data of the target camera, as well as the temperature value corresponding to the central processing unit, and can determine the load state of the target system in a more comprehensive and complete manner based on the above occupancy rate and temperature data. By determining the camera data reading frame rate that matches the load state information and reading the data of the target camera based on the frame rate, the target system's camera data reading operation can be matched with the current load state of the target system, and the system's camera data reading frame rate can be adjusted in time with changes in the system's load, thereby avoiding overload operation and improving the system's processing efficiency and stability.
[0053] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0055] Figure 1 is a schematic diagram of an implementation environment according to an exemplary embodiment;
[0056] Figure 2 is a flow chart of a camera data reading method according to an exemplary embodiment;
[0057] Figure 3 is a flow chart showing a method of determining load status information corresponding to a target system according to an exemplary embodiment;
[0058] Figure 4 is a flow chart showing a method of determining first load information according to an exemplary embodiment;
[0059] Figure 5 is a flow chart showing a method of determining second load information according to an exemplary embodiment;
[0060] Figure 6 is a flow chart showing a method of determining third load information according to an exemplary embodiment;
[0061] Figure 7 is a schematic diagram of a camera data reading device according to an exemplary embodiment;
[0062] Figure 8 The figure is a block diagram of an electronic device for reading camera data according to an exemplary embodiment. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0065] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated. The word "exemplary" is used specifically herein to mean "serving as an example, embodiment, or illustrative". Any embodiment described herein as "exemplary" is not necessarily to be construed as being superior or better than other embodiments.
[0066] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0067] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0068] See also Figure 1 , Figure 1 is a schematic diagram of an application environment according to an exemplary embodiment. Figure 1 As shown, the application environment may include a server 01 and a terminal 02 .
[0069] In an optional embodiment, the server 01 can be used for the camera data reading method to perform calculation processing. Specifically, the server 01 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0070] In an optional embodiment, the terminal 02 may perform calculation processing in combination with the camera data reading method of the server 01. Specifically, the terminal 02 may include but is not limited to smart phones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices and other types of electronic devices. Optionally, the operating system running on the electronic device may include but is not limited to Android system, IOS system, Linux system, Windows system, Unix system and the like.
[0071] For example, the first occupancy information, target temperature information and second occupancy information corresponding to the target system are obtained through terminal 02 and transmitted to server 01, the target system is a system for reading data of a target camera, the first occupancy information represents the occupancy corresponding to the central processing unit of the target system, the target temperature information is the temperature value corresponding to the central processing unit, and the second occupancy information represents the occupancy corresponding to the memory of the target system; based on the first occupancy information, the target temperature information and the second occupancy information, the load status information corresponding to the target system is determined through server 01; the target frame rate corresponding to the load status information is determined, the target frame rate represents the camera data reading frame rate matching the load status information; based on the target frame rate, the data of the target camera is read, and the reading result is transmitted to terminal 02.
[0072] In addition, it should be noted that Figure 1 What is shown is only one application environment provided by the present disclosure. In actual application, other application environments may also be included.
[0073] In the embodiments of this specification, the server 01 and the terminal 02 may be directly or indirectly connected via wired or wireless communication, which is not limited in this disclosure.
[0074] Figure 2 is a flow chart of a camera data reading method according to an exemplary embodiment. Figure 2 As shown, the camera data reading method includes the following:
[0075] Step S201: Obtain first occupancy information, target temperature information and second occupancy information corresponding to the target system, where the target system is a system that reads data from a target camera. The first occupancy information represents the occupancy corresponding to the central processing unit of the target system, the target temperature information is the temperature value corresponding to the central processing unit, and the second occupancy information represents the occupancy corresponding to the memory of the target system.
[0076] In the disclosed embodiment, the target system may be a smart screen system equipped with a camera, which is applied in a kitchen cooking scenario and can realize intelligent cooking tasks by interacting with the user. The camera configured in the system is a target camera, which is used to obtain images during the cooking process, including: user gesture instructions, images of ingredients in cooking utensils, and images of cooking results. The target system may display the images obtained by the target camera, or perform analysis and processing to obtain user needs, information on the maturity of ingredients, and other contents.
[0077] In the disclosed embodiment, the first occupancy information corresponding to the target system can be obtained by reading a first preset file in the target system. The first preset file is used to record the total running time of the central processing unit (CPU) of the target system and the running time of each state. The running time of each state can be the running time of states such as user state, system state, and idle state.
[0078] In one example, when the operating system running in the target system is an Android system, the first preset file includes a "stat" file in the Android system, and the "stat" file can be saved in the "proc" virtual file system. The first preset file in the target system can be obtained by accessing the "proc" virtual file system and reading the "stat" file therein. After reading the above file, the various state times of the CPU are parsed, and then the CPU occupancy rate, i.e., the first occupancy rate information, is obtained by calculating the changes in these times.
[0079] In the embodiment of the present disclosure, the second occupancy information corresponding to the target system can be obtained by using an activity manager (ActivityManager) to obtain the total memory and the current available memory of the target system, and the second occupancy information is calculated according to the total memory and the current available memory.
[0080] In the disclosed embodiment, the target temperature information corresponding to the target system can be obtained by reading a second preset file in the target system, where the second preset file is used to record the hardware temperature data of a specific area in the target system, such as the temperature data of the CPU.
[0081] In one example, when the operating system running in the target system is an Android system built on the Linux kernel, the second preset file may be a "temp" file that records temperature data in the Linux kernel, which can record the temperature data of the CPU. The second preset file may be read by accessing the virtual file system where the "temp" file is located. For example, the "temp" file is stored in the "thermal_zone9" virtual file system, and the "thermal_zone9" virtual file system is stored in the upper virtual file system. The "sys" virtual file system, the "class" virtual file system, the "thermal" virtual file system, and the "thermal_zone9" virtual file system are accessed in sequence, and finally the "temp" file is read and parsed to obtain the temperature information of the CPU. The read value is usually in thousandths of a degree Celsius, so it needs to be converted to degrees Celsius. For example, if the read value is 12345, the actual temperature is 12.345 degrees Celsius.
[0082] Step S202: Determine load state information corresponding to the target system based on the first occupancy rate information, the target temperature information and the second occupancy rate information.
[0083] Figure 3 is a flowchart showing a method of determining load status information corresponding to a target system according to an exemplary embodiment. In an optional embodiment, as shown in FIG. Figure 3 As shown, based on the first occupancy rate information, the target temperature information and the second occupancy rate information, the load state information corresponding to the target system is determined, including:
[0084] Step S301: Determine a first occupancy threshold, a target temperature threshold and a second occupancy threshold, wherein the first occupancy threshold represents the occupancy threshold corresponding to the central processing unit when the preset working requirements are met, the target temperature threshold represents the working temperature threshold corresponding to the central processing unit, and the second occupancy threshold represents the occupancy threshold corresponding to the memory of the target system when the preset working requirements are met.
[0085] In the embodiment of the present disclosure, the preset working requirement may be that no abnormal conditions occur during the operation of the target system, such as no abnormal conditions such as lack of necessary files, freezes, delays, system crashes, etc. When the target system is working stably, the CPU corresponds to an occupancy rate and a processor temperature when working stably, and the occupancy rate and the processor temperature of the CPU when working stably are respectively determined as the first occupancy rate threshold and the target temperature threshold, and the memory corresponds to an occupancy rate when working stably, and the occupancy rate is determined as the second occupancy rate threshold.
[0086] Step S302: Determine first load information based on a first occupancy threshold and first occupancy information, where the first load information represents a load state corresponding to the central processing unit.
[0087] In an optional embodiment, the first occupancy threshold includes a maximum processor occupancy and a minimum processor occupancy. Since the occupancy of the central processing unit when working stably is usually within a certain occupancy range, in an example, the occupancy of the central processing unit is between 30% and 70% to meet the preset work requirements. Therefore, the maximum processor occupancy can be 70% and the minimum processor occupancy can be 30%. Figure 4 is a flow chart showing a method of determining first load information according to an exemplary embodiment. Figure 4 As shown, the first load information is determined based on the first occupancy threshold and the first occupancy information, including:
[0088] Step S3021: Determine the difference between the first occupancy information and the minimum processor occupancy as a first target difference.
[0089] Step S3022: Determine the difference between the maximum processor occupancy and the minimum processor occupancy as the second target difference.
[0090] Step S3023: Determine the ratio between the first target difference and the second target difference as the initial processor parameter.
[0091] In the embodiment of the present disclosure, the calculation process of the above steps S3021 to S3023 can be calculated by the following formula (1):
[0092]
[0093] In formula (1), K c is the initial processor parameter, c is the first occupancy information, the constant 30 is the minimum processor occupancy, and the constant 70 is the maximum processor occupancy.
[0094] Step S3024: Determine the minimum value between the initial processor parameter and the first upper limit value as the target processor parameter, and the first upper limit value represents the upper limit corresponding to the initial processor parameter.
[0095] Step S3025: Determine the maximum value between the target processor parameter and the first lower limit value as the first load information, the first lower limit value represents the lower limit corresponding to the target processor parameter, and the first lower limit value is less than the first upper limit value.
[0096] In the embodiment of the present disclosure, the first lower limit value and the first upper limit value can be set as needed. The calculation process of the above steps S3024 to S3025 can be calculated by the following formula (2):
[0097] u c =max(0,min(1,K c )) (2)
[0098] In formula (2), u c is the first load information, max() indicates the maximum value is taken for calculation, min() indicates the minimum value is taken for calculation, constant 0 is the first lower limit, constant 1 is the first upper limit, K c is the initial processor parameter, min(1,K c ) represents the target processor parameter.
[0099] Based on the above, it can be known that in the embodiment of the present disclosure, by determining the difference between the first occupancy information and the minimum processor occupancy as the first target difference, determining the difference between the maximum processor occupancy and the minimum processor occupancy as the second target difference, and determining the ratio between the first target difference and the second target difference as the initial processor parameter, the initial processor parameter can be obtained by normalization calculation to quantify the occupancy state of the current central processing unit; by determining the minimum value between the initial processor parameter and the first upper limit value as the target processor parameter, and determining the maximum value between the target processor parameter and the first lower limit value as the first load information, the value of the first load information can be limited by the upper and lower limits, thereby improving the accuracy of the load state calculation.
[0100] Step S303: Determine second load information based on the second occupancy threshold and the second occupancy information, where the first load information represents a load state corresponding to the memory of the target system.
[0101] In an optional embodiment, the second occupancy rate threshold includes a maximum memory occupancy rate and a minimum memory occupancy rate. Since the memory occupancy rate of the target system when working stably is usually within a certain occupancy rate range, in an example, the memory occupancy rate is between 60% and 80% to meet the preset working requirements. Therefore, the maximum memory occupancy rate can be 80% and the minimum memory occupancy rate can be 60%. Figure 5is a flow chart showing a method of determining second load information according to an exemplary embodiment. Figure 5 As shown, the second load information is determined based on the second occupancy threshold and the second occupancy information, including:
[0102] Step S3031: determine the difference between the second occupancy information and the minimum memory occupancy as the third target difference.
[0103] Step S3032: Determine the difference between the maximum memory occupancy rate and the minimum memory occupancy rate as the fourth target difference value.
[0104] Step S3033: Determine the ratio between the third target difference and the fourth target difference as the initial memory parameter.
[0105] In the embodiment of the present disclosure, the calculation process of the above steps S3031 to S3033 can be calculated by the following formula (3):
[0106]
[0107] In formula (3), K m is the initial memory parameter, m is the second occupancy information, the constant 60 is the minimum memory occupancy, and the constant 80 is the maximum memory occupancy.
[0108] Step S3034: Determine the minimum value between the initial memory parameter and the second upper limit value as the target memory parameter, and the second upper limit value represents the upper limit corresponding to the initial memory parameter.
[0109] Step S3035: determine the maximum value between the target memory parameter and the second lower limit value as the second load information, the second lower limit value represents the lower limit corresponding to the target memory parameter, and the second lower limit value is less than the second upper limit value.
[0110] In the embodiment of the present disclosure, the second lower limit value and the second upper limit value can be set as needed. The calculation process of the above steps S3034 to S3035 can be calculated by the following formula (4):
[0111] u m =max(0,min(1,K m )) (4)
[0112] In formula (4), u m is the second load information, max() indicates the maximum value is taken for calculation, min() indicates the minimum value is taken for calculation, constant 0 is the second lower limit, constant 1 is the second upper limit, K m is the initial memory parameter, min(1,K m ) represents the target memory parameter.
[0113] Based on the above, it can be known that in the embodiment of the present disclosure, by determining the difference between the second occupancy information and the minimum memory occupancy as the third target difference, determining the difference between the maximum memory occupancy and the minimum memory occupancy as the fourth target difference, and determining the ratio between the third target difference and the fourth target difference as the initial memory parameter, the initial memory parameter can be obtained by normalization calculation to quantify the memory occupancy state of the current target system; by determining the minimum value between the initial memory parameter and the second upper limit value as the target memory parameter, and determining the maximum value between the target memory parameter and the second lower limit value as the second load information, the value of the second load information can be limited by the upper and lower limits, thereby improving the accuracy of the load state calculation.
[0114] Step S304: determining third load information based on the target temperature threshold and the target temperature information, where the third load information represents a temperature load state corresponding to the target system.
[0115] In an optional embodiment, the target temperature threshold includes a maximum operating temperature value and a minimum operating temperature value corresponding to the central processing unit. Since the processor temperature of the central processing unit of the target system is usually within a certain temperature value range when it is working stably, in an example, the processor temperature is between 30° and 70° to meet the preset working requirements. Therefore, the maximum operating temperature value can be 70° and the minimum operating temperature value can be 30°. Figure 6 is a flow chart showing a method of determining third load information according to an exemplary embodiment. Figure 6 As shown, the third load information is determined based on the target temperature threshold and the target temperature information, including:
[0116] Step S3041: determine the difference between the target temperature information and the minimum operating temperature value as the fifth target difference.
[0117] Step S3042: Determine the difference between the maximum operating temperature value and the minimum operating temperature value as the sixth target difference.
[0118] Step S3043: Determine the ratio between the fifth target difference and the sixth target difference as the initial temperature parameter.
[0119] In the embodiment of the present disclosure, the calculation process of the above steps S3041 to S3043 can be calculated by the following formula (5):
[0120]
[0121] In formula (5), K t is the initial temperature parameter, t is the target temperature information, the constant 30 is the minimum operating temperature value, and the constant 70 is the maximum operating temperature value.
[0122] Step S3044: determine the minimum value between the initial temperature parameter and the third upper limit value as the target temperature parameter, and the third upper limit value represents the upper limit corresponding to the initial temperature parameter.
[0123] Step S3045: determine the maximum value between the target temperature parameter and the third lower limit value as the third load information, the third lower limit value represents the lower limit corresponding to the target temperature parameter, and the third lower limit value is less than the third upper limit value.
[0124] In the embodiment of the present disclosure, the first lower limit value and the first upper limit value can be set as needed, and the calculation process of the above steps S3024 to S3025 can be calculated by the following formula (6):
[0125] u t =max(0,min(1,K t )) (6)
[0126] In formula (6), u t is the third load information, max() indicates the maximum value is taken for calculation, min() indicates the minimum value is taken for calculation, constant 0 is the third lower limit value, constant 1 is the third upper limit value, K t is the initial temperature parameter, min(1,K t ) represents the target temperature parameter.
[0127] Based on the above, it can be known that in the embodiment of the present disclosure, by determining the difference between the target temperature information and the minimum operating temperature value as the fifth target difference, determining the difference between the maximum operating temperature value and the minimum operating temperature value as the sixth target difference, and determining the ratio between the fifth target difference and the sixth target difference as the initial temperature parameter, the initial temperature parameter can be obtained by normalization calculation to quantify the processor temperature state of the current target system; by determining the minimum value between the initial temperature parameter and the third upper limit value as the target temperature parameter, and determining the maximum value between the target temperature parameter and the third lower limit value as the third load information, the value of the third load information can be limited by the upper and lower limits, thereby improving the accuracy of the load state calculation.
[0128] Step S305: Determine load status information based on the first load information, the second load information and the third load information.
[0129] In the embodiment of the present disclosure, based on the first load information, the second load information and the third load information, a specific method for determining the load status information may be to add the products obtained by multiplying the first load information, the second load information and the third load information by their respective corresponding impact factors, where the impact factor indicates the impact degree of the corresponding load information on the load status information. The more important the load information is, the greater the corresponding impact factor is. The sum of the impact factors corresponding to the first load information, the second load information and the third load information is 1. The above calculation process is calculated by the following formula (7):
[0130] u=u c *k c +u m *k m +u t *k t (7)
[0131] In formula (7), u is the load status information, u c is the first load information, k c is the impact factor corresponding to the first load information, u m is the second load information, k m is the impact factor corresponding to the second load information, u t is the third load information, k t is the impact factor corresponding to the third load information. In one example, k c It can be 0.5, k m It can be 0.3, k t 0.2 can be taken.
[0132] Based on the above, it can be known that in the embodiment of the present disclosure, by calculating the first occupancy information, the target temperature information, the second occupancy information, and the first occupancy threshold, the target temperature threshold, and the second occupancy threshold, it is possible to obtain load information characterizing the CPU load state, the memory load state, and the system temperature state of the current target system, respectively. By determining the load state information based on the first load information, the second load information, and the third load information, it is possible to comprehensively reflect the load state of the system by combining the CPU load condition, the memory load condition, and the temperature load condition of the system.
[0133] Step S203: determining a target frame rate corresponding to the load status information, where the target frame rate represents a camera data reading frame rate that matches the load status information.
[0134] In an optional embodiment, the target frame rate is not equal to the shooting frame rate of the camera. The target frame rate determination method in this embodiment does not affect the shooting frame rate of the camera, but reads data at the target frame rate in the camera data reading step before the target system performs image recognition on the camera data. The above-mentioned determination of the target frame rate corresponding to the load status information includes:
[0135] The difference between the preset load coefficient and the load state information is determined as the target coefficient; the product of the target coefficient and the first preset frame rate is added to the second preset frame rate to obtain the target frame rate.
[0136] In the embodiment of the present disclosure, the difference between the preset load coefficient and the load state information is determined as the target coefficient; the product of the target coefficient and the first preset frame rate is added to the second preset frame rate to obtain the target frame rate. The calculation process can be calculated by the following formula (8):
[0137] U=5+(1-u)*25 (8)
[0138] In formula (8), U is the target frame rate, constant 1 is the preset load factor, constant 5 is the second preset frame rate, u is the load state information, and constant 25 is the first preset frame rate. Optionally, the values of the first preset frame rate and the second preset frame rate can also be adjusted according to actual needs.
[0139] In the disclosed embodiment, the target frame rate is inversely proportional to the load status information of the system. When the load u=0, the target frame rate is the maximum, which is 5+25=30, and when the load u=1, the target frame rate is the minimum, which is 5+0×25=5. As the load u increases, the target frame rate gradually decreases from 30 to 5.
[0140] Based on the above, it can be known that in the embodiment of the present disclosure, by determining the difference between the preset load coefficient and the load status information as the target coefficient, and adding the product of the target coefficient and the first preset frame rate to the second preset frame rate, the target frame rate is obtained, and the reading frame rate that matches the current system load status can be determined, so that the reading frame rate can be accurately adjusted with changes in the load status.
[0141] Step S204: based on the target frame rate, reading the data of the target camera.
[0142] In an optional embodiment, based on the target frame rate, reading the data of the target camera includes:
[0143] Step S2041: Based on the target frame rate, determine the interval time information, where the interval time information represents the time interval between two adjacent picture frame reading operations.
[0144] In the disclosed embodiment, the frame rate value represented by the target frame rate is the number of picture frames read per unit time. If the currently calculated target frame rate is 20, that is, only 20 frames of camera picture data are processed within a unit time. The interval time information is equal to the unit time divided by the target frame rate. In an example, the unit time is 1000ms (milliseconds), then the interval time information is 1000 divided by 20, which is equal to 50ms. The time interval between two adjacent picture frame reading operations is 50ms.
[0145] Step S2042: Read the data of the target camera based on the interval time information.
[0146] In the disclosed embodiment, the picture frames whose interval is less than the interval time information will be directly discarded and not read, so as to achieve the target frame rate. That is, when the interval time information is 50ms, the picture frames within 50ms are discarded starting from the acquisition time corresponding to the last processed picture frame, and when the time interval reaches 50ms, a picture frame is read again.
[0147] Based on the above, it can be known that in the embodiment of the present disclosure, by determining the interval time information based on the target frame rate, the time interval between two adjacent picture frame reading operations can be determined. By reading the data of the target camera based on the interval time information, the target system can adjust the reading frame rate of the camera data in time with the changes in the system load, thereby avoiding overload operation and improving the processing efficiency and stability of the system.
[0148] Figure 7 is a block diagram of a camera data reading device according to an exemplary embodiment. Figure 7 The device includes an acquisition module 701, a load status module 702, a target frame rate determination module 703 and a reading module 704, wherein:
[0149] The acquisition module 701 is used to acquire first occupancy information, target temperature information and second occupancy information corresponding to the target system, where the target system is a system that reads data from a target camera, the first occupancy information represents the occupancy corresponding to the central processing unit of the target system, the target temperature information is the temperature value corresponding to the central processing unit, and the second occupancy information represents the occupancy corresponding to the memory of the target system;
[0150] A load status module 702, configured to determine load status information corresponding to a target system based on the first occupancy rate information, the target temperature information, and the second occupancy rate information;
[0151] A target frame rate determination module 703 is used to determine a target frame rate corresponding to the load status information, where the target frame rate represents a camera data reading frame rate that matches the load status information;
[0152] The reading module 704 is used to read the data of the target camera based on the target frame rate.
[0153] In an optional embodiment, the load status module 702 includes:
[0154] a threshold determination module, configured to determine a first occupancy rate threshold, a target temperature threshold, and a second occupancy rate threshold, wherein the first occupancy rate threshold represents an occupancy rate threshold corresponding to the central processing unit when a preset working requirement is met, the target temperature threshold represents an operating temperature threshold corresponding to the central processing unit, and the second occupancy rate threshold represents an occupancy rate threshold corresponding to the memory of the target system when the preset working requirement is met;
[0155] A first load information module, configured to determine first load information based on a first occupancy threshold and first occupancy information, wherein the first load information represents a load state corresponding to the central processing unit;
[0156] A second load information module, configured to determine second load information based on a second occupancy threshold and second occupancy information, wherein the first load information represents a load state corresponding to a memory of the target system;
[0157] A third load information module, used to determine third load information based on the target temperature threshold and the target temperature information, where the third load information represents a temperature load state corresponding to the target system;
[0158] The load status determination module is used to determine the load status information based on the first load information, the second load information and the third load information.
[0159] In an optional embodiment, the first occupancy threshold includes a maximum processor occupancy and a minimum processor occupancy, and the first load information module includes:
[0160] A first target difference module, configured to determine a difference between the first occupancy information and the minimum processor occupancy as a first target difference;
[0161] A second target difference module, configured to determine a difference between the maximum processor occupancy rate and the minimum processor occupancy rate as a second target difference value;
[0162] An initial processor parameter module, configured to determine a ratio between the first target difference and the second target difference as an initial processor parameter;
[0163] A target processor parameter module, used to determine the minimum value between the initial processor parameter and a first upper limit value as the target processor parameter, wherein the first upper limit value represents an upper limit corresponding to the initial processor parameter;
[0164] The first load information submodule is used to determine the maximum value between the target processor parameter and the first lower limit value as the first load information, the first lower limit value represents the lower limit corresponding to the target processor parameter, and the first lower limit value is less than the first upper limit value.
[0165] In an optional embodiment, the second occupancy rate threshold includes a maximum memory occupancy rate and a minimum memory occupancy rate, and the second load information module includes:
[0166] A third target difference module, used to determine the difference between the second occupancy information and the minimum memory occupancy as a third target difference;
[0167] a fourth target difference module, configured to determine a difference between the maximum memory occupancy rate and the minimum memory occupancy rate as a fourth target difference;
[0168] An initial memory parameter module, used to determine the ratio between the third target difference and the fourth target difference as an initial memory parameter;
[0169] A target memory parameter module, used to determine the minimum value between the initial memory parameter and the second upper limit value as the target memory parameter, wherein the second upper limit value represents the upper limit corresponding to the initial memory parameter;
[0170] The second load information submodule is used to determine the maximum value between the target memory parameter and the second lower limit value as the second load information, the second lower limit value represents the lower limit corresponding to the target memory parameter, and the second lower limit value is less than the second upper limit value.
[0171] In an optional embodiment, the target temperature threshold includes a maximum operating temperature value and a minimum operating temperature value corresponding to the central processing unit, and the third load information module includes:
[0172] a fifth target difference module, configured to determine a difference between the target temperature information and the minimum operating temperature value as a fifth target difference;
[0173] a sixth target difference module, configured to determine a difference between the maximum operating temperature value and the minimum operating temperature value as a sixth target difference;
[0174] An initial temperature parameter module, used to determine the ratio between the fifth target difference and the sixth target difference as an initial temperature parameter;
[0175] A target temperature parameter module, used to determine the minimum value between the initial temperature parameter and a third upper limit value as the target temperature parameter, wherein the third upper limit value represents an upper limit corresponding to the initial temperature parameter;
[0176] The third load information submodule is used to determine the maximum value between the target temperature parameter and the third lower limit value as the third load information, the third lower limit value represents the lower limit corresponding to the target temperature parameter, and the third lower limit value is less than the third upper limit value.
[0177] In an optional embodiment, the target frame rate determination module 703 includes:
[0178] A target coefficient calculation module, used to determine the difference between the preset load coefficient and the load state information as the target coefficient;
[0179] The target frame rate determination submodule is used to add the product of the target coefficient and the first preset frame rate to the second preset frame rate to obtain the target frame rate.
[0180] In an optional embodiment, the reading module 704 includes:
[0181] An interval time information module is used to determine interval time information based on a target frame rate, where the interval time information represents the time interval between two adjacent picture frame reading operations;
[0182] The reading submodule is used to read the data of the target camera based on the interval time information.
[0183] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware such as processing circuits or memories, or a combination thereof. Similarly, one processor or multiple processors or memories can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0184] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing instructions executable by the processor; wherein the processor is used for the instructions to implement the camera data reading method as in the embodiment of the present disclosure.
[0185] Figure 8 is a block diagram of an electronic device for reading camera data according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a camera data reading method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0186] Those skilled in the art will understand that Figure 8 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0187] In an exemplary embodiment, a storage medium is also provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the camera data reading method in the embodiment of the present disclosure.
[0188] In an exemplary embodiment, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer is enabled to execute the camera data reading method in the embodiment of the present disclosure.
[0189] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present disclosure can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0190] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0191] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A camera data reading method, characterized in that: The method comprises: Obtaining first occupancy information, target temperature information, and second occupancy information corresponding to a target system, wherein the target system is a system that reads data from a target camera, the first occupancy information represents an occupancy corresponding to a central processing unit of the target system, the target temperature information is a temperature value corresponding to the central processing unit, and the second occupancy information represents an occupancy corresponding to a memory of the target system; Determining load state information corresponding to the target system based on the first occupancy rate information, the target temperature information, and the second occupancy rate information; Determine a target frame rate corresponding to the load status information, where the target frame rate represents a camera data reading frame rate that matches the load status information; Based on the target frame rate, data from the target camera is read.
2. The method according to claim 1, characterized in that: The determining, based on the first occupancy rate information, the target temperature information, and the second occupancy rate information, load state information corresponding to the target system includes: Determine a first occupancy rate threshold, a target temperature threshold, and a second occupancy rate threshold, wherein the first occupancy rate threshold represents an occupancy rate threshold corresponding to the central processing unit when a preset working requirement is met, the target temperature threshold represents an operating temperature threshold corresponding to the central processing unit, and the second occupancy rate threshold represents an occupancy rate threshold corresponding to the memory of the target system when the preset working requirement is met; Determine first load information based on the first occupancy threshold and the first occupancy information, where the first load information represents a load state corresponding to the central processor; Determine second load information based on the second occupancy threshold and the second occupancy information, where the first load information represents a load state corresponding to the memory of the target system; Based on the target temperature threshold and the target temperature information, determining third load information, wherein the third load information represents a temperature load state corresponding to the target system; The load status information is determined based on the first load information, the second load information, and the third load information.
3. The method according to claim 2, characterized in that The first occupancy rate threshold includes a maximum processor occupancy rate and a minimum processor occupancy rate, and determining the first load information based on the first occupancy rate threshold and the first occupancy rate information includes: Determine a difference between the first occupancy information and the minimum processor occupancy as a first target difference; Determine a difference between the maximum processor occupancy rate and the minimum processor occupancy rate as a second target difference value; determining a ratio between the first target difference and the second target difference as an initial processor parameter; Determine the minimum value between the initial processor parameter and a first upper limit value as the target processor parameter, wherein the first upper limit value represents an upper limit corresponding to the initial processor parameter; The maximum value between the target processor parameter and a first lower limit value is determined as the first load information, the first lower limit value represents a lower limit corresponding to the target processor parameter, and the first lower limit value is smaller than the first upper limit value.
4. The method according to claim 2, characterized in that: The second occupancy rate threshold includes a maximum memory occupancy rate and a minimum memory occupancy rate, and determining the second load information based on the second occupancy rate threshold and the second occupancy rate information includes: Determine a difference between the second occupancy information and the minimum memory occupancy as a third target difference; Determine a difference between the maximum memory occupancy rate and the minimum memory occupancy rate as a fourth target difference value; Determine the ratio between the third target difference and the fourth target difference as an initial memory parameter; Determine the minimum value between the initial memory parameter and a second upper limit value as the target memory parameter, wherein the second upper limit value represents an upper limit corresponding to the initial memory parameter; The maximum value between the target memory parameter and a second lower limit value is determined as the second load information, the second lower limit value represents a lower limit corresponding to the target memory parameter, and the second lower limit value is less than the second upper limit value.
5. The method according to claim 2, characterized in that: The target temperature threshold includes a maximum operating temperature value and a minimum operating temperature value corresponding to the central processor, and determining the third load information based on the target temperature threshold and the target temperature information includes: Determine a difference between the target temperature information and the minimum operating temperature value as a fifth target difference; determining a difference between the maximum operating temperature value and the minimum operating temperature value as a sixth target difference; Determining a ratio between the fifth target difference and the sixth target difference as an initial temperature parameter; Determine the minimum value between the initial temperature parameter and a third upper limit value as the target temperature parameter, wherein the third upper limit value represents an upper limit corresponding to the initial temperature parameter; The maximum value between the target temperature parameter and a third lower limit value is determined as the third load information, the third lower limit value represents a lower limit corresponding to the target temperature parameter, and the third lower limit value is smaller than the third upper limit value.
6. The method according to claim 1, characterized in that The determining a target frame rate corresponding to the load status information includes: Determine the difference between the preset load coefficient and the load state information as the target coefficient; The target frame rate is obtained by adding the product of the target coefficient and the first preset frame rate to the second preset frame rate.
7. The method according to claim 1, characterized in that The step of reading data from the target camera based on the target frame rate includes: Based on the target frame rate, determining interval time information, wherein the interval time information represents the time interval between two adjacent picture frame reading operations; Based on the interval time information, data from the target camera is read.
8. A camera data reading device, characterized in that: The device comprises: an acquisition module, configured to acquire first occupancy information, target temperature information, and second occupancy information corresponding to a target system, wherein the target system is a system for reading data from a target camera, the first occupancy information represents an occupancy corresponding to a central processing unit of the target system, the target temperature information is a temperature value corresponding to the central processing unit, and the second occupancy information represents an occupancy corresponding to a memory of the target system; a load status module, configured to determine load status information corresponding to the target system based on the first occupancy rate information, the target temperature information and the second occupancy rate information; A target frame rate determination module, used to determine a target frame rate corresponding to the load status information, wherein the target frame rate represents a camera data reading frame rate that matches the load status information; A reading module is used to read data from the target camera based on the target frame rate.
9. An electronic device, characterized in that: include: processor; a reader for storing instructions executable by the processor; Wherein, the processor is used for the instruction to implement the camera data reading method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the camera data reading method as described in any one of claims 1 to 7.