Policy risk location method, device, electronic device and storage medium
The policy risk localization method and device enhance the safety and reliability of quantization policies by detecting and mitigating risks in control configurations, ensuring effective policy construction and operation.
Patent Information
- Application Number
- JP2024537596
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-12-21
- Filing Date
- 2022-12-05
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-12-05
AI Technical Summary
Existing quantization policies in the financial field are prone to risks due to improper construction, leading to operational failures and inefficiencies.
A policy risk localization method and device that includes steps for detecting global configurations, internal parameters, and connection relationships of controls in a canvas area, and identifying risks through detection results to enhance policy safety.
The method and device provide a comprehensive risk assessment, enabling users to build safer policies by identifying and addressing potential risks, thereby improving the reliability and efficiency of policy operations.
Smart Images

Figure 2025502705000001_ABST
Abstract
Description
[Technical field]
[0001] The present application relates to a quantization component in the financial field, and in particular to a policy risk location method, device, electronic device and storage medium. [Background technology]
[0002] In the financial field, both the learning and operation of quantization have certain thresholds, so the policies constructed by ordinary users in the quantization process are prone to risks, the policies often do not function properly, and the quantization operation may fail. Therefore, proposals to overcome the above shortcomings are urgently needed. Summary of the Invention [Problem to be solved by the invention]
[0003] One object of the present application is to propose a policy risk location method, device, electronic device, and storage medium that can improve the security of a constructed policy. [Means for solving the problem]
[0004] According to one aspect of the embodiment of the present application, a policy risk location method is disclosed, the method comprising: building a queue policy in response to a drag operation on a control in the canvas area; detecting a global configuration of all controls within the canvas area in response to a trigger of a first policy detection condition to obtain a global detection result; detecting an internal parameter of each control within the canvas area in response to a trigger of a second policy detection condition to obtain an internal control detection result; detecting a connection relationship between adjacent controls in the canvas area in response to a trigger of a third policy detection condition to obtain an inter-control detection result; Locating risks present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results.
[0005] According to one aspect of an embodiment of the present application, a policy risk location device is disclosed, the device comprising: a policy construction module configured to construct a queue policy in response to a drag operation on a control in the canvas area; a global detection module configured to detect a global configuration of all controls within the canvas area in response to a trigger of a first policy detection condition to obtain a global detection result; an in-control detection module configured to detect an internal parameter of each control within the canvas area in response to a trigger of a second policy detection condition to obtain an in-control detection result; an inter-control detection module configured to detect a connection relationship between adjacent controls in the canvas area in response to a trigger of a third policy detection condition to obtain an inter-control detection result; a risk location module configured to location risks present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results.
[0006] In one exemplary embodiment of the present application, the device comprises: traversing an internal function of each condition control in response to a trigger of the first policy detection condition; Based on the function name and parameter name of the internal function, obtain the number of market targets used for all condition controls in the canvas area, and obtain a global detection result in which the number of market targets is described; The policy is configured to determine that a number of market targets are at risk if the number of market targets described in the global detection result is greater than a predetermined target number threshold.
[0007] In one exemplary embodiment of the present application, the device comprises: In response to the triggering of the first policy detection condition, detecting islanding controls isolated from a start box of the policy to obtain a global detection result describing the islanding controls; The islanding control is located based on the islanding control described in the global detection result, and the policy is configured to determine that the islanding control is at risk.
[0008] In one exemplary embodiment of the present application, the device comprises: Traverse the controls by class downward along the path that the start box is in, resulting in a set of traversed controls, The traversed control set is configured to remove all controls from the canvas area and make the remaining controls the islanding controls.
[0009] In one exemplary embodiment of the present application, an apparatus includes: traversing the controls by class upward along the path in which the leaf node control resides until a vertex node control located at the vertex of the path in which the leaf node control resides has been traversed; If the apex node control is not a start box, then each control traversed along a path of the leaf node control is configured to be an islanding control.
[0010] In one exemplary embodiment of the present application, the device comprises: In response to the triggering of the first policy detection condition, detecting a node type to which each leaf node control belongs, resulting in a global detection result describing leaf node controls that belong to non-event boxes; Based on the leaf node controls belonging to non-event boxes described in the global detection results, the leaf node controls belonging to non-event boxes are located, and the policy is configured to determine that the leaf node controls belonging to non-event boxes are at risk.
[0011] In one exemplary embodiment of the present application, the device comprises: traversing an internal parameter of each control in response to the triggering of the second policy detection condition; determining a missing global variable of the control based on the global variables used for the internal parameters, and obtaining an in-control detection result that describes the missing global variable of the control; The policy is configured to determine that the global variable lacking the control is at risk based on the global variable lacking the control described in the in-control detection result.
[0012] In one exemplary embodiment of the present application, the device comprises: In response to the trigger of the second policy detection condition, determine the logical legitimacy of the combination condition in the policy based on the internal parameters of each detected control, and obtain an intra-control detection result describing the logical legitimacy of the combination condition; A logically illegal combination of conditions in the policy is located based on the logical legality of the combination of conditions, and it is determined that there is a risk in the logically illegal combination of conditions in the policy.
[0013] In one exemplary embodiment of the present application, the device comprises: In response to the trigger of the third policy detection condition, detect the controls belonging to the condition box, and determine the definition of the exit wire connection of the condition box, and obtain a control-to-control detection result in which the definition of the exit wire connection is described; Based on the definition of the exit wire connection described in the inter-control detection result, an error wire connection of a condition box is located, and the policy is configured to determine that the error wire connection is at risk.
[0014] According to one aspect of an embodiment of the present application, an electronic device is disclosed, the electronic device including one or more processors and a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device realizes any one of the above embodiments.
[0015] According to one aspect of an embodiment of the present application, a computer program medium is disclosed, the computer program medium having computer-readable instructions stored thereon, the computer-readable instructions, when executed by a processor of a computer, causing the computer to perform any one of the above embodiments.
[0016] According to one aspect of an embodiment of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium, the computer instructions being read by a processor of a computing device from the computer readable storage medium and executed by the processor to cause the computing device to perform the methods provided in the various optional embodiments described above. Effect of the Invention
[0017] The policy risk location method provided by the present application provides a visualized control operation path for users to construct a waiting policy by dragging controls, and the present application performs global detection, intra-control detection, and inter-control detection on the constructed policy to locate the risk, thereby improving the completeness of risk location and the safety of the constructed policy.
[0018] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the application.
[0019] It is to be understood that the foregoing general description and the following detailed description are merely exemplary and are not restrictive of the present application. [Brief description of the drawings]
[0020] The above and other objects, features and advantages of the present application will become more apparent by describing in detail illustrative embodiments thereof with reference to the accompanying drawings. [Figure 1] 1 shows a flowchart of a policy risk location method according to an embodiment of the present application. [Diagram 2] FIG. 1 shows a schematic diagram of islanding control according to an embodiment of the present application. [Diagram 3] 1 illustrates a schematic diagram of user interaction with a quantization component according to an embodiment of the present application; [Figure 4] 1 shows a block diagram of a policy risk location device according to an embodiment of the present application; [Diagram 5] FIG. 2 shows a hardware diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0021] Hereinafter, exemplary embodiments will be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be implemented in various forms and should not be understood as being limited to the examples described herein. Rather, providing these exemplary embodiments makes it possible to more fully and completely describe the present application and fully convey the concept of the exemplary embodiments to those skilled in the art. The accompanying drawings are exemplary drawings of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings indicate the same or similar parts, and therefore repeated description thereof will be omitted.
[0022] Furthermore, the described features, structures, or characteristics may be incorporated in one or more exemplary embodiments in any suitable manner. In the following description, many specific details are provided to provide a thorough understanding of the exemplary embodiments of the present application. However, those skilled in the art will recognize that one or more of the above specific details may be omitted, or other methods, components, steps, etc. may be adopted to practice the technical proposals of the present application. In other cases, well-known structures, methods, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of the subject matter of the present application.
[0023] Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities, which may be realized in the form of software, in one or more hardware modules or integrated circuits, in different networks and / or processor and / or microcontroller devices.
[0024] This application provides a policy risk location method that is mainly applied to the quantization component in the financial field. Specifically, the quantization component of this application is used by a user to drag controls in its canvas area and combine wire connections between the controls to construct and obtain a corresponding policy. The control usually includes a start box, a condition box, and an event box. The constructed policy can be used to perform real operation or historical back test. Real operation means applying the policy to a real trading scene and trading in real time. Historical back test means using historical data to detect the validity of the policy.
[0025] FIG. 1 shows a flow chart of a policy risk location method according to an embodiment of the present application. An exemplary implementation of the method is a quantization component, which includes: A step S110 of constructing a waiting policy in response to a drag operation on a control in the canvas area; S120, in response to the triggering of a first policy detection condition, detecting a global configuration of all controls within the canvas area to obtain a global detection result; S130: detecting internal parameters of each control in the canvas area in response to the triggering of the second policy detection condition to obtain an internal control detection result; a step S140 of detecting a connection relationship between adjacent controls in the canvas area in response to a trigger of a third policy detection condition to obtain an inter-control detection result; and step S150 of locating risks present in the policy based on the global detection results, the intra-control detection results and the inter-control detection results.
[0026] In an embodiment of the present application, the quantization component provides a canvas area to the user so that the user can construct policies therein. In response to dragging operations on controls in the canvas area, the quantization component constructs corresponding policies and waits for execution. The policies in this embodiment are used to automatically transact targets.
[0027] During policy construction, in response to the triggering of the first policy detection condition, the quantization component detects the global configuration of all controls in the canvas area to obtain a global detection result, i.e., it treats all controls in the canvas area as one detection target, detects the global configuration of this detection target, and obtains a global detection result.
[0028] During policy construction, in response to the trigger of the second policy detection condition, the quantization component detects the internal parameters of each control in the canvas area to obtain an in-control detection result, that is, takes each control in the canvas area as a detection target, detects the internal parameters of each detection target, and obtains an in-control detection result.
[0029] During policy construction, in response to the trigger of the third policy detection condition, the quantization component detects the connection relationship between adjacent controls in the canvas area to obtain the inter-control detection result. That is, each pair of two adjacent controls in the canvas area is treated as a pair of detection targets, and the connection relationship between each pair of detection targets is detected to obtain the inter-control detection result.
[0030] Additionally, risks present in the policy are localized based on global findings, intra-control findings, and inter-control findings.
[0031] From the above, it can be seen that the policy risk location method provided by the present application provides a visualized control operation path for the user to construct a waiting policy by dragging a control. In addition, for the constructed policy, the present application performs global detection, intra-control detection, and inter-control detection to locate the risk, thereby improving the completeness of risk location and improving the safety of the constructed policy.
[0032] In one embodiment, in response to the triggering of the first policy detection condition, the number of all controls in the canvas area is detected to obtain a global detection result in which the number of all controls is accounted for, and if the number of all controls accounted for in the global detection result is greater than a predetermined control number threshold, the number of all controls is determined to be at risk in the policy.
[0033] In this embodiment, the global detection is performed from the dimension of the number of controls. Specifically, after the first policy detection condition is triggered, the number of all controls used to construct the policy in the canvas area is detected. If the number of all controls is greater than a predetermined threshold of the number of controls, there is a risk because too many controls are used to construct the policy, which will exceed the load of the quantization component. Furthermore, after determining that there is a risk in the number of all controls in the policy, an error warning can be triggered to warn the user that the policy that needs to be constructed in the canvas area cannot operate normally because the number of all controls exceeds the limit.
[0034] In one embodiment, in response to the triggering of a first policy detection condition, traverse the internal function of each condition control, obtain the number of market targets used by all condition controls in the canvas area based on the function name and parameter name of the internal function, and obtain a global detection result describing the number of market targets. If the number of market targets described in the global detection result is greater than a predetermined target number threshold, it is determined that the number of market targets is at risk in the policy.
[0035] In this embodiment, the global detection is performed from the dimension of the number of market targets. Specifically, the essence of the condition control is to call the market data with the quantization component, which needs to frequency-limit the market data to protect the background, and therefore the number of market targets used needs to be limited. After the first policy detection condition is triggered, all the condition controls in the canvas area are detected, and the number of market targets used in all the condition controls is further determined. If the number of market targets is greater than the predetermined target number threshold, there is a risk because too many market targets are used to construct the policy, which may pose a threat to the background. Furthermore, after determining that there is a risk in the number of market targets in the policy, an error warning can be triggered to warn the user that the number of all market targets in the policy constructed in the canvas area exceeds the limit and cannot operate normally.
[0036] In one embodiment, in response to the triggering of a first policy detection condition, an islanding control isolated from a start box of the policy is detected to obtain a global detection result in which the islanding control is described, and based on the islanding control described in the global detection result, the islanding control is located and the policy determines that the islanding control is a risk.
[0037] In this embodiment, the global detection is performed from the dimension of the global topology. Specifically, after the first policy detection condition is triggered, the islanding control in the canvas area is detected. Referring to the islanding control surrounded by the dotted box in FIG. 2, the islanding control means a control that is isolated from the start box and has no direct or indirect connection relationship. If islanding controls exist, there is a risk because these islanding controls cannot function as part of the constructed policy. Furthermore, after determining that there is a risk in the islanding control in the policy, a warning reminder can be triggered to remind the user that the policy constructed in the canvas area may be in error due to the existence of the islanding control.
[0038] In one embodiment, the start box traverses the controls by class downward along a path to obtain a traversed control set, which removes all controls from the canvas area and makes the remaining controls stand-alone controls.
[0039] In this embodiment, a start box is located in the canvas area as a root node control, and the start box traverses the controls downward by class along a path, and all the traversed controls have a direct or indirect connection relationship with the start box and do not belong to the islanding control. After traversing all the paths of the start box, the traversed control set includes all the controls that do not belong to the islanding control, and all the controls that are not included in the traversed control set belong to the islanding control. Therefore, the traversed control set removes all the controls from the canvas area, and the remaining controls are islanding controls.
[0040] In one embodiment, the controls along the path in which the leaf node control resides are traversed upward by class until a vertex node control located at the apex of the path in which the leaf node control resides is traversed. If the apex node control is not the starting box, each control traversed along the path in which the leaf node control resides is made an independent control.
[0041] In this embodiment, each leaf node control at the bottom level is located in the canvas area, and then the controls are traversed upwards by class along the path in which the leaf node control is located until the corresponding apex node control is traversed. An apex node control means a control that does not have a parent node and is located at the apex of a path. If an isolated operation control exists, there are multiple apex node controls in the canvas area, and only one of them is the starting box that is the root node control.
[0042] If the apex node control of a leaf node control is not the start box, all controls from this leaf node control to its corresponding apex node control are isolated from the start box, so all controls traversed along the path on which this leaf node control is located belong to the isolated operation control.
[0043] In one embodiment, in response to the trigger of the first policy detection condition, a global detection result is obtained in which the leaf node controls belonging to non-event boxes are described by detecting the node type to which each leaf node control belongs, and the leaf node controls belonging to non-event boxes are located based on the leaf node controls belonging to non-event boxes described in the global detection result, and the leaf node controls belonging to non-event boxes are determined to be at risk in the policy.
[0044] In this embodiment, the global detection is performed from the dimension of the leaf node control type. Specifically, to ensure that the policy runs normally, the end point of the path must be an event box. That is, the leaf node control must be an event box. After the first policy detection condition is triggered, the node type to which each leaf node control in the canvas area belongs is detected, and which leaf node control belongs to an event box and which leaf node control belongs to a non-event box is determined. Here, the leaf node control belonging to a non-event box may affect the normal operation of the policy and is at risk. Furthermore, after determining that the leaf node control belonging to a non-event box is at risk in the policy, an error warning can be triggered to warn the user that the leaf node control does not belong to an event box in the policy constructed in the canvas area and cannot run normally.
[0045] In one embodiment, the first policy detection condition includes detecting a backtest operation on the policy, detecting an actual driving operation on the policy, and detecting a logic verification operation on the policy.
[0046] In this embodiment, any one of the first policy detection conditions can trigger global detection. Global detection is triggered when a user performs a backtest operation on a policy. Global detection is triggered when a user performs an actual running operation on a policy. Global detection is triggered when a user performs a logic verification operation on a policy.
[0047] In one embodiment, the in-control detection is done from the dimension of policy type and function type. The policy type describes the account type corresponding to the user account, which includes futures account and securities account. Every function used for each control has a corresponding function type, which applies only to futures account, which applies only to securities account, and which applies to both. The policy type and function type are detected to ensure the match of account type and function type.
[0048] Specifically, after the second policy detection condition is triggered, the policy type is extracted from the start box and the account type is determined. The function used in the control is traversed to search for the function type, and then compared with the account type to determine whether it matches. If it does not match, it will affect the normal operation of the policy and there is a risk. Furthermore, after determining that there is a risk in the matching between the policy type and the function type in the policy, an error warning can be triggered to warn the user that the policy type and the account type do not match or the function type and the account type do not match in the policy built in the canvas area and cannot operate normally.
[0049] In one embodiment, in response to the triggering of the second policy detection condition, the internal parameters of each control are traversed, and a missing global variable of the control is determined based on the global variables used in the internal parameters, and an in-control detection result is obtained in which the missing global variable of the control is described. Based on the missing global variable of the control described in the in-control detection result, it is determined that the missing global variable of the control is at risk in the policy.
[0050] In this embodiment, the in-control detection is performed from the dimension of the global variables. Specifically, after the second policy detection condition is triggered, the internal parameters of each control are traversed. When a control belonging to the start box is traversed, a global variable set is constructed based on the global variables defined in the start box, and when other controls are traversed, the global variables used in other controls are removed from the global variable set. After the traversal of all controls is completed, the remaining global variables in the global variable set belong to the unused global variables, that is, the missing global variables of the control. When there are missing global variables of the control, there may be operational risks. In addition, after determining that there is a risk in the missing global variables of the policy, a warning reminder can be triggered to remind the user that the policy constructed in the canvas area may be error due to missing global variables.
[0051] In one embodiment, the detection within the control is performed from the dimension of the required parameters. The required parameters are the parameters that should be input. If the required parameters are missing, it will affect the normal operation of the policy. Specifically, a mapping table of the required parameters is pre-configured. After the second policy detection condition is triggered, traverse the internal parameters of each control to detect whether the parameter is manually input and the value is empty, and if so and in the mapping table, indicate that the parameter is a missing required parameter and there is a risk. Furthermore, after determining that there is a risk of missing required parameters in the policy, an error warning can be triggered to warn the user that the policy constructed in the canvas area cannot operate normally due to the missing required parameters.
[0052] In one embodiment, in response to the triggering of the second policy detection condition, the logical legality of the combination condition in the policy is determined based on the internal parameters of each detected control, and an intra-control detection result is obtained that describes the logical legality of the combination condition. Based on the logical legality of the combination condition, a logically illegal combination condition in the policy is located, and it is determined that there is a risk in the logically illegal combination condition in the policy.
[0053] In this embodiment, the detection within the control is performed from the dimension of logical legality of the combined condition. Specifically, after the second policy detection condition is triggered, the internal parameters of each control are detected, and then the sub-conditions used in the control are extracted therefrom. Furthermore, based on the logical relationship between the sub-conditions, it is detected whether the combined condition formed by the combination of multiple sub-conditions is logically legal. If the logic of the combined condition is incomplete, a policy operation error will occur. Furthermore, after determining that there is a risk in the logically illegal combined condition in the policy, an error warning can be triggered to warn the user that the policy constructed in the canvas area cannot operate normally due to the logically illegal combined condition.
[0054] Here, each sub-condition, logical symbol, and parenthesis uses a data structure package called QCGAN (Quant Condition Group AST Node) in the combined condition, and the type to which QCAGN belongs is identified using an enumeration value. The types include conditions, logical symbols, left parenthesis, and right parenthesis. Since the input order of QCAGN is fixed, it is stored in an array, and the subscript position of QCAGN and the corresponding error information are stored in a single table. Each time an illegal QCAGN is judged, the subscript in the array and the corresponding error information are recorded in the table, and the left and right parenthesis are judged using a stack. Each time a left parenthesis is encountered, the subscript of the array is pushed onto the stack, and each time a right parenthesis is encountered, one is popped up. Each time a QCAGN is processed, the type of the current QCAGN and the previous QCAGN are judged to determine whether the combined condition is logically legal or not. The judgment is as follows:
[0055] 1. For a condition type QCAGN, if it does not appear in the start position and the type of the previous QCAGN is not a left parenthesis or a logical symbol, the logic is illegal; otherwise, the logic is legal.
[0056] 2. For a logical symbol type QCAGN, if the type of the previous QCAGN is not a right parenthesis or a condition, the logic is illegal; otherwise, the logic is legal.
[0057] 3. For a QCAGN of type left parenthesis, if it does not appear in the start position and the type of the previous QCAGN is not a logical symbol or left parenthesis, the logic is illegal; otherwise, the logic is legal.
[0058] 4. For a QCAGN of right parenthesis type, first check whether the stack is empty. If the stack is empty, it indicates that there is no corresponding left parenthesis, and then check the type of the previous QCAGN again. If the type of the previous QCAGN is not right parenthesis or condition, the logic is illegal; otherwise, the logic is legal.
[0059] In one embodiment, the in-control detection is performed from the dimension of the sub-condition of the combination condition. The sub-condition is an important part of the combination condition, and if a user creates a sub-condition but does not use it, there is a risk of operation error. Specifically, in the data structure of the combination condition, a table is maintained for recording the usage record of the sub-condition. This table counts the sub-conditions used. After the second policy detection condition is triggered, the table is inspected to locate the sub-condition with a count of 0, and it is determined that the sub-condition with a count of 0 is at risk in the policy. Furthermore, after it is determined that the sub-condition with a count of 0 is at risk in the policy, a warning alert can be triggered to alert the user that the policy built in the canvas area may be in error due to the existence of a sub-condition that is not used in the combination condition.
[0060] In one embodiment, the in-control detection is performed from the target dimension to which the signal condition is applied. The essence of the signal condition is to call quote data by the quantization component, and these quote data are targeted to a specific target. For example, Greeks data are only targeted to options targets, whereas there are no Greeks data for stock targets. Targets that are not applied to the signal condition affect the normal operation of the policy. Specifically, a function table is obtained to encapsulate the signal condition corresponding to a function and to hold function information. The function information held in the function table includes the account type to which the function is applied and the target type to which the function is applied. After the second policy detection condition is triggered, the target information of the signal condition is queried, and the queried target information is compared with the function information held in the function table to determine whether the target applied to the signal condition has a risk. Furthermore, after determining that the target applied to the signal condition has a risk in the policy, an error alert can be triggered to alert the user that the policy constructed in the canvas area cannot operate normally due to an error in the target applied to the signal condition.
[0061] In one embodiment, the detection in the control is performed from the dimension of the target applied to the account condition. The essence of the account condition is that the account related data is called through the quantization component, but the account is also targeted to a specific target. For example, the data of the futures target cannot be called from the stock account. The target that is not applied to the account condition affects the normal operation of the policy. Specifically, after the second policy detection condition is triggered, the policy type is extracted from the start box. The control is traversed to collect the targets in the policy, and compared with the policy type to determine whether the target applied to the account condition has a risk. Furthermore, after determining that the target applied to the account condition has a risk in the policy, an error warning can be triggered to alert the user that the policy built in the canvas area cannot operate normally due to an error in the target applied to the account condition.
[0062] In one embodiment, the second policy detection condition includes detecting an edit operation on a control, the edit operation including editing on the property bar and editing on the combination condition window.
[0063] In one embodiment, in response to the triggering of the third policy detection condition, a control belonging to a condition box is detected, a definition of an exit wire connection of the condition box is determined, and an inter-control detection result is obtained in which the definition of the exit wire connection is described. Based on the definition of the exit wire connection described in the inter-control detection result, an error wire connection of the condition box is located, and it is determined that the error wire connection is a risk in the policy.
[0064] In this embodiment, typically, up to two wire connections can be drawn from the exit of the condition box, and the user can edit the definitions of the two wire connections ("Yes", "No"). If the definitions of the two wire connections are the same, it will affect the normal operation of the policy. Specifically, after the second policy detection condition is triggered, the control is traversed, and when it is traversed to the condition box, it is determined whether the definitions of the exit wire connections are the same, and whether there is an error wire connection is determined. Furthermore, after it is determined that there is a risk in the error wire connection in the policy, an error warning can be triggered to warn the user that the policy built in the canvas area cannot operate normally due to the error wire connection.
[0065] In one embodiment, the third policy detection condition includes detecting a remove operation on the control and detecting a wire connection operation on the control.
[0066] FIG. 3 shows a schematic diagram of user interaction with the quantization component according to one embodiment of the present application.
[0067] In this embodiment, the detection of the canvas area in the quantization component is a process required for policy backtest and real run. If the user does not click the "Logic Check" button, but directly clicks the "Policy Backtest" button or the "Real Run" button, the quantization component system will also detect the policy previously established in the canvas area, and execute the policy backtest or real run after the detection is passed.
[0068] Specifically, a user edits the canvas area to build a policy, and after completing the editing, clicks the "Logic Check" button, or the "Policy Backtest" button, or the "Actual Run" button to trigger policy detection.
[0069] If the policy detection passes, the system front end will issue a notification of success and the system will proceed to the next stage; at the same time, since the policy logic detection passes, meaning that there are no errors that will affect the normal operation of the policy, if it is detected that there is a risk of an error occurring in the policy, the system front end can optionally issue a further warning notification.
[0070] If the policy detection is not passed, the system front end will give an error warning (for example, by setting a color display control or displaying an error mark "X" on the wire connection between two controls), and the user can edit the canvas area again to remove the error. During the process of the user editing the canvas area, the system can optionally synchronously detect whether the policy is passed or not, and give corresponding warnings according to the detection result.
[0071] Furthermore, in this embodiment, the abnormal parameters of the current quantization trading policy are determined based on the global detection results, intra-control detection results, and inter-control detection results. If the abnormal parameters are equal to or greater than a predetermined abnormality threshold, the current quantization trading policy is reconstructed, or the current quantization trading policy has many abnormalities and the user is prompted to choose whether to reconstruct it. If the abnormal parameters are less than the abnormality threshold, the abnormalities and errors in the current quantization trading policy are corrected and corrected.
[0072] JPEG2025502705000002.jpg71170
[0073] The above method suggests that users directly reconstruct policies when anomalies are serious, thereby avoiding the increased time costs of fixing a large number of anomaly problems and improving the efficiency of creating and running quantized trading policies.
[0074] 4 shows a policy risk location device according to an embodiment of the present application. The device includes a policy construction module 210, a global detection module 220, an intra-control detection module 230, an inter-control detection module 240, and a risk location module 250.
[0075] The policy construction module 210 is configured to construct queueing policies in response to dragging operations on controls in the canvas area.
[0076] The global detection module 220 is configured to detect a global configuration of all controls within the canvas area in response to a trigger of a first policy detection condition to obtain a global detection result.
[0077] The in-control detection module 230 is configured to detect, in response to the triggering of a second policy detection condition, an internal parameter of each control within the canvas area to obtain an in-control detection result.
[0078] The inter-control detection module 240 is configured to detect a connection relationship between adjacent controls in the canvas area in response to the triggering of a third policy detection condition to obtain an inter-control detection result.
[0079] A risk location module 250 is configured to location risks present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results.
[0080] In one exemplary embodiment of the present application, the device comprises: traversing an internal function of each condition control in response to a trigger of the first policy detection condition; Based on the function name and parameter name of the internal function, obtain the number of market targets used for all condition controls in the canvas area, and obtain a global detection result in which the number of market targets is described; The policy is configured to determine that a number of market targets are at risk if the number of market targets described in the global detection result is greater than a predetermined target number threshold.
[0081] In one exemplary embodiment of the present application, the device comprises: In response to the triggering of the first policy detection condition, detecting islanding controls isolated from a start box of the policy to obtain a global detection result describing the islanding controls; The islanding control is located based on the islanding control described in the global detection result, and the policy is configured to determine that the islanding control is at risk.
[0082] In one exemplary embodiment of the present application, the device comprises: Traverse the controls by class downward along the path that the start box is in, resulting in a set of traversed controls, The traversed control set is configured to remove all controls from the canvas area and make the remaining controls the islanding controls.
[0083] In one exemplary embodiment of the present application, the device comprises: traversing the controls by class upward along the path in which the leaf node control resides until a vertex node control located at the vertex of the path in which the leaf node control resides has been traversed; If the apex node control is not a start box, then each control traversed along a path of the leaf node control is configured to be an islanding control.
[0084] In one exemplary embodiment of the present application, the device comprises: In response to the triggering of the first policy detection condition, detecting a node type to which each leaf node control belongs, resulting in a global detection result describing leaf node controls that belong to non-event boxes; Based on the leaf node controls belonging to non-event boxes described in the global detection results, the leaf node controls belonging to non-event boxes are located, and the policy is configured to determine that the leaf node controls belonging to non-event boxes are at risk.
[0085] In one exemplary embodiment of the present application, the device comprises: traversing an internal parameter of each control in response to the triggering of the second policy detection condition; determining a missing global variable of the control based on the global variables used for the internal parameters, and obtaining an in-control detection result that describes the missing global variable of the control; The policy is configured to determine that the global variable lacking the control is at risk based on the global variable lacking the control described in the in-control detection result.
[0086] In one exemplary embodiment of the present application, the device comprises: In response to the trigger of the second policy detection condition, determine the logical legitimacy of the combination condition in the policy based on the internal parameters of each detected control, and obtain an intra-control detection result describing the logical legitimacy of the combination condition; A logically illegal combination of conditions in the policy is located based on the logical legality of the combination of conditions, and it is determined that there is a risk in the logically illegal combination of conditions in the policy.
[0087] In one exemplary embodiment of the present application, the device comprises: In response to the trigger of the third policy detection condition, detect the controls belonging to the condition box, and determine the definition of the exit wire connection of the condition box, and obtain a control-to-control detection result in which the definition of the exit wire connection is described; Based on the definition of the exit wire connection described in the inter-control detection result, an error wire connection of a condition box is located, and the policy is configured to determine that the error wire connection is at risk.
[0088] Hereinafter, an electronic device 30 according to an embodiment of the present application will be described with reference to Fig. 5. The electronic device 30 shown in Fig. 5 is merely an example and should not impose any limitations on the functions and scope of use of the embodiment of the present application.
[0089] 5, the electronic device 30 is represented in the form of a general-purpose computing device. The components of the electronic device 30 may include, but are not limited to, at least one processing unit 310 as described above, at least one storage unit 320 as described above, and a bus 330 connecting different system components (including the storage unit 320 and the processing unit 310).
[0090] Here, the storage unit stores program code executable by the processing unit 310 to cause the processing unit 310 to execute steps according to various exemplary embodiments of the present application described in the above exemplary method description section of this specification. For example, the processing unit 310 can execute each step shown in FIG.
[0091] The memory unit 320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 3201 and / or a cache memory storage unit 3202, and may further include a read-only memory unit (ROM) 3203.
[0092] The storage unit 320 may further include a program / utility tool 3204 having a set (at least one) program module 3205, including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each example or some combination of which may include the implementation of a network environment.
[0093] Bus 330 may be viewed as one or more of several types of bus structures, including a storage unit bus, or a storage unit controller, a peripheral bus, a graphics accelerator port, a processing unit, or a local bus using any of a number of bus structures.
[0094] The electronic device 30 may also communicate with one or more external devices 400 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that allow a user to interact with the electronic device 30, and / or any devices (e.g., routers, modems, etc.) that allow the electronic device 30 to communicate with one or more other computing devices. Such communication may occur via an input / output (I / O) interface 350. The input / output (I / O) interface 350 is connected to a display unit 340. Additionally, the electronic device 30 may communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, e.g., the Internet) via a network adapter 360. As shown, the network adapter 360 communicates with other modules of the electronic device 30 via a bus 330. Although not shown, it should be appreciated that other hardware and / or software modules may be used in conjunction with the electronic device 30, including, but not limited to, microcode, device drives, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0095] From the above description of the embodiments, it will be easily understood by those skilled in the art that the embodiments of the examples described herein may be realized by software or by incorporating necessary hardware into software. Therefore, the technical solutions according to the embodiments of the present application can be stored in a non-volatile storage medium (such as a CD-ROM, a U disk, a removable hard disk, etc.) or on a network, and can be realized in the form of a software product that includes some instructions for a computer device (such as a personal computer, a server, a terminal device, or a network device) to execute the method according to the embodiments of the present application.
[0096] Exemplary embodiments of the present application further provide a computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor of a computer, cause the computer to perform the methods described in some of the method embodiments above.
[0097] According to one embodiment of the present application, there is further provided a program product for implementing the method in the above-mentioned method embodiment, which may be implemented on a portable compact disc read only memory (CD-ROM), includes program code, and can be executed on a terminal device such as a personal computer. However, the program product of the present application is not limited thereto, and in the present application, a readable storage medium may be any tangible medium that includes or stores a program that can be used by or in connection with an instruction execution system, device, or apparatus.
[0098] The program product may employ any combination of one or more readable media. The readable storage medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include an electrical connection having one or more conductors, a portable disk, a hard drive, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0099] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code thereon. Such a propagated data signal may take a variety of forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination of the above. A readable signal medium may be any readable medium other than a readable storage medium, which may transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
[0100] The program code contained in the readable medium may be transmitted by a medium including, but not limited to, wireless, wired, optical cable, RF, or any suitable combination of the above.
[0101] Program code for carrying out the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as JAVA, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may run entirely on the user's computing device, partially on the user's computing device, as a standalone package, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device or to an external computing device (e.g., connected to the Internet using an Internet Service Provider) via any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN).
[0102] It should be noted that although several modules or units of a device for performing operations are mentioned in the above detailed description, such division is not mandatory. In fact, according to an embodiment of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be embodied by multiple modules or units that are further divided.
[0103] Also, although the accompanying figures describe steps of the methods in this application in a particular order, this is not intended to require or imply that the steps should be performed in a particular order, or that all of the steps shown should be performed, in order to achieve a desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or a step may be divided into multiple steps for execution.
[0104] From the above description of the embodiments, it will be easily understood by those skilled in the art that the embodiments of the examples described herein may be realized by software or by incorporating necessary hardware into software. Therefore, the technical solutions according to the embodiments of the present application can be stored in a non-volatile storage medium (such as a CD-ROM, a U disk, a removable hard disk, etc.) or on a network, and can be realized in the form of a software product that includes some instructions for a computer device (such as a personal computer, a server, a mobile terminal, or a network device) to execute the method according to the embodiments of the present application.
[0105] Other embodiments of the present application will be readily apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any modifications, uses, or adaptations of the present application that follow the general principles of the present application and include well-known common sense or customary technical means in the art that are not disclosed herein. The specification and examples are considered to be exemplary only, with a true scope and spirit of the present application being indicated by the appended claims. CROSS-REFERENCE TO RELATED APPLICATIONS
[0106] This application claims priority from the application dated December 21, 2021, titled "Policy risk location method, apparatus, electronic device and storage medium", and Chinese patent application number "202111575104.1", the entire contents of which are incorporated herein by reference.
Claims
1. A policy risk location method, comprising: building a queueing policy that is used to automatically transact targets in response to dragging operations on the controls in the canvas area; detecting a global configuration of all controls within the canvas area in response to a trigger of a first policy detection condition to obtain a global detection result; detecting an internal parameter of each control within the canvas area in response to a trigger of a second policy detection condition to obtain an internal control detection result; detecting a connection relationship between adjacent controls in the canvas area in response to a trigger of a third policy detection condition to obtain an inter-control detection result; determining a risk present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results;
2. detecting a global configuration of all controls within the canvas area to obtain a global detection result in response to a trigger of a first policy detection condition, the step of: traversing an internal function of each condition control in response to a trigger of the first policy detection condition; and obtaining the number of market targets used for all condition controls in the canvas area based on the function name and parameter name of the internal function, and obtaining a global detection result describing the number of market targets; The step of determining a risk present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results includes:
2. The method of claim 1, further comprising the step of determining that the policy is at risk for a number of market targets if the number of market targets described in the global detection result is greater than a predetermined target number threshold.
3. detecting a global configuration of all controls within the canvas area to obtain a global detection result in response to a trigger of a first policy detection condition, the step of: detecting an islanding control isolated from a start box of the policy in response to a trigger of the first policy detection condition, to obtain a global detection result describing the islanding control; The step of determining a risk present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results includes: The policy risk location method of claim 1, further comprising a step of determining that the islanding control is a risk in the policy based on the islanding control described in the global detection result.
4. The step of detecting an isolated islanding control from a start box of the policy includes: traversing the controls by class downward along the path along which the starting box is located to obtain a set of traversed controls; 4. The method of claim 3, wherein the traversed control set includes removing all controls from the canvas area and making the remaining controls the islanding controls.
5. The step of detecting an isolated islanding control from a start box of the policy includes: traversing the controls by class upward along the path in which the leaf node control resides until a vertex node control located at the vertex of the path in which the leaf node control resides has been traversed; 4. The method of claim 3, further comprising the step of: if the apex node control is not a starting box, each control traversed along the path on which the leaf node control is located is set as the islanding control.
6. detecting a global configuration of all controls within the canvas area to obtain a global detection result in response to a trigger of a first policy detection condition, the step of: detecting a node type to which each leaf node control belongs in response to a trigger of the first policy detection condition, resulting in a global detection result describing leaf node controls that belong to non-event boxes; The step of determining a risk present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results includes: The policy risk location method of claim 1, further comprising a step of locating leaf node controls belonging to non-event boxes based on the leaf node controls belonging to non-event boxes described in the global detection result, and determining that the leaf node controls belonging to non-event boxes are at risk in the policy.
7. The method for policy risk location according to claim 1 , wherein the first policy detection condition includes detecting a backtest operation for the policy, detecting an actual driving operation for the policy, and detecting a logic verification operation for the policy.
8. detecting an internal parameter of each control within the canvas area to obtain an internal control detection result in response to the triggering of a second policy detection condition, traversing internal parameters of each control in response to the triggering of the second policy detection condition; determining a missing global variable of the control based on the global variables used in the internal parameters, and obtaining an in-control detection result in which the missing global variable of the control is described; The step of determining a risk present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results includes: The policy risk location method of claim 1, further comprising a step of determining that a global variable lacking a control in the policy is at risk based on the global variable lacking a control described in the in-control detection result.
9. detecting an internal parameter of each control within the canvas area to obtain an internal control detection result in response to the triggering of a second policy detection condition, determining a logical validity of a combination condition in the policy based on an internal parameter of each detected control in response to the trigger of the second policy detection condition, and obtaining an intra-control detection result describing the logical validity of the combination condition; The step of determining a risk present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results includes:
2. The policy risk location method according to claim 1, further comprising a step of determining whether a logically illegal combination of conditions in the policy exists as a risk in the policy based on the logical legality of the combination of conditions.
10. The policy risk location method according to claim 1 , wherein the second policy detection condition includes detection of an editing operation on a control.
11. The step of detecting a connection relationship between adjacent controls in the canvas area in response to a trigger of a third policy detection condition to obtain an inter-control detection result includes: In response to the triggering of the third policy detection condition, detecting a control belonging to a condition box, a definition of an exit wire connection of the condition box is determined, and a control-to-control detection result is obtained in which the definition of the exit wire connection is described; The step of determining a risk present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results includes: The policy risk location method of claim 1, further comprising a step of locating an error wire connection of a condition box based on a definition of an exit wire connection described in the inter-control detection result, and determining that the error wire connection is a risk in the policy.
12. 2. The policy risk location method according to claim 1, wherein the third policy detection condition includes detection of a remove operation on a control and detection of a wire connection operation on a control.
13. A policy risk location device, a policy construction module configured to construct a queue policy in response to a drag operation on a control in the canvas area; a global detection module configured to detect a global configuration of all controls within the canvas area in response to a trigger of a first policy detection condition to obtain a global detection result; an in-control detection module configured to detect an internal parameter of each control within the canvas area in response to a trigger of a second policy detection condition to obtain an in-control detection result; an inter-control detection module configured to detect a connection relationship between adjacent controls in the canvas area in response to a trigger of a third policy detection condition to obtain an inter-control detection result; a risk location module configured to locate risks present in the policy based on the global detection results, the intra-control detection results, and the inter-control detection results.
14. An electronic device, one or more processors; a storage device for storing one or more programs; An electronic device, wherein said one or more programs, when executed by said one or more processors, cause said electronic device to implement the method according to any one of claims 1 to 12.
15. 1. A computer-readable storage medium, comprising: The computer-readable storage medium has computer-readable instructions stored thereon, A computer readable storage medium having computer readable instructions which, when executed by a processor of a computer, cause the computer to perform the method of any one of claims 1 to 12.
Citation Information
Patent Citations
Image output device
JP2017092632A
Secure dynamic communication network and protocol
JP2020195141A
Trading systems and methods
US20150235318A1
Methods and system for visually designing trading strategies and execution thereof
US8682773B1