Tobacco inventory updating method, computer device and computer readable storage medium
By receiving tobacco change data sent by external tobacco data monitoring terminals, the tobacco information in the target tobacco storage area is updated, and the pre-trained tobacco storage information identification model is used to generate real-time tobacco change information, which solves the problem of inefficient tobacco abnormal monitoring in the prior art and achieves efficient and accurate tobacco inventory monitoring.
Patent Information
- Application Number
- CN202411961027.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-30
AI Technical Summary
In the prior art, the efficiency of monitoring tobacco abnormalities through manual verification is inefficient, and the tobacco sales data of each tobacco retail terminal cannot be obtained in real time, which is not conducive to tobacco companies to check the abnormalities of tobacco inventory through horizontal comparison of tobacco retail terminals in the area.
A tobacco inventory update method is proposed, and to update the tobacco information in the target tobacco storage area by receiving tobacco change data sent by external tobacco data monitoring terminals. The method includes acquiring real-time and historical tobacco storage area images, inputting these images into a pre-trained tobacco storage information identification model, generating tobacco storage identification information, and using the tobacco category table to determine real-time and historical tobacco category information, and finally generating real-time tobacco change information.
It realizes efficiently generating real-time tobacco change information in the target tobacco storage area, accurately monitoring the tobacco treatment process, and improves the efficiency and accuracy of tobacco inventory monitoring.
Smart Images

Figure CN119399475B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of tobacco inventory updating, and in particular to a tobacco inventory updating method, a computer device, and a computer-readable storage medium. Background Art
[0002] Tobacco sales companies have a tobacco certificate rating for each local retail terminal, and retail terminals purchase and sell cigarettes according to different levels of tobacco certificates. Moreover, cigarettes can only be uniformly distributed to retail terminals by local tobacco sales companies. Individuals and organizations cannot purchase and sell across regions, so tobacco sales companies have strict management of cigarette purchase and sales. At present, there are many types of tobacco in tobacco storage warehouses. Different types of tobacco have different values. In the actual tobacco in and out of the warehouse, it is easy to have abnormal situations such as wrong entry, errors and mismatches with tobacco shipping orders. For the monitoring of tobacco abnormalities, the usual method is to monitor tobacco abnormalities in the outbound or inbound warehouse through manual verification.
[0003] However, when the above method is used to monitor tobacco anomalies, the following technical problems often occur: the manual verification method is inefficient for monitoring tobacco anomalies, and it is impossible to obtain tobacco sales data from each tobacco retail terminal in real time, which is not conducive to tobacco companies to detect abnormal conditions in tobacco inventory through horizontal comparison of tobacco retail terminals in the area. Summary of the invention
[0004] The content of this application is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this application is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.
[0005] Some embodiments of the present application propose a tobacco inventory update method, a computer device, and a computer-readable storage medium to solve one or more of the technical problems mentioned in the above background technology section.
[0006] In a first aspect, some embodiments of the present application provide a tobacco inventory updating method, the method comprising: in response to receiving at least one tobacco change data sent by an external tobacco data monitoring terminal, performing the following updating steps on the tobacco information of the associated target tobacco storage area: obtaining a real-time tobacco storage area image and a historical tobacco storage area image corresponding to the above-mentioned target tobacco storage area, wherein the acquisition time corresponding to the above-mentioned historical tobacco storage area image is before the acquisition time corresponding to the above-mentioned real-time tobacco storage area image; inputting the above-mentioned real-time tobacco storage area image and the above-mentioned historical tobacco storage area image into a pre-trained tobacco storage information recognition model respectively to obtain tobacco storage recognition information, wherein the above-mentioned tobacco storage recognition information comprises: real-time tobacco storage area image segmentation information, real-time tobacco storage area image appearance type, historical tobacco storage area image segmentation information, grass storage area image segmentation information and historical tobacco storage area image appearance type; using the tobacco category table for the above-mentioned target tobacco storage area, determine the real-time tobacco category information corresponding to the above-mentioned real-time tobacco storage area image appearance type and the historical tobacco category information corresponding to the above-mentioned historical tobacco storage area image appearance type, wherein the above-mentioned tobacco category table represents the correspondence between appearance type and tobacco category; according to the above-mentioned real-time tobacco storage area image segmentation information, the above-mentioned historical tobacco storage area image segmentation information, the above-mentioned real-time tobacco category information and the above-mentioned historical tobacco category information, generate real-time tobacco change information of the above-mentioned target tobacco storage area; in response to determining that the above-mentioned real-time tobacco change information is inconsistent with the above-mentioned at least one tobacco change data, send tobacco data abnormality information to the associated tobacco update monitoring terminal and the above-mentioned external tobacco data monitoring terminal.
[0007] In a second aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the method described in any implementation of the first aspect is implemented.
[0008] In a third aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the method described in any implementation of the first aspect is implemented.
[0009] The above-mentioned embodiments of the present application have the following beneficial effects: through the tobacco inventory update method of some embodiments of the present application, real-time tobacco changes in the target tobacco storage area can be efficiently generated to achieve accurate monitoring during tobacco processing. First, in response to receiving at least one tobacco change data sent by an external tobacco data monitoring terminal, the tobacco information of the associated target tobacco storage area is updated as follows: the real-time tobacco storage area image and the historical tobacco storage area image corresponding to the above-mentioned target tobacco storage area are obtained. Wherein, the acquisition time corresponding to the above-mentioned historical tobacco storage area image is before the acquisition time corresponding to the above-mentioned real-time tobacco storage area image. Thus, the real-time tobacco storage area image and the historical tobacco storage area image with a predetermined time interval are used to facilitate the subsequent determination of the changes between the goods. Secondly, the real-time tobacco storage area image and the historical tobacco storage area image are respectively input into the pre-trained tobacco storage information recognition model to obtain tobacco storage recognition information. Wherein, the above-mentioned tobacco storage recognition information includes: real-time tobacco storage area image segmentation information, real-time tobacco storage area image appearance type, historical tobacco storage area image segmentation information and historical tobacco storage area image appearance type. Thus, for different types of tobacco, by determining the corresponding appearance type and tobacco segmentation information, it is easier to determine the tobacco under the corresponding type, and it is more convenient to determine the change of tobacco in the subsequent process. Then, using the tobacco category table for the target tobacco storage area, determine the real-time tobacco category information corresponding to the image appearance type of the real-time tobacco storage area and the historical tobacco category information corresponding to the image appearance type of the historical tobacco storage area. Among them, the tobacco category table represents the corresponding relationship between the appearance type and the tobacco category. Thus, through the pre-maintained tobacco category table, the effective conversion between the appearance type and the tobacco category can be achieved to determine the tobacco information under each category. Furthermore, in the case of tobacco comparison between the real-time tobacco category information and the historical tobacco category information, the real-time tobacco change information for the target tobacco storage area can be accurately generated. Then, according to the real-time tobacco storage area image segmentation information, the historical tobacco storage area image segmentation information, the real-time tobacco category information and the historical tobacco category information, the real-time tobacco change information of the target tobacco storage area is generated. Finally, in response to determining that the real-time tobacco change information is inconsistent with the at least one tobacco change data, send tobacco data abnormal information to the associated tobacco update monitoring terminal and the external tobacco data monitoring terminal. Therefore, through the tobacco storage information recognition model, the appearance type and tobacco segmentation information of the tobacco before and after the change can be accurately generated. Through the category conversion between the tobacco category tables, the changes between the tobacco category information corresponding to the appearance type before and after the tobacco change can be accurately determined. Based on this, real-time tobacco change information can be accurately generated to achieve accurate monitoring during tobacco processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0011] Figure 1 is a flow chart of some embodiments of the tobacco inventory updating method according to the present application;
[0012] Figure 2 is a schematic diagram of a computer device suitable for implementing some embodiments of the present application;
[0013] Figure 3 It is a model structure diagram of the tobacco storage information identification model in the tobacco inventory update method of the present application. DETAILED DESCRIPTION
[0014] Embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.
[0015] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other.
[0016] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0017] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0018] The names of the messages or information exchanged between multiple devices in the embodiments of the present application are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0019] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments.
[0020] Figure 1The process 100 of some embodiments of the tobacco inventory updating method according to the present application is shown. The tobacco inventory updating method comprises the following steps:
[0021] Step 101, in response to receiving at least one tobacco change data sent by an external tobacco data monitoring terminal, performing the following update steps on the tobacco information of the associated target tobacco storage area:
[0022] Step 1011, obtaining a real-time tobacco storage area image and a historical tobacco storage area image corresponding to the target tobacco storage area.
[0023] In some embodiments, the execution subject (e.g., computing device) of the tobacco inventory update method may obtain a real-time tobacco storage area image and a historical tobacco storage area image corresponding to the target tobacco storage area. The acquisition time corresponding to the historical tobacco storage area image is before the acquisition time corresponding to the real-time tobacco storage area image. The target tobacco storage area may be an area to be monitored for tobacco renewal processing. The target tobacco storage area may be a tobacco cabinet or a storage warehouse at a tobacco retail end. Here, the tobacco renewal processing may be: tobacco storage processing, tobacco storage processing. The target tobacco storage area may store multiple types of tobacco. In addition, the target tobacco storage area may store at least one tobacco with different appearance types and the same tobacco. The appearance type may be the appearance packaging type of the goods. For example, the appearance type may be: white plastic appearance, black plastic appearance, yellow paper shell packaging. The real-time tobacco storage area image may be an image of tobacco photographed in the target tobacco storage area at the current time. The historical tobacco storage area image may be an image of the target tobacco storage area photographed at a historical time. The corresponding shooting time of the historical tobacco storage area image is a predetermined time length before the corresponding shooting time of the real-time tobacco storage area image. For example, the predetermined time length may be 10 minutes. In actual scenarios, the real-time tobacco storage area image and the historical tobacco storage area image may be tobacco storage area images with a time difference between the previous and the next shots taken by the same camera device in the target tobacco storage area. The external tobacco data monitoring terminal may refer to the tobacco total background monitoring terminal (for example, the tobacco supply end of each tobacco retail end supplied by the region). At least one tobacco change data may refer to tobacco change data of each category of tobacco corresponding to the target tobacco storage area. The tobacco change data may indicate the purchase information of a certain category of tobacco. Tobacco information may refer to the inventory information of each tobacco in the target tobacco storage area.
[0024] Step 1012: input the real-time tobacco storage area image and the historical tobacco storage area image into a pre-trained tobacco storage information recognition model to obtain tobacco storage recognition information.
[0025] In some embodiments, the execution subject may input the real-time tobacco storage area image and the historical tobacco storage area image into a pre-trained tobacco storage information recognition model to obtain tobacco storage recognition information. The tobacco storage recognition information includes: real-time tobacco storage area image segmentation information, real-time tobacco storage area image appearance type, historical tobacco storage area image segmentation information and historical tobacco storage area image appearance type. The tobacco storage information recognition model may be a neural network model that generates tobacco storage area image segmentation information and the appearance type of tobacco in the image. For example, the tobacco storage information recognition model may be a YOLO v8 model or a model such as AlexNet, VGG, GoogLeNet, ResNet, Inception series, DenseNet, MobileNet, etc. The real-time tobacco storage area image segmentation information and the real-time tobacco storage area image appearance type are model output results corresponding to the real-time tobacco storage area image. The historical tobacco storage area image segmentation information and the historical tobacco storage area image appearance type are model output results corresponding to the historical tobacco storage area image. The real-time tobacco storage area image segmentation information may be the segmentation result after tobacco storage area image segmentation is performed on the real-time tobacco storage area image. The historical tobacco storage area image segmentation information may be a segmentation result of the historical tobacco storage area image after tobacco storage area image segmentation. The real-time tobacco storage area image appearance type may be an actual appearance type corresponding to each tobacco in the real-time tobacco storage area image. The historical tobacco storage area image appearance type may represent the appearance type corresponding to each tobacco in the historical tobacco storage area image. Figure 3 As shown, the tobacco storage information recognition model includes: a tobacco feature extraction layer, a tobacco feature dimension change layer, a multi-scale head layer, an attention layer, a segmentation layer and an appearance type recognition layer.
[0026] In an actual application scenario, the execution subject may input the real-time tobacco storage area image and the historical tobacco storage area image into a pre-trained tobacco storage information recognition model to obtain tobacco storage recognition information through the following steps:
[0027] In the first step, the real-time tobacco storage area image is input into the tobacco feature extraction layer included in the tobacco storage information recognition model to obtain the real-time tobacco storage area image feature information. The tobacco feature extraction layer can be a network layer of the feature semantic content in the tobacco storage area image. For example, the tobacco feature extraction layer can be the backbone network layer in the yolov8-seg model. The real-time tobacco storage area image feature information can characterize the image feature information of tobacco in the real-time tobacco storage area image.
[0028] In the second step, the above-mentioned real-time tobacco storage area image feature information is input into the tobacco feature dimension change layer included in the above-mentioned tobacco storage information recognition model to obtain the changed real-time tobacco storage area image feature information. Among them, the tobacco feature dimension change layer can be a network layer that changes the feature dimension of the input feature information and performs feature fusion on the feature map output by the backbone network. For example, the tobacco feature dimension change layer can be the middle (Neck) network layer in the yolov8-seg model.
[0029] In the third step, the above-mentioned real-time tobacco storage area image feature information is input into the multi-scale head layer included in the above-mentioned tobacco storage information recognition model to obtain the real-time tobacco storage area image output feature information at each scale. Among them, the multi-scale head layer can be a multi-scale variable head (Head) layer. Each scale can be pre-set. By setting the multi-scale variable head layer, tobacco image features of different scales can be fused to achieve full learning of tobacco image features and produce better segmentation effect.
[0030] In the fourth step, for each of the above scales, perform the following processing steps:
[0031] 1. Input the real-time tobacco storage area image output feature information corresponding to the above scale into the attention layer included in the above tobacco storage information recognition model to obtain attention feature information. The attention layer can be a network layer based on the attention mechanism to ensure that each decoupling head corresponding to the head layer has different feature emphases. For example, the feature emphases can be: classification branch emphases, box regression branch emphases, and segmentation branch emphases.
[0032] 2. Input the attention information into the segmentation layer and appearance type recognition layer included in the tobacco storage information recognition model to generate the first initial real-time tobacco storage area image segmentation information and the first initial real-time tobacco storage area image appearance type. The segmentation layer can be a network layer for tobacco segmentation. The appearance type recognition layer can be an output layer for identifying tobacco categories.
[0033] The fifth step is to generate the real-time tobacco storage area image segmentation information and the real-time tobacco storage area image appearance type according to the obtained first initial real-time tobacco storage area image segmentation information and the first initial real-time tobacco storage area image appearance type. For example, the above-mentioned execution subject can take the union of the first initial real-time tobacco storage area image segmentation information to generate the real-time tobacco storage area image segmentation information. The above-mentioned execution subject can filter out the initial appearance type with the largest number of corresponding occurrences from the first initial real-time tobacco storage area image appearance types as the real-time tobacco storage area image appearance type.
[0034] Therefore, during the training of the tobacco storage information recognition model, a box regression layer will be added after the attention layer to decouple the multi-scale head layer and obtain outputs under more tobacco categories to improve the accuracy of the tobacco storage information recognition model.
[0035] The sixth step is to input the above historical tobacco storage area image into the tobacco feature extraction layer included in the above tobacco storage information recognition model to obtain the historical tobacco storage area image feature information.
[0036] The seventh step is to input the above historical tobacco storage area image feature information into the tobacco feature dimension change layer included in the above tobacco storage information recognition model to obtain the changed historical tobacco storage area image feature information.
[0037] In the eighth step, the image feature information of the tobacco storage area with the above-mentioned change history is input into the multi-scale head layer included in the tobacco storage information recognition model, so as to obtain the output feature information of the image of the tobacco storage area with the above-mentioned change history at each scale.
[0038] In the ninth step, for each of the above scales, perform the following processing steps:
[0039] 1. Input the historical tobacco storage area image output feature information corresponding to the above scale into the attention layer included in the above tobacco storage information recognition model to obtain historical attention feature information.
[0040] 2. Input the above historical attention information into the segmentation layer and appearance type recognition layer included in the above tobacco storage information recognition model to generate the first initial historical tobacco storage area image segmentation information and the first initial historical tobacco storage area image appearance type.
[0041] The tenth step is to generate historical tobacco storage area image segmentation information and historical tobacco storage area image appearance types according to the obtained first initial historical tobacco storage area image segmentation information and first initial historical tobacco storage area image appearance types.
[0042] Here, the implementation methods of steps 6 to 10 can refer to the implementation methods of steps 1 to 5.
[0043] Furthermore, the tobacco storage information recognition model can be trained through the following steps:
[0044] The first step is to obtain a sample set of tobacco storage area images. The tobacco storage area image samples include: sample real-time tobacco storage area images, sample historical tobacco storage area images and sample labels. The sample labels can represent tobacco change information between the sample real-time tobacco storage area images and the sample historical tobacco storage area images.
[0045] The second step is to determine the initial tobacco storage information recognition model, which includes: initial tobacco feature extraction layer, initial tobacco feature dimension change layer, initial multi-scale head layer, initial attention layer, initial segmentation layer and initial appearance type recognition layer.
[0046] The third step is to select a tobacco storage area image sample from the above tobacco storage area image sample set as the target tobacco storage area image sample.
[0047] Step 4: Based on the target tobacco storage area image sample, perform the following training steps:
[0048] In the first training step, the sample tobacco storage area image and the sample historical tobacco storage area image included in the target tobacco storage area image sample are input into the initial tobacco feature extraction layer included in the initial tobacco storage information recognition model to obtain the initial real-time tobacco storage area image feature information and the initial historical tobacco storage area image feature information.
[0049] In the second training step, the above-mentioned initial tobacco storage area image feature information and the initial historical tobacco storage area image feature information are input into the above-mentioned initial tobacco feature dimension change layer to obtain the initial real-time change tobacco storage area image feature information and the initial historical change tobacco storage area image feature information.
[0050] In the third training step, the above-mentioned initial change tobacco storage area image feature information and the initial historical change tobacco storage area image feature information are input into the above-mentioned initial multi-scale head layer to obtain the initial real-time tobacco image output feature information and the initial historical tobacco image output feature information at each scale.
[0051] In the fourth training step, for each of the above scales, the following processing steps are performed:
[0052] 1. Input the initial real-time tobacco image output feature information and the initial historical tobacco image output feature information corresponding to the above scale into the above initial attention layer to obtain the initial real-time attention feature information and the initial historical attention feature information.
[0053] 2. Input the above attention information and the initial historical attention feature information into the initial segmentation layer and the initial appearance type recognition layer respectively to generate initial real-time tobacco storage area image segmentation information and initial real-time tobacco storage area image appearance type, initial historical tobacco storage area image segmentation information and initial historical tobacco storage area image appearance type.
[0054] The fifth training step is to generate initial real-time tobacco storage identification information based on the obtained initial real-time tobacco storage area image segmentation information and the initial real-time tobacco storage area image appearance type; and to generate initial historical tobacco storage identification information based on the obtained initial historical tobacco storage area image segmentation information and the initial historical tobacco storage area image appearance type.
[0055] The sixth training step is to determine the sample tobacco change information according to the initial real-time tobacco storage identification information and the initial historical tobacco storage identification information.
[0056] The sixth training step is to determine the content loss value between the above sample tobacco change information and the corresponding sample label.
[0057] A seventh training step, in response to determining that the content loss value is less than or equal to a preset loss value, determines the initial tobacco storage information recognition model as a trained tobacco storage information recognition model.
[0058] Therefore, during the training of the tobacco storage information recognition model, after the attention layer, a box regression layer is added during the training process to decouple the multi-scale head layer and obtain outputs of more types to improve the accuracy of the tobacco storage information recognition model. In addition, the tobacco storage area image sample set during the training process can be annotated using the labelme tool.
[0059] Step 1013, using the tobacco category table for the target tobacco storage area, determine the real-time tobacco category information corresponding to the real-time tobacco storage area image appearance type and the historical tobacco category information corresponding to the historical tobacco storage area image appearance type.
[0060] In some embodiments, the execution subject may determine the real-time tobacco category information corresponding to the appearance type of the real-time tobacco storage area image and the historical tobacco category information corresponding to the appearance type of the historical tobacco storage area image using the tobacco category table for the target tobacco storage area. The tobacco category table represents the corresponding relationship between the appearance type and the tobacco category. The tobacco category table is an association table preset for the target tobacco storage area. The real-time tobacco category information may represent the tobacco category corresponding to each tobacco in the real-time tobacco storage area image. The historical tobacco category information may represent the tobacco category corresponding to each tobacco in the historical tobacco storage area image.
[0061] For example, a table of tobacco categories might include the following:
[0062] [“White square box” <-> “A Tobacco”, “Yellow square box” <-> “B Tobacco”, “White round box” <-> “C Tobacco”].
[0063] Step 1014, generating real-time tobacco change information of the target tobacco storage area according to the real-time tobacco storage area image segmentation information, the historical tobacco storage area image segmentation information, the real-time tobacco category information and the historical tobacco category information.
[0064] In some embodiments, the execution subject may generate the real-time tobacco change information of the target tobacco storage area based on the real-time tobacco storage area image segmentation information, the historical tobacco storage area image segmentation information, the real-time tobacco category information, and the historical tobacco category information. The real-time tobacco change information may be the tobacco change situation of each tobacco in the target tobacco storage area within a predetermined time period. For example, the real-time tobacco change information may be the tobacco processing quantity change information of each tobacco in the area. For the tobacco cabinet scenario, the tobacco processing quantity may refer to the quantity increase information of each tobacco in the tobacco cabinet.
[0065] In an actual application scenario, the execution subject can generate the real-time tobacco change information of the target tobacco storage area through the following steps:
[0066] The first step is to generate a real-time tobacco category mask matrix based on the real-time tobacco storage area image segmentation information and the real-time tobacco category information. The real-time tobacco storage area image segmentation information includes: at least one real-time tobacco segmentation contour, and the real-time tobacco category information includes: at least one real-time tobacco category corresponding to at least one real-time tobacco segmentation contour. The real-time tobacco segmentation contour can be the contour information of the corresponding tobacco segmentation in the real-time tobacco storage area image. Each real-time tobacco segmentation contour in the at least one real-time tobacco segmentation contour has an independently placed storage area. One real-time tobacco segmentation contour corresponds to one real-time tobacco category.
[0067] The first step may include:
[0068] First, for each of the at least one real-time tobacco segmentation contours, according to the real-time tobacco category corresponding to the real-time tobacco segmentation contour, fill the contour content corresponding to the real-time tobacco segmentation contour with the value corresponding to the real-time tobacco category. Each real-time tobacco category has a corresponding value, and the value here can represent tobacco category information. For example, the value can be a tobacco category identifier.
[0069] Second, a real-time tobacco category mask matrix is generated based on at least one filled real-time tobacco segmentation contour obtained. The numerical values in the real-time tobacco category mask matrix represent the area corresponding to the real-time tobacco category. The numerical value of the non-tobacco area in the real-time tobacco category mask matrix is the numerical value 0. For example, the above-mentioned execution subject can set the corresponding blank matrix according to the image matrix corresponding to the real-time tobacco storage area image. Then, according to the contour content value and contour position corresponding to at least one filled tobacco segmentation contour, the corresponding numerical value is filled in the blank matrix to generate a real-time tobacco category mask matrix. The numerical value of the non-tobacco area in the real-time tobacco category mask matrix is the numerical value 0.
[0070] The second step is to generate a historical tobacco category mask matrix based on the historical tobacco storage area image segmentation information and the historical tobacco category information. The historical tobacco storage area image segmentation information includes: at least one historical tobacco segmentation contour, and the historical tobacco category information includes: at least one historical tobacco category corresponding to at least one historical tobacco segmentation contour. For specific implementation methods, please refer to the generation of real-time tobacco category mask matrix.
[0071] The second step may include:
[0072] First, for each historical tobacco segmentation contour in the at least one historical tobacco segmentation contour, according to the historical tobacco category corresponding to the historical tobacco segmentation contour, fill the contour content corresponding to the historical tobacco segmentation contour with the value corresponding to the historical tobacco category.
[0073] Second, a historical tobacco category mask matrix is generated based on the obtained at least one filled historical tobacco segmentation contour, wherein the values in the historical tobacco category mask matrix represent the areas corresponding to the historical tobacco categories.
[0074] The third step is to generate mask change information between the real-time tobacco category mask matrix and the historical tobacco category mask matrix, wherein the mask change information may represent element changes between the real-time tobacco category mask matrix and the historical tobacco category mask matrix.
[0075] The third step may include:
[0076] First, the elements in the real-time tobacco category mask matrix and the elements in the historical tobacco category mask matrix are subjected to corresponding XOR processing to generate an XOR matrix. The same elements in the real-time tobacco category mask matrix and the historical tobacco category mask matrix are set to 0, and the different elements are set to the corresponding values of the non-0 area in the mask matrix.
[0077] Second, at least one value region in the XOR matrix is determined as mask change information. The value region may be a non-zero region.
[0078] The fourth step is to generate real-time tobacco change information for each tobacco category based on the above mask change information. For example, first, the mask area corresponding to the mask change information is intercepted. Then, the sum of pixels of the real-time tobacco storage area image in the mask area is determined to obtain the sum of pixels of the tobacco storage area image. Next, the pixel synthesis of the historical tobacco storage area image in the mask area is determined to obtain the sum of pixels of the historical tobacco storage area image. According to the numerical difference between the sum of pixels of the above tobacco storage area image and the sum of pixels of the above historical tobacco storage area image, the corresponding tobacco change amount is matched as the real-time tobacco change information.
[0079] The fourth step may include:
[0080] First, for each value region in the at least one value region, perform the following processing steps:
[0081] 1. In response to determining that the above-mentioned numerical range belongs to the above-mentioned real-time tobacco category mask matrix, determine the real-time tobacco category corresponding to the target numerical value as the target real-time tobacco category. The above-mentioned target numerical value is a numerical value within the above-mentioned numerical range. The numerical range belongs to the real-time tobacco category mask matrix, and the sub-region in the real-time tobacco category mask matrix at the corresponding position of the numerical range is consistent with the numerical range.
[0082] 2. Generate tobacco change information representing an increase in tobacco under the above-mentioned target real-time tobacco category.
[0083] 3. In response to determining that the numerical value region belongs to the historical tobacco category mask matrix, determine the historical tobacco category corresponding to the target numerical value as the target historical tobacco category. The numerical value region belonging to the historical tobacco category mask matrix may be that the sub-region in the historical tobacco category mask matrix at the corresponding position of the numerical value region is consistent with the numerical value region.
[0084] 4. Generate tobacco change information representing tobacco reduction under the above-mentioned target historical tobacco categories.
[0085] Second, based on the obtained at least one tobacco change information, real-time tobacco change information is generated. For example, the at least one tobacco change information can be combined into real-time goods change information.
[0086] Thus, by generating the real-time tobacco category mask matrix and the historical tobacco category mask matrix, the goods situation in the real-time tobacco storage area image and the historical tobacco storage area image can be more explicitly displayed. In addition, it is also convenient to compare the tobacco information in the two images to quickly and accurately determine the real-time tobacco change information.
[0087] Step 102: in response to determining that the real-time tobacco change information is inconsistent with the at least one tobacco change data, sending tobacco data abnormality information to the associated tobacco update monitoring terminal and the external tobacco data monitoring terminal.
[0088] In some embodiments, the execution subject may send tobacco data abnormality information to the associated tobacco update monitoring terminal and the external tobacco data monitoring terminal in response to determining that the real-time tobacco change information is inconsistent with the at least one tobacco change data. For example, the real-time tobacco change information may indicate that A tobacco increases by 10 boxes / cartons; B tobacco increases by 8 boxes / cartons. At least one tobacco change data may refer to the change data of each tobacco that should be updated in the target tobacco storage area. For example, at least one tobacco change data may be: A tobacco increases by 9 boxes / cartons; B tobacco increases by 8 boxes / cartons. Tobacco data abnormality information may indicate that the real-time tobacco change information is inconsistent with at least one tobacco change data. The tobacco update monitoring terminal may refer to the tobacco data monitoring terminal of the target tobacco storage area.
[0089] Figure 2 A schematic block diagram of the structure of a computer device provided in an embodiment of the present disclosure. The computer device may be a terminal.
[0090] like Figure 2 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0091] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any tobacco inventory update method.
[0092] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0093] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any tobacco inventory update method.
[0094] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0095] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0096] In one embodiment, the processor is used to run a computer program stored in a memory to implement the following steps: in response to receiving at least one tobacco change data sent by an external tobacco data monitoring terminal, the following update steps are performed on the tobacco information of the associated target tobacco storage area: a real-time tobacco storage area image and a historical tobacco storage area image corresponding to the target tobacco storage area are obtained, wherein the acquisition time corresponding to the historical tobacco storage area image is before the acquisition time corresponding to the real-time tobacco storage area image; the real-time tobacco storage area image and the historical tobacco storage area image are respectively input into a pre-trained tobacco storage information recognition model to obtain tobacco storage recognition information, wherein the tobacco storage recognition information includes: real-time tobacco storage area image segmentation information, real-time tobacco storage area image appearance type , historical tobacco storage area image segmentation information and historical tobacco storage area image appearance type; using the tobacco category table for the above-mentioned target tobacco storage area, determine the real-time tobacco category information corresponding to the above-mentioned real-time tobacco storage area image appearance type and the historical tobacco category information corresponding to the above-mentioned historical tobacco storage area image appearance type, wherein the above-mentioned tobacco category table represents the correspondence between the appearance type and the tobacco category; generate the real-time tobacco change information of the above-mentioned target tobacco storage area according to the above-mentioned real-time tobacco storage area image segmentation information, the above-mentioned historical tobacco storage area image segmentation information, the above-mentioned real-time tobacco category information and the above-mentioned historical tobacco category information; in response to determining that the above-mentioned real-time tobacco change information is inconsistent with the above-mentioned at least one tobacco change data, send tobacco data abnormality information to the associated tobacco update monitoring terminal and the above-mentioned external tobacco data monitoring terminal.
[0097] The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the tobacco inventory updating method of the present disclosure.
[0098] The computer-readable storage medium may be an internal storage unit of the computer device in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., provided on the computer device.
[0099] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0100] The serial numbers of the embodiments of the present disclosure are only for description and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present disclosure, and these modifications or replacements should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A tobacco inventory updating method, comprising: In response to receiving at least one tobacco change data sent by the external tobacco data monitoring terminal, the following update steps are performed on the tobacco information of the associated target tobacco storage area: Acquire a real-time tobacco storage area image and a historical tobacco storage area image corresponding to the target tobacco storage area, wherein the acquisition time corresponding to the historical tobacco storage area image is before the acquisition time corresponding to the real-time tobacco storage area image; Inputting the real-time tobacco storage area image into a pre-trained tobacco storage information recognition model to obtain real-time tobacco storage area image segmentation information and real-time tobacco storage area image appearance type, and inputting the historical tobacco storage area image into a tobacco storage information recognition model to obtain historical tobacco storage area image segmentation information and historical tobacco storage area image appearance type; Determine the real-time tobacco category information corresponding to the appearance type of the real-time tobacco storage area image and the historical tobacco category information corresponding to the appearance type of the historical tobacco storage area image by using the tobacco category table for the target tobacco storage area, wherein the tobacco category table represents the correspondence between the appearance type and the tobacco category; Generate real-time tobacco change information of the target tobacco storage area according to the real-time tobacco storage area image segmentation information, the historical tobacco storage area image segmentation information, the real-time tobacco category information and the historical tobacco category information; In response to determining that the real-time tobacco change information is inconsistent with the at least one tobacco change data, sending tobacco data abnormality information to the associated tobacco update monitoring terminal and the external tobacco data monitoring terminal; The step of generating the real-time tobacco change information of the target tobacco storage area according to the real-time tobacco storage area image segmentation information, the historical tobacco storage area image segmentation information, the real-time tobacco category information and the historical tobacco category information comprises: Generate a real-time tobacco category mask matrix according to the real-time tobacco storage area image segmentation information and the real-time tobacco category information, wherein the real-time tobacco storage area image segmentation information includes: at least one real-time tobacco segmentation contour, and the real-time tobacco category information includes: at least one real-time tobacco category corresponding to the at least one real-time tobacco segmentation contour; Generate a historical tobacco category mask matrix according to the historical tobacco storage area image segmentation information and the historical tobacco category information, wherein the historical tobacco storage area image segmentation information includes: at least one historical tobacco segmentation contour, and the historical tobacco category information includes: at least one historical tobacco category corresponding to the at least one historical tobacco segmentation contour; Generating mask change information between the real-time tobacco category mask matrix and the historical tobacco category mask matrix; According to the mask change information, real-time tobacco change information for each tobacco category is generated.
2. The tobacco inventory updating method according to claim 1, characterized in that: The step of generating a real-time tobacco category mask matrix according to the real-time tobacco storage area image segmentation information and the real-time tobacco category information comprises: For each real-time tobacco segmentation contour of the at least one real-time tobacco segmentation contour, according to the real-time tobacco category corresponding to the real-time tobacco segmentation contour, filling the contour content corresponding to the real-time tobacco segmentation contour with a value corresponding to the real-time tobacco category; A real-time tobacco category mask matrix is generated according to the obtained at least one filled real-time tobacco segmentation contour, wherein the values in the real-time tobacco category mask matrix represent the area corresponding to the real-time tobacco category.
3. The tobacco inventory updating method according to claim 1, characterized in that: The step of generating a historical tobacco category mask matrix according to the historical tobacco storage area image segmentation information and the historical tobacco category information comprises: For each historical tobacco segmentation contour of the at least one historical tobacco segmentation contour, according to the historical tobacco category corresponding to the historical tobacco segmentation contour, filling the contour content corresponding to the historical tobacco segmentation contour with a value corresponding to the historical tobacco category; A historical tobacco category mask matrix is generated according to the obtained at least one filled historical tobacco segmentation contour, wherein the values in the historical tobacco category mask matrix represent the areas corresponding to the historical tobacco categories.
4. The tobacco inventory updating method according to claim 1, characterized in that: The generating of mask change information between the real-time tobacco category mask matrix and the historical tobacco category mask matrix includes: Performing corresponding XOR processing on the elements in the real-time tobacco category mask matrix and the elements in the historical tobacco category mask matrix to generate an XOR matrix; At least one value region in the XOR matrix is determined as mask change information.
5. A computer device, wherein: The computer device comprises a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 4 are implemented.
6. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Aerial-image-based method for identification and counting of tobacco plants
CN106503695A
Target object detection method and device for continuous contour and storage medium
CN114049499A