The content of the invention
The embodiment of the present application provides a kind of directed acyclic graph DAG lines reminding method and device, to point out
User carries out legitimacy editor to DAG.
The embodiment of the present application provides a kind of directed acyclic graph DAG line reminding methods, including:
The connection of a line in DAG is used as in the output connection stake that detects user and have selected node
After starting point, it is determined that in the connection stake of the non-line of display, the connection stake inconsistent with the connection source classification
And can cause to connect cyclic connection stake in DAG;
By the connection stake inconsistent with the connection source classification, it can cause to connect cyclic connection in DAG
Stake and remaining output connection stake are set to forbid connection status, are being not set to prohibit with instruction user
Only connection endpoint is selected in the connection stake of connection status;Wherein, the remaining output connection stake be except with it is described
The inconsistent connection stake of connection source classification and the output that can cause to connect in DAG in the connection stake of cyclization connect
Other outputs connection stake outside pile extension.
Optionally it is determined that in the connection stake of the non-line of display, the connection that cyclization is connected in DAG can be caused
Stake, including:
It is determined that the upstream connection stake of the connection source indicated in the chained list built;
The upstream is connected into stake, is defined as the connection stake that can cause to connect cyclization in DAG.
Alternatively, methods described also includes:
By except it is described be arranged to forbid the connection stake of connection status in addition to other connections stake using default
First, which highlights mode, is shown.
Alternatively, described first to highlight mode be the mode being highlighted.
Alternatively, methods described also includes:
It will be arranged to forbid the connection stake of connection status to highlight mode using default second to be shown
Show.
The embodiment of the present application provides a kind of DAG lines suggestion device, including:
Determining module, for connecting stake as in DAG in the output that detects user and have selected node
After the connection source of one line, it is determined that in the connection stake of the non-line of display, with the connection source classification
Inconsistent connection stake and connection stake that cyclization is connected in DAG can be caused;
Setup module, for by inconsistent with connection source classification connection stake, can cause in DAG
The connection stake and remaining output connection stake for connecting cyclization are set to forbid connection status, are existed with instruction user
Connection endpoint is selected in the connection stake for being not set to forbid connection status;Wherein, the remaining output connects
Pile extension is except the connection stake inconsistent with the connection source classification and can cause to connect cyclic company in DAG
Other outputs connection stake outside output connection stake in pile extension.
The embodiment of the present application connects stake as in DAG one in the output that detects user and have selected node
After the connection source of bar line, it is determined that in the connection stake of the non-line of display, with the connection source classification not
Consistent connection stake and connection that cyclization is connected in DAG can be caused;Will be with the connection source classification
Inconsistent input connection stake, the connection stake that can cause to connect cyclization in DAG and, except with the company
Pick up the inconsistent output connection stake of a classification and the output for connecting cyclization in DAG can be caused to connect outside stake
Other outputs connection stake be set to forbid connection status, be not set to forbid connection with instruction user
Connection endpoint is selected in the connection stake of state.Using the embodiment of the present application, user can be avoided in editor DAG
When cause final modeling failure because line is illegal, improve the accuracy and modeling efficiency of modeling.
Embodiment
The embodiment of the present application is described in further detail with reference to Figure of description.
As shown in Fig. 2 the DAG line reminding method flow charts provided for the embodiment of the present application, including with
Lower step:
S201:The output connection stake of a node is have selected as a line in DAG detecting user
Connection source after, it is determined that display non-line connection stake in, it is inconsistent with the connection source classification
Connect stake and can cause to connect cyclic connection stake in DAG.
In specific implementation, clicking operation of the user in the user interface of modeling tool can be monitored, according to
The positional information that user clicks on, and the positional information that each connection stake is shown on a user interface, it is determined that with
Family is selected as the output connection stake of connection source.After user selects a connection source, risen in the connection
A directive connecting line is drawn on point, user can point to the connecting line connection endpoint of selection.
When editing DAG, it could be connected between only generic connection stake, such as the number of one node
Exporting connection stake according to class needs the data class input with another node to be connected stake connection.As shown in figure 3, working as
Detect user have selected A4 this output connection stake as connection source after, inquire about storage A4 class
Other information, if A4, which is data class, connects stake, it is determined that the class of algorithms connection stake B1, B2, B3 are and A4
The inconsistent connection stake of classification.In addition, connection cyclic in DAG is illegal, therefore also need to
It is determined that the connection stake of connection cyclization can be caused, such as, it is determined that in the connection stake connected, A4 upstream connects
Pile extension A1, A2, A3 are the connection stake that can cause to connect cyclization in DAG, such as, if A4 is connected
A1, can form loop connecting as A1 → A2 → A3 → A4 → A1.
As shown in figure 4, in specific implementation, can be described by the way of chained list in DAG, chained list
Each element represents a connection stake.Between connection stake represented by direction based on line in DAG
Pointer information in upstream-downstream relationship, addition chained list, namely referred to by being preserved in each element of chained list
Describe to connect the upstream-downstream relationship between stake in DAG to the pointer of next element.When building chained list,
The input connection stake of the same node of user's selection and output connection stake acquiescence are as adjacent upper in chained list
Downstream node.In specific implementation, it can update what is built whenever one connection stake of user's selection connection
Link table information.After detecting user and selecting a connection source, can according to the link table information of latest update,
The upstream connection stake of the connection source is determined, and is defined as to cause to connect cyclic connection in DAG
Stake.In such as Fig. 4, annexation A1 → A2 → A3 → A4 according to indicated by the chained list set up →
A5 → A6, if it is determined that A6 is selected into any one in A1~A5 as the connection source of a line
Connection cyclization can all be caused as connection endpoint.
S202:By the connection stake inconsistent with the connection source classification, it can cause to connect cyclization in DAG
Connection stake and remaining output connection stake be set to forbid connection status, set with instruction user not
It is set in the connection stake for forbid connection status and selects connection endpoint;Wherein, the remaining output connection stake be except
With the connection source classification inconsistent connection stake and can cause in DAG connect cyclization connection stake in
Other outputs connection stake outside output connection stake.
In specific implementation, because DAG is acyclic figure, and only generic connection stake could mutually
Connection, therefore inconsistent with connection source classification connection stake and can cause to connect into DAG
The connection stake of ring, is that should not be connected with the connection source, therefore, connects these in the embodiment of the present application
Pile extension is disabled.In addition, because the connection endpoint of a line can only be input connection stake, therefore, this
Apply embodiment also by all output connection stake disablings.Here, due to inconsistent with connection source classification
Connect stake and can cause to connect in DAG and output connection stake is there may be in cyclic connection stake, therefore,
In S202, really all output connection stakes, the input inconsistent with connection source classification are connected
Stake and it can cause to connect the input connection stake of cyclization in DAG and be set to forbid connection status, in other words,
It is that the input inconsistent with connection source classification is connected stake and output connection stake, can cause to connect in DAG
The input connection stake and output connection stake of cyclization, and other all output connection stakes are set to forbid connecting shape
State.Such as, in Fig. 4, using A4 as current connection source to be connected exemplified by, A1~A3 is its upstream
Stake is connected, B1~B3 is the connection stake different classes of with A4, A4 (namely connection source is in itself) and A6
Stake is connected for the output in addition to A2, B1, B3, therefore, A1~A4, A6, B1~B3 are set
To forbid connection status.
, can be with if user is attempted in forbidding the connection stake of connection status to be attached in specific implementation
Do not handle, or while not handling, forbid the prompt message of connection to user feedback.
Alternatively, can be by addition to being arranged to forbid the connection stake of connection status in specific implementation
Other connection stakes highlight mode using default first and shown.This first highlight mode can be with
For the mode being highlighted (such as green is highlighted).Such as, if in Fig. 4, the completed company of user
A1 → A2 → A3 → A4 is connected in, A4, as the connection source of a new line, is being selected into the line
Connection endpoint when, legal connection stake A5 is highlighted, user can now select highlighted
A5 is used as connection endpoint.In addition, first highlight mode and can also be:Optionally connect each
The optional prompting mark of increase beside pile extension, it each will optionally connect stake and be shown using default shape
Deng.
Alternatively, in specific implementation, it will can also be arranged to forbid the connection stake of connection status using pre-
If second highlight mode and shown, this second highlights mode and is specifically as follows red mark
Mode, or other highlight mode.Such as, if in Fig. 4, user is completed to be connected as A1 → A2
→ A3 → A4, using A4 as a new line connection source, when selecting the connection endpoint of the line,
Connection stake A1~A3 (the connection stake that connection cyclization can be caused), the B1~B3 of connection status will be arranged to forbid
(inconsistent with connection source classification), A4 (connection source is in itself), A6 (remaining output is connected stake)
Using red mark.
The such scheme provided using the embodiment of the present application, can avoid user when editing DAG due to even
Line is illegal to cause final modeling failure, improves the accuracy and modeling efficiency of modeling.
Based on same inventive concept, a kind of and DAG line reminding methods are additionally provided in the embodiment of the present application
Corresponding DAG lines suggestion device, because the device solves the principle and the embodiment of the present application DAG of problem
Line reminding method is similar, therefore the implementation of the device may refer to the implementation of method, repeats part and no longer goes to live in the household of one's in-laws on getting married
State.
As shown in figure 5, the DAG line suggestion device structural representations provided for the embodiment of the present application, bag
Include:
Determining module 51, for connecting stake as DAG in the output that detects user and have selected node
In a line connection source after, it is determined that display non-line connection stake in, with the connection source class
Not inconsistent connection stake and connection stake that cyclization is connected in DAG can be caused;
Setup module 52, for by inconsistent with connection source classification connection stake, DAG can be caused
The connection stake of middle connection cyclization and remaining output connection stake are set to forbid connection status, with instruction user
Connection endpoint is selected in the connection stake for being not set to forbid connection status;Wherein, the remaining output
Connection stake is except the connection stake inconsistent with the connection source classification and can cause to connect cyclization in DAG
Connect other outputs connection stake outside the output connection stake in stake.
Alternatively, the determining module 51 specifically for:
It is determined that the upstream connection stake of the connection source indicated in the chained list built;The upstream is connected
Stake, is defined as the connection stake that can cause to connect cyclization in DAG.
Alternatively, the setup module 52 is additionally operable to:
By except it is described be arranged to forbid the connection stake of connection status in addition to other connections stake using default
First, which highlights mode, is shown.
Alternatively, described first to highlight mode be the mode being highlighted.
Alternatively, the setup module 52 is additionally operable to:
It will be arranged to forbid the connection stake of connection status to highlight mode using default second to be shown
Show.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or meter
Calculation machine program product.Therefore, the application can be using complete hardware embodiment, complete software embodiment or knot
The form of embodiment in terms of conjunction software and hardware.Wherein wrapped one or more moreover, the application can be used
Containing computer usable program code computer-usable storage medium (include but is not limited to magnetic disk storage,
CD-ROM, optical memory etc.) on the form of computer program product implemented.
The application is produced with reference to according to the method for the embodiment of the present application, device (system) and computer program
The flow chart and/or block diagram of product is described.It should be understood that can be realized by computer program instructions flow chart and
/ or each flow and/or square frame in block diagram and the flow in flow chart and/or block diagram and/
Or the combination of square frame.These computer program instructions can be provided to all-purpose computer, special-purpose computer, insertion
Formula processor or the processor of other programmable data processing devices are to produce a machine so that pass through and calculate
The instruction of the computing device of machine or other programmable data processing devices is produced for realizing in flow chart one
The device for the function of being specified in individual flow or multiple flows and/or one square frame of block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or the processing of other programmable datas to set
In the standby computer-readable memory worked in a specific way so that be stored in the computer-readable memory
Instruction produce include the manufacture of command device, the command device realization in one flow or multiple of flow chart
The function of being specified in one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices, made
Obtain and perform series of operation steps on computer or other programmable devices to produce computer implemented place
Reason, so that the instruction performed on computer or other programmable devices is provided for realizing in flow chart one
The step of function of being specified in flow or multiple flows and/or one square frame of block diagram or multiple square frames.
Although having been described for the preferred embodiment of the application, those skilled in the art once know base
This creative concept, then can make other change and modification to these embodiments.So, appended right will
Ask and be intended to be construed to include preferred embodiment and fall into having altered and changing for the application scope.
Obviously, those skilled in the art can carry out various changes and modification without departing from this Shen to the application
Spirit and scope please.So, if the application these modification and modification belong to the application claim and
Within the scope of its equivalent technologies, then the application is also intended to comprising including these changes and modification.