CN-121982133-A - Method, system, equipment and medium for drawing train number of webpage version train running chart
Abstract
Dividing a drawing area into continuous partitions, determining a corresponding initial graphic area according to text attributes of a target train number when drawing or updating the target train number, and determining an initial partition occupied by the initial graphic area; the method comprises the steps of carrying out collision detection on the coordinate information of an initial graph area and the coordinate information of graph areas of other vehicle numbers stored in an initial partition through a cache structure index, selecting one candidate graph area which does not collide from a plurality of generated candidate graph areas to be determined as a final drawing area when collision is detected, drawing a target vehicle number in the final drawing area, and updating the cache structure. The calculation process of collision detection is effectively reduced, the problem of overlapping shielding of the train number is solved, and the visual definition of the running chart is improved.
Inventors
- Suo Da
- FAN DONGMING
- MAO JIAMING
- QIAO YONGTAO
- SUN YOU
- LIANG XUAN
- WANG GANG
- WANG RUYUE
Assignees
- 卡斯柯信号(成都)有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260109
Claims (10)
- 1. A method for drawing train number of a webpage version train running chart is characterized by comprising the following steps: Dividing a drawing area of a webpage version train operation diagram into a plurality of continuous subareas along a longitudinal axis direction, and establishing a cache structure associated with the subareas, wherein the cache structure is used for storing train number and corresponding graphic area coordinate information in each subarea; When a target train number needs to be drawn or updated, determining a corresponding initial graph area according to the text attribute of the target train number, and determining an initial partition associated with the initial graph area from the partitions based on the ordinate range of the initial graph area; The coordinate information of the initial graphic area and the coordinate information of the graphic areas of the other train numbers are subjected to collision detection by indexing the coordinate information of the graphic areas of the other train numbers stored in the initial partition through the cache structure; under the condition that the collision detection result is collision, sequentially generating candidate graph areas in a plurality of preset offset layers along a vertical axis according to the drawing direction of the operation line corresponding to the target train number, and sequentially carrying out corresponding collision detection on the candidate graph areas so as to select one candidate graph area which is not collided from the plurality of candidate graph areas to be determined as a final drawing area; And drawing the target train number in the final drawing area, and updating and storing the target train number and the coordinate information of the corresponding final drawing area to the corresponding partition in the cache structure.
- 2. The method for drawing the train number of the webpage version train operation chart according to claim 1, wherein the establishing the cache structure associated with the subarea comprises the following steps: And establishing a hash table taking the partition index as a key as a cache structure, wherein the value corresponding to each key is the number of the train in the corresponding partition and the coordinate information of the graph area corresponding to the number of the train.
- 3. The web page version train operation chart train number drawing method according to claim 1, wherein in the case that the target train number needs to be deleted, the method further comprises: And removing the target train number and the corresponding graphic region coordinate information from all the partitions of the cache structure.
- 4. The method for drawing the train number of the web version train operation chart according to claim 1, wherein the step of performing collision detection on the coordinate information of the initial graphic area and the coordinate information of the graphic areas of the other train numbers comprises the steps of: detecting whether rectangles corresponding to the coordinate information of the initial graphic area are intersected with rectangles corresponding to the coordinate information of the graphic areas of other train numbers or not through a rectangle intersection method; And determining that collision is generated when the detection result meets the intersection condition corresponding to the rectangular intersection method.
- 5. The method for drawing the train number of the webpage version train operation chart according to claim 1, wherein the method for generating the candidate graph area comprises the following steps: Determining the offset direction of the initial graphic area according to the drawing direction of the operation line corresponding to the target train number; And generating a candidate graph area according to the ordinate of the initial graph area, the current preset offset layer and the preset offset step distance.
- 6. The method for drawing the train number of the running chart of the webpage version of the train according to claim 5, wherein the generating the candidate graphic area according to the ordinate of the initial graphic area, the current preset offset layer and the preset offset step distance comprises the following steps: when the drawing direction is the upward direction, the candidate graphics area is shifted downward based on the initial graphics area; When the drawing direction is the downward direction, the candidate graphics area is shifted upward based on the initial graphics area.
- 7. The method for drawing train number of running map of web page version of train according to claim 1, wherein if no candidate graphic area which is not collided is found in all preset offset layers, a candidate graphic area is determined from a preset default offset layer as a final drawing area.
- 8. A web page train running chart number drawing system, which is characterized by being used for rendering and displaying a train running chart in a display page and applying the web page train running chart number drawing method in any one of claims 1 to 7 in the display process.
- 9. An electronic device, comprising: A processor; A memory for storing the processor-executable instructions; Wherein the processor is configured to execute to implement a web version train operation drawing number drawing method as claimed in any one of claims 1 to 7.
- 10. A non-transitory computer readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform a method of implementing a web page train operation drawing train number drawing according to any one of claims 1 to 7.
Description
Method, system, equipment and medium for drawing train number of webpage version train running chart Technical Field The invention relates to the technical field of webpage train running chart visualization, in particular to a webpage train running chart train number drawing method, system, equipment and medium. Background The webpage version train running diagram is taken as a core foundation of railway transportation, is a key for guaranteeing safe, efficient and orderly development of transportation, a dispatcher scientifically arranges train running paths and sequences through the running diagram, the railway line passing capacity can be utilized to the maximum extent, the transportation benefit maximization is realized, the train number is taken as core information of a train identified in the train running diagram, and clear and non-shielding display is directly related to the efficiency and the accuracy of dispatching work. In the technical field of webpage train running diagram visualization, collision detection of graphic elements is a key technology for ensuring normal display of train number, three types of common collision detection modes mainly exist in the prior art, namely, a global traversal method is used for judging whether all existing graphic elements are overlapped in pairs or not through comparison, the method is simple in logic, but in practical application, obvious performance bottlenecks are faced, real-time interaction requirements are difficult to adapt, a quadtree or a space division tree is used for detecting elements in the same area through recursively dividing drawing areas, the method is more suitable for static or low-frequency updated scenes, a tree structure needs to be rebuilt or updated frequently in dynamic scenes of frequent movement, new addition, deletion or update of the graphic elements of a train running diagram, maintenance cost is too high, the implementation process is complex, a grid-based partitioning method is used for dividing canvas into grids with fixed sizes, and elements in a grid storage area are used, but because the train number consists of letters and numbers, the length exists, grid granularity is difficult to be unified, memory is easy to be sparse or too dense, and memory waste or collision detection failure is caused. In the prior art, for example, chinese patent CN121118196a provides a method, an apparatus and a medium for labeling a beam and slab, and the method includes receiving a labeling configuration parameter of a target labeling view, labeling the target labeling view according to a selected labeling update mode and the labeling configuration parameter to generate a target beam and slab label, performing collision detection on the target beam and slab label according to an avoidance rule and a beam and slab priority to obtain a standard beam and slab label, and generating drawing description annotation of the target labeling view according to a template description family and a beam and slab section size to be hidden and labeled. But obviously belongs to different application scenes with the train operation diagram, and the technical migration is difficult for a person skilled in the art. The difficulty is that with the continuous increase of railway passenger transport and freight transport demands, the number of running lines required to be managed by each dispatching desk is greatly increased, the train departure interval is short, the running lines on the running chart are densely arranged, meanwhile, the number of trains is also in complicated conditions of inconsistent length, real-time addition, deletion and correction, different running line uplink and downlink directions and the like, the existing collision detection technology is difficult to adapt to a special application scene of the train running chart, the number of trains is easy to be overlapped and shielded, a dispatcher cannot quickly position the running line of a target train, the efficiency and the accuracy of dispatching work are affected, and hidden danger is also possibly caused to the running safety of the trains. In view of this, the present application has been proposed. Disclosure of Invention The embodiment of the application solves the technical problem that the number of the train in the webpage train running chart is not clearly displayed in the prior art by providing the method, the system, the equipment and the medium for drawing the number of the train in the webpage train running chart, and achieves the technical effect of improving the visual definition of the number of the train in the webpage train running chart. In a first aspect, the application provides a method for drawing train number of a webpage version train running chart, which comprises the following steps: Dividing a drawing area of a webpage version train running chart into a plurality of continuous subareas along a longitudinal axis direction, and establishing a cache structure associ