Station yard graph generation method based on Web Worker

By adopting Web Worker technology in site map generation and using parallel processing methods of the first thread and the second thread, the existing site map generation problem is solved, and efficient site map generation is achieved and user experience is improved.

CN120066812APending Publication Date: 2025-05-30ZHONGHE ZHIXING RAIL TRANSIT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411922762.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The existing site map generation method is complex and inefficient in system integration and software updates, and the performance of ordinary browser solutions is low, which cannot meet the needs of big data interaction.

Method used

Using the Web Worker-based site diagram generation method, by creating a first thread and a second thread, where the first thread is responsible for interacting with the user and generating site diagram, and the second thread is responsible for processing complex data and generating rendering instructions. The two process configuration parameters in parallel to improve generation speed and efficiency.

Benefits of technology

It significantly improves the generation speed and efficiency of the site map, reduces the computing load of the first thread, improves the user experience, and reduces the difficulty of engineering and maintenance work intensity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066812A_ABST
    Figure CN120066812A_ABST
Patent Text Reader

Abstract

The invention discloses a Web Worker-based station graph generation method, which belongs to the technical field of rail transit, and is characterized in that a first thread and a second thread are constructed, the first thread is responsible for interacting with a user, generating a station graph according to a rendering instruction and updating a UI interface, and the second thread is responsible for interacting with the user; the second thread is responsible for processing complex station graph data and generating a rendering instruction according to a processing result, and the two processes configuration parameters in parallel; according to the method, the problems of low production efficiency and slow response caused by relatively complex project and relatively high software performance under the condition of relatively large data volume of an existing station graph generation mode are solved, data processing and analysis operations are executed in a background thread, user interface interaction of a first thread cannot be blocked or delayed, and the user experience is improved. And the second thread is specially responsible for data evaluation and processing, so that a large amount of data can be processed more efficiently, the burden of the first thread is reduced, and the overall processing efficiency is improved, thereby improving the generation rate of the station yard graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of rail transit. Specifically, it relates to a method for generating a station yard map based on Web Worker. Background Art

[0002] With the rapid development of rail transit signal systems, safety and efficient operation have been highly emphasized. Thus, the Urban Rail Transit Signal Maintenance Support System (MSS) has emerged. Its main functions include operation status monitoring, equipment identification, fault troubleshooting and handling, and equipment operation quality evaluation. Station yard map monitoring belongs to the operation status monitoring function, which is the data monitoring aggregation display function of the entire CBTC system (Communication Based Train Control System). It plays an important role in monitoring track signals and train operation information, with a huge data interaction scenario. The display solutions mainly include desktop applications made with QT and ordinary browser display solutions. However, the above technologies have the following two problems: 1. For the windows desktop application solution, when integrating the system and updating the software, each workstation needs to install or update the software uniformly, which is complex, cumbersome, labor-intensive, and inefficient; 2. For the ordinary browser solution, due to browser limitations, the performance is low. In the case of a large amount of data interaction, it leads to untimely or incorrect responses and lacks cross-system capabilities.

[0003] Chinese Patent, Publication No.: CN113724571A, Publication Date: November 30, 2021, discloses a method for generating a rail transit station yard map. By obtaining the electronic map information of the target rail line, converting the electronic map information into map JSON data; obtaining the basic primitive JSON data; generating the station yard map of the target rail line according to the map JSON data and the basic primitive JSON data. However, it requires uniform installation or update of software, which is complex, cumbersome, and labor-intensive, and the generation efficiency is too low to meet the current business requirements. Summary of the Invention

[0004] In view of the problems of the existing method for generating station yard diagrams, which are relatively complex in engineering, require high software performance in the case of large data volumes, resulting in low production efficiency and slow response, the present invention provides a method for generating station yard diagrams based on Web Worker. By constructing a first thread and a second thread, where the first thread is responsible for interacting with the user, generating a station yard diagram according to a rendering instruction, and updating the UI interface, while the second thread is responsible for processing complex station yard diagram data and generating a rendering instruction according to the processing result. The two perform parallel processing on the configuration parameters, execute data processing and analysis operations in the background thread, do not block or delay the user interface interaction of the first thread, and the second thread is specifically responsible for data evaluation and processing, can process a large amount of data more efficiently, reduce the burden on the first thread, improve the overall processing efficiency, and thus improve the generation rate of the station yard diagram.

[0005] In a first aspect, a technical solution provided in an embodiment of the present invention is: a method for generating a station yard diagram based on Web Worker, comprising the following steps: S1. Obtain configuration parameters based on business requirements, and create a first thread based on the configuration parameters; the first thread obtains a second thread in response to a thread generation mechanism; S2. The first thread sends the configuration parameters to the second thread based on a data transmission mechanism; S3. The second thread evaluates the data length of the configuration parameters in response to a data evaluation principle, and processes the configuration parameters based on the evaluation result to obtain a data queue; S4. The data in the data queue obtains a rendering instruction in response to a data processing mechanism and sends it to the first thread based on a data transmission mechanism; the first thread calls a corresponding graphics library based on the rendering instruction to obtain a target station yard diagram.

[0006] In this solution, by creating and utilizing a first thread and a second thread, where the first thread is responsible for interacting with the user, generating a station yard diagram according to a rendering instruction, and updating the UI interface, while the second thread is responsible for processing complex station yard diagram data and generating a rendering instruction according to the processing result. The two perform parallel processing on the configuration parameters, can reduce the computing load of the first thread, and perform data processing in the background by the second thread, thereby significantly improving the generation speed of the station yard diagram; by executing scripts in the background thread by Web Worker, it does not block or delay the user interface interaction of the main thread. While generating the station yard diagram, the user can still interact with the web page smoothly, improving the user experience; by processing data in the background, there is no need to install software, reducing the steps in generating the station yard diagram, reducing the engineering difficulty, and there is no need to frequently update the software, reducing the labor expenditure and the work intensity of maintenance personnel, and improving the work efficiency.

[0007] Preferably, in S1, configuration parameters are obtained based on business requirements, and a first thread is created based on the configuration parameters, including the following steps: Configuration parameters are obtained based on track signals and train operation information, the configuration parameters are classified according to the data types of the configuration parameters, a UI interface is constructed based on the types of the configuration parameters, and a first thread is created based on the data display area and data update mechanism in the UI interface.

[0008] In this solution, the first thread is responsible for interacting with the user and displaying the station yard diagram, and the station yard diagram usually includes track signals and train operation information. Therefore, in order to accurately synchronize this information to the station yard diagram, the configuration parameters are classified, and a UI interface is constructed according to the classified data, which can simplify the data processing flow, make data management more orderly. At the same time, the classified data is easier to understand and analyze, which helps the design of the UI interface and data display in the subsequent steps; and a first thread is created to handle the tasks of data display and data update in the UI interface, which can ensure that these tasks run independently in the background and do not block the main thread. In this way, even if the data is updated frequently or the data volume is large, the response of the user interface remains smooth, thus improving the efficiency of generating the station yard diagram and the user experience.

[0009] Preferably, in S1, the first thread obtains a second thread in response to a thread generation mechanism, including the following steps: the first thread creates a service instance by introducing a second thread constructor. Synchronously, a service script is created based on business requirements, and the service script is imported into the service instance to obtain the second thread.

[0010] In this solution, the constructor can initialize all resources and states required for the service instance, ensure that the service instance has all the conditions required for execution when it is created, help to create the service instance quickly and consistently, and reduce human errors and unnecessary configuration time; by encapsulating the business logic in the service script and importing it into the service instance, the modularity and reusability of the business logic can be realized. This service script is generated according to business requirements, such as the scope, generation logic, generation steps and parameters for generating the station yard diagram to process the configuration parameters, and can be updated in real time according to the change of requirements, making the business logic clearer, easier to understand and maintain.

[0011] Preferably, in S2, the first thread sends the configuration parameters to the second thread based on a data transmission mechanism, including the following steps: The configuration parameters are grouped based on the data sources of the configuration parameters to obtain target data; The message sending function is called to send the target data to the second thread and the target data is arranged based on the message record order generated by the sending of the target data to obtain a message queue.

[0012] In this solution, by grouping configuration parameters based on the data sources of the configuration parameters, data of the same or similar types can be classified together, which helps to simplify the data processing flow, reduce unnecessary data conversion and format adjustment, and thus improve the data processing efficiency; sending the target data to the second thread and arranging the target data based on the message record order generated by the sending of the target data to obtain a message queue helps to optimize inter-thread communication. Arranging and storing the data structure in a first-in, first-out manner can ensure that the data is received and processed in the sending order, thus avoiding problems such as data loss or out-of-order; using the message queue as a communication bridge between the first thread and the second thread can enable the second thread to start processing immediately after receiving the data without waiting for the first thread to complete all data processing tasks, thus improving the data processing speed and the efficiency of generating the station yard diagram.

[0013] Preferably, in S3, the second thread evaluates the data volume of the configuration parameters in response to the data evaluation principle, including the following steps: The second thread receives the target data in the message queue and detects the number of message records corresponding to the target data. If the number exceeds the set threshold, the unprocessed target data is discarded and the target data is sequentially saved to the message queue again.

[0014] In this solution, when the number of message records corresponding to the target data in the message queue exceeds the set threshold, the second thread discards the unprocessed target data. This mechanism helps to prevent the system from being overloaded due to processing too much data and ensures the stable operation of the system; by discarding the data exceeding the threshold, the system can avoid consuming too many system resources such as CPU and memory for processing these data. This helps to protect system resources and prevent the system from crashing or its performance from degrading due to resource exhaustion; by sequentially saving the target data to the message queue again, it can ensure that the system maintains a certain rhythm and efficiency when processing data, avoiding problems such as processing delay or processing failure caused by processing too much data at one time, and ensuring the accuracy of the data monitored and displayed in the generated station yard diagram.

[0015] Preferably, in S3, processing the configuration parameters based on the evaluation result to obtain a data queue includes the following steps: Based on the order of the first thread processing the target data in the message queue, the target data being processed is sent to the second thread through a message sending function, and is sequentially arranged and saved based on the target data sending order to obtain a data queue.

[0016] In this solution, the target data being processed is sent to the second thread through a message sending function, and is arranged and saved in sequence based on the target data sending order to obtain a data queue, which promotes the effective cooperation between the first thread and the second thread. The first thread is responsible for processing and preparing data, while the second thread is responsible for receiving and further processing this data. Through the message sending function and the data queue, the two threads can transfer data seamlessly, thereby achieving efficient parallel processing, improving the data transmission rate and thus enhancing the generation efficiency of the station yard diagram; during the data processing process, if a certain thread fails or encounters an exception, the data queue can serve as a buffer to store the unprocessed data. When the failure is recovered, the system can retrieve these data from the data queue and continue processing, thereby ensuring the integrity and accuracy of the data and guaranteeing the accuracy of the data monitored and displayed in the generated station yard diagram.

[0017] Preferably, in S4, the data in the data queue receives a rendering instruction in response to the data processing mechanism and is sent to the first thread based on the data transmission mechanism, including the following steps: Send the target data in the data queue to the data processing model. The data processing model filters and classifies the target data to obtain at least train data, section data, axle counter data, and signal data, and distributes them to the corresponding processing tasks to obtain a rendering instruction. The rendering instruction is sent to the first thread through the message sending function.

[0018] In this solution, by distributing different types of data to the corresponding processing tasks, the system can allocate computing resources more reasonably. For example, the task of processing train data may require more computing resources to ensure real-time performance and accuracy, while the task of processing signal data may be relatively simple, which helps to maximize the utilization of computing resources; since different types of data are distributed to different processing tasks, these tasks can be executed in parallel, thereby further improving the speed and efficiency of data processing, applicable to the large-scale data processing scenario generated during the monitoring of rail transit operation status, and can significantly shorten the processing time.

[0019] Preferably, in S4, the first thread calls the corresponding graphics library based on the rendering instruction to obtain the target station yard diagram, including the following steps: The first thread saves the rendering instructions in sequence based on the sending order of the rendering instructions sent by the second thread to obtain a task queue; The first thread sequentially executes the rendering instructions in the task queue and calls the corresponding graphics library to render the UI interface to obtain the target station yard diagram.

[0020] In this solution, due to the large amount of data obtained, the tasks to be processed are arranged in a task queue. If a certain thread fails or encounters an exception, the task queue can serve as a buffer to store the unprocessed tasks. When the failure is recovered, the system can retrieve these tasks from the task queue and continue to process them, thus ensuring that subsequent task executions will not all be incorrect due to short-term failures, limiting the losses caused by failures, and improving the ability to handle unexpected situations in the station yard diagram.

[0021] Preferably, the rendering instruction at least includes a drawing instruction for the track line and a display format for the station information.

[0022] In this solution, in the station yard diagram, the train operation information and traffic signal information will be displayed, facilitating users to clearly understand the specific operation of the entire rail transit on the station yard diagram. In order to accurately display this data on the station yard diagram, these data are updated and displayed according to the drawing instruction of the track line and the display format of the station information, so as to update and render the UI interface.

[0023] Preferably, the first thread interacts with the user to obtain interaction instructions and edits the station yard diagram based on the interaction instructions; the editing at least includes zooming, panning, selecting stations or trains.

[0024] In this solution, the user can interact on the UI interface. The first thread collects and analyzes the user interaction information, and responds to the user interaction information in a timely manner based on the analysis results, thus ensuring the user experience.

[0025] Advantages of the present invention: (1) By creating and utilizing the first thread and the second thread, the first thread is responsible for interacting with the user, generating the station yard diagram according to the rendering instruction, and updating the UI interface, while the second thread is responsible for processing complex station yard diagram data and generating rendering instructions according to the processing results. The two perform parallel processing on the configuration parameters, which can reduce the computing load of the first thread, and the second thread performs data processing in the background, thus significantly improving the generation speed of the station yard diagram; (2) By executing the script in the background thread through Web Worker, it will not block or delay the user interface interaction of the main thread. While generating the station yard diagram, the user can still interact with the web page smoothly, improving the user experience; (3) By processing the data in the background, there is no need to install software, reducing the steps in generating the station yard diagram, reducing the engineering difficulty, and there is no need to frequently update the software, reducing the labor expenditure, reducing the work intensity of the maintenance personnel, and improving the work efficiency.

[0026] The above invention content is only an overview of the technical solution of the present invention. In order to be able to more clearly understand the technical means of the present invention, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable, the specific embodiments of the present invention are specifically exemplified below. Brief Description of the Drawings

[0027] By reading the detailed description of the non-restrictive embodiments with reference to the following drawings, other features, purposes and advantages of the present invention will become more obvious. The drawings are only for the purpose of showing the preferred embodiments and are not considered as limiting the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components.

[0028] Figure 1 It is a flowchart of a method for generating a station yard map based on Web Worker of the present invention. Specific Embodiments

[0029] To make the purpose, technical solution and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only the best embodiments of the present invention, which are only used to explain the present invention and do not limit the protection scope of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0030] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts depict the operations (or steps) as sequential processes, many of the operations (or steps) can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operations are completed, but there can also be additional steps not included in the drawings; the process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0031] Embodiment: As Figure 1 shown, in order to solve the problems of the existing station yard map generation method that the project is relatively complex and the software performance required is relatively high in the case of a large amount of data, resulting in low production efficiency and slow response, this embodiment provides a method for generating a station yard map based on Web Worker, including the following steps: S1: Obtain configuration parameters based on service requirements, and create a first thread based on the configuration parameters; the first thread obtains a second thread in response to the thread generation mechanism.

[0032] In this embodiment, obtaining configuration parameters based on service requirements and creating a first thread based on the configuration parameters include the following steps: Obtain configuration parameters based on track signals and train operation information, classify the configuration parameters according to the data types of the configuration parameters, construct a UI interface based on the types of the configuration parameters, and create a first thread based on the data display area and data update mechanism in the UI interface.

[0033] In this embodiment, the first thread is responsible for interacting with the user and displaying the station yard map. Usually, the station yard map contains track signals and train operation information. Therefore, in order to accurately synchronize this information to the station yard map, the configuration parameters are classified, and a UI interface is constructed according to the classified data, which can simplify the data processing flow, make data management more orderly. At the same time, the classified data is easier to understand and analyze, which helps the design and data display of the UI interface in the subsequent steps; and a first thread is created to handle the tasks of data display and data update in the UI interface, which can ensure that these tasks run independently in the background and do not block the main thread. In this way, even if the data is updated frequently or the data volume is large, the response of the user interface remains smooth, thus improving the generation efficiency of the station yard map and the user experience.

[0034] In this embodiment, the first thread obtains a second thread in response to the thread generation mechanism, including the following steps: The first thread introduces the second thread constructor to create a service instance. Synchronously, a service script is created based on service requirements, and the service script is imported into the service instance to obtain the second thread.

[0035] The second thread constructor in this embodiment can initialize all resources and states required by the service instance, ensure that the service instance has all the conditions required for execution when it is created, which helps to create the service instance quickly and consistently, and reduces human errors and unnecessary configuration time; by encapsulating the business logic in the service script and importing it into the service instance, the modularity and reusability of the business logic can be achieved. This service script is generated according to service requirements, such as the scope, generation logic, generation steps and parameters for generating the station yard map to process the configuration parameters, and at the same time, the service script can be updated in real time according to the change of requirements, making the business logic clearer, easier to understand and maintain.

[0036] S2: The first thread sends the configuration parameters to the second thread based on the data transmission mechanism.

[0037] In this embodiment, the first thread sends the configuration parameters to the second thread based on the data transmission mechanism, including the following steps: Group the configuration parameters according to the data sources of the configuration parameters to obtain target data; Call the message sending function to send the target data to the second thread and arrange the target data according to the message record order generated by the sending of the target data to obtain a message queue.

[0038] In this embodiment, by grouping the configuration parameters based on the data sources of the configuration parameters, the same or similar types of data can be classified together, which helps to simplify the data processing flow, reduce unnecessary data conversion and format adjustment, and thus improve the data processing efficiency; sending the target data to the second thread and arranging the target data based on the message record order generated by the sending of the target data to obtain a message queue helps to optimize the inter-thread communication. Arranging and storing the data structure in a first-in, first-out manner can ensure that the data is received and processed in the sending order, thus avoiding the problems of data loss or out-of-order; using the message queue as a bridge for communication between the first thread and the second thread can enable the second thread to start processing immediately after receiving the data without waiting for the first thread to complete all data processing tasks, thereby improving the data processing speed and the efficiency of generating the yard plan.

[0039] S3: The second thread evaluates the data length of the configuration parameters in response to the data evaluation principle, and processes the configuration parameters based on the evaluation result to obtain a data queue.

[0040] In this embodiment, the second thread evaluates the data volume of the configuration parameters in response to the data evaluation principle, including the following steps: The second thread receives the target data in the message queue and detects the number of message records corresponding to the target data. If the number exceeds the set threshold, the unprocessed target data is discarded and the target data is saved to the message queue again in sequence.

[0041] In this embodiment, when the number of message records corresponding to the target data in the message queue exceeds the set threshold, the second thread will discard the unprocessed target data. This mechanism helps to prevent the system from being overloaded due to processing too much data and ensures the stable operation of the system; by discarding the data exceeding the threshold, the system can avoid consuming too much system resources such as CPU and memory due to processing this data. This helps to protect the system resources and prevent the system from crashing or the performance from degrading due to resource exhaustion; by saving the target data to the message queue again in sequence, it can ensure that the system maintains a certain rhythm and efficiency when processing data, avoiding the problems of processing delay or processing failure caused by processing too much data at one time, and ensuring the accuracy of the data monitored and displayed in the generated yard plan.

[0042] In this embodiment, processing the configuration parameters based on the evaluation result to obtain a data queue includes the following steps: based on the order of the first thread processing the target data in the message queue, sending the target data being processed to the second thread through a message sending function, and arranging and saving them in sequence based on the sending order of the target data to obtain a data queue.

[0043] In this embodiment, the target data being processed is sent to the second thread through a message sending function, and is sequentially arranged and saved based on the target data sending order to obtain a data queue, which promotes the effective cooperation between the first thread and the second thread. The first thread is responsible for processing and preparing data, while the second thread is responsible for receiving and continuing to process this data. Through the message sending function and the data queue, the two threads can seamlessly transfer data, thereby achieving efficient parallel processing, improving the data transmission rate, and thus improving the generation efficiency of the station yard diagram; during the data processing process, if a certain thread fails or has an exception, the data queue can serve as a buffer to store the unprocessed data. When the failure is recovered, the system can re-obtain this data from the data queue and continue to process it, thereby ensuring the integrity and accuracy of the data and guaranteeing the accuracy of the data monitored and displayed in the generated station yard diagram.

[0044] S4: The data in the data queue receives a rendering instruction in response to the data processing mechanism and is sent to the first thread based on the data transmission mechanism; the first thread calls the corresponding graphics library based on the rendering instruction to obtain the target station yard diagram.

[0045] In this embodiment, the data in the data queue receives a rendering instruction in response to the data processing mechanism and is sent to the first thread based on the data transmission mechanism, including the following steps: Send the target data in the data queue to the data processing model. The data processing model filters and classifies the target data to obtain at least train data, section data, axle counter data, and signal data, and distributes them to the corresponding processing tasks to obtain a rendering instruction. The rendering instruction is sent to the first thread through a message sending function.

[0046] In this embodiment, by distributing different types of data to the corresponding processing tasks, the system can allocate computing resources more reasonably. For example, the task of processing train data may require more computing resources to ensure real-time performance and accuracy, while the task of processing signal data may be relatively simple, which helps to maximize the utilization of computing resources; since different types of data are distributed to different processing tasks, these tasks can be executed in parallel, thereby further improving the speed and efficiency of data processing, being applicable to large-scale data processing scenarios generated during rail transit operation status monitoring, and being able to significantly shorten the processing time.

[0047] In this embodiment, the first thread calls the corresponding graphics library based on the rendering instruction to obtain the target station yard diagram, including the following steps: The first thread saves the rendering instructions based on the sending order of the rendering instructions sent by the second thread to obtain a task queue; The first thread sequentially executes the rendering instructions in the task queue and calls the corresponding graphics library to render the UI interface to obtain the target station yard diagram.

[0048] In this embodiment, since a large amount of data is obtained, the tasks to be processed are arranged in the form of a task queue. If a certain thread fails or encounters an exception, the task queue can serve as a buffer to store the unprocessed tasks. When the failure is recovered, the system can retrieve these tasks from the task queue and continue to process them, thus ensuring that subsequent task executions will not all be in error due to short-term failures, limiting the losses caused by the occurrence of failures, and thereby improving the ability to handle unexpected situations in the station yard map.

[0049] In this embodiment, the rendering instruction at least includes a drawing instruction for the track line and a display format for the station information.

[0050] In this embodiment, in the station yard map, the train operation information and traffic signal information will be displayed, facilitating the user to clearly understand the specific operation situation of the entire rail transit on the station yard map. In order to accurately display this data on the station yard map, these data are updated and displayed according to the drawing instruction of the track line and the display format of the station information, so as to update and render the UI interface.

[0051] In this embodiment, the first thread interacts with the user to obtain interaction instructions and edits the station yard map based on the interaction instructions; the editing at least includes zooming, panning, selecting stations or trains.

[0052] In this embodiment, the user can interact on the UI interface. The first thread collects and analyzes the user interaction information and responds to the user interaction information in a timely manner based on the analysis result, thus ensuring the user experience.

[0053] In this embodiment, by creating and utilizing the first thread and the second thread, where the first thread is responsible for interacting with the user, generating the station yard map according to the rendering instruction, and updating the UI interface, while the second thread is responsible for processing complex station yard map data and generating the rendering instruction according to the processing result. The two perform parallel processing on the configuration parameters, which can reduce the computing load of the first thread and have the second thread perform data processing in the background, thus significantly improving the generation speed of the station yard map; by executing the script in the background thread through Web Worker, it will not block or delay the user interface interaction of the main thread. While the station yard map is being generated, the user can still smoothly interact with the web page, enhancing the user experience; by processing the data in the background, there is no need to install software, reducing the steps in generating the station yard map, lowering the engineering difficulty, and there is no need to frequently update the software, reducing the labor expenditure and the work intensity of the maintenance personnel, and improving the work efficiency.

[0054] It can be seen from the above embodiments that at least the following substantial effects are achieved: (1) The present invention creates and utilizes a first thread and a second thread. The first thread is responsible for interacting with the user, generating a station yard diagram according to rendering instructions, and updating the UI interface. The second thread is responsible for processing complex station yard diagram data and generating rendering instructions according to the processing results. The two perform parallel processing on configuration parameters, which can reduce the computing load of the first thread and perform data processing in the background by the second thread, thereby significantly improving the generation speed of the station yard diagram; (2) The present invention executes scripts in a background thread through Web Worker, which does not block or delay the user interface interaction of the main thread. While generating the station yard diagram, the user can still interact with the web page smoothly, improving the user experience; (3) The present invention processes data in the background, eliminating the need for software installation, reducing the steps in generating the station yard diagram, lowering the engineering difficulty, and eliminating the need for frequent software updates, reducing labor costs and the work intensity of maintenance personnel, and improving work efficiency.

[0055] The above-described specific embodiments are the preferred embodiments of a method for generating a station yard diagram based on Web Worker of the present invention, and do not limit the specific scope of the present invention. The scope of the present invention includes but is not limited to this specific embodiment. Any equivalent changes made according to the shape and structure of the present invention are within the protection scope of the present invention.

Claims

1. A method for generating a station map based on Web Worker, characterized in that: The following steps are involved: S1. Obtain configuration parameters based on business requirements, and create a first thread based on the configuration parameters; The first thread obtains the second thread in response to the thread generation mechanism; S2. The first thread sends the configuration parameters to the second thread based on the data transmission mechanism; S3, the second thread evaluates the data length of the configuration parameter in response to the data evaluation principle, and processes the configuration parameter based on the evaluation result to obtain a data queue; S4. The data in the data queue obtains a rendering instruction in response to the data processing mechanism and is sent to the first thread based on the data transmission mechanism; the first thread calls the corresponding graphics library based on the rendering instruction to obtain a target site map.

2. According to the method for generating a site map based on Web Worker according to claim 1, it is characterized in that: In S1, configuration parameters are obtained based on business requirements, and a first thread is created based on the configuration parameters, including the following steps: Configuration parameters are obtained based on track signals and train operation information, the configuration parameters are classified based on their data types, a UI interface is constructed based on the types of configuration parameters, and a first thread is created based on the area where data is displayed in the UI interface and a data update mechanism.

3. The method for generating a site map based on Web Worker according to claim 1, characterized in that: In S1, the first thread obtains the second thread in response to the thread generation mechanism, including the following steps: The first thread introduces the second thread constructor to create a business instance, and synchronously creates a business script based on business requirements, and imports the business script into the business instance to obtain the second thread.

4. The method for generating a site map based on Web Worker according to claim 1, characterized in that: In S2, the first thread sends the configuration parameters to the second thread based on the data transmission mechanism, including the following steps: The configuration parameters are grouped and processed based on the data sources of the configuration parameters to obtain target data; The message sending function is called to send the target data to the second thread and the target data is arranged based on the message record sequence generated by the target data sending to obtain a message queue.

5. The method for generating a site map based on Web Worker according to claim 4, characterized in that: In S3, the second thread evaluates the data volume of the configuration parameter in response to the data evaluation principle, including the following steps: The second thread receives the target data in the message queue and detects the number of message records corresponding to the target data. If the number exceeds a set threshold, the unprocessed target data is discarded and the target data is saved in the message queue again in sequence.

6. The method for generating a site map based on Web Worker according to claim 5, characterized in that: In S3, the configuration parameters are processed based on the evaluation results to obtain a data queue, including the following steps: Based on the order in which the first thread processes the target data in the message queue, the target data being processed is sent to the second thread through a message sending function, and is sequentially arranged and saved based on the target data sending order to obtain a data queue.

7. The method for generating a site map based on Web Worker according to claim 1, characterized in that: In S4, the data in the data queue receives a rendering instruction in response to the data processing mechanism and is sent to the first thread based on the data transmission mechanism, including the following steps: The target data in the data queue is sent to the data processing model. The data processing model screens and classifies the target data to obtain at least train data, section data, axle counting data and signal data and distributes them to corresponding processing tasks to obtain rendering instructions. The rendering instructions are sent to the first thread through a message sending function.

8. The method for generating a site map based on Web Worker according to claim 7, characterized in that: In S4, the first thread calls the corresponding graphics library based on the rendering instruction to obtain the target station map, including the following steps: The first thread saves the rendering instructions based on the sending order of the rendering instructions sent by the second thread to obtain a task queue; The first thread executes the rendering instructions of the task queue in sequence and calls the corresponding graphics library to render the UI interface to obtain the target station map.

9. A method for generating a site map based on Web Worker according to claim 1 or 8, characterized in that: The rendering instructions at least include drawing instructions for the track line and a display format for station information.

10. A method for generating a site map based on Web Worker according to claim 1, 2, 3 or 8, characterized in that: The first thread interacts with the user to obtain an interaction instruction, and edits the station map based on the interaction instruction; the editing at least includes zooming, panning, and selecting a station or a train.

Citation Information

Patent Citations

  • Rail transit station map generation method and device, and electronic equipment

    CN113724571A