Prompt rule generation method, electronic device and storage medium

By obtaining the elements in the element library of the regular prompts, the method of generating the prompt rules solves the problem of low efficiency and high compilation ability in the existing technology, and achieves more convenient and efficient rules.

CN118917406BActive Publication Date: 2025-01-24ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing technology requires manual compilation of code when generating prompt rules in different scenarios, which is inefficient and has high requirements for compilation capabilities, making it difficult to meet personalized customization requirements.

Method used

By obtaining the prompts, the element library, including the associated group mode, association relationship, and trigger conditions, combine the candidate element group, determine the target factor group, and use the target element group to fill the rules to generate templates to generate the prompt rule.

Benefits of technology

It reduces the compilation capability requirements for generating prompt rules, improves the convenience and efficiency of the generation process, and can better adapt to the personalized needs of different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118917406B_ABST
    Figure CN118917406B_ABST
Patent Text Reader

Abstract

The present application discloses a prompt rule generation method, an electronic device and a storage medium, the prompt rule generation method comprising: obtaining a prompt rule element library, the prompt rule element library including several association group patterns, several association relationships and several trigger conditions, wherein each association group pattern, each association relationship and each trigger condition can be used to arrange and combine to obtain several groups of candidate element groups, each group of candidate element groups including an association group pattern, at least one association relationship and at least one trigger condition; based on at least one group of candidate element groups among the several groups of candidate element groups, determining a target element group; using the target element group to fill in a rule generation template to obtain a prompt rule, the prompt rule can be used to determine whether a prompt is required for the processing result of the target model on the image. The above scheme can improve the convenience of prompt rule generation in multiple scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a prompt rule generation method, an electronic device, and a storage medium. Background Art

[0002] The demand for industrial upgrading in the direction of digitalization and intelligence is growing in all walks of life. At the same time, with the popularization of intelligent solutions, customers' intelligent demands are showing a trend of being small but numerous, and personalized customization demands are accounting for an increasing proportion.

[0003] The intelligent solution is a dynamic library composed of a series of functional operators and business operators according to certain dependencies, which are then compiled and packaged, also known as SDK. Functional operators include input operators and output operators, and business operators include target detection, target recognition, target tracking, prompting and other operators. They form a data flow according to certain dependencies.

[0004] The requirements for prompt rules may be different in different scenarios. Each prompt rule generation requires manual code compilation, which has high requirements on compilation capabilities and low efficiency of manual code compilation. How to improve the convenience of generating prompt rules in different scenarios is an urgent problem to be solved. Summary of the invention

[0005] The present application at least provides a prompt rule generation method, an electronic device and a storage medium.

[0006] The present application provides a prompt rule generation method, including: obtaining a prompt rule element library, the prompt rule element library includes several associated group patterns, several associated relationships and several trigger conditions, wherein each associated group pattern, each associated relationship and each trigger condition can be used to arrange and combine to obtain several groups of candidate element groups, each group of candidate element groups includes an associated group pattern, at least one associated relationship and at least one trigger condition; based on at least one group of candidate element groups among the several groups of candidate element groups, determining a target element group; using the target element group to fill in a rule generation template to obtain a prompt rule, which can be used to determine whether a processing result of an image by a target model needs to be prompted.

[0007] The present application provides a prompt rule generation device, including: an element acquisition module, an element determination module and a rule generation module; the element acquisition module is used to obtain a prompt rule element library, the prompt rule element library includes several associated group patterns, several associated relationships and several trigger conditions, wherein each associated group pattern, each associated relationship and each trigger condition can be used to arrange and combine to obtain several groups of candidate element groups, each group of candidate element groups includes an associated group pattern, at least one associated relationship and at least one trigger condition; the element determination module is used to determine a target element group based on at least one group of candidate element groups among the several groups of candidate element groups; the rule generation module is used to fill a rule generation template with the target element group to obtain a prompt rule, and the prompt rule can be used to determine whether a prompt is required for the processing result of the target model on the image.

[0008] The present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned prompt rule generation method.

[0009] The present application provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, the above-mentioned prompt rule generation method is implemented.

[0010] The above scheme, by setting several associated group patterns, several associated relationships and several trigger conditions in the prompt rule element library, enables each associated group pattern, associated relationship and trigger condition to be combined to obtain a plurality of candidate element groups, so that the corresponding candidate element group can be selected according to the generation requirements of the corresponding prompt rule, and the target element group is determined by using the selected candidate element group, and the rule generation template is filled with the target element group to obtain the prompt rule. Compared with the manual compilation of code, this scheme has lower requirements on compilation capabilities and the generation of prompt rules is more convenient.

[0011] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0013] Figure 1 It is a flowchart of an embodiment of a method for generating prompt rules of the present application;

[0014] Figure 2 This is another flowchart of an embodiment of the method for generating prompt rules of the present application;

[0015] Figure 3 This is a schematic diagram of the image processing result shown in an embodiment of the prompt rule generation method of the present application. Figure 1 ;

[0016] Figure 4 This is a schematic diagram of the image processing result shown in an embodiment of the prompt rule generation method of the present application. Figure 2 ;

[0017] Figure 5 This is a schematic diagram of the image processing result shown in an embodiment of the prompt rule generation method of the present application. Figure 3 ;

[0018] Figure 6 This is a schematic diagram of the image processing result shown in an embodiment of the prompt rule generation method of the present application. Figure 4 ;

[0019] Figure 7 This is a schematic diagram of the image processing result shown in an embodiment of the prompt rule generation method of the present application. Figure 5 ;

[0020] Figure 8 yes Figure 1 Schematic diagram of the sub-process of step S13;

[0021] Fig. 9 It is a structural diagram of an embodiment of a prompt rule generating device of the present application;

[0022] Fig.10 It is a structural schematic diagram of an embodiment of the electronic device of the present application;

[0023] Fig.11 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0024] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0025] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0026] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0027] In some application scenarios, the prompt rule generation method provided by the present application can be applied to the computer field, etc. The execution subject for implementing the prompt rule generation method described in the present application can be a prompt rule generation device, an electronic device, etc. For example, the prompt rule generation device can be set in a terminal device or a server or other processing device, wherein the terminal device can be an audio device, an electronic device, a device (User Equipment, UE), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the prompt rule generation method can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0028] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the method for generating prompt rules of the present application. Figure 1 As shown, the prompt rule generation method provided by the embodiment of the present disclosure may include the following steps:

[0029] Step S11: Acquire the prompt rule element library.

[0030] The prompt rule element library includes several associated group patterns, several associated relationships and several trigger conditions, wherein each associated group pattern, each associated relationship and each trigger condition can be used to arrange and combine to obtain several groups of candidate element groups, each group of candidate element groups includes an associated group pattern, at least one associated relationship and at least one trigger condition.

[0031] The association group mode can be used to indicate the triggering condition of the association relationship between the master target and the slave target required for issuing a prompt. The association relationship can be an aspect that needs to be paid attention to between the master target and the slave target. Exemplarily, the aspects that need to be paid attention to between the master target and the slave target include but are not limited to the position relationship, quantity relationship and / or area size relationship between the master target and the slave target. The triggering condition may include the requirements for each association relationship to cause a prompt, such as a close position relationship, a large area difference, etc.

[0032] The form of the prompt rule element library includes but is not limited to databases, text files, and lists. Exemplarily, the association group pattern can correspond to a list of available patterns, the association relationship can correspond to a list of available relationships, and the trigger condition can correspond to a list of conditions. In some application scenarios, each association relationship in the relationship list may have a corresponding list of conditions, that is, different association relationships may correspond to different trigger conditions. The prompt rule element library is set in advance, and the method of obtaining the prompt rule element library includes calling the prompt rule element library each time it is used. Each association group pattern, association relationship, and trigger condition in the prompt rule element library can be added, modified, or deleted. For example, as the scene diversifies, the prompt rule element library can no longer meet the needs, and new association group patterns, association relationships, and / or trigger conditions can be added to the prompt rule element library.

[0033] Step S12: Determine a target element group based on at least one candidate element group among the plurality of candidate element groups.

[0034] In some application scenarios, it may be necessary to pay attention to different associations of multiple groups of target objects, so multiple groups of candidate element groups may be selected to determine the target element group. For example, in a certain scenario, it is necessary to pay attention to the distance between vehicles and the overlap between vehicles and prohibited parking areas, so two groups of element groups may be selected to determine the target element group. In some application scenarios, only one association of different target objects may be observed, and a group of candidate element groups may be selected to obtain the target element group. For example, in a certain scenario, only the distance between vehicles and non-motor vehicles may be paid attention to, so only one group of candidate element groups may be selected to determine the target element group. According to the selected at least one group of candidate element groups, the method of determining the target element group may be to directly combine the selected at least one group of candidate element groups to obtain the target element group, or to further adjust the selected at least one group of candidate element groups to obtain the target element group, or to further specify the specific objects referred to by the main target and the subordinate target, for example, specify the main target as a vehicle and the subordinate target as a non-motor vehicle.

[0035] In some application scenarios, several association group modes, several association relationships, and several trigger conditions that can be selected can be displayed on the display interface of the execution device, so that at least one set of candidate element groups can be determined based on the selection of each association group mode, several association relationships, and several trigger conditions. In other embodiments, a requirement text can also be determined, and at least one set of candidate element groups can be determined by parsing the requirement text.

[0036] Step S13: Fill the rule generation template with the target element group to obtain prompt rules.

[0037] The prompt rule can be used to determine whether the processing result of the target model on the image needs to be prompted. The rule generation template can include multiple areas to be filled. The associated group pattern, association relationship and trigger condition in the target element group are filled into the corresponding area to be filled to obtain the prompt rule. The prompt rule is placed in the prompt operator in the intelligent solution to enable the prompt operator to determine whether the image processing result output by the target model needs to be prompted.

[0038] The above scheme, by setting several associated group patterns, several associated relationships and several trigger conditions in the prompt rule element library, enables each associated group pattern, associated relationship and trigger condition to be combined to obtain a plurality of candidate element groups, so that the corresponding candidate element group can be selected according to the generation requirements of the corresponding prompt rule, and the target element group is determined by using the selected candidate element group, and the rule generation template is filled with the target element group to obtain the prompt rule. Compared with the manual compilation of code, this scheme has lower requirements on compilation capabilities and the generation of prompt rules is more convenient.

[0039] As mentioned above, the prompt rule can determine whether the image processing result output by the target model needs to be prompted. In this embodiment, the target model includes but is not limited to a target detection model, a target recognition model or an event detection model. Among them, the target model can be selected according to the scene and requirements. For example, the input scene and requirements are analyzed to determine the target model to be used. Among them, the main target and the secondary target can be the target objects that can be recognized by the target model. Please refer to Figure 2 In some embodiments, the method for generating prompt rules further includes the following steps:

[0040] Step S21: parsing the target model to determine that the target model can identify enumeration values ​​of several types of target objects.

[0041] The target model may be parsed by a model analyzer. Optionally, step S21 may include the following steps: obtaining text information of the target model. Then, the text information is parsed by a text parser to obtain enumeration values ​​of the target objects of the plurality of types.

[0042] In some application scenarios, the format of the target model is converted from the ONNX model to the original Caffe model to obtain the basic information of the model, which is a json text, including information such as the algorithm version information, the color space of the preprocessing operation, the mean, the scaling parameters, and the model accuracy. Then the json text can be parsed using the json parser to obtain the enumeration values ​​of the categories of the target objects that the target model can recognize. For example, for the target model that can recognize motor vehicles and non-motor vehicles, the extracted enumeration values ​​include 65538 and 65539. For the target model that can recognize cars, light trucks, heavy trucks, and buses in motor vehicles, the enumeration values ​​parsed include 0, 1, 2, and 3. In some cases, the label of the target model is uncertain during training, so the enumeration value is used to represent it. Among them, in some scenarios, the Caffe model is encrypted, and the model can be decrypted by the decryption key and then the json text can be parsed using the json parser.

[0043] Step S22: Based on the preset enumeration table and each of the enumeration values ​​obtained by parsing, determine the type of the target object corresponding to each of the enumeration values.

[0044] Continuing with the above example, the preset enumeration table can be: 65538-motor vehicle, 65539-non-motor vehicle; 0-car, 1-light truck, 2-heavy truck, 3-bus. The enumeration values ​​obtained by parsing are passed through the preset enumeration table to obtain the real target categories corresponding to each enumeration value. Optionally, the target model includes a cascaded target detection model and a target recognition model. The target detection model can detect motor vehicles and non-motor vehicles, and the target recognition model can recognize multiple specific types of motor vehicles (such as cars, light trucks, heavy trucks and buses). Here, the target objects that can be detected by the target detection model can be called the categories of target objects, and the types of target objects that can be recognized by the target recognition model are attributes. The above-mentioned main target and slave target can be the categories of target objects that can be detected by the target detection model, or they can also be the attributes of each target object that can be recognized by the target recognition model.

[0045] In some embodiments, the above step S12 may include the following steps: determining a main target class and a sub-target class corresponding to the main target class from several types of target objects. Among them, several types of target objects may be types that can be recognized by the target model. Then, based on at least one set of candidate element groups, the main target class and the sub-target class, the target element group is determined. Exemplarily, in response to the selection instruction for the main target class, the main target class can be selected from the category of target objects that can be recognized by the target model, and in response to the selection instruction for the sub-target class, the sub-target class can be selected from the category of target objects that can be recognized by the target model. In this embodiment, several can be one or more. In some embodiments, the selected at least one set of candidate element groups only defines the aspects that need to be paid attention to between the main target and the sub-target, but it is not determined which type of target object the main target is specifically, nor which type of target object the sub-target is. By combining the main target class and the sub-target class, it is possible to determine which target object is the main target class and which target object is the sub-target class in the determined target elements.

[0046] Among them, the association relationship in the target element group includes the quantitative statistical relationship and / or relative position relationship between the main target class and the subordinate target class, the trigger condition in the target element group includes the prompt requirements of each quantitative statistical relationship and / or relative position relationship, and the association group pattern in the target element group includes the requirement that the association relationship that meets the trigger condition can trigger the prompt.

[0047] Optionally, the association group mode includes any one of the following: the association relationship between some main targets belonging to the main target class and some subordinate targets belonging to the subordinate target class meets the trigger condition; the association relationship between some main targets belonging to the main target class and all subordinate targets belonging to the subordinate target class meets the trigger condition; the association relationship between all main targets belonging to the main target class and some subordinate targets belonging to the subordinate target class meets the trigger condition; the association relationship between all main targets belonging to the main target class and all subordinate targets belonging to the subordinate target class meets the trigger condition. Among them, the part can be one or more than two, which is not specifically limited here.

[0048] As mentioned above, the prompt rule can determine whether the image processing result output by the target model needs to be prompted. Taking the target model as the processing result of a single image as an example, if the processing result includes the position of the main target and the position of the slave target marked in the image, the main target is specifically a target object belonging to the main target class, and the slave target can be specifically a target object belonging to the slave target class. For example, the main target type is a car, and the slave target class is a non-motor vehicle. If the image includes 1 car of brand A and 1 car of brand B, and the slave targets in the image include 1 bicycle and 1 electric tricycle.

[0049] Exemplarily, the association group between the master target and the slave target may include the following four action modes. It should be noted that the following four examples are only examples and are not intended to limit the scope of this application. The following association group mode is represented by population_mode:

[0050] The first type: when population_mode=0, it means that any main target and any subordinate target are associated. Continuing with the above example, the image includes two main targets and two subordinate targets. If the association between one of the main targets and any of the subordinate targets meets the trigger condition, it is determined that a prompt is required. For example, if the association between a car of brand A and a bicycle meets the trigger condition, it is determined that a prompt is required.

[0051] The second type: when population_mode=1, it means that any main target and all the subordinate targets are associated and the association is established; following the above example, the image includes two main targets and two subordinate targets. If the association between one of the main targets and all the subordinate targets meets the trigger condition, it is determined that a prompt is required. For example, the association between brand A cars and bicycles meets the trigger condition and the association between brand A and electric tricycles also meets the trigger condition, then it is determined that a prompt is required. Or, the association between brand B cars and bicycles meets the trigger condition and the association between brand B and electric tricycles also meets the trigger condition, then it is determined that a prompt is required.

[0052] The third type: when population_mode=2, it means that if all main targets and any subordinate targets are associated, the association is established; following the above example, the image includes two main targets and two subordinate targets. If the association between all main targets and any subordinate target meets the trigger condition, it is determined that a prompt is required. Optionally, when population_mode=2, it can also be determined that a prompt is required if the association between each main target and different subordinate targets meets the trigger condition. For example, if the association between brand A cars and bicycles meets the trigger condition and the association between brand B and electric tricycles also meets the trigger condition, it is determined that a prompt is required.

[0053] The fourth type: when population_mode=3, it means that all main targets and all sub-targets are associated and the association is established. For example, if the association between brand A cars and bicycles meets the trigger condition and the association between brand B and bicycles also meets the trigger condition, and the association between brand A cars and electric tricycles meets the trigger condition and the association between brand B and electric tricycles also meets the trigger condition, it is determined that a prompt is required.

[0054] Optionally, the relative position relationship includes at least one of the following: a distance relationship, an intersection relationship, and a direction relationship. The trigger condition includes at least one of the following: the distance relationship meets the distance threshold requirement, the intersection relationship meets the overlap area requirement, the direction relationship meets the direction requirement, and the quantity statistical relationship meets the quantity requirement. The distance relationship may include the distance between the center point of the main target and the center point of the slave target, the intersection relationship may include the overlap relationship between the area where the main target is located and the area where the slave target is located, the direction relationship may include the angle between the line between the center of the main target and the center of the slave target and a preset straight line in the image, and the preset straight line may be the straight line where the bottom edge of the image is located, the straight line where the side edge of the image is located, or a custom straight line in the image.

[0055] For example, in the following embodiments, the association relationship is represented by population_type. In different association relationships, different trigger thresholds can be selected and represented by alarm_value:

[0056] In some application scenarios, when population_type=0, it indicates a distance relationship, and alarm_value is the absolute value of the distance to the target center point. For example, see Figure 3 In the image processing result, there is 1 main target Q1 and 2 slave targets, namely slave target P1 and slave target P2. The associated population mode selects population_mode=0, the trigger condition is alarm_value=10, the distance between the main target Q1 and the slave target P1 is D1, and the distance between the main target Q1 and the slave target P2 is D2. The generated prompt rules include that when either D1 or D2 is greater than alarm_value, it is determined that a prompt is required.

[0057] In some application scenarios, when population_type=1, it indicates an intersection relationship, mainly the intersection-and-union ratio between targets, and alarm_value is the intersection-and-union ratio between the minimum bounding rectangles of the targets. Figure 4 As shown, the image processing result has 1 main target Q1, 2 slave targets are slave targets P1 and slave targets P2, the associated population mode selects population_mode=0, the trigger condition is alarm_value=0.5, the overlap area of ​​the main target Q1 and the slave target P1 is represented by C1, and the overlap area of ​​the main target Q1 and the slave target P2 is represented by C2. The generated prompt rules include determining that a prompt is required when any one of the main target Q1 and the slave target P1, or the main target Q1 and the slave target P2 satisfies the intersection over union ratio IoU greater than 0.5. Among them, the calculation method of the intersection over union ratio of the main target Q1 and the slave target P1 can be C1 / (Q1+P1-C1), and the calculation method of the intersection over union ratio of the main target Q1 and the slave target P2 can be C2 / (Q1+P2-C2).

[0058] In some application scenarios, when population_type=2, it indicates an inclusion relationship, which is a special case of an intersection relationship, and alarm_value=100%. Figure 5 As shown, the image processing result has 1 main target Q1, 2 slave targets are slave targets P1 and slave targets P2, and the associated population mode selects population_mode=0. The generated prompt rule can be considered as: when any one of the main target Q1 and the slave target P1, or the main target Q1 and the slave target P2 satisfies the intersection over union ratio IoU equal to 100%, it is determined that a prompt is required.

[0059] In some application scenarios, when population_type=3, it indicates a directional relationship, and alarm_value is the angle value of the relative distance. Figure 6 As shown in the figure, the image processing result has one main target Q1, two slave targets are slave target P1 and slave target P2, and the associated population mode selects population_mode=0. and Indicates an angle, used to indicate a direction relationship. The generated prompt rule can be considered as follows: when any one of the main target Q1 and the secondary target P1 or the main target Q1 and the secondary target P2 meets the angle relationship, it is determined that a prompt is required.

[0060] In some application scenarios, when population_type=4, it indicates a quantitative statistical relationship, and alarm_value is the target quantity of the statistics. Figure 7 As shown, the image processing result has 1 main target Q1, 2 slave targets are slave targets P1 and slave targets P2, the associated population mode selects population_mode=0, and the generated prompt rules may include: when any one of the main target Q1 and slave targets P1 or P2 meets the quantitative statistical relationship, it is determined that a prompt is required.

[0061] In some specific embodiments, when performing operator arrangement, the main target and the secondary target can be selected in real time, and then the corresponding association group mode and association relationship can be selected to generate the corresponding rule file. This kind of prompt rule is more flexible in generation and use, and can be adapted to more business scenarios.

[0062] For example, for a model that can identify motor vehicles and non-motor vehicles, motor vehicles can be selected as the main target and motor vehicles as the secondary target. The selected associated group mode is population_mode=0, the selected associated relationship is population_type=0, and the selected trigger condition threshold alarm_value is less than or equal to 1 meter. The information represented by this arranged rule is that when the distance relationship between any motor vehicle target and any non-motor vehicle target is less than or equal to 1 meter, it is determined that a prompt is required.

[0063] Among them, the above-mentioned associated group patterns, associated relationships and trigger conditions can generate a variety of prompt rules through permutations and combinations, which improves the complexity and diversity of the prompt rules and can adapt to more scenario requirements and business requirements.

[0064] In some embodiments, see Figure 8 , the above step S13 may include the following steps:

[0065] Step S31: Determine whether there is any change in the prompt auxiliary information.

[0066] The prompt auxiliary information may include at least one of the following: first prompt time, repeated prompt time, prompt area, filter area, target object corresponding to the prompt and category of the target object. The first prompt time may be considered as the triggering event of the first prompt, the repeated prompt event may include the triggering event of each prompt, the prompt area may include the installation position of the image acquisition component or the image area where the target is located in the image, and the filter area may include the local image where the target is located.

[0067] The associated group pattern, associated relationship and trigger condition can be the basic information in the prompt rule. In addition to these elements, other auxiliary information can also be included, such as the first prompt time, repeated prompt time, prompt area, filter area, target object corresponding to the prompt and the category of the target object. According to the representation and generation method of the prompt rule, only the key elements need to be selected when arranging the operator, and the auxiliary information can be filled in by inheritance, thereby improving operability. Among them, if the modification instruction of the prompt auxiliary information is not received, it can be determined that the prompt auxiliary information has not changed. Among them, if the modification instruction of the prompt auxiliary information is received, it can be determined that the prompt auxiliary information has changed.

[0068] Step S32: In response to the prompt auxiliary information not being changed, selecting preset prompt auxiliary information as target prompt auxiliary information.

[0069] Step S33: In response to a change in the prompt auxiliary information, the changed prompt auxiliary information is used as the target prompt auxiliary information.

[0070] That is, it is possible to determine whether a change has occurred by means of a difference check. If no change has occurred, the default prompt auxiliary information is used; if a change has occurred, the prompt auxiliary information after the change is used.

[0071] Step S34: Fill the target element group and target prompt auxiliary information into the rule generation template to obtain the prompt rule.

[0072] Optionally, a rule generator can be used to automatically generate a complete target prompt rule, fill it in through difference verification, and use default auxiliary information to improve the efficiency of generating prompt rules. The rule generator provided in this embodiment supports rule information in multiple formats and can adapt to the scene requirements of different solutions.

[0073] In some embodiments, the above method may further include the following steps: connecting the input operator, the target model, the prompt operator module and the output operator module to obtain a target program. Then, the prompt rule is sent to the prompt operator module so that the prompt operator module can determine whether the image processing result output by the target model needs a prompt according to the prompt rule. That is, the corresponding prompt rule information can be sent to the smart SDK to realize the prompt function of the customized open smart business.

[0074] The target program may include algorithm modules such as input operators, output operators, target detection, target recognition, target tracking and prompt operators. The input operator is used to receive images, target detection is used to perform target detection on the input images, target tracking is used to track the detected target objects, target recognition is used to classify the target objects in the image, the prompt operator is used to determine whether the image processing result obtained by target recognition needs to be prompted, and the output operator is used to output the result of the prompt operator, or it can also output the image processing result.

[0075] The above scheme sets several associated group patterns, several associated relationships and several trigger conditions in the prompt rule element library, so that each associated group pattern, associated relationship and trigger condition can be combined to obtain a variety of element groups, so that the corresponding element group can be selected according to the generation requirements of the corresponding prompt rules later, and the prompt rules can be obtained by filling the rule generation template with the selected element group. Compared with the manual compilation of code, this scheme has lower requirements on compilation capabilities and the generation of prompt rules is more convenient.

[0076] See also Fig. 9 , Fig. 9It is a structural diagram of an embodiment of the prompt rule generation device of the present application. The prompt rule generation device 40 can execute the above-mentioned prompt rule generation method. The prompt rule generation device 40 includes an element acquisition module 41, an element determination module 42 and a rule generation module 43; the element acquisition module 41 is used to obtain a prompt rule element library, and the prompt rule element library includes several types of associated group patterns, several types of associated relationships and several types of trigger conditions, wherein each associated group pattern, each associated relationship and each trigger condition can be used to arrange and combine to obtain several groups of candidate element groups, and each group of candidate element groups includes an associated group pattern, at least one associated relationship and at least one trigger condition; the element determination module 42 is used to determine the target element group based on at least one group of candidate element groups in the several groups of candidate element groups; the rule generation module 43 is used to fill the rule generation template with the target element group to obtain the prompt rule, and the prompt rule can be used to determine whether the processing result of the target model on the image needs to be prompted.

[0077] The above scheme, by setting several associated group patterns, several associated relationships and several trigger conditions in the prompt rule element library, enables each associated group pattern, associated relationship and trigger condition to be combined to obtain a plurality of candidate element groups, so that the corresponding candidate element group can be selected according to the generation requirements of the corresponding prompt rule, and the target element group is determined by using the selected candidate element group, and the rule generation template is filled with the target element group to obtain the prompt rule. Compared with the manual compilation of code, this scheme has lower requirements on compilation capabilities and the generation of prompt rules is more convenient.

[0078] The functions of each module can be found in the description of the prompt rule generation method embodiment, which will not be repeated here.

[0079] See also Fig.10 , Fig.10 1 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 50 includes a memory 51 and a processor 52, and the processor 52 is used to execute program instructions stored in the memory 51 to implement the steps in any of the above-mentioned prompt rule generation method embodiments. In a specific implementation scenario, the electronic device 50 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 50 may also include a carrier device such as a laptop computer and a tablet computer, which is not limited here.

[0080] Specifically, the processor 52 is used to control itself and the memory 51 to implement the steps in any of the above-mentioned prompt rule generation method embodiments. The processor 52 can also be called a CPU (Central Processing Unit). The processor 52 may be an integrated circuit chip with signal processing capabilities. The processor 52 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 52 can be implemented by an integrated circuit chip.

[0081] The above scheme, by setting several associated group patterns, several associated relationships and several trigger conditions in the prompt rule element library, enables each associated group pattern, associated relationship and trigger condition to be combined to obtain a plurality of candidate element groups, so that the corresponding candidate element group can be selected according to the generation requirements of the corresponding prompt rule, and the target element group is determined by using the selected candidate element group, and the rule generation template is filled with the target element group to obtain the prompt rule. Compared with the manual compilation of code, this scheme has lower requirements on compilation capabilities and the generation of prompt rules is more convenient.

[0082] See also Fig.11 , Fig.11 The computer-readable storage medium 60 stores program instructions 601, which, when executed by a processor, implement the steps in any of the above-mentioned prompt rule generation method embodiments.

[0083] The above scheme, by setting several associated group patterns, several associated relationships and several trigger conditions in the prompt rule element library, enables each associated group pattern, associated relationship and trigger condition to be combined to obtain a plurality of candidate element groups, so that the corresponding candidate element group can be selected according to the generation requirements of the corresponding prompt rule, and the target element group is determined by using the selected candidate element group, and the rule generation template is filled with the target element group to obtain the prompt rule. Compared with the manual compilation of code, this scheme has lower requirements on compilation capabilities and the generation of prompt rules is more convenient.

[0084] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0085] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0086] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. In another image position, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0087] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. A method for generating prompt rules, characterized in that: include: Acquire a prompt rule element library, wherein the prompt rule element library includes a plurality of associated group patterns, a plurality of associated relationships, and a plurality of trigger conditions, wherein each of the associated group patterns, each of the associated relationships, and each of the trigger conditions can be used to arrange and combine to obtain a plurality of candidate element groups, each of the candidate element groups including an associated group pattern, at least one associated relationship, and at least one trigger condition; Determining a target element group based on at least one candidate element group among the plurality of candidate element groups; Filling a rule generation template with the target element group to obtain a prompt rule, wherein the prompt rule can be used to determine whether a prompt is required for a processing result of the target model on the image; Wherein, the determining of the target element group based on at least one candidate element group among the several groups of candidate element groups comprises: determining a main target class and a subordinate target class corresponding to the main target class from several types of target objects, wherein the several types of target objects are types that can be recognized by a target model; determining the target element group based on the at least one group of candidate element groups, the main target class and the subordinate target class; wherein the association relationship in the target element group comprises a quantitative statistical relationship and / or a relative positional relationship between the main target class and the subordinate target class, the triggering condition in the target element group comprises a prompting requirement of the quantitative statistical relationship and / or the relative positional relationship, and the association group pattern in the target element group comprises a requirement that an association relationship that satisfies the triggering condition can trigger a prompt; The associated group pattern includes any one of the following: the association relationship between some main targets belonging to the main target class and some subordinate targets belonging to the subordinate target class meets the trigger condition; the association relationship between some main targets belonging to the main target class and all subordinate targets belonging to the subordinate target class meets the trigger condition; the association relationship between all main targets belonging to the main target class and some subordinate targets belonging to the subordinate target class meets the trigger condition; the association relationship between all main targets belonging to the main target class and all subordinate targets belonging to the subordinate target class meets the trigger condition.

2. The method according to claim 1, characterized in that The relative position relationship includes at least one of the following: a distance relationship, an intersection relationship, and a direction relationship; The trigger condition includes at least one of the following: the distance relationship meets the distance threshold requirement, the intersection relationship meets the overlap area requirement, the direction relationship meets the direction requirement, and the quantity statistical relationship meets the quantity requirement.

3. The method according to claim 1, characterized in that The method further comprises: Parsing the target model to determine enumeration values ​​of several types of target objects that the target model can identify; Based on the preset enumeration table and each of the enumeration values ​​obtained by parsing, the type of the target object corresponding to each of the enumeration values ​​is determined.

4. The method according to claim 3, characterized in that The target model is parsed to determine that the target model can identify enumeration values ​​of several types of target objects, including: Acquire text information of the target model; The text information is parsed using a text parser to obtain enumeration values ​​of the several types of target objects.

5. The method according to any one of claims 1 to 4, characterized in that: The method of filling a rule generation template with the target element group to obtain a prompt rule includes: Determine whether there is a change in the prompt auxiliary information, wherein the prompt auxiliary information includes at least one of the following: first prompt time, repeated prompt time, prompt area, filter area, target object corresponding to the prompt, and category of the target object; In response to the prompt auxiliary information not changing, selecting the preset prompt auxiliary information as the target prompt auxiliary information; or, in response to the prompt auxiliary information changing, using the changed prompt auxiliary information as the target prompt auxiliary information; The target element group and the target prompt auxiliary information are filled into the rule generation template to obtain the prompt rule.

6. The method according to claim 5, characterized in that The method further comprises: Connect the input operator, target model, prompt operator module and output operator module to obtain the target program; The prompt rule is sent to the prompt operator module so that the prompt operator module can determine whether the image processing result output by the target model needs a prompt according to the prompt rule.

7. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the method according to any one of claims 1 to 6.

8. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Data analysis method and device, computer equipment and storage medium

    CN114218357A

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

    CN116739088A