Rail Transit Map Drawing System, Method, Electronic Device and Storage Medium
Through the web-based signal equipment graphics library and event mapping tree technology, the cumbersome problem of the rail transit drawing process is solved, convenient drawing and unified management are realized on the web side, and system maintenance costs are reduced.
Patent Information
- Application Number
- CN202111011746.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-31
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-08-31
AI Technical Summary
In the existing rail transit line design, the drawing process of station maps, route maps and interval maps is cumbersome, and tools based on specific clients lead to high maintenance and upgrade costs, making it difficult to achieve convenient editing and interactive rendering.
Using a web-based signal equipment graphics library, through the JSON/XML data model, the event reading, conversion unit, execution unit and graphic display unit are used to build an event mapping tree, automatically identify and draw rail transit maps, simplifying the drawing process, and unified management and upgrade through the server.
It realizes that the rail transit diagram can be drawn without installing specific software on the web side, reduces client load and maintenance costs, supports multiple people to work online, and simplifies the graphics drawing and maintenance process.
Smart Images

Figure CN113838157B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to a rail transit map drawing system, method, electronic device, and storage medium. Background Art
[0002] The rail transit signal system is a safety system for real-time control of rail transit signal equipment. The station yard map accurately describes the association relationships among axle counters, signal machines, switches, track sections, stopping points, platform screen doors, etc. within the station yard. The line map describes the ownership relationships, interlocking relationships, topological relationships, etc. among the signal equipment of various section lines. The section map includes the relationships among signal equipment such as axle counters, signal machines, track sections, switches, etc. on the sections such as reversing tracks, transition tracks, single crossovers, double crossovers, yard lines, etc.
[0003] In the design of subway lines, it is necessary to accurately and meticulously draw the station yard map, line map, section map, etc., requiring easy editing, strong interactivity, dynamic rendering, and the ability to monitor the working and operating states of all signal equipment on the rail line in real time, and to conveniently achieve rapid positioning and diagnosis of signal equipment failures.
[0004] In the current rail transit line design, it is necessary to graphically represent the station yard information and line information and be able to display an intuitive 2D map. The existing station yard maps, line maps, and section maps are generally based on the C / S architecture, such as java swing, QT, MFC, Flash, SVG, etc. The client needs to install specific client software, and the drawing process is too cumbersome, which is not conducive to the drawing, updating, and maintenance of the station yard map, line map, and section map.
[0005] In the field of rail transit line design, there is a need for accurate drawing of the station yard map, line map, and section map, and it should be convenient for interaction, unified management, and upgrade and maintenance. However, for the drawing tools based on specific clients, the drawing process is too cumbersome and costly, which is not conducive to the drawing, updating, and software upgrade of the station yard map, line map, and section map. Summary of the Invention
[0006] The present invention provides a rail transit map drawing system, method, electronic device, and storage medium to solve the defect of the cumbersome process of drawing rail transit maps in the prior art.
[0007] The present invention provides a rail transit map drawing system, including:
[0008] An event reading unit, configured to receive a mapping instruction and, based on the mapping instruction, determine a first window event; the first window event is used to characterize the operation information in the mapping instruction;
[0009] An event conversion unit for parsing the first window event to obtain a second window event representing the action type corresponding to the operation information, and constructing an event mapping tree with each action type in the second window event as a node;
[0010] An event execution unit for determining whether to execute the action of the corresponding node based on the semantic information of each node in the event mapping tree, and if so, obtaining the graphic parameters of the corresponding node from the graphic database;
[0011] A graphic display unit for generating and displaying a rail transit map based on the graphic parameters.
[0012] According to a rail transit map drawing system provided by the present invention, the event conversion unit includes a coordinate conversion module and an event interpretation module;
[0013] The coordinate conversion module is used to convert the original coordinates of the first window event into canvas coordinates; the canvas coordinates carry the graphic parameters;
[0014] The event interpretation module is used to parse the canvas coordinates to obtain the second window event, and construct an event mapping tree with each action type in the second window event as a node.
[0015] According to a rail transit map drawing system provided by the present invention, it further includes:
[0016] A data storage unit for converting each graphic parameter in the canvas coordinates into a data model and storing the data model in the graphic database.
[0017] According to a rail transit map drawing system provided by the present invention, the event execution unit includes:
[0018] An event traversal unit for traversing each node in the event mapping tree using a depth-first traversal strategy and obtaining the semantic information of each node;
[0019] An action processing unit for determining whether to execute the action of the corresponding node based on the semantic information of each node, and if so, obtaining the graphic parameters of the corresponding node from the graphic database.
[0020] According to a rail transit map drawing system provided by the present invention, the mapping instruction is a drawing instruction or a rendering instruction; the rail transit map is a drawn graphic or a rendered graphic;
[0021] When the mapping instruction is a drawing instruction, the graphic display unit is used to generate and display the drawn graphic based on the graphic parameters;
[0022] When the mapping instruction is a rendering instruction, the graphics display unit is used to render the drawn graphics based on the graphics parameters, generate and display the rendered graphics.
[0023] According to a rail transit map drawing system provided by the present invention, when the mapping instruction is a drawing instruction, the action types include at least one of clicking, stretching, and dragging; when the mapping instruction is a rendering instruction, the action types include at least one of displaying, flashing, and moving.
[0024] The present invention also provides a method for drawing a rail transit map, including:
[0025] Receiving a mapping instruction, and based on the mapping instruction, determining a first window event; the first window event is used to represent the operation information in the mapping instruction;
[0026] Parsing the first window event to obtain a second window event used to represent the action type corresponding to the operation information, and using each action type in the second window event as a node to construct an event mapping tree;
[0027] Based on the semantic information of each node in the event mapping tree, determining whether to execute the action of the corresponding node. If so, obtaining the graphics parameters corresponding to the node from the graphics database;
[0028] Generating and displaying a rail transit map based on the graphics parameters.
[0029] According to a method for drawing a rail transit map provided by the present invention, the parsing the first window event to obtain a second window event used to represent the action type corresponding to the operation information, and using each action type in the second window event as a node to construct an event mapping tree includes:
[0030] Converting the original coordinates of the first window event into canvas coordinates; the canvas coordinates carry the graphics parameters;
[0031] Parsing the canvas coordinates to obtain the second window event, and using each action type in the second window event as a node to construct an event mapping tree.
[0032] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of any one of the above-mentioned rail transit map drawing methods are implemented.
[0033] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the above-mentioned rail transit map drawing methods are implemented.
[0034] The rail transit map drawing system, method, electronic device and storage medium provided by the present invention, after receiving a mapping instruction, parse a second window event for characterizing an action type corresponding to operation information based on a first window event, and construct an event mapping tree with each action type as a node, so that it can automatically identify actions to be executed based on the semantic information of each node, and automatically draw a completed rail transit map based on corresponding graphic parameters, simplifying the rail transit map drawing process and reducing the system maintenance cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0036] Figure 1 is one of the schematic structural diagrams of the rail transit map drawing system provided by the present invention;
[0037] Figure 2 is the schematic structural diagram of the event mapping tree provided by the present invention;
[0038] Figure 3 is the schematic flow diagram of event recognition provided by the present invention;
[0039] Figure 4 is the schematic structural diagram of the graphic interface presentation mechanism provided by the present invention;
[0040] Figure 5 is the second schematic structural diagram of the rail transit map drawing system provided by the present invention;
[0041] Figure 6 is the schematic structural diagram of the rail transit map drawing system architecture provided by the present invention;
[0042] Figure 7 is the schematic flow diagram of the rail transit map drawing method provided by the present invention;
[0043] Figure 8 is the schematic structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0044] To make the objectives, technical solutions and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention with reference to the accompanying drawings in the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without making creative efforts shall fall within the protection scope of the present invention.
[0045] In the field of rail transit line design, there are precise drawing requirements for rail transit maps (such as yard maps and line maps), and it should be convenient for interaction, unified management, and upgrade and maintenance. However, for the drawing tools based on specific clients, the drawing process is too cumbersome and costly, which is not conducive to the drawing, updating, and software upgrade of yard maps and line maps.
[0046] The present invention draws yard maps and line maps on the web page. The interaction method is based on the signal device graphics library on the web page, and the data is based on the JSON / XML data model. The drawing personnel only need to use a browser to draw the entire yard equipment and line equipment. Thus, there is no need to install a specific software terminal on the client side, and the server is responsible for the unified maintenance and upgrade of the software. The following will explain and illustrate in detail the content provided by the present invention through specific embodiments.
[0047] Figure 1 is a schematic structural diagram of the rail transit map drawing system provided by the present invention, as Figure 1 shown. The system includes: an event reading unit 110, an event conversion unit 120, an event execution unit 130, and a graphic display unit 140.
[0048] Among them, the event reading unit 110 is used to monitor the operations of users. If a drawing instruction sent by a user is monitored, based on the drawing instruction, a first window event used to represent the operation information in the drawing instruction is determined. Among them, the first window event can be regarded as a low-level window event, such as a click operation of a user on a window. For example, the event reading unit can monitor the drawing instructions of users based on the event listening function event_listeners(). When a drawing instruction of a user is monitored, the first window event, that is, the low-level window event, is identified.
[0049] After recognizing the first window event, the event conversion unit 120 can obtain the corresponding original coordinates of the first window event. Since the original coordinates depend on the canvas coordinates, the original coordinates of the first window event can be converted into canvas coordinates, and then the events in the drawing instructions can be accurately recognized. After converting the original coordinates of the first window event into canvas coordinates, the canvas coordinates are parsed to obtain the second window event. The second window event is used to represent the action type corresponding to the operation information, such as click, stretch, drag, etc. At the same time, the canvas coordinates contain graphic parameter information. Therefore, each action type can be used as a node, and a corresponding event list, graphic parameters, and semantic information are assigned to each node to construct an event mapping tree.
[0050] As Figure 2 shown, each node of the event mapping tree contains a graphic. Among them, the leaf node is a primary object representing the visual attributes of the graphic (such as shape, color, size, etc.) and interaction methods, etc. The non-leaf node specifies the level at which the description of the graphic object is located. For example, "GraphElement" represents a graphic object node; the "Type" attribute represents the graphic type, such as "group", "single", and "Style" describes the visual attributes, including "backcolor", "drawcolor", "fillcolor", etc.; the "data" attribute represents the text information content to be displayed; "Event" describes the event, and its attributes include "open", "click", "highlight", etc. This is an abstract way of describing interaction events, and the specific semantics of the event are explained at a lower level, that is, the specific work that the interaction event needs to complete is clarified. This node model is the cornerstone of the interactive graphics system and provides a unified description method for interactive graphics.
[0051] In addition, Table 1 is a comparison table of each graphic attribute. The graphics in the graphic library define various attributes of the signal device in a structured manner for interactive graphics. As shown in Table 1, GraphID is the unique identifier of the graphic, and through this attribute value, the graphic can be conveniently searched and referenced; GraphName represents the name of the graphic, which is restricted by the Schema. GraphInfo is the basic information of the graphic, including version number, creation time, modification time, creator, modifier, usage, etc. GraphIns identifies the graphic instance, including namespace, organizational structure, etc.; the interaction event Events part describes the interaction events that the graphic can execute, which is a unique attribute of interactive graphics.
[0052] Table 1
[0053]
[0054] After obtaining the event mapping tree, the event execution unit 130 can traverse each node in the event mapping tree and determine whether to execute the action of the corresponding node based on the semantic information of each node in the event mapping tree. If so, it can obtain the graphic parameters of the corresponding node from the graphic database. Among them, the graphic database stores the graphic parameters corresponding to the canvas coordinates, and the graphic parameters can be stored in the graphic database in the form of a data model.
[0055] As Figure 3 shown, first, the initial event of the user operation, that is, the low-level window event or the low-level reading event, is obtained through the listener (belonging to the page presentation mechanism), and then it is converted into a specific interaction event through the event mechanism, and looped to match with the events in the event library and give the matching result, that is, the event recognition result. The interface graphic description file is parsed by the parsing engine TH-parser to form an event mapping tree. Whether to traverse the event mapping tree is determined according to the recognition result, and only the events recognized successfully can traverse the event mapping tree. The depth-first traversal strategy is adopted to traverse each node in the mapping tree. If a certain node responds to the event, semantic calculation is executed and the result is fed back to the interface for presentation. Otherwise, continue to traverse downward. Traversing the entire event mapping tree means that the semantic feedback is completed.
[0056] After obtaining the graphic parameters, the graphic display unit 140 generates a rail transit map based on the graphic parameters and feeds it back to be presented on the canvas. It can be understood that the system receives the user's mapping instruction and displays the rail transit map can be realized through the presentation mechanism of the graphic interface. As Figure 4 shown, the presentation mechanism of the graphic interface is mainly responsible for two parts of work, one is graphic presentation, and the other is user interaction. During the graphic display process, based on the THSVG interactive graphic library, the parsing engine TH-parser is used to parse the model data, map it to the graphic object and instantiate it, and finally present the specific graphic on the user interface.
[0057] It should be noted that the above rail transit map drawing system can be installed on the web side, that is, the user can draw a complex rail transit map on the web without installing a specific software terminal on the client side, which not only simplifies the process of drawing the rail transit map, but also can maintain and upgrade the system uniformly on the web side.
[0058] It can be seen that the rail transit map drawing system provided by the embodiment of the present invention draws train signal equipment in the form of a web page, and realizes unified management of the client through server-side deployment. That is, when the software needs to be upgraded, it only needs to be deployed once on the server side, and all clients will be upgraded. At the same time, the load of the client is reduced. The client only needs a web page to operate and does not need to install other clients. When the server performance permits, at least 1000 people can be allowed to work online at the same time. The client only needs a browser to operate without installing a specific client, which greatly reduces the maintenance cost.
[0059] After receiving the mapping instruction, the rail transit map drawing system provided by the embodiment of the present invention parses the first window event to obtain a second window event used to represent the action type corresponding to the operation information, and constructs an event mapping tree with each action type as a node, so that it can automatically identify the actions to be executed based on the semantic information of each node, and automatically draw and complete the rail transit map based on the corresponding graphic parameters, simplifying the drawing process of the rail transit map and reducing the maintenance cost of the system.
[0060] Based on the above embodiment, the event conversion unit 120 includes a coordinate conversion module and an event interpretation module;
[0061] The coordinate conversion module is used to convert the original coordinates of the first window event into canvas coordinates; the canvas coordinates carry graphic parameters;
[0062] The event interpretation module is used to parse the canvas coordinates to obtain a second window event, and construct an event mapping tree with each action type in the second window event as a node.
[0063] Specifically, after the event reading unit 110 obtains the first window event, the coordinate conversion module can convert the first window event into a second window event based on event_converter(), capture the original coordinates of the first window event through a listening function. Since the original event coordinates depend on the canvas coordinates, the original coordinates are converted into canvas coordinates through event_converter(), thus ensuring the accuracy of event response.
[0064] After obtaining the canvas coordinates, the event interpretation module uses event_interpretator() to receive the event conversion result (canvas coordinates), obtains a second window event (i.e., a high-level abstract event) through event_interpretator(), interprets the second window event as a specific action (click, stretch, drag, etc.), each graphic action corresponds to a specific action class, and constructs an event mapping tree with each action type in the second window event as a node.
[0065] Based on any of the above embodiments, it further includes:
[0066] A data storage unit, configured to convert each graphic parameter in the canvas coordinates into a data model and store the data model in a graphic database.
[0067] Specifically, the canvas coordinates carry graphic parameter information. The data storage unit can transfer the graphic parameters to the graphic database. Specifically, the graphic parameters on the canvas coordinates can be converted into a data model through the data model conversion event_transmodel() function, and the data model can be stored in the database through the spark-redis component.
[0068] Based on any of the above embodiments, the event execution unit includes:
[0069] An event traversal unit, configured to traverse each node in the event mapping tree by adopting a depth-first traversal strategy and obtain the semantic information of each node;
[0070] An action processing unit, configured to determine whether to execute the action of the corresponding node based on the semantic information of each node. If so, obtain the graphic parameters of the corresponding node from the graphic database.
[0071] Specifically, after the event mapping tree is constructed, the event traversal unit can execute specific graphic actions through event_processor(), search the event mapping tree by the depth-first traversal strategy. When a matching node is found, the action processing unit determines whether to execute according to the semantic information of the corresponding node. If so, execute the action processing method of the node, and find the matching graphic parameters and feedback them to the graphic rendering layer on the canvas.
[0072] Based on any of the above embodiments, the drawing instruction is a drawing instruction or a rendering instruction; the rail transit map is a drawn graphic or a rendered graphic;
[0073] When the drawing instruction is a drawing instruction, the graphic display unit is configured to generate and display a drawn graphic based on the graphic parameters;
[0074] When the drawing instruction is a rendering instruction, the graphic display unit is configured to render the drawn graphic based on the graphic parameters, generate and display a rendered graphic.
[0075] Specifically, when the mapping instruction is a drawing instruction, that is, when it is necessary to present the required rail transit map on a blank canvas, the graphic display unit generates and displays the drawing graphics based on the graphic parameters. When the mapping instruction is a rendering instruction, that is, when it is necessary to render the previously drawn graphics (such as dynamic display), the graphic display unit renders the drawn graphics based on the graphic parameters, generates and displays the rendered graphics. It can be understood that the drawn graphics can be stored in the graphic database, and when a rendering instruction is received, the corresponding drawn graphics are imported from the graphic database for rendering.
[0076] For example, when the mapping instruction is a rendering instruction, as Figure 5 shown, the canvas data reading function getDrawingsModel() reads the data in the graphic database. After the user saves the graphics drawn on the canvas to the database through the event_savemodel() function and then opens it again, it is necessary to read the data in the database and redraw the line diagram or yard diagram according to the read data. The event listening function event_listeners() of the graphics listens to the data reading. When a user opens the drawn line diagram or yard diagram, the reading operation is monitored, and the low-level reading event identified by the data reading operation is obtained. The event converter event_converter() converts the low-level reading event into a high-level abstract event, captures the event coordinates through the listening function. The event coordinates depend on the canvas coordinates, and it is necessary for event_converter() to convert the event coordinates into canvas coordinates. There is a corresponding relationship between the graphic parameters and the graphic state, and event_converter() parses the graphic parameters in the database and passes them to the graphic rendering module. The event interpreter event_interpretator() is used to receive the event conversion result. When event_interpretator() receives the high-level abstract event, it interprets the high-level event as specific drawing actions (display, blink, move), etc. Each graphic action corresponds to a specific action class. The parsing engine TH-parser of the graphic library receives the event interpretation information and displays the graphics on the canvas through the subdrawing() function. The WebSocket asynchronous transmission function for the web page and the database is used to asynchronously read the business data in the database, such as the lamp position change of the signal machine, the switch state information, the train position information, the route information, etc. The event interpreter event_interpretator() is used to receive the data conversion result, and finally the parsing engine TH-parser of the graphic library re-renders the state of the signal equipment to achieve the purpose of dynamic display.
[0077] Based on any of the above embodiments, when the drawing instruction is a drawing command, the action types include at least one of clicking, stretching, and dragging; when the drawing instruction is a rendering command, the action types include at least one of displaying, flashing, and moving.
[0078] As Figure 6 shown, the embodiment of the present invention designs a graphic database THSVG for the signal device network. Based on the drawing of HTML5 Canvas, through the research on the existing graphical technology methods, aiming at the characteristics and deficiencies of current JavaScript on the HTML5 interface, a parsing engine TH-parser based on the graphic library and a signal device graphic library THSVG are designed and implemented. Among them, the signal device graphic library THSVG altogether includes six core parts: an interactive graphic library, an interface display mechanism, an event mechanism, an interaction event library, a parsing engine TH-parser of the graphic library, and a human-computer interaction mechanism. Through this series of functions, the web-based graphic drawing technology is completed.
[0079] Among them, the human-computer interaction mechanism mainly includes two processes: event recognition and event feedback:
[0080] The event recognition process is relatively simple. When the user calls the graphic library for drawing, the user operation instructions are collected through the listener, and the event recognition function identificateEvent(Object) translates the user operation into a specific event in the event library.
[0081] The event feedback process is more complex. It is mainly that the parsing engine TH-parser of the graphic library parses the description recognition result of the user operation interface graph to form an event mapping tree. Only the user operations that are recognized successfully can be recognized as valid events, and the valid events can trigger traversing the event mapping tree to find the matching graphic parameters and feedback them to the graphic presentation layer.
[0082] In addition, the event mapping tree includes three elements: an event list, graphic parameters, and semantic information. The depth-first traversal strategy is used to search the event tree, the correct operation event is matched through the semantic information, and the matching graphic parameters are called out through the event.
[0083] Next, the rail transit map drawing method provided by the present invention will be described. The rail transit map drawing method described below can be correspondingly referred to the rail transit map drawing device described above.
[0084] Based on any of the above embodiments, the embodiment of the present invention provides a rail transit map drawing method based on the rail transit map drawing system described in any of the above embodiments. As Figure 7 shown, this method includes:
[0085] Step 710: Receive a mapping instruction and, based on the mapping instruction, determine a first window event; the first window event is used to represent the operation information in the mapping instruction.
[0086] Step 720: Parse the first window event to obtain a second window event used to represent the action type corresponding to the operation information, and construct an event mapping tree with each action type in the second window event as a node.
[0087] Step 730: Based on the semantic information of each node in the event mapping tree, determine whether to execute the action corresponding to the node. If so, obtain the graphic parameters corresponding to the node from the graphic database.
[0088] Step 740: Generate and display a rail transit map based on the graphic parameters.
[0089] Based on any of the above embodiments, parsing the first window event to obtain a second window event used to represent the action type corresponding to the operation information, and constructing an event mapping tree with each action type in the second window event as a node includes:
[0090] Convert the original coordinates of the first window event to canvas coordinates; the canvas coordinates carry graphic parameters.
[0091] Parse the canvas coordinates to obtain a second window event, and construct an event mapping tree with each action type in the second window event as a node.
[0092] Figure 8 It is a schematic structural diagram of an electronic device provided by the present invention. As Figure 8 shown, the electronic device may include: a processor 810, a memory 820, a communication interface 830, and a communication bus 840. Among them, the processor 810, the memory 820, and the communication interface 830 complete mutual communication through the communication bus 840. The processor 810 can call the logical instructions in the memory 820 to execute a rail transit map drawing method, which includes: receiving a mapping instruction and, based on the mapping instruction, determining a first window event; the first window event is used to represent the operation information in the mapping instruction; parsing the first window event to obtain a second window event used to represent the action type corresponding to the operation information, and constructing an event mapping tree with each action type in the second window event as a node; based on the semantic information of each node in the event mapping tree, determining whether to execute the action corresponding to the node. If so, obtaining the graphic parameters corresponding to the node from the graphic database; generating and displaying a rail transit map based on the graphic parameters.
[0093] In addition, when the logical instructions in the above-mentioned memory 820 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0094] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the rail transit map drawing method provided by the above-mentioned various methods. The method includes: receiving a mapping instruction, and based on the mapping instruction, determining a first window event; the first window event is used to represent the operation information in the mapping instruction; parsing the first window event to obtain a second window event used to represent the action type corresponding to the operation information, and using each action type in the second window event as a node to construct an event mapping tree; based on the semantic information of each node in the event mapping tree, determining whether to execute the action corresponding to the node. If so, obtaining the graphic parameters corresponding to the node from the graphic database; and generating and displaying a rail transit map based on the graphic parameters.
[0095] On another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the rail transit map drawing method provided by the above-mentioned various methods. The method includes: receiving a mapping instruction, and based on the mapping instruction, determining a first window event; the first window event is used to represent the operation information in the mapping instruction; parsing the first window event to obtain a second window event used to represent the action type corresponding to the operation information, and using each action type in the second window event as a node to construct an event mapping tree; based on the semantic information of each node in the event mapping tree, determining whether to execute the action corresponding to the node. If so, obtaining the graphic parameters corresponding to the node from the graphic database; and generating and displaying a rail transit map based on the graphic parameters.
[0096] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative work.
[0097] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A rail transit map drawing system, characterized in that, including: An event reading unit, configured to receive a mapping instruction and determine a first window event based on the mapping instruction; The first window event is used to represent the operation information in the mapping instruction; The first window event is a low-level window event; An event conversion unit, configured to parse the first window event to obtain a second window event for representing the action type corresponding to the operation information, and construct an event mapping tree with each action type in the second window event as a node; The second window event is a high-level abstract event; An event execution unit, configured to determine whether to execute the action of the corresponding node based on the semantic information of each node in the event mapping tree. If so, obtain the graphic parameters of the corresponding node from the graphic database; A graphic display unit, configured to generate and display a rail transit map based on the graphic parameters; The event conversion unit includes a coordinate conversion module and an event interpretation module; The coordinate conversion module is configured to convert the original coordinates of the first window event into canvas coordinates; the canvas coordinates carry the graphic parameters; The event interpretation module is configured to parse the canvas coordinates to obtain the second window event, and construct an event mapping tree with each action type in the second window event as a node; The rail transit map drawing system is installed on the web page.
2. The rail transit map drawing system according to claim 1, wherein It further includes: A data storage unit, configured to convert each graphic parameter in the canvas coordinates into a data model and store the data model in the graphic database.
3. The rail transit map drawing system according to claim 1, wherein The event execution unit includes: An event traversal unit, configured to traverse each node in the event mapping tree using a depth-first traversal strategy and obtain the semantic information of each node; An action processing unit, configured to determine whether to execute the action of the corresponding node based on the semantic information of each node. If so, obtain the graphic parameters of the corresponding node from the graphic database.
4. The rail transit map drawing system according to any one of claims 1 to 3, characterized in that, The mapping instruction is a drawing instruction or a rendering instruction; the rail transit map is a drawn graphic or a rendered graphic; When the mapping instruction is a drawing instruction, the graphic display unit is configured to generate and display the drawn graphic based on the graphic parameters; When the mapping instruction is a rendering instruction, the graphic display unit is configured to render the drawn graphic based on the graphic parameters, and generate and display the rendered graphic.
5. The rail transit map drawing system according to claim 4, wherein When the mapping instruction is a drawing instruction, the action type includes at least one of click, stretch, and drag; when the mapping instruction is a rendering instruction, the action type includes at least one of display, flash, and move.
6. A method for drawing a rail transit map based on the rail transit map drawing system according to any one of claims 1 to 5, characterized in that, including: Receiving a mapping instruction and determining a first window event based on the mapping instruction; The first window event is used to represent the operation information in the mapping instruction; Parsing the first window event to obtain a second window event for representing the action type corresponding to the operation information, and constructing an event mapping tree with each action type in the second window event as a node; Determining whether to execute the action of the corresponding node based on the semantic information of each node in the event mapping tree. If so, obtain the graphic parameters of the corresponding node from the graphic database; Generate and display a rail transit map based on the graphic parameters.
7. The method for drawing a rail transit map according to claim 6, wherein Parse the first window event to obtain a second window event for characterizing the action type corresponding to the operation information, and construct an event mapping tree with each action type in the second window event as a node, including: Convert the original coordinates of the first window event into canvas coordinates; the canvas coordinates carry the graphic parameters; Parse the canvas coordinates to obtain the second window event, and construct an event mapping tree with each action type in the second window event as a node.
8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, the steps of the rail transit map drawing method according to claim 6 or 7 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the rail transit map drawing method according to claim 6 or 7 are implemented.
Citation Information
Patent Citations
Method and device for map route compilation
CN105094815A