Communication method of graph editing engine nodes, graph editing engine system and storage medium
By defining the connection between Vue node instances and bus BUS in the graph editing engine, and using the event triggering mechanism for data transmission between nodes, the problem of low communication efficiency of AntV X6 nodes is solved, and more efficient data transmission and processing is achieved.
Patent Information
- Application Number
- CN202410977177.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-08
AI Technical Summary
The existing graph editing engine AntV X6 node has low communication efficiency, resulting in too many data transmission levels between nodes, complex and inefficient.
By defining the connection between Vue node instances and bus BUS, the broadcast and monitoring of events are realized, and the layers of bubbles are reduced, and the event triggering mechanism is used to transmit and process data between nodes.
It improves communication efficiency between nodes, reduces performance overhead, and makes the data transmission of graphics nodes more efficient and flexible.
Smart Images

Figure CN118916189A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer graphics processing technology, and in particular to a communication method for a graph editing engine node, a graph editing engine system and a storage medium. Background Art
[0002] The graph editing engine AntV X6 node is used to build various types of graphs, including flow charts, organizational charts, etc. So that the constructed graphs can be applied to various fields to help users better understand and use data.
[0003] The current graph editing engine AntV X6 node only supports the embedding of native vector graphics format SVG (Scalable Vector Graphics), plain text and Hypertext Markup Language HTML (Hypertext Markup Language). In order to realize the application functions of some complex scenarios, such as right-click menus, drop-down tool boxes, pop-up dialog boxes, and when more beautiful styles are required, it is difficult to achieve them using native HTML. Therefore, the above problems are solved by introducing Vue instances to utilize the characteristics of Vue to realize component-based development and responsive data binding.
[0004] When the graph editing engine nodes of the introduced Vue instance are communicating internally, if a graph node triggers an event through the emit method to transmit information, this event will be listened to by the graph initialization component, and then the corresponding handler function will be triggered for processing. In the handler function, the graph instance of the current graph is first obtained, the target node is found through the graph instance, and then the data of the target node is modified to realize data transmission. The above method solves the internal communication of the graph nodes by bubbling layer by layer. The implementation process is complicated, the content of the node definition component is complicated, and the graph instance must be used for node interaction. There are too many levels of event transmission, which leads to low communication efficiency. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a communication method for a graph editing engine node, a graph editing engine system and a storage medium to solve the problem of low communication efficiency in the prior art.
[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0007] A first aspect of an embodiment of the present invention shows a communication method of a graph editing engine node, which is applied to a graph editing engine system, wherein the graph editing engine system includes a graph node, a VUE node instance connected to the graph node, all the VUE node instances are connected via a bus BUS, and the number of the graph nodes is multiple, and the method includes:
[0008] When the VUE node instance connected to the graphic node generates an event to be processed based on the user's behavior operation on the graphic node, the event to be processed is broadcasted on the bus BUS, and the event to be processed carries a node identifier or an event identifier;
[0009] If another VUE node instance determines that the event to be processed has been verified, the event to be processed is processed based on the corresponding processing function to achieve communication among multiple graphic nodes.
[0010] Optionally, a trigger and a listener are provided in the VUE node instance, and the method further includes:
[0011] When the VUE node instance connected to the graphic node generates an event to be processed based on the user's behavior operation on the graphic node, the trigger triggers the event to be processed to broadcast on the bus BUS, and the event to be processed carries a node identifier or an event identifier;
[0012] If the listener of another VUE node instance listens to the event to be processed and determines that the event to be processed is verified, the event to be processed is processed based on the corresponding processing function to achieve communication among multiple graphic nodes.
[0013] Optionally, if another VUE node instance determines that the event to be processed is verified to be passed, it includes:
[0014] The listener of each VUE node instance monitors the bus BUS, and if the event to be processed is monitored, the node identifier carried by the event to be processed is verified;
[0015] Determine whether the node identifier carried by the event to be processed is consistent with a preset node identifier;
[0016] If they are consistent, the verification is confirmed to be successful.
[0017] Optionally, the graph editing engine system further includes an external component, and the external component is connected to each of the VUE node instances via a bus BUS. The method further includes:
[0018] When the listener of the external component monitors the existence of a to-be-processed event carrying an event identifier on the bus BUS, the listener obtains the to-be-processed event with an event identifier consistent with a preset event identifier from the bus BUS;
[0019] The event to be processed is processed.
[0020] Optionally, the graph editing engine system further includes a first drawer component, the first drawer component is connected to each of the VUE node instances via a bus BUS, and the method further includes:
[0021] If any of the graphic nodes triggers a new main node button, the VUE node instance corresponding to the graphic node opens the first drawer component corresponding to the newly added node through the bus based on the operation of the new main node button;
[0022] The first drawer component obtains the newly added master node parameters input by the user, and stores the newly added master node parameters;
[0023] The first drawer component sends a confirmation event to the VUE node instance through a bus BUS, so that the user can feedback and confirm the generation information through the graphic node corresponding to the VUE node instance;
[0024] The VUE node instance is based on the determined generation information, and based on the determined generation information, uses a corresponding processing function to process the first drawer component to generate a corresponding newly added main node.
[0025] Optionally, the graph editing engine system further includes a second drawer component, the second drawer component is connected to each of the VUE node instances via a bus BUS, and the method further includes:
[0026] If any of the graphic nodes triggers a corresponding step editing button, the VUE node instance corresponding to the graphic node displays the corresponding editable step so that the user can select it through the corresponding graphic node;
[0027] The VUE node instance corresponding to the graphic node generates a step editing event based on the attribute information of the step selected by the user through the corresponding graphic node, and broadcasts it through the bus;
[0028] The VUE node instance opens the second drawer component through the bus based on the step editing event so as to modify the corresponding node step in the VUE node instance.
[0029] Optionally, the graph editing engine system further includes a data cache center, and the method further includes:
[0030] If any of the graphic nodes triggers data caching, the VUE node instance corresponding to the graphic node generates a corresponding cache event based on the data cache, and broadcasts it through the bus BUS to transmit the cache event carrying the node identifier and cache data of the node;
[0031] After the data cache center monitors the cache event, it determines whether the node identifier carried in the cache event has been verified; if the verification has been passed, the content in the cache event is stored in the hash table of the data cache center.
[0032] Optionally, the method further includes:
[0033] If any graphic node triggers a first event, the VUE node instance corresponding to the graphic node broadcasts the first event through the bus BUS to transmit the first event carrying the node identifier and the first information of the node;
[0034] If the first event is a data reading event, when the data cache center monitors the first event, the corresponding node data is retrieved from the hash table according to the node identifier in the first event;
[0035] If the first event is a data repair event, when the data cache center monitors the first event, it takes out the corresponding node data from the hash table according to the node identifier in the first event, and generates a data write event based on the node data;
[0036] The data cache center broadcasts the data write event via the bus BUS;
[0037] All VUE node instances on the bus will listen to the data write event and match the node identifier passed in the data write event with the preset node identifier;
[0038] If there is a match, the VUE node instance triggers a corresponding processing function to write corresponding data based on the data write event.
[0039] The second aspect of the embodiment of the present invention shows a graph editing engine system, the graph editing engine system includes a graph node, a VUE node instance connected to the graph node, and all the VUE node instances are connected via a bus BUS;
[0040] The VUE node instance connected to the graphic node is used to broadcast the event to be processed on the bus BUS when a to-be-processed event is generated based on the user's behavior operation on the graphic node, and the event to be processed carries a node identifier or an event identifier;
[0041] The other VUE node instances are used to determine whether the pending event is verified and process the pending event based on the corresponding processing function to achieve communication among multiple graphic nodes.
[0042] The third aspect of an embodiment of the present invention shows a storage medium, which includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the communication method of the graph editing engine node as shown in the first aspect of the embodiment of the present invention.
[0043] A communication method, a graph editing engine system and a storage medium for a graph editing engine node provided based on the above-mentioned embodiment of the present invention are applied to a graph editing engine system, wherein the graph editing engine system includes a graph node, a VUE node instance connected to the graph node, and all the VUE node instances are connected through a bus BUS. The method includes: when the VUE node instance connected to the graph node generates an event to be processed based on the user's behavior operation on the graph node, the event to be processed is broadcast on the bus BUS, and the event to be processed carries a node identifier or an event identifier; if another VUE node instance determines that the event to be processed is verified, the event to be processed is processed based on the corresponding processing function to realize the communication of multiple graph nodes. The present invention defines the bus BUS to which the Vue node instance is connected, so that the Vue node instance shares the bus event, monitors and triggers the sending and receiving of events through the bus, rather than solving it through a layer-by-layer bubbling method. The level of AntV X6 event transmission is reduced, and the performance overhead is reduced, thereby improving the node communication efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0045] Figure 1 A schematic diagram of the structure of a graph editing engine system shown in an embodiment of the present invention;
[0046] Figure 2 A schematic diagram of the structure of another graph editing engine system according to an embodiment of the present invention;
[0047] Figure 3 A flowchart of creating a graphic node and a Vue node instance according to an embodiment of the present invention;
[0048] Figure 4 A schematic diagram of communication interaction shown in an embodiment of the present invention;
[0049] Figure 5 A structural schematic diagram of another graph editing engine system shown in an embodiment of the present invention;
[0050] Figure 6 A schematic diagram of the structure of another image editing engine system according to an embodiment of the present invention;
[0051] Figure 7 A schematic diagram of the structure of another image editing engine system according to an embodiment of the present invention;
[0052] Figure 8 A schematic diagram of the structure of another image editing engine system according to an embodiment of the present invention;
[0053] Fig. 9 A flow chart of a communication method for a graph editing engine node according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0056] It should be noted that the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0057] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0058] See also Figure 1 , is a structural diagram of a graph editing engine system shown in an embodiment of the present invention, the graph editing engine system includes a graphic node node10, a VUE node instance 20 connected to the graphic node node10, and the VUE node instance 20 is connected via a bus BUS30.
[0059] There are multiple graphic nodes node10 , and each graphic node node10 is connected to a VUE node instance 20 , that is, there is a one-to-one correspondence between the graphic node node10 and the VUE node instance 20 .
[0060] Specifically, each graphic node node10 is connected to a corresponding VUE node instance 20 , and all VUE node instances 20 are connected via a bus BUS30 .
[0061] It should be noted that the VUE node instance 20 refers to an independent computing unit in the cluster that can perform special tasks and can be composed of one node or multiple nodes.
[0062] There are multiple graph nodes node10 under the Graph graph instance.
[0063] When the VUE node instance 20 connected to the graphic node node10 generates an event to be processed based on the user's behavior operation on the graphic node node10, the event to be processed is broadcasted on the bus BUS30, and the event to be processed carries a node identifier or an event identifier;
[0064] If the remaining VUE node instance 20 determines that the event to be processed has been verified, the event to be processed is processed based on the corresponding processing function to achieve communication among multiple graphic nodes.
[0065] Based on the graph editing engine system shown in the above embodiment of the present invention, the embodiment of the present invention also discloses a specific structure diagram of the VUE node instance 20, such as Figure 2 As shown, a trigger 21 and a listener 22 are provided in the VUE node instance 20 .
[0066] Specifically, the x6-vue-shape extension is introduced into the graphics engine AntV X6. In the graphics initialization node, a graphics node node10 is created to obtain the graph instance; a VUE node instance 20 is defined and a bus instance Bus is created, and the graphics node node10 to which the VUE node instance 20 needs to be connected is defined; and the bus instance Bus is introduced into the VUE node instance component; a listener Bus.$on is defined in the VUE node instance 20 to capture events on the bus; a trigger Bus.$emit is defined in the Vue component to trigger events, such as Figure 3 shown.
[0067] Among them, the VUE node instance is registered through the register method; an instance 20 of the Vue component node is created on the graph.
[0068] In the embodiment of the present invention, the event triggering mechanism of the bus BUS30 instance can be used for data interaction of the VUE node instance 20. By calling the Bus.emit method to transfer data, the Bus.on method can be used in the bus BUS30 instance to monitor global events, and the data can be processed in the callback function to realize data transmission and processing, and realize data interaction between nodes.
[0069] When the VUE node instance 20 connected to the graphic node node10 generates an event to be processed based on the user's behavior operation on the graphic node node10, the trigger 21 triggers the event to be processed to broadcast on the bus BUS30, and the event to be processed carries a node identifier or an event identifier;
[0070] If the listener of another VUE node instance 20 listens to the event to be processed and determines that the event to be processed is verified, the event to be processed is processed based on the corresponding processing function to achieve communication between multiple graphic nodes node10.
[0071] It should be noted that the other VUE node instance 20 refers to any VUE node instance 20 except the VUE node instance 20 that triggers the event to be processed. Based on this, the other graphic node node10 refers to the VUE node instance 20 except the VUE node instance 20 that triggers the event to be processed.
[0072] Optionally, the user performs an operation based on a certain graphic node node10 and records the behavior operation, and the graphic node node10 performs processing based on the behavior operation, such as editing and saving data operations; if the behavior operation will cause internal data processing of other graphic nodes node10; the VUE node instance 20 connected to the graphic node node10 obtains the internal data of other graphic nodes node10 that causes the processing, as well as the node identifier of other graphic nodes node10, and then generates a to-be-processed event based on the operation and node identifier corresponding to the internal data of other graphic nodes node10 that causes the processing, so that the to-be-processed event carries the node identifier.
[0073] It should be noted that the node identifier can be directly obtained by other VUE node instances 20, but the internal data processing in the pending event requires the node identifier to be verified before it can be decoded, that is, obtained.
[0074] Further, it should be noted that the node identifier is used to uniquely identify the graph node node10, and the node identifier may be a node ID.
[0075] In a specific implementation, the event to be processed is triggered by a trigger 21 in a VUE node instance 20 connected to the graphic node node10, so that the event can be monitored by all VUE node instances 20 connected to the bus BUS;
[0076] The listeners 22 of each other VUE node instance 20 monitor in real time; for each listener 22 of the VUE node instance 20, if the event to be processed is listened to, the event to be processed is verified. If the verification passes, the processing function handler corresponding to the listener 22 is called to trigger the processing function and execute internal data processing to perform data update and other processing.
[0077] In the embodiment of the present invention, the bus BUS is set to realize communication between multiple graphic nodes node10 in a broadcasting manner.
[0078] Preferably, if the remaining VUE node instance determines that the event to be processed is verified to be passed, it includes:
[0079] The listener 22 of each other VUE node instance 20 listens to the bus BUS30. If the event to be processed is listened to, the node identifier carried by the event to be processed is verified; it is determined whether the node identifier carried by the event to be processed is consistent with its own identifier; if they are consistent, it is determined that the verification is successful.
[0080] For example: Figure 4As shown, when the user clicks on the graphic node A and edits and saves the data a, the behavior operation 1 corresponding to the editing and saving of the data a is recorded; this operation causes the internal data message1 of the graphic node B to be updated. At this time, the graphic node A is the source node, and the trigger Bus.$emit in the VUE node instance 1 corresponding to the graphic node A will trigger the pending event Q('$event1', message1) containing the internal data message1 and the node ID of the graphic node B. The update event Bus.$emit('$event1', message1) of node B is triggered on the bus Bus through the trigger of the graphic node A, that is, the pending event Q. The VUE node instances corresponding to all the connected graphic nodes on the BUS will listen to the update event, that is, the pending event Q; for each VUE node instance, for example, the listener Bus.$on in the VUE node instance 2 captures the update event, that is, the pending event Q, and compares whether the node ID carried in the event Q is consistent with its own ID. If they are consistent, the VUE node instance 20 calls the event processing function Bus.$on('$event1', handler1) corresponding to its own listener to update the internal data b through handler1.
[0081] Optionally, using the bus mechanism, you can inject global configuration into all Vue node instances 20 at once, and trigger global data writing through the Bus.emit method. At the same time, use the Bus.on method on each Vue node instance 20 to listen to events and write data to the node. In this way, global configuration information and data are shared to all to improve the flexibility and scalability of the system. This global configuration and data sharing mechanism makes system configuration management more convenient and also reduces the writing of duplicate code.
[0082] In an embodiment of the present invention, the present invention defines the bus BUS connected to the Vue node instance, creates a Vue node instance in the graphic component, and creates a bus instance BUS therein, and acts as an intermediary for data transmission between graphic nodes through the bus BUS instance, and realizes data interaction between nodes through an event triggering mechanism. The Vue bus component uses the characteristics of the Vue.js framework to provide a simple and powerful way to manage global events and data, allowing Vue node instances to share bus events, monitor and trigger event sending and receiving through the bus, and realize communication between multiple graphic nodes, rather than solving it through a layer-by-layer bubbling method. The level of AntV X6 event transmission is reduced, and the performance overhead is reduced, thereby improving the efficiency of node communication.
[0083] A schematic diagram of another structure of a graph editing engine system shown in an embodiment of the present invention, combined with Figure 1 , see Figure 5 , the graph editing engine system also includes an external component 40.
[0084] The external component 40 is connected to each of the VUE node instances 20 via a bus BUS30.
[0085] It should be noted that the external component 40 includes a listener and a processor.
[0086] When the listener of the external component 40 monitors the bus BUS for an event to be processed with an event identifier, the listener obtains an event to be processed with an event identifier consistent with a preset event identifier from the bus BUS30; and processes the event to be processed.
[0087] Optionally, the user performs an operation based on a certain graphic node node10 and records the behavior operation. The graphic node node10 performs processing based on the behavior operation, such as editing a saved data operation. If the behavior operation will cause internal data changes of a certain external component 40, a to-be-processed event is generated based on the operation corresponding to the internal data change of other graphic nodes node10 and the set event identifier, so that the to-be-processed event carries the event identifier.
[0088] It should be noted that the event to be processed can only be acquired by the external component 40 that has a corresponding event identifier, that is, a preset event identifier.
[0089] The preset event identifier is pre-stored in the external component 40 .
[0090] In a specific implementation, when the listener of the external component 40 monitors the bus BUS30 for a pending event with an event identifier, it matches the event identifier of the pending event with a preset event identifier stored in itself to see if it is consistent. If they are consistent, it obtains the pending event with an event identifier consistent with the preset event identifier from the bus BUS30; and processes the pending event.
[0091] In the embodiment of the present invention, by introducing a bus instance in an external component and monitoring global events on the bus, the Bus.$emit method can be used in the node to trigger an event, and the callback function in the external component can be processed accordingly. This reduces the coupling degree of the system, makes the interaction between the node and the external component more flexible and scalable, and realizes the communication between the graphic node and the external component, thereby improving the node communication efficiency.
[0092] A schematic diagram of another structure of a graph editing engine system shown in an embodiment of the present invention, combined with Figure 1 , see Figure 6 , the image editing engine system also includes a first drawer component 50.
[0093] The first drawer component 50 is connected to each of the VUE node instances 20 via a bus BUS50.
[0094] If the user triggers the button for adding a new main node through any graphic node node10, the VUE node instance 20 corresponding to the graphic node node10 opens the first drawer component 50 corresponding to the newly added node through the bus based on the operation of the button for adding a new main node;
[0095] The first drawer component 50 obtains the newly added master node parameters input by the user, and stores the newly added master node parameters;
[0096] The first drawer component 50 sends a confirmation event to the VUE node instance 20 through the bus BUS30, so that the user can feedback the generated information through the graphic node node10 corresponding to the VUE node instance 20;
[0097] The VUE node instance 20 processes the first drawer component 50 to generate a corresponding newly added main node based on the determined generation information and using a corresponding processing function.
[0098] In a specific implementation, if a user triggers a new main node button through any graphic node node10, a trigger 21 of a VUE node instance 20 corresponding to the graphic node node10 generates a new event based on the operation of the new main node button and broadcasts it through the bus;
[0099] It should be noted that the newly added event can only be acquired by the empty drawer component, that is, the first drawer component 50 .
[0100] The newly added event carries the attribute information of the graphic node node10 of the current newly added step, which may specifically include graphic information and node identification.
[0101] When the first drawer component 50 monitors a new event, it executes a drawer opening operation to allow the user to input new main node parameters such as the type of new node step. When the user clicks Save, a new node event will be triggered; the first drawer component 50 stores the new main node parameters. At this time, the trigger 22 in the first drawer component 50 triggers a confirmation event carrying attribute information and node identification.
[0102] All VUE node instances 20 on the bus will listen to the confirmation event, and match the node identifier of the node step attribute information transmitted in the confirmation event with the ID of its own node. If the match is successful, that is, consistent, the user can feedback the generated information through the graphic node node10 corresponding to the VUE node instance 20;
[0103] Based on the determined generation information, the VUE node instance 20 uses a corresponding processing function to process the first drawer component 50 to generate a corresponding newly added main node.
[0104] In an embodiment of the present invention, in order to simplify the operation process of the node, by monitoring the new operations of all node steps, and using the Bus.$emit method in the corresponding first drawer component to pass the data to the bus instance, it is ensured that the data in the steps of each node is in the latest state, and the addition of graphic nodes is realized. This method makes the operation of the node more intuitive and efficient, and improves the user experience.
[0105] A schematic diagram of another structure of a graph editing engine system shown in an embodiment of the present invention, combined with Figure 1 , see Figure 7 , the image editing engine system also includes a second drawer component 60.
[0106] The second drawer component 60 is connected to each of the VUE node instances 20 via a bus BUS, and the subcomponents are connected to the VUE node instances 20 and the bus BUS30 respectively.
[0107] It should be noted that the subcomponent is a node step under the VUE node instance.
[0108] If the user triggers the corresponding step editing button through any graphic node node10, the VUE node instance 20 corresponding to the graphic node node10 displays the corresponding editable step so that the user can select it through the corresponding graphic node node10; the VUE node instance 20 corresponding to the graphic node node10 generates a step editing event based on the attribute information of the step selected by the user through the corresponding graphic node node10, and broadcasts it through the bus;
[0109] The VUE node instance 20 opens the second drawer component 60 through the bus based on the step editing event, so as to modify the corresponding node step in the VUE node instance 20;
[0110] In a specific implementation, if a user triggers a corresponding step edit button through any graphic node node10, a trigger 21 of a VUE node instance 20 corresponding to the graphic node node10 generates a step edit event based on the attribute information of the step edit button, and broadcasts it through the bus BUS30;
[0111] It should be noted that the step editing event can only be acquired by the empty drawer component, that is, the second drawer component 60 .
[0112] The step editing event carries the attribute information of the node step of the VUE node instance 20 of the step to be edited, which may specifically include step information.
[0113] The second drawer component 60 listens to the step editing event and executes the drawer opening operation to allow the user to modify the corresponding node step under the VUE node instance 20. When the user clicks Save, the trigger 22 in the second drawer component 60 triggers the step editing event.
[0114] All VUE node instances 20 on the bus will listen to the step editing event and match the node identifier passed in the step editing event with the ID of their own node. If the match is successful, that is, they are consistent, the user can trigger the corresponding processing function through the VUE node instance 20 to modify the step corresponding to the node based on the step editing event.
[0115] In an embodiment of the present invention, in order to simplify the operation process of the node, the step editing operation of all node steps is monitored, and the Bus.$emit method is used in the corresponding second drawer component to pass data to the bus instance to implement the step editing of the graphic node. This method makes the operation of the node more intuitive and efficient, and improves the user experience.
[0116] A schematic diagram of another structure of a graph editing engine system shown in an embodiment of the present invention, combined with Figure 1 , see Figure 8 The graph editing engine system also includes a data cache center 70.
[0117] If data caching is triggered by any graphic node node10, the VUE node instance 20 corresponding to the graphic node node10 generates a corresponding cache event based on the data cache, and broadcasts it through the bus BUS30 to transmit the cache event carrying node information such as the node identifier and cache data.
[0118] After the data cache center 70 monitors the cache event, it determines whether the node identifier carried in the cache event has been verified; if the verification has been passed, the content in the cache event is stored in the hash table of the data cache center 70.
[0119] In a specific implementation, after the data cache center 70 listens to the cache event, it determines whether the node identifier carried in the cache event is consistent with the identifier stored in itself. If they are consistent, it is determined that the verification is successful, and the content in the cache event is stored in the hash table of the data cache center 70; if they are inconsistent, it is determined that the verification fails, and the corresponding cache event is deleted.
[0120] It should be noted that the data cache center 70 is a Vue instance, which is used to store the data cached by the node instance. In the data cache center 70, a hash table (hashMap) is defined to cache the attribute information of the node.
[0121] Optionally, multiple writes to the same node will be overwritten, that is, after verification, the data cache center 70 determines whether there is information corresponding to the node identifier in the cache event; if so, based on the cache event, the information in the data cache center 70 corresponding to the node identifier in the cache event is overwritten to save the cached data in the current cache event.
[0122] In the embodiment of the present invention, through the data cache center connected to the bus, the data cache center can be used to store node data so as to perform node data caching, acquisition and overwriting operations, thereby improving the user experience.
[0123] Optionally, based on the data cache center 70 shown above, it further includes:
[0124] If the user triggers the first event through any graphic node node10, the trigger 21 of the VUE node instance 20 corresponding to the graphic node node10 broadcasts the first event through the bus BUS30 to transmit the first event carrying node information such as the node identifier and the first information.
[0125] If the first event is a data reading event, when the data cache center 70 monitors the first event, it retrieves the corresponding node data from the hash table according to the node identifier in the first event.
[0126] If the first event is a data repair event, when the data cache center 70 monitors the first event, it takes out the corresponding node data from the hash table according to the node identifier in the first event, and generates a data write event based on the node data;
[0127] The data cache center 70 broadcasts the data write event via the bus BUS30;
[0128] All VUE node instances 20 on the bus will listen to the data write event and match the node identifier passed in the data write event with the ID of their own node. If the match is successful, that is, consistent, the user can trigger the corresponding processing function through the VUE node instance 20 to write the corresponding data based on the data write event, that is, to overwrite the node data passed in the event with its own node.
[0129] It should be noted that the first event includes a data reading event and a data repair event.
[0130] In the embodiment of the present invention, the data cache center can only monitor the cache event and the first event.
[0131] Optionally, VUE node instances 20 can share attribute information. When a user edits a node's attribute, an attribute edit event is sent through the bus. All nodes listen to the event and get the edited attribute from the event. Then, the attribute is compared with its own attribute list. If the attribute exists in its own attribute list, the incoming attribute data is overwritten to maintain data consistency.
[0132] In the embodiment of the present invention, through the data cache center connected to the bus, the data cache center can be used to store node data so as to perform node data caching, acquisition and overwriting operations, thereby improving the user experience.
[0133] Based on the graph editing engine system shown in the above embodiment of the present invention, the embodiment of the present invention also discloses a flow chart of a communication method of a graph editing engine node. Fig. 9 As shown, the method includes:
[0134] Step S901: When the VUE node instance connected to the graphic node generates an event to be processed based on the user's behavior operation on the graphic node, the event to be processed is broadcasted on the bus BUS, and the event to be processed carries a node identifier or an event identifier;
[0135] Step S902: The other VUE node instances respectively determine whether the pending event has passed the verification. If the verification has passed, step S903 is executed. If the verification has not passed, the pending event is deleted.
[0136] In the process of implementing step S902, the listener of each VUE node instance listens to the bus BUS. If the event to be processed is listened to, the node identifier carried by the event to be processed is verified; it is determined whether the node identifier carried by the event to be processed is consistent with the preset node identifier; if they are consistent, it is determined that the verification is passed, and step S903 is executed; if the verification fails, the event to be processed is deleted.
[0137] Step S903: If another VUE node instance determines that the event to be processed has been verified, the event to be processed is processed based on a corresponding processing function to achieve communication among multiple graphic nodes.
[0138] It should be noted that the steps of the communication method of the graph editing engine node disclosed in the above-mentioned embodiment of the present application and the corresponding parts of the specific principles and execution processes of each unit in the graph editing engine system shown in the above-mentioned implementation of the present application will not be repeated here.
[0139] In an embodiment of the present invention, the present invention defines the bus BUS connected to the Vue node instance, creates a Vue node instance in the graphic component, and creates a bus instance BUS therein, and acts as an intermediary for data transmission between graphic nodes through the bus BUS instance, and realizes data interaction between nodes through an event triggering mechanism. The Vue bus component uses the characteristics of the Vue.js framework to provide a simple and powerful way to manage global events and data, allowing Vue node instances to share bus events, monitor and trigger event sending and receiving through the bus, and realize communication between multiple graphic nodes, rather than solving it through a layer-by-layer bubbling method. The level of AntV X6 event transmission is reduced, and the performance overhead is reduced, thereby improving the efficiency of node communication.
[0140] Optionally, based on the method shown in the above embodiment of the present invention, the method further includes:
[0141] When the VUE node instance connected to the graphic node generates an event to be processed based on the user's behavior operation on the graphic node, the trigger triggers the event to be processed to broadcast on the bus BUS, and the event to be processed carries a node identifier or an event identifier;
[0142] If the listener of another VUE node instance listens to the event to be processed and determines that the event to be processed is verified, the event to be processed is processed based on the corresponding processing function to achieve communication among multiple graphic nodes.
[0143] Optionally, based on the method shown in the above embodiment of the present invention, the method further includes:
[0144] When the listener of the external component monitors the bus BUS for an event to be processed with an event identifier, the listener obtains the event to be processed with an event identifier consistent with a preset event identifier from the bus BUS; and processes the event to be processed.
[0145] Optionally, based on the method shown in the above embodiment of the present invention, the method further includes:
[0146] If any of the graphic nodes triggers a new main node button, the VUE node instance corresponding to the graphic node opens the first drawer component corresponding to the newly added node through the bus based on the operation of the new main node button;
[0147] The first drawer component obtains the newly added master node parameters input by the user, and stores the newly added master node parameters;
[0148] The first drawer component sends a confirmation event to the VUE node instance through a bus BUS, so that the user can feedback and confirm the generation information through the graphic node corresponding to the VUE node instance;
[0149] The VUE node instance is based on the determined generation information, and based on the determined generation information, uses a corresponding processing function to process the first drawer component to generate a corresponding newly added main node.
[0150] Optionally, based on the method shown in the above embodiment of the present invention, the method further includes:
[0151] If any of the graphic nodes triggers a corresponding step editing button, the VUE node instance corresponding to the graphic node displays the corresponding editable step so that the user can select it through the corresponding graphic node;
[0152] The VUE node instance corresponding to the graphic node generates a step editing event based on the attribute information of the step selected by the user through the corresponding graphic node, and broadcasts it through the bus;
[0153] The VUE node instance opens the second drawer component through the bus based on the step editing event so as to modify the corresponding node step in the VUE node instance.
[0154] Optionally, based on the method shown in the above embodiment of the present invention, the method further includes:
[0155] If any of the graphic nodes triggers data caching, the VUE node instance corresponding to the graphic node generates a corresponding cache event based on the data cache, and broadcasts it through the bus BUS to transmit a cache event carrying node information such as the node identifier and cache data.
[0156] After the data cache center monitors the cache event, it determines whether the node identifier carried in the cache event has been verified; if the verification has been passed, the content in the cache event is stored in the hash table of the data cache center.
[0157] Optionally, based on the method shown in the above embodiment of the present invention, the method further includes:
[0158] If any graphic node triggers a first event, the VUE node instance corresponding to the graphic node broadcasts the first event through the bus BUS to transmit the first event carrying node information such as the node identifier and the first information.
[0159] If the first event is a data reading event, when the data cache center monitors the first event, the corresponding node data is retrieved from the hash table according to the node identifier in the first event.
[0160] If the first event is a data repair event, when the data cache center monitors the first event, it takes out the corresponding node data from the hash table according to the node identifier in the first event, and generates a data write event based on the node data;
[0161] The data cache center broadcasts the data write event via the bus BUS;
[0162] All VUE node instances on the bus will listen to the data write event and match the node identifier passed in the data write event with the preset node identifier;
[0163] If there is a match, the VUE node instance triggers a corresponding processing function to write corresponding data based on the data write event.
[0164] The embodiment of the present invention also discloses an electronic device, which is used to run a database storage process, wherein the above-mentioned Fig. 9 A communication method for a graph editing engine node is disclosed.
[0165] The embodiment of the present invention also discloses a storage medium, wherein the storage medium includes a storage database storage process, wherein when the database storage process is running, the device where the storage medium is located is controlled to execute the above Fig. 9 A communication method for a graph editing engine node is disclosed.
[0166] In the context of the present disclosure, a storage medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
[0167] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0168] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0169] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A communication method for a graph editing engine node, characterized in that: Applied to a graph editing engine system, the graph editing engine system includes a graph node, a VUE node instance connected to the graph node, all the VUE node instances are connected via a bus BUS, the number of the graph nodes is multiple, and the method includes: When the VUE node instance connected to the graphic node generates an event to be processed based on the user's behavior operation on the graphic node, the event to be processed is broadcasted on the bus BUS, and the event to be processed carries a node identifier or an event identifier; If another VUE node instance determines that the event to be processed has been verified, the event to be processed is processed based on the corresponding processing function to achieve communication among multiple graphic nodes.
2. The method according to claim 1, characterized in that The VUE node instance is provided with a trigger and a listener, and the method further comprises: When the VUE node instance connected to the graphic node generates an event to be processed based on the user's behavior operation on the graphic node, the trigger triggers the event to be processed to broadcast on the bus BUS, and the event to be processed carries a node identifier or an event identifier; If the listener of another VUE node instance listens to the event to be processed and determines that the event to be processed is verified, the event to be processed is processed based on the corresponding processing function to achieve communication among multiple graphic nodes.
3. The method according to claim 1, characterized in that If another VUE node instance determines that the event to be processed is verified, it includes: The listener of each VUE node instance monitors the bus BUS, and if the event to be processed is monitored, the node identifier carried by the event to be processed is verified; Determine whether the node identifier carried by the event to be processed is consistent with a preset node identifier; If they are consistent, the verification is confirmed to be successful.
4. The method according to claim 1, characterized in that: The graph editing engine system further includes an external component, which is connected to each of the VUE node instances via a bus BUS. The method further includes: When the listener of the external component monitors the existence of a to-be-processed event carrying an event identifier on the bus BUS, the listener obtains the to-be-processed event with an event identifier consistent with a preset event identifier from the bus BUS; The event to be processed is processed.
5. The method according to claim 1, characterized in that The graph editing engine system further includes a first drawer component, wherein the first drawer component is connected to each of the VUE node instances via a bus BUS, and the method further includes: If any of the graphic nodes triggers a new main node button, the VUE node instance corresponding to the graphic node opens the first drawer component corresponding to the newly added node through the bus based on the operation of the new main node button; The first drawer component obtains the newly added master node parameters input by the user, and stores the newly added master node parameters; The first drawer component sends a confirmation event to the VUE node instance through a bus BUS, so that the user can feedback and confirm the generation information through the graphic node corresponding to the VUE node instance; The VUE node instance is based on the determined generation information, and based on the determined generation information, uses a corresponding processing function to process the first drawer component to generate a corresponding newly added main node.
6. The method according to claim 1, characterized in that The diagram editing engine system further includes a second drawer component, wherein the second drawer component is connected to each of the VUE node instances via a bus BUS, and the method further includes: If any of the graphic nodes triggers a corresponding step editing button, the VUE node instance corresponding to the graphic node displays the corresponding editable step so that the user can select it through the corresponding graphic node; The VUE node instance corresponding to the graphic node generates a step editing event based on the attribute information of the step selected by the user through the corresponding graphic node, and broadcasts it through the bus; The VUE node instance opens the second drawer component through the bus based on the step editing event so as to modify the corresponding node step in the VUE node instance.
7. The method according to claim 1, characterized in that The graph editing engine system further includes a data cache center, and the method further includes: If any of the graphic nodes triggers data caching, the VUE node instance corresponding to the graphic node generates a corresponding cache event based on the data cache, and broadcasts it through the bus BUS to transmit the cache event carrying the node identifier and cache data of the node; After the data cache center monitors the cache event, it determines whether the node identifier carried in the cache event has been verified; if the verification has been passed, the content in the cache event is stored in the hash table of the data cache center.
8. The method according to claim 7, characterized in that The method further comprises: If any graphic node triggers a first event, the VUE node instance corresponding to the graphic node broadcasts the first event through the bus BUS to transmit the first event carrying the node identifier and the first information of the node; If the first event is a data reading event, when the data cache center monitors the first event, the corresponding node data is retrieved from the hash table according to the node identifier in the first event; If the first event is a data repair event, when the data cache center monitors the first event, it takes out the corresponding node data from the hash table according to the node identifier in the first event, and generates a data write event based on the node data; The data cache center broadcasts the data write event via the bus BUS; All VUE node instances on the bus will listen to the data write event and match the node identifier passed in the data write event with the preset node identifier; If there is a match, the VUE node instance triggers a corresponding processing function to write corresponding data based on the data write event.
9. A graph editing engine system, characterized in that: The graph editing engine system includes a graph node, a VUE node instance connected to the graph node, and all the VUE node instances are connected via a bus BUS; The VUE node instance connected to the graphic node is used to broadcast the event to be processed on the bus BUS when a to-be-processed event is generated based on the user's behavior operation on the graphic node, and the event to be processed carries a node identifier or an event identifier; The other VUE node instances are used to determine whether the pending event is verified and process the pending event based on the corresponding processing function to achieve communication among multiple graphic nodes.
10. A storage medium, characterized in that: The storage medium includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the communication method of the graph editing engine node as described in any one of claims 1-8.
