Self-closing valve management method and system and storage medium
By detecting the working status and food information of the gas stove, we can determine whether the self-closing valve needs to be closed, which solves the safety hazards caused by user negligence in traditional gas stoves, and realizes intelligent management and energy conservation of gas stoves.
Patent Information
- Application Number
- CN202411574320.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-14
AI Technical Summary
During the use of traditional gas stoves, due to users’ negligence or forgetting to turn off the fire, there are safety hazards such as fire and gas leakage. How to reduce these hazards has become an urgent problem to be solved.
By checking whether the gas stove is in a working state and combining the maximum working time determined by food information, it is precisely determined whether the self-closing valve needs to be closed, thereby avoiding safety hazards caused by user negligence.
It effectively avoids safety hazards such as fires and gas leakage caused by users' negligence or forgetting to turn off the fire. At the same time, it realizes intelligent management of gas stoves, reduces energy waste, and protects the environment and resources.
Smart Images

Figure CN119443514A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of self-closing valves, and in particular to a self-closing valve management method, system and storage medium. Background Art
[0002] With the advancement of technology and the improvement of people's living standards, smart home devices play an increasingly important role in people's daily lives. As one of the core devices in the family kitchen, the safety and intelligence level of the gas stove directly affect the user experience and quality of life.
[0003] In order to improve the safety of gas use, self-closing valves are generally installed on indoor gas pipelines. Self-closing valves have the functions of automatically closing in case of overpressure, underpressure, overcurrent and gas outage. Its characteristics are that it does not require external power when closing, and must be opened manually after closing.
[0004] However, during the use of traditional gas stoves, due to user negligence or forgetting to turn off the fire, there are often safety hazards such as fire, gas leakage, etc. Therefore, how to reduce the safety hazards caused by the long-term operation of the gas stove has become a problem to be solved urgently. Summary of the invention
[0005] In order to reduce the potential safety hazards caused by long-term operation of a gas stove, the present application provides a self-closing valve management method, system and storage medium.
[0006] In the first aspect, the present application provides a self-closing valve management method, which adopts the following technical solution: A self-closing valve management method, comprising: Make sure the gas stove is in working condition; When the gas stove is in working state, determining food information corresponding to the gas stove; Based on the food information, determining the maximum working time corresponding to the gas stove; Obtaining the working time of the gas stove; Based on the working time and the maximum working time, determine whether to close the self-closing valve.
[0007] By adopting the above technical solution, by detecting whether the gas stove is in working state, and when the gas stove is in working state, detecting the working time of the gas stove, and combining the longest working time determined by the food information, it is possible to accurately determine whether the self-closing valve needs to be closed. This effectively avoids safety hazards such as fire and gas leakage caused by user negligence or forgetting to turn off the fire. At the same time, this solution combines the working state of the gas stove, food information and automatic control of the self-closing valve to realize intelligent management of the gas stove. And by reasonably controlling the working time of the gas stove, unnecessary energy waste can be avoided. At the same time, reducing gas leakage that may be caused by long-term work also helps protect the environment and resources.
[0008] In a possible implementation, when the gas stove is in a working state, determining food information corresponding to the gas stove includes: Determining a food image corresponding to the gas stove; Identify the food image and determine a cooking label corresponding to the food image, where the cooking label is used to represent the cooking method corresponding to the food image; Based on the cooking label, food information corresponding to the gas stove is determined.
[0009] By adopting the above technical solution, the cooking label of the ingredient image is identified through the time image corresponding to the ingredient being cooked on the gas stove, so as to determine the ingredient information corresponding to the ingredient being cooked on the gas stove according to the cooking label, so as to determine the maximum working time corresponding to the gas stove, thereby improving the accuracy of determining the maximum working time corresponding to the gas stove.
[0010] In a possible implementation, determining the food image corresponding to the gas stove includes: receiving a target video sent by a shooting device, wherein the target video is a video obtained by shooting the gas stove between a preset time and a current time, wherein the preset time is a time corresponding to a preset time length before a start time corresponding to the gas stove, and the start time is a time when the gas stove is switched from a non-working state to a working state; Identify each video frame image in the target video to determine the video frame image containing the food; The video frame image containing the food is determined as the food image corresponding to the gas stove.
[0011] By adopting the above technical solution, by receiving a video of the gas stove shot between a preset time and the current time, the method can capture the food situation on the gas stove in real time. The setting of the preset time ensures that the video includes a short time before the gas stove starts working, which helps to more accurately identify the food information. Unlike static image recognition, this solution uses video frame images for recognition, which can capture the dynamic changes of food during the cooking process. This helps to more comprehensively understand the state of the food, such as size, shape information, etc., so as to more accurately determine the food information and improve the accuracy of determining the maximum working time corresponding to the gas stove.
[0012] In a possible implementation, the process of identifying the food image, determining the cooking label corresponding to the food image, and determining the cooking label corresponding to each food image includes: Identify the food images to obtain the food category and food shape corresponding to each food image; Inputting the food category and the food shape into a convolutional neural network model to obtain a first feature vector; Inputting the food image, the food category and the food shape into a recurrent neural network model to obtain a second feature vector; Merging the first feature vector and the second feature vector to obtain a merged feature vector; Inputting the merged feature vector into the fully connected layer to obtain the cooking label corresponding to the food image; Wherein, determining the food information corresponding to the gas stove based on the cooking label includes: Based on the food category, the food shape and the cooking label, food information corresponding to the gas stove is determined.
[0013] By adopting the above technical solution, by identifying the category and shape of ingredients in the ingredient image, and combining the features extracted by the convolutional neural network (CNN) and the recurrent neural network (RNN), the solution can more accurately identify the ingredient information. CNN is good at capturing local features of images, while RNN is good at processing sequence data. Combining the two can make full use of the cooking labels corresponding to the ingredient images, thereby improving the accuracy of the determined cooking labels.
[0014] In a possible implementation, determining the maximum working time corresponding to the gas stove based on the food information includes: Based on the ingredient category, the ingredient shape and the cooking label, determining a recipe label corresponding to the ingredient image; and obtaining a cooking time corresponding to the recipe label; Based on the cooking time corresponding to the recipe label, the maximum working time corresponding to the gas stove is determined.
[0015] By adopting the above technical solution, it is possible to automatically identify the category, shape and cooking label of the ingredients, filter out the corresponding recipes, generate corresponding recipe labels, and obtain the cooking time corresponding to the recipe label based on the recipe label corresponding to the ingredient, so as to obtain the corresponding maximum working time of the gas stove.
[0016] In a possible implementation, determining the recipe label corresponding to the ingredient image based on the ingredient category, the ingredient shape, and the cooking label includes: Selecting a main ingredient category from the ingredient categories; Matching the main ingredient category with the ingredient category in each recipe, and determining a recipe with a matching degree higher than a preset matching degree as a target recipe; Obtaining cooking methods for the target recipe; determining whether the cooking method of the target recipe is consistent with the cooking label; When the cooking method of the target recipe is consistent with the cooking label, the cooking time of the target recipe is obtained as the recipe label corresponding to the ingredient image.
[0017] By adopting the above technical solution, through comprehensive analysis of the type, shape and cooking label of the ingredients, the recipe label that matches the current ingredients can be determined more accurately. After accurately determining the recipe label corresponding to the ingredients, the gas stove can set the maximum working time according to the cooking time on the recipe label. This helps to avoid long working hours caused by user negligence or forgetting to turn off the fire, thereby reducing safety hazards such as fire and gas leakage.
[0018] In a possible implementation, determining whether the gas stove is in a working state includes any one of the following items: obtaining a first temperature and a second temperature of the gas stove, where the first temperature is a temperature of a burner on the gas stove, and the second temperature is a temperature of an ignition module on the gas stove, and determining whether the first temperature is greater than a preset temperature threshold; when the first temperature is greater than the preset temperature threshold, determining a temperature difference between the first temperature and the second temperature, and determining whether the temperature difference is greater than a temperature difference threshold; if the temperature difference is greater than the temperature difference threshold, determining that the gas stove is in a working state; Receive a current image of the gas stove sent by a photographing device, the current image including a complete image of a burner on the gas stove, obtain a flame color threshold, identify the current image based on the flame color threshold, and determine whether there is a flame feature in the current image; when the flame feature exists in the current image, determine that the gas stove is in a working state; when the flame feature does not exist in the current image, determine that the gas stove is not in a working state.
[0019] By adopting the above technical solutions, the first solution can more accurately determine whether the gas stove is actually in working condition by simultaneously monitoring the temperature of the burner and the ignition module. Because only when the burner temperature rises significantly and there is a significant difference between the temperature of the ignition module and the burner temperature can it be determined that the gas stove is working. The second solution can obtain the current image of the gas stove in real time and quickly identify whether there is a flame feature in the image based on the flame color threshold. This method has high accuracy and can accurately determine whether the gas stove is in working condition.
[0020] In the second aspect, the present application provides a self-closing valve management system, which adopts the following technical solution: A self-closing valve management system, comprising: A camera for capturing a video and / or an image containing the gas stove; Self-closing valve, used to cut off the flow of gas; A controller, connected to the self-closing valve, and used to control the self-closing valve to close; Electronic equipment.
[0021] In a possible implementation, the electronic device includes: at least one processor; Memory; At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the self-closing valve management method described in the first aspect above.
[0022] In a third aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium includes: a computer program that can be loaded by a processor and execute the self-closing valve management method described in the first aspect above.
[0023] In summary, the present application includes the following beneficial technical effects: by detecting whether the gas stove is in working state, and when the gas stove is in working state, detecting the working time of the gas stove, and combining the longest working time determined by the food information, it is possible to accurately determine whether the self-closing valve needs to be closed. This effectively avoids safety hazards such as fire and gas leakage caused by user negligence or forgetting to turn off the fire. At the same time, this solution combines the working state of the gas stove, food information and automatic control of the self-closing valve to realize intelligent management of the gas stove. And by reasonably controlling the working time of the gas stove, unnecessary energy waste can be avoided. At the same time, reducing gas leakage that may be caused by long-term work also helps to protect the environment and resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flow chart of a self-closing valve management method provided in an embodiment of the present application; Figure 2 It is a block diagram of a self-closing valve management system provided by an embodiment of the present application; Figure 3 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following is combined with Figure 1 -Attached Figure 3 This application is described in further detail.
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. 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.
[0027] In order to facilitate understanding of the technical solution proposed in this application, several elements introduced in the description of this application are first introduced here. It should be understood that the following introduction is only for the convenience of understanding these elements, so as to understand the content of the embodiments of this application, and does not necessarily cover all possible situations.
[0028] The self-closing valve is a device installed on the indoor gas pipeline, which has the functions of automatic closing in case of overpressure, automatic closing in case of underpressure, and automatic closing in case of overcurrent. Its characteristics are that it does not require external power when closing, and must be opened manually after closing. The working principle of the self-closing valve is based on the principle of pressure difference. When the self-closing valve is in the closed state, the pressure difference inside and outside the valve will cause the valve to close. When the pressure difference disappears, the valve will open automatically. The main components of the self-closing valve are the valve core and the valve seat. The opening degree of the valve is controlled by adjusting the position of the valve core, thereby realizing the control of the fluid.
[0029] The names and functions of the various components of the gas stove are as follows: Igniter: The device responsible for igniting the gas stove, which can be piezoelectric ignition or pulse ignition.
[0030] Nozzle: The device that sprays gas from a gas stove.
[0031] Nozzle Cap: The seal between the nozzle and the cap.
[0032] Valve core: A component that controls the flow of gas.
[0033] Cyclone device: A device that causes the gas to rotate and mix for combustion.
[0034] Flame: The flame produced by a gas stove can be of different colors or temperatures.
[0035] Air valve: Air pressure regulating valve, used to regulate air pressure.
[0036] Cyclone tube: A rotating pipe that allows the gas to mix and burn during rotation.
[0037] Burner: It is composed of multiple parts such as burner head, nozzle, outer fire cover, air adjustment plate and center fire cover, and is responsible for heating the cookware.
[0038] Flameout protection device: usually composed of a solenoid valve and a thermocouple, which prevents gas leakage when the gas stove is accidentally turned off.
[0039] Ignition device: includes ignition controller, battery box, micro switch, thermocouple, solenoid valve and other components, responsible for igniting the gas stove.
[0040] Burner: The part of a gas stove that is used to place cooking utensils.
[0041] Fire cover: also known as a flame divider, a component that controls the burning and dispersion shape of the flame.
[0042] Hob: The part used to support the pot.
[0043] Gas pipe / gas pipe: The pipe connecting the gas source and the gas stove.
[0044] Knob: A component used to adjust the size of the flame.
[0045] With the advancement of science and technology and the improvement of people's living standards, smart home devices play an increasingly important role in people's daily lives. As one of the core equipment in the family kitchen, the safety and intelligence level of the gas stove directly affect the user's experience and quality of life. In order to improve the safety of gas use, a self-closing valve is generally installed on the indoor gas pipeline. The self-closing valve has the functions of automatic closing when overpressure, automatic closing when underpressure, automatic closing when overcurrent, and automatic closing when gas is stopped. Its characteristics are that it does not require external power when closing, and it must be opened manually after closing. However, during the use of traditional gas stoves, there are often safety hazards such as fire and gas leakage due to user negligence or forgetting to turn off the fire. Therefore, how to reduce the safety hazards caused by long-term operation of gas stoves has become a problem that needs to be solved urgently.
[0046] In view of this, the embodiment of the present application provides a self-closing valve management method, which can accurately determine whether the self-closing valve needs to be closed by detecting whether the gas stove is in working state, and when the gas stove is in working state, detecting the working time of the gas stove, and combining the longest working time determined by the food information. Thereby effectively avoiding safety hazards such as fire and gas leakage caused by user negligence or forgetting to turn off the fire. At the same time, this solution combines the working state of the gas stove, food information and automatic control of the self-closing valve to realize intelligent management of the gas stove. And by reasonably controlling the working time of the gas stove, unnecessary energy waste can be avoided. At the same time, reducing gas leakage that may be caused by long-term work also helps to protect the environment and resources.
[0047] See also Figure 1 The embodiment of the present application provides a self-closing valve management method, which is executed by an electronic device. The method includes: step S101, determining whether the gas stove is in a working state.
[0048] Specifically, the gas flow data collected by the gas flow sensor can be obtained to obtain the gas flow data output within a preset time period. If the detected gas flow data persists within a preset time period (such as 1 minute) or exceeds a preset flow threshold, it can be determined that the gas stove is in a working state. On the contrary, if the gas flow data is zero or lower than the preset flow threshold, it may indicate that the gas stove is not in a working state or has been turned off.
[0049] Step S102: when the gas stove is in working state, determine the food information corresponding to the gas stove.
[0050] The food information may include food name, food shape, food size and other information.
[0051] When the gas stove is in working state, generally, there is a pot on the gas stove and cooking food. In order to reduce the occurrence of safety hazards such as fire and gas leakage caused by user negligence or forgetting to turn off the fire, the time required for cooking food can be judged to determine whether to automatically close the self-closing valve. Specifically, when there is a pot on the gas stove and cooking food, the pressure value corresponding to the burner on the gas stove is inconsistent with the pressure value corresponding to the burner when there is no pot on the gas stove. Therefore, the pressure value corresponding to the burner on the gas stove can be obtained, and it can be determined whether the pressure value is greater than the preset pressure value. When the pressure data is greater than the preset pressure value, it is determined that there is a pot on the gas stove; when the pressure data is not greater than the preset pressure value, it is determined that there is no pot on the gas stove. Among them, the preset pressure data can be a value when there is no pot on the gas stove, and can also be set according to actual conditions, which is not limited in the embodiment of the present application.
[0052] Furthermore, when there is a pot on the gas stove, that is, when there are ingredients being cooked on the gas stove, the information of the ingredients being cooked on the gas stove can be determined, so as to determine the time required to cook the ingredients based on the information of the ingredients. Specifically, a recipe name input by a user can be received, and the ingredient information corresponding to the recipe name can be obtained to obtain the ingredient information corresponding to the gas stove. For example, if the recipe name input by the user is scrambled eggs with tomatoes, the ingredient information corresponding to the recipe name is tomatoes and eggs, and the shape of the tomatoes is in pieces.
[0053] More specifically, when the gas stove is in working condition and no pot is placed on the gas stove, the self-closing valve is controlled to fill the pancake.
[0054] Step S103: Determine the maximum working time corresponding to the gas stove based on the food information.
[0055] After obtaining the food information, the cooking time corresponding to the food information can be determined to obtain the maximum working time corresponding to the gas stove. Specifically, the food is classified based on the name of the food, such as vegetables, meat and seafood. Generally speaking, vegetables: usually have a shorter cooking time to maintain their freshness and color. For example, the time for frying vegetables is generally controlled at 2-3 minutes. Meat: The cooking time is relatively long, and the meat must be cooked thoroughly. The cooking time of red meat such as beef and pork is usually longer than that of white meat such as chicken and duck. Seafood: The cooking time depends on its freshness to avoid overcooking and affecting the taste. Furthermore, since the shape of the food affects the uniformity of heat distribution and cooking efficiency, and the size of the food directly affects the cooking time, the cooking time corresponding to the food information can be further determined according to the shape and size of the food. For example, flat-shaped food is easier to heat evenly and the cooking time is relatively short, while large pieces of food take longer to ensure that the inside is cooked thoroughly.
[0056] Furthermore, different cooking methods have different requirements for cooking time. For example, stir-frying is usually short and fast, while stewing takes a long time to fully flavor the ingredients. Therefore, based on the texture and shape of the ingredients, the range of their cooking time is preliminarily determined. Combined with the specific cooking method, the longest cooking time under this method is determined. For example, for a medium-sized piece of beef, when using the stewing method, the longest cooking time is 2 hours to ensure that the meat is cooked through and tender.
[0057] After the longest cooking time corresponding to the food information is obtained, the longest cooking time is used as the longest working time corresponding to the gas stove.
[0058] Step S104: Obtain the working time of the gas stove.
[0059] The target time for the gas stove to switch from the non-working state to the working state is obtained, and the current time is obtained. Based on the working time=current time-target time, the working time of the gas stove is obtained.
[0060] Step S105: Determine whether to close the self-closing valve based on the working time and the maximum working time.
[0061] Specifically, it is determined whether the working time is greater than the maximum working time. If the working time is not greater than the maximum working time, the self-closing valve is not controlled to be closed; if the working time is greater than the maximum working time, the self-closing valve is controlled to be closed.
[0062] Furthermore, if the gas stove is not in working state, no operation is performed.
[0063] A possible implementation method of the embodiment of the present application is to determine whether the gas stove is in a working state in the above step S101, which can refer to the following method 1 or method 2.
[0064] Specifically, method one: obtain the first temperature and the second temperature of the gas stove, determine whether the first temperature is greater than a preset temperature threshold, when the first temperature is greater than the preset temperature threshold, determine the temperature difference between the first temperature and the second temperature, and determine whether the temperature difference is greater than the temperature difference threshold, if the temperature difference is greater than the temperature difference threshold, determine that the gas stove is in a working state.
[0065] The first temperature is the temperature of the burner on the gas stove, and the second temperature is the temperature of the ignition module on the gas stove.
[0066] Specifically, the values of the two temperature sensors, i.e., the first temperature and the second temperature, can be read regularly through the data interface of the temperature sensor (such as analog signal, digital signal or wireless transmission). The temperature difference between the first temperature and the second temperature is calculated based on the temperature difference = the first temperature - the second temperature, and a preset temperature threshold is obtained, such as the temperature difference threshold = 100°C (set according to the actual working conditions of the gas stove).
[0067] Further, the calculated temperature difference is compared with a temperature difference threshold. If the temperature difference is greater than the temperature difference threshold, it is determined that the gas stove is in a working state. Further, if the temperature difference is not greater than the temperature difference threshold, it is determined that the gas stove is not in a working state.
[0068] Furthermore, whether the gas stove is in working state can be determined in another way: a target preset temperature threshold can be obtained, such as the preset temperature threshold = 500°C (set according to the actual working condition of the gas stove), and the read first temperature is compared with the preset temperature threshold. If the first temperature is greater than the preset temperature threshold, it means that the burner is working. If any condition is not met (such as the first temperature does not exceed the preset temperature threshold, or the temperature difference does not exceed the temperature difference threshold), it cannot be determined that the gas stove is in working state.
[0069] Method 2: Receive a current image of the gas stove sent by a shooting device, the current image including a complete image of a burner on the gas stove, obtain a flame color threshold, identify the current image based on the flame color threshold, and determine whether there is a flame feature in the current image. When the flame feature exists in the current image, determine that the gas stove is in a working state; when the flame feature does not exist in the current image, determine that the gas stove is not in a working state.
[0070] Specifically, after receiving the current image of the gas stove, the image is color analyzed, and the color of each pixel in the image is compared with a preset flame color threshold to identify a possible flame area. If there is no flame area with a preset flame color threshold, it is determined that there is no flame feature. The flame color threshold is pre-set according to the typical color features of the flame (such as blue, orange or a mixture of the two), and these thresholds usually include ranges in color space (such as RGB, HSV, etc.).
[0071] Furthermore, the flame features are further confirmed by morphological analysis (such as edge detection, region growing, etc.), and other non-flame interference is eliminated. Then, based on the image recognition results, it is determined whether there is an area that meets the flame features in the current image. If the identified flame area reaches a certain area or density threshold (which can be set according to actual conditions), it is considered that the flame features exist in the current image. If the flame features exist in the current image, it is determined that the gas stove is in working condition; if the flame features do not exist in the current image, it is determined that the gas stove is not in working condition.
[0072] A possible implementation of the embodiment of the present application is that in the above step S102, when the gas stove is in a working state, determining the food information corresponding to the gas stove includes: Determine the food image corresponding to the gas stove; Identify the food image and determine the cooking label corresponding to the food image, where the cooking label is used to represent the cooking method corresponding to the food image; Based on the cooking label, determine the food information corresponding to the gas stove.
[0073] Specifically, the food image sent by the camera can be received, and the received food image can be preprocessed, and then the preprocessed food image can be recognized by the first image recognition model to obtain the output cooking label. The first image recognition model is trained by a large number of food image samples and corresponding cooking label samples, and can recognize the characteristics of various food ingredients and output corresponding cooking labels. The cooking label is used to characterize the cooking methods commonly used in the cooking process of the food ingredient, such as frying, boiling, roasting, steaming, etc.
[0074] Furthermore, based on the cooking label, the cooking method of the ingredients corresponding to the gas stove can be further determined to obtain the ingredient information corresponding to the gas stove.
[0075] A possible implementation of the present application, in the above embodiment, determining the food image corresponding to the gas stove includes: Receiving a target video sent by a shooting device; Identify each video frame image in the target video to determine the video frame image containing the food; The video frame image containing the food is determined as the food image corresponding to the gas stove.
[0076] The target video is a video obtained by shooting the gas stove between the preset time and the current time, the preset time is the time corresponding to the preset time before the start time corresponding to the gas stove, and the start time is the time when the gas stove changes from the non-working state to the working state. The selection of the preset time should be based on a certain time before the gas stove starts working, and this time can be determined according to actual conditions and needs, such as a few minutes or seconds before the gas stove starts.
[0077] Specifically, a target video sent by a shooting device is received, which starts from a preset moment and ends at the current moment, and covers the entire process of the gas stove changing from a non-working state to a working state. Then, each frame image in the video is extracted, and each extracted frame image is preprocessed. For each preprocessed frame image, a second image recognition model can be used to identify whether it contains food. The second image recognition model is trained by a large number of video frame image samples and video frame image samples containing food. Multiple video frame images are input into the second image recognition model, and video frame images containing food are output.
[0078] Furthermore, the video frame images that are identified to contain food ingredients are marked as food ingredient images corresponding to the gas stove, and these images will serve as the basis for subsequent processing and analysis.
[0079] In a possible implementation of the embodiment of the present application, in the above embodiment, the process of identifying the food image and determining the cooking label corresponding to the food image and determining the cooking label corresponding to each food image includes: identifying the food image and obtaining the food category and food shape corresponding to each food image; Input the food category and shape into the convolutional neural network model to obtain the first feature vector; Inputting the food image, food category and food shape into the recurrent neural network model to obtain a second feature vector; Merge the first eigenvector and the second eigenvector to obtain a merged eigenvector; The merged feature vector is input into the fully connected layer to obtain the cooking label corresponding to the food image; Wherein, based on the cooking label, determining the food information corresponding to the gas stove includes: Determine the ingredient information corresponding to the gas stove based on the ingredient category, ingredient shape and cooking label.
[0080] Among them, a food information database is established, which contains multiple food categories and the color, texture and other characteristics corresponding to each food category.
[0081] Specifically, edge detection can be used to extract shape features of ingredients in ingredient images to obtain the ingredient shapes corresponding to the ingredients, and texture analysis methods and color histogram methods can be used to extract texture features and color features of ingredients in ingredient images, and the obtained texture features and color features are matched with the colors and texture features corresponding to each ingredient category in the ingredient information database to determine the ingredient category corresponding to each ingredient image, and the ingredient category in the ingredient image is matched with the ingredient shape to obtain the ingredient category contained in each ingredient image and the ingredient shape corresponding to each ingredient category.
[0082] Furthermore, the identified food category and food shape are used as input and sent to a convolutional neural network model (CNN) for feature extraction to obtain a first feature vector related to the food category and shape.
[0083] At the same time, the original food image, food category and food shape are also taken as input and sent to the recurrent neural network model (RNN) or long short-term memory network (LSTM) to capture the sequence information and contextual relationship in the image and obtain the second feature vector related to the image content, category and shape.
[0084] Merge the first eigenvector and the second eigenvector extracted from the CNN and RNN / LSTM models. The merged eigenvector can be the direct merging of the first eigenvector and the second eigenvector, or the merging of the first eigenvector and the second eigenvector into a matrix. For example, if the first eigenvector is A = [1,2,3,4], the second eigenvector is B = [5,6,7,8], and the merged eigenvector is C, then C = [A, B] = [1,2,3,4,5,6,7,8], or
[0085] Furthermore, the merged feature vector is fed into a fully connected layer (or multi-layer perceptron MLP) for processing. The fully connected layer will output one or more cooking tags based on the input feature vector. Cooking tags may include cooking methods (such as stir-frying, boiling, baking, steaming, etc.).
[0086] Furthermore, based on the identified ingredient category, ingredient shape and cooking label, the ingredient information corresponding to the gas stove can be determined.
[0087] A possible implementation of the embodiment of the present application, in the above embodiment, based on the food information, determining the maximum working time corresponding to the gas stove includes: Determine the recipe label corresponding to the ingredient image based on the ingredient category, ingredient shape and cooking label; Get the cooking time corresponding to the recipe tag; Based on the cooking time corresponding to the recipe label, determine the maximum working time of the gas stove.
[0088] Wherein, a database or knowledge base including mapping relationships among ingredient categories, ingredient shapes, cooking labels and recipe labels is established on the electronic device.
[0089] Specifically, for each ingredient image, the corresponding recipe label is queried in a database or knowledge base according to the identified ingredient category, ingredient shape, and cooking label.
[0090] Further, after determining the recipe tag corresponding to the ingredient image, the cooking time corresponding to the recipe tag is obtained from the database or knowledge base. The cooking time can be a specific value (such as 30 minutes) or a range (such as 20-30 minutes).
[0091] If there are multiple matching recipe tags in the database, further processing may be required to determine the final cooking time. For example, the average cooking time of all matching tags can be taken.
[0092] After the cooking time is obtained, it can be regarded as the maximum working time of the gas stove for the current ingredient. This is because the cooking time usually represents the maximum time required to complete the cooking process. If multiple ingredients are cooked on the gas stove at the same time, and the maximum working time of each ingredient is different, then the longest cooking time of all ingredients can be taken as the maximum working time of the gas stove.
[0093] Furthermore, if there is no completely matching record in the database, a label consistent with the cooking method corresponding to the cooking label can be selected from multiple recipe labels based on the cooking label as a backup recipe label, and the ingredient category corresponding to each backup recipe label can be obtained, and the ingredient category corresponding to each backup recipe label can be compared with the ingredient category corresponding to the gas stove to obtain the similarity corresponding to each backup recipe label, and the backup recipe label with the highest similarity can be used as the recipe label corresponding to the ingredient image.
[0094] A possible implementation of the embodiment of the present application, in the above embodiment, determining the recipe label corresponding to the ingredient image based on the ingredient category, ingredient shape and cooking label includes: Select the main ingredient category from the ingredient category; Matching the main ingredient category with the ingredient category in each recipe, and determining the recipe with a matching degree higher than a preset matching degree as a target recipe; Obtaining cooking methods for a target recipe; Determine whether the cooking method of the target recipe is consistent with the cooking label; When the cooking method of the target recipe is consistent with the cooking tag, the cooking time of the target recipe is obtained as the recipe tag corresponding to the ingredient image.
[0095] In the process of cooking ingredients, the cooking time is generally determined based on the main ingredients in the recipe. For example, the cooking time of beef brisket stewed with tomatoes is determined based on the cooking time required for the beef brisket. Therefore, among the identified ingredient categories, one or more main ingredient categories are selected based on factors such as the quantity, size or importance of the ingredients.
[0096] Specifically, the food category can be selected according to the food in the seasoning database. More specifically, the food category corresponding to the gas stove that is consistent with the stone type in the seasoning database is determined as the auxiliary food category, and the food category corresponding to the gas stove except the auxiliary food category is determined as the main food category. The seasoning database is pre-established and includes seasoning or spice food, such as onion, ginger and garlic.
[0097] Furthermore, each main ingredient category is matched with the ingredient category in each recipe to determine whether there is an ingredient category in a recipe that includes the main ingredient category corresponding to the gas stove. If so, the recipe is determined to be the target recipe. Exemplarily, the main ingredient categories corresponding to the gas stove are ingredient A, ingredient B, and ingredient C, respectively, the main ingredient categories included in the first recipe are ingredient A, ingredient B, ingredient C, and ingredient D, and the main ingredient categories included in the second recipe are ingredient A, ingredient D, and ingredient E, then the first recipe is determined to be the target recipe.
[0098] If it does not exist, then based on the cosine similarity, the similarity between each recipe and the ingredients cooked by the gas stove is calculated to obtain the matching degree between each recipe and the ingredients cooked by the gas stove, and a preset matching degree threshold is obtained, and the recipe with a matching degree higher than the threshold is determined as the target recipe. The matching degree can be adjusted according to the actual situation to ensure the accuracy and availability of the matching results.
[0099] Furthermore, different cooking methods also have a great impact on cooking time. Therefore, the cooking methods defined in the target recipe can be obtained, and the cooking methods of the target recipe can be compared with the cooking labels identified by the ingredient image. There may be one or more cooking labels, representing the cooking methods commonly used in the cooking process of the ingredients, such as stir-frying, boiling, baking, steaming, etc. Determine whether the cooking methods of the target recipe are consistent with the cooking labels. The "consistent" here can be a complete match or a partial match (for example, when the cooking label is "stir-fry", the cooking method of the target recipe can be "quick stir-fry" or "stir-fry").
[0100] Furthermore, when the cooking method of the target recipe is consistent with the cooking tag, or when the target recipe does not exist, a tag that is consistent with the cooking method corresponding to the cooking tag is selected from multiple recipe tags as a backup recipe tag, and the ingredient category corresponding to each backup recipe tag is obtained, and the ingredient category corresponding to each backup recipe tag is compared with the ingredient category corresponding to the gas stove to obtain the similarity corresponding to each backup recipe tag, and the backup recipe tag with the highest similarity is used as the recipe tag corresponding to the ingredient image.
[0101] The above-mentioned embodiment introduces a self-closing valve management method from the perspective of method flow, and the following embodiment introduces a self-closing valve management system from the perspective of a physical device. Please refer to the following embodiment for details.
[0102] See also Figure 2 The self-closing valve management system 20 may specifically include: A self-closing valve management system 20, comprising: A shooting device 201, used for shooting a video and / or an image including a gas stove; The self-closing valve 202 is used to cut off the flow of gas; A controller 203 is connected to the self-closing valve 202 and is used to control the self-closing valve 202 to close; Electronic device 204.
[0103] Among them, the shooting device 201 can be a camera, and the shooting device 201 can be installed on the self-closing valve 202 or above the gas stove. This embodiment of the present application is not limited to this.
[0104] Specifically, see Figure 3 , Figure 3 The electronic device 204 shown includes: a processor 2041 and a memory 2043. The processor 2041 and the memory 2043 are connected, such as through a bus 2042. Optionally, the electronic device 204 may also include a transceiver 2044. It should be noted that in actual applications, the transceiver 2044 is not limited to one, and the structure of the electronic device 204 does not constitute a limitation on the embodiments of the present application.
[0105] Processor 2041 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 2041 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0106] The bus 2042 may include a path to transmit information between the above components. The bus 2042 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 2042 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0107] The memory 2043 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0108] The memory 2043 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 2041. The processor 2041 is used to execute the application code stored in the memory 2043 to implement the content shown in the above method embodiment.
[0109] Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc., and can also be servers, etc. Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0110] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment.
[0111] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0112] The above are only some implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A self-closing valve management method, characterized in that: include: Make sure the gas stove is in working condition; When the gas stove is in working state, determining food information corresponding to the gas stove; Based on the food information, determining the maximum working time corresponding to the gas stove; Obtaining the working time of the gas stove; Based on the working time and the maximum working time, determine whether to close the self-closing valve.
2. The self-closing valve management method according to claim 1, characterized in that: When the gas stove is in working state, determining food information corresponding to the gas stove includes: Determining a food image corresponding to the gas stove; Identify the food image and determine a cooking label corresponding to the food image, where the cooking label is used to represent the cooking method corresponding to the food image; Based on the cooking label, food information corresponding to the gas stove is determined.
3. The self-closing valve management method according to claim 2, characterized in that: The determining the food image corresponding to the gas stove includes: receiving a target video sent by a shooting device, wherein the target video is a video obtained by shooting the gas stove between a preset time and a current time, wherein the preset time is a time corresponding to a preset time length before a start time corresponding to the gas stove, and the start time is a time when the gas stove is switched from a non-working state to a working state; Identify each video frame image in the target video to determine the video frame image containing the food; The video frame image containing the food is determined as the food image corresponding to the gas stove.
4. The self-closing valve management method according to claim 2, characterized in that: The process of identifying the food image, determining the cooking label corresponding to the food image, and determining the cooking label corresponding to each food image includes: Identify the food images to obtain the food category and food shape corresponding to each food image; Inputting the food category and the food shape into a convolutional neural network model to obtain a first feature vector; Inputting the food image, the food category and the food shape into a recurrent neural network model to obtain a second feature vector; Merging the first feature vector and the second feature vector to obtain a merged feature vector; Inputting the merged feature vector into the fully connected layer to obtain the cooking label corresponding to the food image; Wherein, determining the food information corresponding to the gas stove based on the cooking label includes: Based on the food category, the food shape and the cooking label, food information corresponding to the gas stove is determined.
5. The self-closing valve management method according to claim 4, characterized in that: The determining, based on the food information, the maximum working time corresponding to the gas stove includes: Determining a recipe label corresponding to the ingredient image based on the ingredient category, the ingredient shape, and the cooking label; Obtaining the cooking time corresponding to the recipe label; Based on the cooking time corresponding to the recipe label, the maximum working time corresponding to the gas stove is determined.
6. The self-closing valve management method according to claim 5, characterized in that: The determining, based on the ingredient category, the ingredient shape, and the cooking label, a recipe label corresponding to the ingredient image includes: Selecting a main ingredient category from the ingredient categories; Matching the main ingredient category with the ingredient category in each recipe, and determining a recipe with a matching degree higher than a preset matching degree as a target recipe; Obtaining cooking methods for the target recipe; determining whether the cooking method of the target recipe is consistent with the cooking label; When the cooking method of the target recipe is consistent with the cooking label, the cooking time of the target recipe is obtained as the recipe label corresponding to the ingredient image.
7. The self-closing valve management method according to claim 1, characterized in that: The step of determining whether the gas stove is in working state includes any one of the following: Acquire a first temperature and a second temperature of the gas stove, wherein the first temperature is the temperature of the burner on the gas stove, and the second temperature is the temperature of the ignition module on the gas stove, and determine whether the first temperature is greater than a preset temperature threshold; when the first temperature is greater than the preset temperature threshold, determine a temperature difference between the first temperature and the second temperature, and determine whether the temperature difference is greater than a temperature difference threshold; if the temperature difference is greater than the temperature difference threshold, determine that the gas stove is in a working state; Receive a current image of the gas stove sent by a photographing device, the current image including a complete image of a burner on the gas stove, obtain a flame color threshold, identify the current image based on the flame color threshold, and determine whether there is a flame feature in the current image; when the flame feature exists in the current image, determine that the gas stove is in a working state; when the flame feature does not exist in the current image, determine that the gas stove is not in a working state.
8. A self-closing valve management system, characterized in that: The system comprises: A camera for capturing a video and / or an image containing the gas stove; Self-closing valve, used to cut off the flow of gas; A controller, connected to the self-closing valve, and used to control the self-closing valve to close; Electronic equipment.
9. The self-closing valve management system according to claim 8, characterized in that: The electronic device comprises: at least one processor; Memory; At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the self-closing valve management method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed in a computer, the computer is caused to execute the self-closing valve management method according to any one of claims 1 to 7.