Railway station building seismic resilience assessment system based on flask framework
The seismic toughness assessment system for railway passenger station buildings based on the Flask framework integrates functions such as seismic wave processing, structural response data acquisition, and Monte Carlo simulation. It solves the problems of integration, transparency, and engineering friendliness of existing assessment methods, and achieves efficient and reliable seismic toughness assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA RAILWAY FIRST SURVEY & DESIGN INST GRP
- Filing Date
- 2026-05-08
- Publication Date
- 2026-06-09
AI Technical Summary
Existing methods for assessing the seismic toughness of railway passenger station buildings suffer from several problems in practical applications, including insufficient integration and automation of the assessment process, lack of transparency in the calculation process and intermediate results, and poor engineering friendliness of the system operation.
A seismic toughness assessment system for railway passenger station buildings based on the Flask framework is adopted. It includes a seismic wave processing module, a railway passenger station structural response data acquisition module, a railway passenger station structural response data preprocessing and verification module, a multi-threaded toughness index simulation module, and a post-earthquake recovery process visualization module. Through a unified interactive interface, it integrates functions such as seismic wave amplitude modulation, structural response data acquisition, Monte Carlo simulation, and functional recovery curve plotting, realizing the end-to-end connection and closed-loop management of the assessment process, and providing a graphical operation interface and one-click generation of assessment reports.
It improves the efficiency and reliability of the assessment process, enhances the visualization and transparency of the calculation process, reduces the dependence on users' programming skills and numerical simulation experience, and promotes the popularization and practical application of seismic toughness assessment technology.
Smart Images

Figure CN122174332A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of building structure monitoring and evaluation technology, specifically to a seismic toughness evaluation system for railway passenger station buildings based on the Flask framework. Background Technology
[0002] As crucial transportation hubs, railway passenger stations' seismic performance and post-disaster functional recovery capabilities (i.e., seismic resilience) directly impact operational safety and the efficiency of social emergency response. Currently, post-earthquake recovery assessments typically rely on engineering demand parameter matrices, combined with methods such as Monte Carlo simulations, to quantify indicators like repair time, repair costs, and casualties, thereby supporting decision-making. However, existing assessment methods still face the following prominent problems in practical applications:
[0003] (1) The evaluation process is not sufficiently integrated and automated. Existing methods mostly rely on discrete professional software or manual processing, involving multiple independent links such as data processing, data expansion, simulation calculation, and result analysis. The operation is cumbersome and prone to errors, making it difficult to achieve integrated control of the evaluation process.
[0004] (2) Lack of transparency in the calculation process and intermediate results. Key steps such as Monte Carlo simulation and parameter fitting are usually performed in a "black box" manner. Users cannot intuitively track the error of data augmentation, simulation progress and intermediate statistical characteristics, which reduces the interpretability and credibility of the evaluation results.
[0005] (3) The system is not very user-friendly for engineering operations. Existing tools often require users to have strong programming skills or numerical simulation experience, and have high professional requirements for file format, parameter settings, and process connection, which limits the popularization and application of this method among engineering design and management personnel. Summary of the Invention
[0006] This application provides a seismic toughness assessment system for railway passenger station buildings based on the Flask framework, in order to solve the problems of insufficient integration and automation of the assessment process, lack of transparency in the calculation process and intermediate results, and poor engineering friendliness of the system operation in the practical application of existing seismic toughness assessment methods.
[0007] One embodiment of the present invention provides a seismic toughness assessment system for railway passenger station buildings based on the Flask frame, the system comprising:
[0008] The seismic wave processing module is used to receive multiple seismic wave files and preset target peak acceleration parameters from the front end based on Flask routing. It performs batch amplitude modulation processing on the multiple uploaded seismic wave files through an asynchronous thread to generate amplitude-modulated seismic wave files that conform to the target peak acceleration.
[0009] The railway passenger station structural response data acquisition module is used to receive the finite element software server connection parameters, structural dynamic characteristic parameters and seismic wave files submitted by the front end based on Flask routing. It calls the finite element software through API and starts the elastoplastic time history analysis of the railway passenger station structure under seismic conditions. It extracts the inter-story drift angle and peak floor acceleration of each floor under each seismic condition, and finally obtains a railway passenger station structural response dataset containing multiple conditions and multiple floors.
[0010] The railway passenger station structural response data preprocessing and verification module is used to receive the railway passenger station structural response dataset uploaded by the front end based on Flask routing, and to expand and verify the railway passenger station structural response data to obtain the expanded railway passenger station structural response dataset.
[0011] The multi-threaded resilience index simulation module is used to receive the expanded railway passenger station structural response dataset uploaded by the front end based on Flask routing. Combined with the built-in phased post-earthquake repair strategy, it uses Monte Carlo simulation function to batch calculate multiple resilience assessment index values, including repair time, repair cost, casualties, and post-earthquake function, at the completion time of each repair stage.
[0012] The post-earthquake recovery process visualization module is used to receive multiple resilience assessment index values at the completion time of each repair stage uploaded by the Flask routing front end, fit and establish a post-earthquake functional recovery function model that changes with repair time, and draw the post-earthquake functional recovery curve. The seismic toughness index is calculated based on the area of the post-earthquake functional recovery curve obtained by integration.
[0013] The integrated interaction and management module provides a unified graphical user interface based on the Flask front-end framework, enabling one-click generation and download of parameter configuration, task submission, progress tracking, intermediate result verification, and evaluation reports. All business logic is modularly organized through Flask blueprints to ensure system scalability.
[0014] Furthermore, the seismic wave processing module is specifically used for:
[0015] The front end obtains multiple seismic wave files and preset target peak acceleration values uploaded by the user, performs verification, and submits the data asynchronously to the Flask backend in FormData format after successful verification.
[0016] The Flask backend extracts the seismic wave file and target peak acceleration parameters, generates a unique task ID, initializes the task dictionary to record the initial progress value and task status, and starts a background thread.
[0017] The background thread writes each seismic wave file to the server's temporary directory, generates an AT2 format seismic wave file with a unique task ID, performs amplitude modulation processing on the AT2 format seismic wave file based on the target peak acceleration parameter, generates an amplitude-modulated seismic wave file and saves it to the specified folder, and extracts the characteristic parameters of the seismic wave file, including name, peak acceleration, duration and time interval, and stores them in a list. The progress information in the task dictionary is updated after each seismic wave file is processed.
[0018] After all seismic wave files have been processed, the list of characteristic parameters of the seismic wave files is converted into a DataFrame structure and serialized into a JSON format string and stored in the task dictionary. At the same time, the amplitude-modulated seismic wave files are packaged into a compressed file and saved to a temporary directory. The progress of the task dictionary is updated to 100% and the task status is marked as completed. The generated list of filenames is stored in the task dictionary.
[0019] The frontend uses setInterval to periodically call the API to start polling. The Flask backend reads the current progress from the task dictionary and returns it to the frontend in JSON format. The frontend dynamically updates the progress bar based on the returned progress and stops polling when the progress reaches 100%.
[0020] The front end requests amplitude-modulated seismic wave file data from the Flask back end. After the Flask back end confirms that the task is completed, it generates response data including target peak ground acceleration parameters, characteristic parameter data of seismic wave files, and a list of file names, and returns it to the front end. After parsing the data, the front end dynamically updates the seismic wave file characteristic parameter table and updates the download link of the seismic wave file compressed package.
[0021] The front-end initiates a plotting request based on any seismic wave file selected by the user, submitting the plotting request, which includes the seismic wave file name and the target peak acceleration, to the Flask back-end. The Flask back-end reads the corresponding amplitude-modulated seismic wave file, generates an acceleration time history curve, saves it, and returns the image access path to the front-end. The front-end refreshes and displays the generated acceleration time history curve in real time through the image access path.
[0022] Furthermore, the railway passenger station structure response data acquisition module is specifically used for:
[0023] The front end obtains the finite element software server connection parameters, structural dynamic characteristic parameters, and amplitude-modulated seismic wave files uploaded by the user, and performs verification. After successful verification, the data is asynchronously submitted to the Flask backend in FormData format. The finite element software server connection parameters include the finite element software server URL and the finite element software API key. The structural dynamic characteristic parameters include the first and second natural vibration periods and their corresponding damping ratios, the direction of the seismic motion, and the horizontal acceleration angle.
[0024] The Flask backend extracts the seismic wave file, finite element software server connection parameters, and structural dynamic characteristic parameters, generates a unique task ID, and saves the seismic wave file to the server's temporary directory.
[0025] The Flask backend uploads the seismic wave file to the finite element software server via the finite element software API key, sets the time history analysis conditions and starts the time history analysis. The Flask backend encapsulates the time history analysis start information into JSON format and returns it to the frontend so that the frontend can notify the user that the time history analysis has started.
[0026] After the time-to-time analysis is completed, the front end initiates a request to extract railway passenger station structure response data containing floor information and submits it asynchronously to the Flask backend;
[0027] After receiving the request to extract structural response data of the railway passenger station, the Flask backend parses the floor information, generates a unique task ID again, calls the API to query the total number of seismic conditions in the time history analysis, initializes the task dictionary to record the initial progress value and task status, and starts a background thread.
[0028] The background thread iterates through each seismic condition, extracts the inter-story drift angle and peak floor acceleration of each floor through the finite element software API, updates the task dictionary after each condition is completed, until all conditions are processed, saves the railway passenger station structural response dataset to the server temporary directory, updates the task progress to 100% and marks the task status as completed.
[0029] The front-end uses setInterval to periodically call the interface to start polling. The Flask back-end reads the current progress from the task dictionary and returns it in JSON format. The front-end dynamically updates the progress bar. When the progress reaches 100%, the polling stops, and a download link for the railway passenger station structure response dataset is generated on the front-end.
[0030] The front-end initiates a drawing request, the Flask back-end reads the railway passenger station structural response dataset file, generates a railway passenger station structural response data curve, saves it to a specified directory on the server, and returns the image access path to the front-end. The front-end refreshes and displays the generated railway passenger station structural response data curve in real time through the image access path.
[0031] Furthermore, the railway passenger station structure response data preprocessing and verification module specifically includes:
[0032] The front end obtains the railway passenger station structure response data file uploaded by the user and the set number of dataset expansions, and asynchronously submits the data to the Flask backend in FormData format;
[0033] The Flask backend extracts the railway passenger station structure response data file and the number of times the dataset is expanded, generates a fully unique task ID, and saves the railway passenger station structure response data file to the server's temporary directory;
[0034] The Flask backend processes the structured response data matrix, including logarithmic transformation, covariance matrix calculation, and eigenvalue decomposition. Based on the set number of times the dataset is augmented, it generates an augmented sample matrix that conforms to the distribution of the original data. At the same time, it calculates the relative error between the covariance matrix and the mean vector before and after augmentation, and encapsulates the error data, the file name of the augmented data, and the task ID into JSON format response data and returns it to the frontend.
[0035] The front-end receives JSON response data asynchronously, parses it, dynamically updates the error data display table, and generates a download link for the expanded sample matrix file based on the task ID and the expanded file name, so as to realize one-click download of the expanded sample matrix file.
[0036] Furthermore, the multi-threaded resilience index simulation module is specifically used for:
[0037] The front end obtains the number of Monte Carlo simulations, the fit confidence level, the city size parameters, and the uploaded railway passenger station structural response extended matrix data file and BIM building information data file, and submits the data asynchronously to the Flask back end in FormData format;
[0038] The Flask backend extracts the railway passenger station structural response augmentation matrix data file, BIM building information data file and related parameters, generates a unique task ID, saves the uploaded file to the server's temporary directory, and starts a background thread to execute the Monte Carlo simulation task;
[0039] The background thread calculates the logic function based on multiple resilience assessment indicators, including repair time, repair cost, casualties, and post-earthquake functionality, at the completion time of each repair stage. It executes Monte Carlo iterations one after another, and updates the progress percentage of the corresponding unique task ID in the global task dictionary after each iteration.
[0040] The frontend uses setInterval to periodically call the API to start polling. The Flask backend reads the current progress from the task dictionary and returns it in JSON format. The frontend dynamically updates the progress bar and stops polling when the progress reaches 100%.
[0041] Once the Monte Carlo simulation is complete, the background thread saves the calculation results as an Excel file to a temporary directory, calls the numerical fitting function to fit the simulation results to a log-normal distribution, generates the fitted value, expected value and standard deviation at the specified confidence level and stores them in the global task dictionary, marks the task status as complete, and encapsulates the simulation results and numerical fitting results into JSON format response data and returns it to the front end.
[0042] The front-end retrieves JSON response data, parses it, and dynamically updates the resilience index table. Based on the unique task ID, it generates download links for the simulation results Excel file and the resilience index fitted value Excel file, enabling one-click download of the results files.
[0043] Furthermore, the post-earthquake recovery process visualization module specifically includes:
[0044] The front end obtains the resilience index file uploaded by the user, as well as the input downtime parameters and recovery curve shape coefficients for different repair stages, and submits the data asynchronously to the Flask backend in FormData format;
[0045] The Flask backend extracts the resilience index file, downtime, and recovery curve shape coefficients for different repair stages, and saves the resilience index file to the server's temporary directory.
[0046] The Flask backend calls the numerical calculation module to construct piecewise nonlinear functions using the NumPy library based on the read resilience index data, downtime, and recovery curve shape coefficients at different repair stages. This simulates the post-earthquake function recovery process, where the post-earthquake function remains constant during the downtime stage and smoothly increases according to the trigonometric function law at each repair stage. The ratio of the area under the post-earthquake function recovery curve to the baseline area is calculated through integral calculation to obtain the quantified seismic resilience index.
[0047] The numerical calculation module generates a post-earthquake functional recovery curve that changes with repair time by calling the Matplotlib library, saves the image to a static folder on the server, and returns the access path of the image to the Flask backend. The Flask backend encapsulates the image path and seismic toughness index into JSON format response data and returns it to the frontend.
[0048] The front end receives JSON format response data, parses it, and then refreshes and displays the generated post-earthquake functional recovery curve in real time according to the image access path. The seismic toughness index is also displayed in the corresponding position on the interface for easy user evaluation.
[0049] Furthermore, the phased post-earthquake repair strategy specifically includes:
[0050] The post-earthquake repair strategy was formulated as "structure first, then enclosure, then electromechanical," which means repairing structural components and vertical transportation components, enclosure structure and water supply and drainage system, HVAC system and power and main signal equipment, and secondary signal equipment in four stages.
[0051] Furthermore, the structural components and vertical transportation components include: reinforced concrete frame columns, reinforced concrete frame beams, reinforced concrete shear walls, reinforced concrete connecting beams, steel structure beams, steel structure columns, steel support components, steel-concrete composite columns, steel-concrete composite beams, steel space frames, steel trusses, stairs, and elevators;
[0052] The enclosure structure and water supply and drainage system include: infill walls, glass curtain walls, suspended ceilings, water supply pipes, fire sprinkler pipes, and sprinkler head risers;
[0053] The HVAC system and power and main signaling equipment include: suspended lighting fixtures, switchgear, distribution boxes, air outlets, HVAC ducts, HVAC fans, air conditioning system fans, battery cabinets, cable systems, ISFS (Integrated Signal and Frequency Synthesizer) cabinets, IFSSI (Integrated Signal and Frequency Synthesizer Interface) cabinets, ISRC (Integrated Signal and Route Controller) cabinets, train control cabinets, CTC (Centralized Traffic Control) cabinets, interlocking cabinets, RBC (Radio Block Center) cabinets, and TSRS (Temporary Speed Restriction Server) cabinets.
[0054] The secondary signaling equipment includes: IFS (Interface and Frequency Synthesizer) cabinet, IFSI (Interface and Frequency Synthesizer Interface) cabinet, and IRC (Interface and Route Controller) cabinet.
[0055] This application provides a seismic toughness assessment system for railway passenger station buildings based on the Flask framework, which has the following beneficial effects:
[0056] (1) This invention constructs a highly integrated and automated seismic toughness assessment system based on the Flask microservice framework. Through a unified interactive interface, it organically integrates functional modules such as seismic wave amplitude modulation, railway passenger station structural response data acquisition and expansion, Monte Carlo simulation, toughness index calculation and functional recovery curve drawing, realizing the full-link connection and closed-loop management of the assessment process. It effectively solves the problems of discretization and strong reliance on manual operation in existing methods, and significantly improves the efficiency and reliability of the assessment process.
[0057] (2) This invention realizes the visualization and transparency of the calculation process and intermediate results. Users can track the progress of seismic wave amplitude modulation, data acquisition, matrix expansion, Monte Carlo simulation and statistical characteristics of various resilience indicators in real time through the Web interface, which enhances the verifiability of the evaluation data and the credibility of the results, and overcomes the limitations of the traditional "black box" calculation mode in engineering interpretation and decision support.
[0058] (3) This invention significantly reduces the dependence of seismic toughness assessment on the user's programming ability and numerical simulation experience through graphical operation interface, parameterized input configuration and one-stop result output, improves the engineering friendliness and ease of use of the system, and is conducive to the promotion and application of this method in railway engineering design and operation and maintenance management personnel, and promotes the popularization and practical application of seismic toughness assessment technology. Attached Figure Description
[0059] Figure 1 This is a schematic diagram of the logical structure of a railway passenger station building seismic toughness assessment system provided in one embodiment of the present invention;
[0060] Figure 2 The following is an implementation flow of the seismic wave processing module in a railway passenger station building seismic toughness assessment system according to an embodiment of the present invention;
[0061] Figure 3 The following is an implementation process of a railway passenger station structural response data acquisition module in a railway passenger station building seismic toughness assessment system, as provided in one embodiment of the present invention.
[0062] Figure 4 This invention provides an implementation process for a railway passenger station structural response data preprocessing and verification module in a railway passenger station building seismic toughness assessment system, as an embodiment of the present invention.
[0063] Figure 5 The following is an implementation flow of a multi-threaded toughness index simulation module in a seismic toughness assessment system for railway passenger station buildings, provided as an embodiment of the present invention.
[0064] Figure 6 The following is an implementation flow of a post-earthquake recovery process visualization module in a railway passenger station building seismic toughness assessment system, provided as an embodiment of the present invention;
[0065] Figure 7 This is a schematic diagram of a seismic wave processing module of a railway passenger station building seismic toughness assessment system according to an embodiment of the present invention;
[0066] Figure 8 A schematic diagram of a railway passenger station structure response data acquisition module provided in an embodiment of the railway passenger station building seismic toughness assessment system according to an embodiment of the present invention;
[0067] Figure 9 This is a schematic diagram of a railway passenger station structural response data preprocessing and verification module provided in a railway passenger station building seismic toughness assessment system according to an embodiment of the present invention;
[0068] Figure 10 A schematic diagram of a multi-threaded toughness index simulation module of a railway passenger station building seismic toughness assessment system provided in an embodiment of the present invention;
[0069] Figure 11 This is a schematic diagram of a post-earthquake recovery process visualization module of a railway passenger station building seismic toughness assessment system provided in one embodiment of the present invention. Detailed Implementation
[0070] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of this application. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to this application are not shown or described in the specification. This is to avoid obscuring the core parts of this application with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.
[0071] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.
[0072] The main naming concepts involved in this embodiment are as follows:
[0073] API (Application Programming Interface);
[0074] Flask (Flask, a lightweight web microservices framework).
[0075] BIM (Building Information Modeling).
[0076] JSON (JavaScript Object Notation);
[0077] AT2 (Seismic Wave File Specific Format);
[0078] HTTP (Hypertext Transfer Protocol);
[0079] NumPy (Numerical Python, a Python library for numerical computation);
[0080] Matplotlib (a Python plotting library; it doesn't have a universal full name, so we'll just use its original name).
[0081] Fetch API (Fetch Application Programming Interface).
[0082] POST (HTTP request method);
[0083] HTML (HyperText Markup Language);
[0084] ID (Identity, unique identifier).
[0085] This invention provides a seismic toughness assessment system for railway passenger station buildings based on the Flask framework, such as... Figure 1 As shown, the system specifically includes the following modules:
[0086] The seismic wave processing module 101 is used to: receive seismic wave files and target peak acceleration parameters uploaded by the front end based on Flask routing; perform batch amplitude modulation processing on multiple uploaded seismic wave files through an asynchronous thread; push the extraction progress to the front end in real time through an asynchronous task polling mechanism; finally generate amplitude-modulated seismic wave data that conforms to the target peak acceleration; return the characteristic parameters of each amplitude-modulated seismic wave to the front end in tabular form for display; and provide a download link for the data compressed package and a visualization of the seismic wave acceleration time history curve.
[0087] The railway passenger station structural response data acquisition module 102 is used to: receive finite element software server connection parameters, structural dynamic characteristic parameters and seismic wave files submitted by the front end based on Flask routing; upload seismic wave files and start time history analysis by calling the finite element software through API; asynchronously traverse each time history condition to extract structural node displacement, inter-story drift angle and acceleration response data; and push the extraction progress to the front end in real time through an asynchronous task polling mechanism. Finally, a railway passenger station structural response dataset containing multiple conditions and multiple floors is obtained, and the front end provides a data file download link and a visualization display of structural response data curves.
[0088] The railway passenger station structural response data preprocessing and verification module 103 is used to: receive railway passenger station structural response data uploaded by the front end based on Flask routing, automatically perform logarithmic spatial statistical analysis and feature decomposition on the data samples in the back end, generate an expanded sample matrix that conforms to the original distribution law, and return the covariance and mean relative error of the dataset before and after expansion through Flask JSON response. The front end displays the verification results in real time in the form of charts and provides a download link for the expanded file.
[0089] The multi-threaded resilience index simulation module 104 is used to: receive simulation counts, city size, and confidence parameters uploaded by the front end based on Flask routing; distribute Monte Carlo simulation tasks to asynchronous execution in the background; push simulation progress to the front end in real time through a polling mechanism; and calculate in batches the cumulative time, overall repair cost, estimated number of injuries and deaths, and station functional level sequence corresponding to the completion node of each repair stage based on the phased repair logic and component equipment vulnerability database built into the module. After the simulation is completed, the results are returned in JSON format and stored as a file for download.
[0090] The post-earthquake recovery process visualization module 105 is used to: receive the repair time series, functional level data and user-defined downtime and shape coefficients transmitted from the front end through Flask routing, generate a functional recovery curve in the back end, save the image to the server and return the access path, and quantify the seismic toughness score through integral calculation and return it to the front end for display.
[0091] The integrated interaction and management module 106 is used to: provide a unified graphical operation interface based on the Flask front-end framework, realize one-click generation and download of parameter configuration, task submission, progress tracking, intermediate result verification and evaluation report; all business logic is modularly organized through Flask blueprints to ensure system scalability.
[0092] like Figure 2 As shown, in this embodiment, the seismic wave processing module 101 is specifically used for:
[0093] 1) The front-end page uses a multi-file upload component and a text input box to obtain multiple seismic wave files uploaded by the user and the set target peak acceleration value. After the amplitude modulation is started, the front-end JavaScript verifies the file type. After successful verification, the entire form data is asynchronously submitted to the Flask back-end route in FormData format through the Fetch API.
[0094] 2) After receiving the POST request, the Flask backend extracts the list of seismic wave files from request.files, extracts the target peak acceleration value from request.form, generates a unique task ID associated with the current user, initializes the task dictionary, records the initial progress value and task status, reads all file contents and saves them to a list in memory, and then starts a background thread, passing the file content list, temporary file path, target peak acceleration and task ID to the thread;
[0095] 3) In a thread, each file is written to the server's temporary directory in a loop, generating an AT2 format file labeled with the task ID. This file is then subjected to amplitude modulation (AM) processing to generate an AM-modulated seismic wave file, which is saved to a specified folder. Simultaneously, the name, peak ground acceleration (PGA), duration, and time interval of the seismic wave are extracted and stored in a list. The task dictionary is updated after each file is processed. (In this embodiment, the AM processing is as follows: First, each seismic wave is iterated through, and the maximum absolute value of the seismic wave acceleration at each moment is selected. Then, the ratio of the target PGA to the above maximum value is calculated, which is the amplitude modulation ratio. Next, the acceleration data at each moment in the seismic wave is multiplied by the amplitude modulation ratio to obtain the AM-modulated seismic acceleration. Finally, the AM-modulated seismic wave acceleration is combined with the original time sequence to form the AM-modulated seismic wave. This is the entire process of amplitude modulation processing.)
[0096] 4) After all files have been processed, convert the list to a DataFrame and serialize it into a JSON string, store it in the task dictionary, save the generated seismic wave folder after amplitude modulation as a compressed file to a temporary directory, update the task progress to 100%, mark the status as completed, and store the generated file name list in the task dictionary.
[0097] 5) After the frontend initiates the amplitude adjustment request, it immediately starts polling and calls the interface periodically through setInterval. The route reads the current progress value from the task dictionary and returns it in the form of a JSON string. The frontend dynamically updates the progress bar according to the returned progress value. When the progress reaches 100%, the polling stops and the frontend sends a request to obtain the amplitude-adjusted data.
[0098] 6) After receiving the request, the backend router checks the task status. If the task has been completed, it retrieves the stored JSON data and file name list from the task dictionary and returns it to the frontend in JSON format, including the data table content and the drop-down menu option list.
[0099] 7) After receiving the response, the front end parses the JSON data, dynamically updates the seismic wave name, peak acceleration, duration, and time interval in the page table, updates the drop-down selection box for drawing graphics based on the returned file name list, modifies the href attribute of the download link on the page to point to the corresponding compressed file in the server's temporary directory based on the task ID and target peak acceleration, and sets the download attributes so that all amplitude-modulated seismic wave data can be downloaded with one click.
[0100] 8) Select any seismic wave and plot it. The front end sends a POST request via the Fetch API, which includes the file name of the selected seismic wave and the target peak acceleration value. After receiving the request, the back end reads the corresponding amplitude-modulated seismic wave file from the temporary directory, generates an acceleration time history curve using Matplotlib, saves the image to the server's image directory, and returns the image access path. After receiving the path, the front end refreshes and displays the generated curve in real time by setting the src attribute of the img tag.
[0101] The HTML page of the seismic wave processing module 101 includes a title, a seismic wave file selection bar, a target peak acceleration input bar, a start amplitude modulation button, a progress bar display, a seismic wave data form, a download link for the data after amplitude modulation, a seismic wave file drop-down menu, and a graph drawing button.
[0102] The steps for implementing the "Start Amplitude Adjustment" button using the script in the HTML page are as follows:
[0103] (1) When the start amplitude modulation operation is executed, the system determines whether amplitude modulation has started. If confirmed, the system reads the file selected in the "Seismic Wave File Selection Bar". Otherwise, a "Cancel Amplitude Modulation" prompt box will pop up.
[0104] (2) If there is no file in the seismic wave file selection bar, the user will be prompted to upload a file. If there is a file, the user will add a confirmation execution variable and pass it to the backend Flask program.
[0105] (3) After the backend receives the execution variable, it executes the start amplitude adjustment view function and returns a task ID to the frontend. After the frontend receives the task ID, it updates the progress bar every 0.5 seconds until the progress bar reaches 100%, and updates the seismic wave data processed by the backend to the form and download link on the frontend.
[0106] The specific steps for starting the amplitude-adjusted view function are as follows:
[0107] (3.1) Create a task storage dictionary, use Flask request to get the seismic wave files in the seismic wave amplitude section of the HTML page, determine whether the files exist, if the files exist, get the file list, target peak acceleration, temporary storage path of the files and the command to be executed, otherwise return the error information to the HTML front end;
[0108] (3.2) After obtaining the execution command, if the command is true, obtain the user ID, traverse the files and save them to the historical storage path;
[0109] (3.3) Initialize the task storage dictionary, including amplitude adjustment progress, data content, task status, and file name;
[0110] (3.4) Loop through the file list, store the file content in dictionary format, with three keys: file name, file content, and file type, and finally store the dictionary of each file in list form;
[0111] (3.5) Call the amplitude modulation function in the form of a task flow. The objective function of the task is the amplitude modulation function, and the task parameters are the file content list, temporary storage address, target peak acceleration, and user ID;
[0112] (3.6) Enter the amplitude modulation function, loop through each dictionary in the file list, and determine the file name, data content, original file name (.AT2 suffix), new file name (.thd suffix), and file path;
[0113] (3.7) Perform amplitude modulation processing on the seismic waves, analyze and calculate, and return the amplitude-modulated data results;
[0114] (3.8) Store the amplitude adjustment result of each file in a list, and calculate the current amplitude adjustment progress based on the current number of files traversed and the total number of files, and update the amplitude adjustment progress and file name in the task dictionary;
[0115] (3.9) If the loop traversal has not ended, repeat the steps (3.4) to (3.8) above. If the loop traversal has ended, convert the transformed seismic wave data into an array and store it in a compressed package (.zip) in a temporary directory. At the same time, store the data in the task dictionary in JSON format.
[0116] (3.10) Update the amplitude adjustment progress to 100%, the task status to complete, and the address of the compressed file in the task dictionary.
[0117] The steps for drawing the graphic button using the script in the HTML page are as follows:
[0118] (1) After the drawing operation is executed, the system confirms whether to start drawing. If confirmed, the system reads the file name selected in the seismic wave file drop-down menu; otherwise, the drawing is canceled.
[0119] (2) If no file is selected in the seismic wave file selection bar, the system will prompt you to select a seismic wave first. If a file is available, the system will add a confirmation execution variable and pass it to the backend Flask program.
[0120] (3) After the backend receives the execution variable, it starts to generate the seismic wave time history curve and returns a task ID to the frontend. After the frontend receives the task ID, it updates the image name and address drawn by the backend to the frontend's graphics window.
[0121] like Figure 3 As shown, in this embodiment, the railway passenger station structure response data acquisition module 102 is specifically used for:
[0122] 1) The front-end page obtains the finite element software server URL, finite element software API key, first and second order natural vibration periods and corresponding damping ratios, seismic motion direction and horizontal acceleration angle through the text input box, and selects the seismic wave file through the multi-file upload component to start time history analysis. The front-end JavaScript first checks the file and parameter types, and uses the Fetch API to asynchronously submit the form data to the Flask back-end route in FormData format.
[0123] 2) After receiving the POST request, the Flask backend extracts the list of seismic wave files from request.files, and extracts the server URL, API key, natural period, damping ratio, seismic motion direction and horizontal acceleration angle from request.form. It generates a unique task ID associated with the currently logged-in user, saves all seismic wave files to the server's temporary directory, and then uploads the seismic wave files to the server using the API key. It sets the time history analysis conditions and starts the analysis. The backend encapsulates the data information into JSON format and returns it to the frontend. The frontend then notifies the user that the analysis has started.
[0124] 3) After the time-to-time analysis is completed, the front-end page obtains the floor information table, begins to extract the railway passenger station structure response data, and constructs a data form together with other parameters, which is then asynchronously submitted to the back-end route via the Fetch API;
[0125] 4) After receiving the extraction request, the Flask backend parses the floor data JSON string from request.form, extracts the server URL, API key, natural vibration period, damping ratio, seismic motion direction and horizontal acceleration angle, regenerates the task ID associated with the user, then calls the API to query the total number of time-series working conditions, initializes the task dictionary to record the progress status, and starts the background thread.
[0126] 5) In the thread, iterate through each time-series working condition, extract nodal displacement, inter-story drift angle, and acceleration response data through the finite element software API. After each working condition is completed, update the task dictionary until all working conditions are processed. Save the complete dataset to the server temporary directory, update the progress to 100%, and mark the task status as completed.
[0127] 6) After the front-end initiates the extraction request, it immediately starts polling and calls the interface periodically through setInterval. The route reads the current progress value from the task dictionary and returns it in the form of a JSON string. The front-end dynamically updates the progress bar according to the returned progress value. When the progress reaches 100%, the polling stops. The front-end modifies the href of the download link on the page and sets the download attribute. Users can click the link to download the generated railway passenger station structure response dataset file.
[0128] 7) After drawing the graph, the front end sends a POST request to the specified route. The back end reads the dataset file corresponding to the task ID, generates a railway passenger station structure response data curve, saves the image to the specified directory on the server, and returns the image access path. After receiving the path, the front end refreshes and displays the generated curve in real time through the src attribute of the specified tag.
[0129] The HTML page of the railway passenger station structural response data acquisition module 102 includes a title, finite element server URL, finite element API key, input field for the first natural period, input field for the damping ratio corresponding to the first natural period, selection field for the direction of seismic motion, input field for the first natural period, input field for the damping ratio corresponding to the first natural period, input field for the angle of horizontal ground acceleration, selection field for seismic wave file, start time history analysis button, floor information input form, download link for structural response data matrix, button to extract structural response data matrix, progress bar display, railway passenger station structural response data curve graph, and drawing graph button.
[0130] The steps for implementing the "Start Timeline Analysis" button in the HTML page are as follows:
[0131] (1) After starting the time history analysis, the system will determine whether all parameters (including: finite element server URL, API key, first natural period, damping ratio corresponding to the first natural period, second natural period, damping ratio corresponding to the second natural period, direction of ground motion, angle of horizontal ground acceleration, seismic wave file) have been entered. If they have been entered, the system will add a confirmation execution variable and send it to the backend Flask program. If any parameters have not been entered, a pop-up window will appear on the front end to indicate that the relevant parameters have not been entered.
[0132] (2) After the backend obtains the execution variables, it starts calling the time-based analysis view function and finally returns the task completion information to the frontend HTML;
[0133] The specific steps of the aforementioned time-history analysis view function are as follows:
[0134] (2.1) Determine whether a file has been selected in the seismic wave input field. If at least one file (.thd format) has been selected, obtain the temporary file path, seismic wave file list, various parameters, and execute the command. If no file has been selected, return the error message to the HTML front end.
[0135] (2.2) Determine whether the command to be executed is true. If it is true, obtain the user ID. If it is false, return the error message to the HTML front end.
[0136] (2.3) After obtaining the user ID, generate a temporary file save path;
[0137] (2.4) Loop through the seismic wave files and save each file to the specified directory;
[0138] (2.5) Remotely call the finite element program, input parameters are server address, API, folder address, and various parameters. The finite element software starts calculation and generates prompt information, which is returned to the web page front-end HTML in JSON format;
[0139] (3) After the front end receives the task completion feedback, a pop-up prompt box will appear to explain the task status and progress.
[0140] The steps for implementing the above floor information input form using a script in the HTML page are as follows:
[0141] (1) Get the content of the main elements of the table, initialize the form rows of the first layer and the first layer, including: floor name cell, floor height input cell, operation cell (add floor, delete floor button);
[0142] (2) Add a new row to the table. The row content is the same as above. Get the floor number of all rows in the current form. Find the index of the new row. If there are other rows after the new row, add this row and increment the floor number of all rows after the new row by 1. Update all floor numbers in the form. Otherwise, add this row.
[0143] (3) Delete a row from the table. The row content is the same as above. Get the floor number of all rows in the current form. Find the index of the row to be deleted. If there are other rows after the row to be deleted, after deleting this row, decrement the floor number of all rows after the row to be deleted and update all floor numbers in the form. Otherwise, delete this row.
[0144] The steps for extracting the structure response data matrix button and adding the script to the HTML page are as follows:
[0145] (1) Perform data extraction operation. The system determines whether the floor height of each floor in the front-end form has been entered completely. If all the floor heights have been entered, the system further determines whether the required parameters have been entered. Otherwise, the system prompts the user to enter floor information on the front end.
[0146] (2) If all required parameters (including: finite element server, API key, and direction of seismic action) have been entered, add a confirmation execution variable and send it to the backend Flask program; otherwise, prompt that the parameters have not been entered in the front end.
[0147] (3) After receiving the execution command, the backend executes the function to extract the structure response data view, returns the generated task ID to the frontend, and updates the progress bar synchronously;
[0148] The specific steps of the above-mentioned function for extracting structural response data view are as follows:
[0149] (3.1) Create a task storage dictionary, use Flask request to obtain the seismic wave file in the time history analysis section of the HTML page, determine whether the file exists, if the file exists, obtain the file list, finite element software server URL, API, seismic motion direction, temporary file storage path and execution command; otherwise, return the error information to the HTML front end.
[0150] (3.2) After obtaining the execution command, if the command is true, obtain the user ID; otherwise, return the error message to the HTML front end.
[0151] (3.3) After determining the user ID, obtain the data in the front-end floor information form, call the API, access the finite element software, and read the number of time history load cases in the finite element program.
[0152] (3.4) Initialize the task storage dictionary, including retrieval progress and task status;
[0153] (3.5) Data extraction tasks are performed in the form of task flow. The objective function of the task is the function to extract response data. The task parameters are the number of time history load cases, floor information, direction of ground motion, server address, API, and user ID.
[0154] (3.6) Enter the extraction function, loop through each load case, access the finite element software through the API, obtain the structural response data of each floor under the load case, calculate the current amplitude adjustment progress, and update the amplitude adjustment progress of the task dictionary.
[0155] (3.7) If the loop traversal has not ended, repeat the steps (3.4) to (3.6) above; otherwise, convert the extracted data into an array and store it in a table format in a temporary directory.
[0156] (3.8) Update the amplitude adjustment progress in the task dictionary to 100% and update the task status to complete.
[0157] (4) After the progress bar reaches 100%, obtain the name of the backend data file and update the finite element matrix file in the frontend download link.
[0158] The steps for drawing the graphic button using the script in the HTML page are as follows:
[0159] (1) When the drawing operation is executed, the system determines whether the drawing is confirmed. If confirmed, a confirmation execution variable is added and sent to the background Flask program; otherwise, the drawing is canceled.
[0160] (2) After receiving the execution variable, the backend starts executing the function to draw the graphical view and returns a task ID to the frontend;
[0161] The specific steps of the above-mentioned function for drawing a graphical view are as follows:
[0162] (2.1) Use Flask request to obtain the execution parameters in the script of drawing graphic buttons on the HTML page. If the parameter value is True, obtain the user ID, draw the railway passenger station structure response data curve, and return the image name. Combine the image name and the image storage address to return the completed path name to the HTML front end.
[0163] (2.2) If the parameter value is not True, an error message is returned.
[0164] (3) After receiving the task ID, the front end updates the image name and address drawn by the back end to the front end's graphical window.
[0165] like Figure 4 As shown, in this embodiment, the railway passenger station structure response data preprocessing and verification module 103 is specifically used for:
[0166] 1) The front end provides the function of selecting and uploading the original railway passenger station structure response data file through a graphical interface. After the dataset is expanded a certain number of times, a POST request is sent asynchronously to the specified Flask backend route through the JavaScript fetch interface. The request body encapsulates the uploaded file and expansion number parameters in FormData format.
[0167] 2) After receiving the request, the Flask backend router extracts the uploaded railway passenger station structure response data from request.files, obtains the number of augmentations from request.form, and generates a globally unique task ID. The backend saves the uploaded file to the server's temporary directory and performs logarithmic transformation, covariance matrix calculation, and eigenvalue decomposition on the original data matrix. Then, it generates an augmented sample matrix that conforms to the distribution pattern of the original data according to the specified number of augmentations.
[0168] 3) While generating the expanded matrix, calculate the relative error (including maximum, minimum and average values) of the covariance matrix and mean vector before and after expansion, and return the error data along with the expanded file name and task ID to the Flask route. The backend organizes this data into a JSON response, which includes the status identifier, task ID, file name and the variance and expected relative error values.
[0169] 4) The front-end receives JSON data through the asynchronous response of fetch, parses it, and dynamically updates the maximum, minimum, and average relative error values between the variance row and the expected row in the page table. Then, based on the returned task ID and file name, the front-end modifies the href attribute of the download link on the page to point to the corresponding extended matrix file in the server's temporary directory and sets the download attribute. Users can download the generated extended matrix file with one click.
[0170] The HTML page of the railway passenger station structure response data preprocessing and verification module 103 includes a title, a raw data matrix file selection bar, a data matrix expansion number input bar, a start expansion button, an expansion matrix verification form, and a data expansion matrix download link.
[0171] The steps for implementing the script in the HTML page for the aforementioned original data matrix file selection bar are as follows:
[0172] (1) Select the original railway passenger station structure response data matrix file (.xlsx format);
[0173] (2) If a file has been selected, the file will be sent to the Flask backend, and the name of the selected file will be displayed in the selection bar;
[0174] (3) If no file is selected, the upload will be cancelled.
[0175] The specific steps for implementing the "Start Expanding" button in the HTML page are as follows:
[0176] (1) Select the original data matrix file. If it has been selected, then determine whether to start expanding. Otherwise, a pop-up window in the front-end HTML will prompt that no file has been selected.
[0177] (2) If the expansion is confirmed to start, add the confirmation execution variable and pass it to the backend Flask program; otherwise, cancel the expansion.
[0178] (3) After confirming the execution variables and passing them to the backend Flask program, the backend calls the matrix expansion view function. After the task is completed, the processed data and user ID are returned to the frontend in JSON format.
[0179] The matrix expansion view function has the following steps:
[0180] (3.1) Determine whether the original data matrix file has been selected. If a file (.xlsx format) has been selected, obtain the original data matrix file, the temporary file path, the number of times the data matrix has been expanded, and the command to be executed. Otherwise, return the error message to the HTML front end.
[0181] (3.2) Determine if the command to be executed is true. If it is true, obtain the user ID; otherwise, return the error message to the HTML front end.
[0182] (3.3) After obtaining the user ID, generate a temporary file save path;
[0183] (3.4) After labeling the original data matrix file with user IDs, save it to the specified directory;
[0184] (3.5) Input parameters are temporary file path, number of times the data matrix is expanded, and user ID. Expand and verify the matrix, and return the relative error and the name of the data expansion matrix file;
[0185] (3.6) If a relative error exists, generate a result dictionary containing: user ID, task status, file name, maximum relative error, minimum relative error, and average relative error of the expected value and variance of the extended matrix. Return the result dictionary to the web page front-end in JSON format. Otherwise, return an error message indicating that data extraction failed.
[0186] (4) After the front-end HTML confirms the task is completed, the processed data is displayed in the front-end extended matrix verification form, and the user ID is obtained and the download link of the extended matrix of project requirements parameters is updated.
[0187] like Figure 5As shown, in this embodiment, the multi-threaded resilience index simulation module 104 is specifically used for:
[0188] 1) The front-end page receives the number of Monte Carlo simulations, the fit confidence level, and the city size parameters input by the user through a graphical interface, and uploads the railway passenger station structural response extended matrix data and BIM building information data; after the simulation starts, the front-end JavaScript asynchronously sends a POST request to the specified Flask back-end route through the fetch interface, and the request body encapsulates all input files and parameters in FormData format;
[0189] 2) After receiving the request, the Flask backend router extracts the files and parameters from request.files and request.form, generates a unique task ID based on the user identifier, immediately cleans up the previous unfinished tasks, saves the uploaded files to a temporary directory, and then starts a background thread to execute the Monte Carlo simulation task. The thread objective function encapsulates the complete resilience index calculation logic, including data matrix traversal, component vulnerability query, phased repair time and cost calculation, casualty estimation, and post-earthquake functional recovery simulation.
[0190] 3) During the execution of the simulation thread, the progress percentage of the corresponding task ID in the global task dictionary is updated after each Monte Carlo iteration. The front end polls another Flask route through setInterval, carries the task ID to get the current progress value, and dynamically updates the progress bar on the page. After the simulation is completed, the thread saves the final calculation result as an Excel file to a temporary directory and updates the task status.
[0191] 4) After the simulation thread completes all iterations, it calls the numerical fitting module to fit the simulation results to a log-normal distribution, generates the fitted value, expected value and standard deviation at a specified confidence level, and stores the fitting results in the global task dictionary. After the front-end progress reaches 100%, it obtains the fitted value data through the polling interface, parses the JSON response and dynamically updates the resilience index in the page table.
[0192] 5) The front end dynamically constructs download links for the result files based on the task ID, and displays the download addresses of two Excel files, namely the simulation results and the fitted values of the resilience index, on the page, allowing users to download them with one click.
[0193] In this embodiment, the phased serial repair logic is specifically as follows:
[0194] The repair process is divided into four consecutive stages: "structural system", "enclosure system", "heating, ventilation and air conditioning and water supply and drainage system", and "signal equipment and power system". In the repair time calculation of each stage, the floor area limit, parallel work surface constraint and resource scheduling are comprehensively considered to simulate the actual emergency repair process. The calculation of repair time, cost and functional recovery rate are all encapsulated into independent Python functions, which are called by Flask view and managed modularly through blueprints.
[0195] The HTML page of the multi-threaded resilience index simulation module 104 includes a title, a Monte Carlo simulation number input field, a city size drop-down menu, a fit confidence input field, a progress bar display field, a resilience index form, a simulation result download link, a railway passenger station structural response data extension matrix file selection field, a building information file selection field, and a start simulation button.
[0196] The steps for using the script in the HTML page for the above-mentioned railway passenger station structural response data expansion matrix file selection bar and building information file selection bar are as follows:
[0197] (1) Determine whether the structural response data augmentation matrix file (.xlsx format) and building information file (.xlsx format) have been selected;
[0198] (2) If a file has been selected, the file will be sent to the Flask backend, and the name of the selected file will be displayed in the selection bar;
[0199] (3) If no file is selected, the upload will be cancelled.
[0200] The steps for implementing the "Start Simulation" button in the HTML page are as follows:
[0201] (1) After the Monte Carlo simulation starts, the system determines whether the data augmentation matrix file or building information file has been selected. If it has been selected, it further determines whether the city scale has been selected. Otherwise, a pop-up window will appear in front of the system to indicate that no file has been selected.
[0202] (2) If the city size has been selected, then further determine whether to start the simulation; otherwise, a pop-up window will appear on the front end to indicate that no city size has been selected.
[0203] (3) If the simulation is confirmed to start, add the confirmation execution variable and pass it to the backend Flask program; otherwise, cancel the simulation.
[0204] (4) After confirming the execution variables and passing them to the backend Flask program, the backend calls the start mock view function. After completing the task, it returns the task dictionary to the frontend in JSON format.
[0205] The specific steps to start simulating the view function are as follows:
[0206] (4.1) Create a task storage dictionary, use Flask request to obtain the structural response data extension file and building information data file in the time history analysis section of the HTML page, determine whether the file exists, if the file exists, obtain the relevant file, temporary file path, number of Monte Carlo simulations, fit confidence, city size and execution command, otherwise return the error information to the HTML front end;
[0207] (4.2) After obtaining the execution command, if the command is true, obtain the user ID; otherwise, return the error message to the HTML front end.
[0208] (4.3) After determining the user ID, generate a file save address, mark the structural response data extended matrix file and building information data file with the user ID, and save them to that address;
[0209] (4.4) Initialize the task storage dictionary, including: simulation progress, task status, and fitting results;
[0210] (4.5) Calculate various resilience indicators in the form of task flow. The required parameters are temporary file path, number of Monte Carlo simulations, city size, and user ID.
[0211] (4.6) Read the structural response data extension matrix and building information data, start the i-th Monte Carlo simulation, calculate the repair time, repair cost, casualties, and post-earthquake function of this simulation, then calculate the simulation progress and update the progress value in the task dictionary synchronously.
[0212] (4.7) Determine whether the number of simulations has been reached. If it has, save the simulation results; otherwise, let i = i + 1 and repeat step (4.6).
[0213] (4.8) Save the Monte Carlo simulation results to a temporary directory, calculate the fitted value at a specified confidence level, and then update the simulation progress, task status and fitted results in the task dictionary.
[0214] (5) After the front-end HTML confirms that the task is completed, it obtains the task progress, calls the progress bar update view function, and refreshes the progress bar;
[0215] The specific steps of the progress bar update view function are as follows:
[0216] (5.1) Use Flask request to obtain the user ID. If the ID exists, further check whether the task dictionary contains the ID. Otherwise, return the error message to the HTML front end.
[0217] (5.2) If the task dictionary contains the user ID, the progress status in the task dictionary corresponding to the ID is returned to the HTML front end; otherwise, an error message is returned.
[0218] (6) When the progress bar reaches 100%, read the data and user ID from the final task dictionary, call the function to get the fitted value view, and update the resilience index form and simulation result download link on the front-end page.
[0219] The specific steps for obtaining the fitted value view function are as follows:
[0220] (6.1) Use Flask request to obtain the user ID. If the ID exists, further check whether the task dictionary contains the ID. Otherwise, return the error message to the HTML front end.
[0221] (6.2) If the task dictionary contains the user ID, determine whether the task status is completed and whether the fitting result data exists; otherwise, return the error message to the HTML front end.
[0222] (6.3) If the task has been completed and the fitting result data exists, convert the fitting result into a two-dimensional list according to the form format requirements; otherwise, return the task processing information to the HTML front end.
[0223] (6.4) Return the two-dimensional list and task completion information to the HTML front end in JSON format.
[0224] like Figure 6 As shown, in this embodiment, the post-earthquake recovery process visualization module 105 is specifically used for:
[0225] 1) The front-end page provides the function of uploading resilience index files through a graphical interface, and receives downtime parameters and recovery curve shape coefficients for the four repair stages. It then performs graph drawing. The front-end JavaScript asynchronously sends a POST request to the specified Flask back-end route through the fetch interface. The request body encapsulates the uploaded resilience index files and all curve shape coefficient parameters in FormData format.
[0226] 2) After receiving the request, the Flask backend router extracts the resilience index file from request.files, obtains the downtime and four shape coefficients from request.form, saves the uploaded file to the server's temporary directory, and calls the numerical calculation module to read the repair time series and corresponding post-earthquake functional level data from the file;
[0227] 3) The numerical calculation module, based on the read repair time and functional data, combined with the user-defined downtime and shape coefficient, uses NumPy to construct piecewise nonlinear functions to simulate the process of maintaining constant function during the downtime stage and smooth growth of function in each repair stage according to the trigonometric function law. It also calculates the ratio of the area under the recovery curve to the reference area through integral calculation to obtain the quantitative seismic toughness score.
[0228] 4) The calculation module calls the Matplotlib library to generate a functional recovery curve, saves the image with a unique filename to the static folder on the server, and returns the relative path of the image to the Flask route. The backend encapsulates the image path and resilience score into a JSON response and returns it to the frontend.
[0229] 5) After receiving the response, the front end extracts the image path and adds a timestamp parameter to prevent caching. It dynamically updates the src attribute of the img element on the page to realize the real-time display of the recovery curve and displays the resilience score in the corresponding position on the interface for easy user evaluation.
[0230] The HTML page of the post-earthquake recovery process visualization module 105 includes a title, a resilience index file selection bar, a shutdown time input bar, a recovery curve shape coefficient input bar, a start drawing button, and a railway passenger station function recovery curve graph.
[0231] The steps for using the script in the HTML page to select the resilience index file are as follows:
[0232] (1) Determine whether a resilience index file (.xlsx format) has been selected;
[0233] (2) If a file has been selected, the file will be sent to the Flask backend, and the name of the selected file will be displayed in the selection bar;
[0234] (3) If no file is selected, the upload will be cancelled.
[0235] The steps for creating the button using the script in the HTML page are as follows:
[0236] (1) When entering the graph drawing program, the system will determine whether the resilience index file has been selected. If it has been selected, it will further determine whether to start drawing the graph. Otherwise, a pop-up window will appear in front of the system to indicate that no file has been selected.
[0237] (2) If you decide to start drawing a graphic, call the drawing graphic view function to generate an image name; otherwise, cancel the drawing.
[0238] The specific steps for drawing the graphical view function are as follows:
[0239] (2.1) Determine whether a resilience index file has been selected. If a file (.xlsx format) has been selected, obtain the file, temporary file path, downtime, recovery curve shape coefficient (repair phase 1), recovery curve shape coefficient (repair phase 2), recovery curve shape coefficient (repair phase 3), recovery curve shape coefficient (repair phase 4), and execute the command. If no file has been selected, return the error message to the HTML front end.
[0240] (2.2) If the command is True, the user ID is obtained, the railway passenger station function recovery curve is drawn, and the image name is returned. The image name and image storage address are combined, and the complete path name is returned to the HTML front end.
[0241] (2.3) If the command to be executed is False, an error message will be returned.
[0242] (3) Generate image link address based on image name and temporary storage address, and update the front-end HTML function recovery curve image.
[0243] In this embodiment, the system uses Flask blueprints to decouple the various functional modules, including data seismic wave amplitude modulation blueprint, data acquisition blueprint, preprocessing blueprint, simulation calculation blueprint, visualization blueprint and user management blueprint. The system uses HTTP protocol to realize JSON data exchange between the front end and the back end, and Bootstrap is used on the front end to realize responsive interface and dynamic chart display.
[0244] Using the technology of this invention, a corresponding system was developed. Firstly, in the seismic wave processing module (see...) Figure 7 The system reads 39 near-field seismic waves, sets the target peak ground acceleration to 0.2g, and completes amplitude modulation processing of this batch of seismic waves in approximately 5 seconds. Simultaneously, the system allows users to select and view the time history curves of the seismic waves before and after amplitude modulation on the webpage in a WYSIWYG manner. Then, in the railway passenger station structural response data acquisition module (see...),... Figure 8 The program sets the server URL and API key for the finite element software. Based on the modal analysis results of a railway passenger station, it sets the first-order natural period to 0.5840s, the second-order natural period to 0.5540s, the damping ratio corresponding to the first and second-order natural periods to 0.05, the direction of the seismic motion to the x-direction, and the horizontal ground acceleration angle to 0°. It then selects 39 processed seismic wave files and begins time-history analysis. After the analysis starts, the program remotely accesses the finite element program on the specified server via API and automatically sets the seismic wave load conditions. After the calculation is completed, the number of floors and floor height information of the station building are set, and the structural response data is extracted with one click, taking approximately 10-15 minutes (depending on the size of the finite element model). This yields a line graph showing the structural response data changing along the floor levels. Further processing and verification of the railway passenger station structural response data are performed in the module (see...).Figure 9 The original structural response data matrix (65 rows × 8 columns) of a railway passenger station was read. The matrix was expanded 1000 times, taking approximately 5-10 seconds. The expansion results showed that the maximum relative error of the variance was 167.53%, the minimum relative error was 0.02%, and the average relative error was 10.82%. The expected maximum relative error was 2.00%, the minimum relative error was 0.00%, and the average relative error was 0.44%. This was then analyzed in the multi-threaded resilience index simulation module (see...). Figure 10 The expanded railway passenger station structural response data matrix and building information model data were read. The Monte Carlo simulation was set to 1000 times, the city size to be a large city, and the fit confidence level to be 0.84. The time to complete 1000 Monte Carlo simulations was approximately 15-20 minutes. Simulation results showed that the fitted value for the first stage repair time was 25.67 days (expected 19.91, variance 0.26), and the fitted value for the second stage repair time was 129.45 days (expected 122.99, variance 0.05). The fitted values for the repair time in the third stage were 129.90 days (expected 123.45 days, variance 0.05), and for the fourth stage were 130.36 days (expected 123.90 days, variance 0.05). The fitted value for repair costs was 23.682 million yuan (expected 22.8281 million yuan, variance 0.04 million yuan). The fitted value for the casualty rate was 0.24% (expected 0.02%, variance 2.76%), and the fitted value for the mortality rate was 0.10% (expected 0.10%, variance 0.00%). These values are visualized in the post-earthquake recovery process visualization module (see...). Figure 11 The invention reads resilience index data, sets the downtime to 10 days, sets the recovery curve shape coefficient for the four repair stages to 1, and plots the functional recovery curve of the railway passenger station. This invention provides a clear and concise method for assessing the seismic resilience of railway passenger station buildings, improves user experience, and enables the application and promotion of complex assessment algorithms in practical engineering.
[0245] The specific calculation processes involved in each module of this system are explained in detail below:
[0246] 1. In this embodiment, based on the finite element analysis of railway passenger station buildings under seismic conditions, the engineering demand parameter matrix of railway passenger station buildings is obtained. By expanding and verifying the engineering demand parameter matrix of railway passenger station buildings, the expanded engineering demand parameter matrix is obtained.
[0247] The engineering requirements parameters include inter-story drift angle and peak floor acceleration. A finite element model of the station structure was established, seismic conditions were set, and elastoplastic time history analysis was performed. After calculation, the inter-story drift angle and peak floor acceleration of each floor under each seismic condition were extracted and used as engineering requirements parameters to assemble an engineering requirements parameter matrix. , where m is the row of the matrix, each row corresponds to a seismic condition; n is the column of the matrix, each column corresponds to an engineering requirement parameter, which includes the inter-story drift angle and peak floor acceleration of each floor.
[0248] The specific steps for expanding and verifying the engineering requirement parameter matrix are as follows:
[0249] Step 1.1: Read the original project requirement parameter matrix ;
[0250] Step 1.2: For the matrix Taking the logarithm, we obtain the transformation matrix. The covariance matrix is calculated using the `cov` and `mean` functions of Python NumPy array manipulation. and mean matrix ;
[0251] Step 1.3: Calculate the covariance matrix using the `linalg.matrix_rank` and `linalg.eigh` functions of Python NumPy. rank R, eigenvalues eigenvectors ;
[0252] Step 1.4: Partition the eigenvalue matrix according to rank R eigenvector matrix ,have to and Then, the eigenvalue matrix after segmentation is processed using the sqrt and diag functions of Python NumPy array operations. Square root and transform into a diagonal matrix ;
[0253] Step 1.5: Determine the expansion number x, and generate an independent standard normal random variable matrix of dimension x×R using the random.randn function of Python NumPy array operations. And based on the mean matrix of the original engineering requirement parameter matrix Use the dot and ones functions to generate a dimension of matrix ;
[0254] Step 1.6: Using the dot and exp functions of Python NumPy array manipulation, calculate the expanded engineering requirement parameter matrix according to the following formula. And calculate in step 1.2. covariance matrix and mean matrix ;
[0255] (1)
[0256] Step 1.7: Calculate the absolute error of the covariance before and after expansion using the abs function of Python NumPy array manipulation. absolute error of expectation ;
[0257] Step 1.8: Determine the original covariance matrix through screening. and The mask of non-zero elements;
[0258] Step 1.9: Create the covariance matrix using the zeros_like functions of Python NumPy array manipulation. and Given a zero matrix of the same dimension, calculate the relative error of the non-zero elements based on the non-zero element mask, set the relative error of other elements to None, and update the corresponding elements in the zero matrix to obtain the relative error matrix of covariance and expectation. , ;
[0259] Step 1.10: Return the covariance and expected relative error , The maximum, minimum, and average values are determined and verified (generally, the average error is used to check whether it exceeds a preset threshold). After verification, the expanded engineering requirement parameter matrix is generated. Save to the specified directory.
[0260] 2. Obtain the quantity of station building components or equipment based on the Building Information Model (BIM) of railway passenger station buildings. Station building room area A, project volume U.
[0261] The quantity U is the number of components or equipment counted based on the BIM model, for example:
[0262] The volume of the reinforced concrete frame column is 100 cubic meters; the volume of the steel structure column is 100 tons.
[0263] The ceiling installation area is 100 square meters;
[0264] The number of IFS racks is 10;
[0265] And so on, counting each layer.
[0266] 3. Construct a vulnerability parameter database for railway passenger station building components or equipment. The vulnerability parameter database contains the expected values and variances of engineering requirement parameters for different components or equipment under different damage states.
[0267] Specifically, the types of damage states are determined based on the component. Different components or equipment have different types of damage states. For example, reinforced concrete frame columns generally have four types of damage states; cable systems generally have two types of damage states. The damage states of these components are determined according to specifications and experimental studies. The expected values and standard deviations of the engineering requirement parameters corresponding to different components or equipment under different damage states are also determined according to specifications and experimental studies.
[0268] The components or equipment include the following:
[0269] (1) Structural components: reinforced concrete frame columns, reinforced concrete frame beams, reinforced concrete shear walls, reinforced concrete connecting beams, steel structure beams, steel structure columns, steel bracing components, steel-concrete composite columns, steel-concrete composite beams, steel space frames, and steel trusses;
[0270] (2) Displacement-sensitive non-structural components: infill walls, glass curtain walls, stairs;
[0271] (3) Acceleration-sensitive non-structural components: ceiling, elevator, suspended light fixture, switchgear, distribution box, water supply pipe, fire sprinkler pipe, sprinkler head riser, HVAC duct, air outlet, HVAC fan, air conditioning system fan;
[0272] (4) Specialized equipment: battery cabinet, cable system, IFS cabinet, IFSI cabinet, ISFS cabinet, IFSSI cabinet, IRC cabinet, ISRC cabinet, train control cabinet, CTC cabinet, interlocking cabinet, RBC cabinet, TSRS cabinet.
[0273] 4. Formulate a post-earthquake repair strategy of "structure first, then enclosure, then electromechanical", that is, repair the structural components and vertical transportation components, the enclosure structure and water supply and drainage system, the heating, ventilation and air conditioning system and power and main signal equipment, and the secondary signal equipment in four stages.
[0274] Structural components and vertical transportation components include the following: reinforced concrete frame columns, reinforced concrete frame beams, reinforced concrete shear walls, reinforced concrete connecting beams, steel structure beams, steel structure columns, steel bracing components, steel-concrete composite columns, steel-concrete composite beams, steel space frames, steel trusses, stairs, and elevators;
[0275] The building envelope and water supply and drainage system include the following: infill walls, glass curtain walls, suspended ceilings, water supply pipes, fire sprinkler pipes, and sprinkler head risers;
[0276] The HVAC system and power and major signaling equipment include the following: suspended lighting fixtures, switchgear, distribution boxes, air outlets, HVAC ducts, HVAC fans, air conditioning system fans, battery cabinets, cable systems, ISFS cabinets, ISFSI cabinets, ISRC cabinets, train control cabinets, CTC cabinets, interlocking cabinets, RBC cabinets, and TSRS cabinets.
[0277] Secondary signal equipment includes the following: IFS cabinet, IFSI cabinet, and IRC cabinet.
[0278] 5. Based on the established post-earthquake repair strategy, and according to the expanded engineering requirement parameter matrix, building information model data, and vulnerability parameter database, call the Monte Carlo simulation function to calculate the resilience assessment indicators of the station building, including repair time, repair cost, casualties, and post-earthquake function, and calculate the fitted values of each resilience assessment indicator according to the specified confidence level.
[0279] The specific steps of the Monte Carlo simulation function are as follows:
[0280] Step 5.1: Define the initial number of damaged components or equipment. (Initially set to 0, used to store the number of damaged components or equipment on each floor), and initialize the floor indices for inter-story drift angle and peak floor acceleration. ;
[0281] Step 5.2: Traverse the extended matrix of project requirement parameters row by row. This yields the value in the i-th row (operating condition) and j-th column (parameter), i.e. .
[0282] Step 5.3: If If the inter-story drift angle is used, then the number of components or equipment in that story is determined by iterative filtering. The term "structural component" or "displacement-sensitive non-structural component" is used; if To determine the peak floor acceleration, the number of components or equipment on each floor is then iterated through and filtered. The "acceleration-sensitive non-structural components" or "specialized equipment" mentioned above;
[0283] Step 5.4: If the number of components or devices in the selected layer is not zero, then iterate through the damage states of the component or device and calculate the log-normal cumulative distribution probability of the p-th type of component or device in the d-th damage state using the norm.cdf function of the Python Scipy library. As shown in the following formula;
[0284] (2)
[0285] in, Let f be the expected value of the p-th component or equipment in the fragility parameter database F under the d-th damage state; Let be the variance of the p-th component or equipment in the fragility parameter database F under the d-th damage state.
[0286] Step 5.5: Determine the quantity of the p-th type of component or equipment in this layer. Repeated random sampling Each time, a random number r between 0 and 1 is generated, and the number of components or equipment of type p in each damage state is determined according to the probability interval of the random number falling into it.
[0287] The probability intervals are divided as follows:
[0288] (1) If the probability If it contains 4 elements, it means that the damage state of the component is of type 4. Indicates no damage ; Indicates minor injury ; Indicates moderate damage ; Indicates severe injury ; Indicates complete destruction .
[0289] (2) If If it contains 3 elements, it indicates that the damage state of the component is of type 3. Indicates no damage ; Indicates minor injury ; Indicates moderate damage ; Indicates severe injury .
[0290] (3) If If it contains two elements, it indicates that the damage state of the component is of type 2. Indicates no damage ; Indicates minor injury ; Indicates severe injury .
[0291] (4) If If a component contains one element, it indicates that the damage state is type 1. Indicates no damage ; Indicates severe injury .
[0292] Step 5.6: If For inter-story drift angle, update The Middle The number of components or equipment of type p in the d-th damage state is determined, and the floor index is updated. Repeat steps 5.2 to 5.5 above; if Update for peak floor acceleration The Middle The number of components or equipment of type p in the d-th damage state is determined, and the floor index is updated. Repeat steps 5.2 to 5.5 above;
[0293] Step 5.7: Calculate the repair time, repair cost, casualties, and post-earthquake functionality of the station building based on the sampling results, and return the calculation results.
[0294] The specific steps for calculating the repair time are as follows:
[0295] Step (1): Count the number of damaged components or equipment. Determine the repair time Q for components or equipment, the number of workers q required to repair a single component or piece of equipment, the station building area A, and the repair cost reduction factor. The station building room area A was obtained from the BIM model, and other parameters were determined according to the "Evaluation Standard for Seismic Toughness of Buildings" (GB / T 38591-2020).
[0296] Step (2): Calculate the number of workers required to repair the vertical transportation components on the k-th floor. and total working hours The repair time can be obtained by dividing the total working hours by the number of workers required. Where p represents the p-th type of component or equipment; P represents the total number of component or equipment types; d represents the d-th damage state; D represents the total number of damage state types; k represents the k-th floor; and K represents the total number of floors. The number of workers required to repair component or equipment of type p; This represents the number of the p-th type of component or equipment in the k-th layer under the d-th damage state. Repair time for component or equipment of type p under damage condition d.
[0297] Step (3): Calculate the maximum number of workers allowed on the k-th floor (0.026A(k)), the number of workers required to repair the structural components (0.02A(k)), and the total working hours for repairing the structural components. Provided that the sum of the number of workers needed to repair structural components and the number of workers needed to repair vertical transportation components does not exceed the maximum number of workers allowed per floor, the time required to repair the structural components can be obtained by dividing the total working hours by the number of workers needed. ;
[0298] Step (4): Extraction and The larger of the two, serving as the total time for repairing structural components and vertical transportation components. Therefore, the total time to complete the first phase of repair work is... , recorded as ;in The total time for repairing structural components and vertical transportation components on the kth floor; The maximum value in the total time for repairing the structural components and vertical transportation components of each floor (Phase 1), that is, the longest time required to repair the entire station building's structural components and vertical transportation components;
[0299] Step (5): Calculate the number of workers required to repair the k-th floor enclosure structure and water supply and drainage system. and total working hours The repair time can be obtained by dividing the total working hours by the number of workers required. Therefore, the total time to complete the first and second phases of repair work is... , recorded as ;in, The maximum value in the total time for repairing the building envelope and water supply and drainage system of each floor (Phase 2), that is, the longest time required to repair the entire station building envelope and water supply and drainage system; The sum of the maximum total time required to repair the structural components and vertical transportation components of each floor and the maximum total time required to repair the enclosure structure and water supply and drainage system of each floor is the maximum time required to repair the entire station building's structural components, vertical transportation components, enclosure structure, and water supply and drainage system.
[0300] Step (6): Calculate the number of workers required to repair the power and main signal equipment on the k-th floor. and total working hours The repair time can be obtained by dividing the total working hours by the number of workers required. ;
[0301] Step (7): Calculate the maximum number of workers allowed to repair the k-th layer. Number of workers needed to repair HVAC systems Total man-hours for repairing the HVAC system Provided that the sum of the number of workers needed to repair the HVAC system and the number of workers needed to repair the electrical and main signaling equipment does not exceed the maximum number of workers allowed on the floor, the time required to repair the HVAC system can be obtained by dividing the total working hours by the number of workers needed. ;
[0302] Step (8): Extraction and The larger of the two, representing the total time required to repair the HVAC system and electrical and major signaling equipment. Therefore, the total time to complete the first, second, and third phases of repair work is: , recorded as ;in, The maximum value in the total time required to repair the HVAC system, power and main signaling equipment on each floor (Phase 3), i.e. the longest time required to repair the entire station building's HVAC system, power and main signaling equipment; The sum of the maximum total time required to repair the structural components and vertical transportation components of each floor, the maximum total time required to repair the enclosure structure and water supply and drainage system of each floor, and the maximum total time required to repair the heating, ventilation and air conditioning system and power and main signaling equipment of each floor, is the maximum time required to repair the entire station building's structural components and vertical transportation components, enclosure structure and water supply and drainage system, and heating, ventilation and air conditioning system and power and main signaling equipment.
[0303] Step (9): Calculate the number of workers required to repair the signal equipment at level k. and total working hours The repair time can be obtained by dividing the total working hours by the number of workers required. Therefore, the total time to complete the repair work in stages 1, 2, 3, and 4 is... , recorded as ;in, The maximum value in the total time required to repair the secondary signal equipment on each floor (Phase 4) is the maximum time required to repair the secondary signal equipment in the entire station building. The maximum time required to repair the structural components and vertical transportation components of each floor, the maximum time required to repair the enclosure structure and water supply and drainage system of each floor, the maximum time required to repair the heating, ventilation and air conditioning system, power and main signaling equipment of each floor, and the maximum time required to repair the main signaling equipment of each floor is the sum of the four values. In other words, it is the maximum time required to repair the entire station building's structural components and vertical transportation components, enclosure structure and water supply and drainage system, heating, ventilation and air conditioning system, power and main signaling equipment, and secondary signaling equipment.
[0304] Step (10): Return the repair time for each stage .
[0305] The specific steps for calculating the repair costs are as follows:
[0306] Step (1): Count the number of damaged components or equipment. Quantity of components or equipment on each floor Quantity U, determine the component or equipment loss coefficient. Cost and expenses C, repair coefficient Repair cost reduction factor Floor location influence coefficient ;
[0307] Step (2): Based on the number of damaged components or equipment and the number of components or equipment on each floor The component damage ratio was obtained. Then, calculate the repair cost of the p-th component in the k-th layer under the d-th damage condition. , recorded as ;in, For the quantity of components or equipment of type p; The cost of the p-th component in the k-th layer under the d-th damage condition; The component damage ratio of the p-th type of component or equipment in the k-th layer under the d-th damage state; Let be the loss coefficient of the p-th component or equipment under the d-th damage state;
[0308] Step (3): Calculate the repair cost of the p-th type of component in the k-th layer. , recorded as ;in, Let be the repair coefficient of the p-th component or equipment under the d-th damage state;
[0309] Step (4): Calculate the total repair cost of all components on the k-th floor. Let R(k) be the denoted R(k);
[0310] Step (5): Calculate the total repair cost , and return; where K is the total number of floors; is the influence coefficient of the floor location on the kth floor.
[0311] The specific steps for calculating casualties are as follows:
[0312] Step (1): Count the number of damaged components or equipment. Quantity of components or equipment on each floor The number of structural components and non-structural components that could cause injury or death (including infill walls, glass curtain walls, and suspended ceilings) should be counted separately. , Determine indoor occupancy density Station building room area A;
[0313] Step (2): Calculate the proportion of structural components and non-structural components that may cause injury or death on each floor under different damage states. This allows for the determination of the damage level of each floor, and the calculation of the nominal casualty rate based on the damage level. and nominal mortality rate ;in, The number of structural components of type p in the k-th layer under type d damage state; Let p be the number of non-structural components that can cause injury or death in the k-th layer;
[0314] Specifically, the proportion of structural components and non-structural components that could cause injury or death on each floor under different damage states was analyzed. By consulting the "Standard for Seismic Toughness Evaluation of Buildings," the floor damage level can be determined. Based on the floor damage level, the nominal casualty rate can then be determined. and nominal mortality rate ;
[0315] Step (3): Calculate the population density of the k-th layer. , recorded as Where i represents the room type, including: waiting room, shop, restaurant, office, equipment room, and restroom; Let i be the area of the i-th type of room on the k-th floor, where i is the room type; The indoor occupancy density of type i housing was determined through a survey; Let be the area of the k-th type of house;
[0316] Step (4): Calculate the number of injured. and death toll , respectively denoted as and ;in, Let K be the population density at the kth layer. The nominal mortality rate for the k-th layer; The nominal casualty rate for the k-th layer;
[0317] Step (5): Calculate the true casualty rate and the actual mortality rate , and return.
[0318] The specific steps for post-earthquake functional calculation are as follows:
[0319] Step (1): Read the quantity of components or equipment on each floor. Read the corresponding expected values from the vulnerability parameter library of various components or equipment. Then the functional loss reduction coefficient of the p-th type of component or equipment under the d-th damage state is: , recorded as ;in Let be the expected value of the vulnerability parameter of the p-th type of component or equipment under the D-th damage state, where D is the damage state index corresponding to the failure of the component or equipment, which is related to the type of component or equipment; Let be the expected value of the p-th type of component or equipment under the d-th damage state;
[0320] Step (2): Count the number of damaged components or equipment. Quantity of components or equipment on each floor Calculate the damage probability of components or equipment under each damage state. , recorded as Then calculate the building function at the time of the earthquake. , recorded as ;in, This represents the number of the p-th type of component or equipment in the k-th layer under the d-th damage state. The quantity of the p-th type of component or equipment in the k-th layer; The functional loss reduction coefficient for the p-th type of component or equipment under the d-th damage state; The probability of damage to the p-th type of component or equipment on the k-th floor under the d-th damage state at the time after the earthquake; The number of components or equipment in the k-th layer;
[0321] Step (3): Copy Update the damage probabilities corresponding to structural components and vertical transportation components. If the damage state is... If the probability of updating damage is 1, then the probability of updating damage is 0, and the new list is denoted as P. r1 Then calculate the building function after the first repair phase is completed. , recorded as ;in, The damage probability of the p-th type of component or equipment on the k-th floor under the d-th damage state after repairing structural components and vertical transportation components;
[0322] Step (4): Copy Update the damage probabilities corresponding to the building envelope and water supply and drainage system. If the damage state is... If the probability of updating damage is 1, then the probability of updating damage is 0, and the new list is denoted as . Then, calculate the building functions after the completion of the first and second repair phases. , denoted as F s2 ;in, For complex structural components and vertical transportation components, enclosure structures and water supply and drainage systems, the damage probability of the p-th type of component or equipment on the k-th floor under the d-th damage state is given.
[0323] Step (5): Copy Update the damage probability corresponding to the HVAC system, power supply, and main signal equipment. If the damage status is... If the probability of updating damage is 1, then the probability of updating damage is 0, and the new list is denoted as . Then, the building functions after the completion of the first, second, and third repair phases are calculated. , recorded as ;in, The damage probability of the p-th type of component or equipment on the k-th floor under the d-th damage state after repairing structural components and vertical transportation components, enclosure structures and water supply and drainage systems, HVAC systems and power and main signal equipment.
[0324] Step (6): Copy Update the damage probability corresponding to the secondary signal device. If the damage state is... If the probability of updating damage is 1, then the probability of updating damage is 0, and the new list is denoted as . Then, the building functions after the completion of the first, second, third, and fourth repair stages are calculated. , recorded as ;in, The damage probability of the p-th type of component or equipment on the k-th floor under the d-th damage state after repairing structural components and vertical transportation components, enclosure structures and water supply and drainage systems, HVAC systems and power and main signal equipment, and secondary signal equipment.
[0325] Step (7): Return to post-earthquake functionality .
[0326] The specific steps for calculating the fitted value are as follows:
[0327] Step 5.1: Initialize three lists to store the fitted values. Expected fit value , standard deviation of fitted values And read the repair time, repair cost, casualties, and post-earthquake functional data from the Monte Carlo simulation results;
[0328] Step 5.2: Define a function using the stats.lognorm.fit and stats.lognorm.ppf functions in the Python Scipy library to calculate the fitted value of the given data at a specified confidence level;
[0329] Step 5.3: Based on the data from Step 5.1, call the fitting function from Step 5.2 to calculate the fitted values, expected values, and standard deviations of the fitted values for repair time, repair cost, casualties, and post-earthquake function, and save them to the corresponding lists.
[0330] 6. Based on the obtained resilience assessment index, fit and establish a post-earthquake functional recovery function model that varies with repair time, and plot the post-earthquake functional recovery curve. Calculate the seismic resilience index based on the area of the post-earthquake functional recovery curve obtained by integration, and classify the seismic resilience assessment level according to the seismic resilience index.
[0331] The specific steps of the toughness grade determination method based on repair time are as follows:
[0332] Step 6.1: Read the repair time and post-earthquake functions Determine the work stoppage time (Customizable based on actual needs);
[0333] Step 6.2: Define a nonlinear function recovery model that considers the impact of downtime. ,as follows:
[0334] (3)
[0335] Step 6.3: Based on the repair time and functional recovery model, generate time series and post-earthquake functional series, plot the post-earthquake functional recovery curve, integrate to obtain the area of the functional recovery curve, and obtain the post-earthquake toughness index R through normalization.
[0336] Step 6.4: Determine the seismic toughness assessment level of the railway passenger station based on the post-earthquake toughness index R. If it is excellent; if If it is good; if If it is, then it is considered medium; if If so, it is considered poor; If the range is 0, then it is the extreme range.
[0337] The above examples illustrate the present invention only to aid in understanding it and are not intended to limit the scope of the invention. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the principles of this invention.
Claims
1. A seismic toughness assessment system for railway passenger station buildings based on the Flask framework, characterized in that, The system includes: The seismic wave processing module is used to receive multiple seismic wave files and preset target peak acceleration parameters from the front end based on Flask routing. It performs batch amplitude modulation processing on the multiple uploaded seismic wave files through an asynchronous thread to generate amplitude-modulated seismic wave files that conform to the target peak acceleration. The railway passenger station structural response data acquisition module is used to receive the finite element software server connection parameters, structural dynamic characteristic parameters and seismic wave files submitted by the front end based on Flask routing. It calls the finite element software through API and starts the elastoplastic time history analysis of the railway passenger station structure under seismic conditions. It extracts the inter-story drift angle and peak floor acceleration of each floor under each seismic condition, and finally obtains a railway passenger station structural response dataset containing multiple conditions and multiple floors. The railway passenger station structural response data preprocessing and verification module is used to receive the railway passenger station structural response dataset uploaded by the front end based on Flask routing, and to expand and verify the railway passenger station structural response data to obtain the expanded railway passenger station structural response dataset. The multi-threaded resilience index simulation module is used to receive the expanded railway passenger station structural response dataset uploaded by the front end based on Flask routing. Combined with the built-in phased post-earthquake repair strategy, it uses Monte Carlo simulation function to batch calculate multiple resilience assessment index values, including repair time, repair cost, casualties, and post-earthquake function, at the completion time of each repair stage. The post-earthquake recovery process visualization module is used to receive multiple resilience assessment index values at the completion time of each repair stage uploaded by the Flask routing front end, fit and establish a post-earthquake functional recovery function model that changes with repair time, and draw the post-earthquake functional recovery curve. The seismic toughness index is calculated based on the area of the post-earthquake functional recovery curve obtained by integration. The integrated interaction and management module provides a unified graphical user interface based on the Flask front-end framework, enabling one-click generation and download of parameter configuration, task submission, progress tracking, intermediate result verification, and evaluation reports. All business logic is modularly organized through Flask blueprints to ensure system scalability.
2. The seismic toughness assessment system for railway passenger station buildings based on the Flask frame as described in claim 1, characterized in that, The seismic wave processing module is specifically used for: The front end obtains multiple seismic wave files and preset target peak acceleration values uploaded by the user, performs verification, and submits the data asynchronously to the Flask backend in FormData format after successful verification. The Flask backend extracts the seismic wave file and target peak acceleration parameters, generates a unique task ID, initializes the task dictionary to record the initial progress value and task status, and starts a background thread. The background thread writes each seismic wave file to the server's temporary directory, generates an AT2 format seismic wave file with a unique task ID, performs amplitude modulation processing on the AT2 format seismic wave file based on the target peak acceleration parameter, generates an amplitude-modulated seismic wave file and saves it to the specified folder, and extracts the characteristic parameters of the seismic wave file, including name, peak acceleration, duration and time interval, and stores them in a list. The progress information in the task dictionary is updated after each seismic wave file is processed. After all seismic wave files have been processed, the list of characteristic parameters of the seismic wave files is converted into a DataFrame structure and serialized into a JSON format string and stored in the task dictionary. At the same time, the amplitude-modulated seismic wave files are packaged into a compressed file and saved to a temporary directory. The progress of the task dictionary is updated to 100% and the task status is marked as completed. The generated list of filenames is stored in the task dictionary. The frontend uses setInterval to periodically call the API to start polling. The Flask backend reads the current progress from the task dictionary and returns it to the frontend in JSON format. The frontend dynamically updates the progress bar based on the returned progress and stops polling when the progress reaches 100%. The front end requests amplitude-modulated seismic wave file data from the Flask back end. After the Flask back end confirms that the task is completed, it generates response data including target peak ground acceleration parameters, characteristic parameter data of seismic wave files, and a list of file names, and returns it to the front end. After parsing the data, the front end dynamically updates the seismic wave file characteristic parameter table and updates the download link of the seismic wave file compressed package. The front-end initiates a plotting request based on any seismic wave file selected by the user, submitting the plotting request, which includes the seismic wave file name and the target peak acceleration, to the Flask back-end. The Flask back-end reads the corresponding amplitude-modulated seismic wave file, generates an acceleration time history curve, saves it, and returns the image access path to the front-end. The front-end refreshes and displays the generated acceleration time history curve in real time through the image access path.
3. The seismic toughness assessment system for railway passenger station buildings based on the Flask frame as described in claim 1, characterized in that, The railway passenger station structure response data acquisition module is specifically used for: The front end obtains the finite element software server connection parameters, structural dynamic characteristic parameters, and amplitude-modulated seismic wave files uploaded by the user, and performs verification. After successful verification, the data is asynchronously submitted to the Flask backend in FormData format. The finite element software server connection parameters include the finite element software server URL and the finite element software API key. The structural dynamic characteristic parameters include the first and second natural vibration periods and their corresponding damping ratios, the direction of the seismic motion, and the horizontal acceleration angle. The Flask backend extracts the seismic wave file, finite element software server connection parameters, and structural dynamic characteristic parameters, generates a unique task ID, and saves the seismic wave file to the server's temporary directory. The Flask backend uploads the seismic wave file to the finite element software server via the finite element software API key, sets the time history analysis conditions and starts the time history analysis. The Flask backend encapsulates the time history analysis start information into JSON format and returns it to the frontend so that the frontend can notify the user that the time history analysis has started. After the time-to-time analysis is completed, the front end initiates a request to extract railway passenger station structure response data containing floor information and submits it asynchronously to the Flask backend; After receiving the request to extract structural response data of the railway passenger station, the Flask backend parses the floor information, generates a unique task ID again, calls the API to query the total number of seismic conditions in the time history analysis, initializes the task dictionary to record the initial progress value and task status, and starts a background thread. The background thread iterates through each seismic condition, extracts the inter-story drift angle and peak floor acceleration of each floor through the finite element software API, updates the task dictionary after each condition is completed, until all conditions are processed, saves the railway passenger station structural response dataset to the server temporary directory, updates the task progress to 100% and marks the task status as completed. The front-end uses setInterval to periodically call the interface to start polling. The Flask back-end reads the current progress from the task dictionary and returns it in JSON format. The front-end dynamically updates the progress bar. When the progress reaches 100%, the polling stops, and a download link for the railway passenger station structure response dataset is generated on the front-end. The front-end initiates a drawing request, the Flask back-end reads the railway passenger station structural response dataset file, generates a railway passenger station structural response data curve, saves it to a specified directory on the server, and returns the image access path to the front-end. The front-end refreshes and displays the generated railway passenger station structural response data curve in real time through the image access path.
4. The seismic toughness assessment system for railway passenger station buildings based on the Flask frame as described in claim 1, characterized in that, The railway passenger station structural response data preprocessing and verification module specifically includes: The front end obtains the railway passenger station structure response data file uploaded by the user and the set number of dataset expansions, and asynchronously submits the data to the Flask backend in FormData format; The Flask backend extracts the railway passenger station structure response data file and the number of times the dataset is expanded, generates a fully unique task ID, and saves the railway passenger station structure response data file to the server's temporary directory; The Flask backend processes the structured response data matrix, including logarithmic transformation, covariance matrix calculation, and eigenvalue decomposition. Based on the set number of times the dataset is augmented, it generates an augmented sample matrix that conforms to the distribution of the original data. At the same time, it calculates the relative error between the covariance matrix and the mean vector before and after augmentation, and encapsulates the error data, the file name of the augmented data, and the task ID into JSON format response data and returns it to the frontend. The front-end receives JSON response data asynchronously, parses it, dynamically updates the error data display table, and generates a download link for the expanded sample matrix file based on the task ID and the expanded file name, so as to realize one-click download of the expanded sample matrix file.
5. The seismic toughness assessment system for railway passenger station buildings based on the Flask frame as described in claim 1, characterized in that, The multi-threaded resilience index simulation module is specifically used for: The front end obtains the number of Monte Carlo simulations, the fit confidence level, the city size parameters, and the uploaded railway passenger station structural response extended matrix data file and BIM building information data file, and submits the data asynchronously to the Flask back end in FormData format; The Flask backend extracts the railway passenger station structural response augmentation matrix data file, BIM building information data file and related parameters, generates a unique task ID, saves the uploaded file to the server's temporary directory, and starts a background thread to execute the Monte Carlo simulation task; The background thread calculates the logic function based on multiple resilience assessment indicators, including repair time, repair cost, casualties, and post-earthquake functionality, at the completion time of each repair stage. It executes Monte Carlo iterations one after another, and updates the progress percentage of the corresponding unique task ID in the global task dictionary after each iteration. The frontend uses setInterval to periodically call the API to start polling. The Flask backend reads the current progress from the task dictionary and returns it in JSON format. The frontend dynamically updates the progress bar and stops polling when the progress reaches 100%. Once the Monte Carlo simulation is complete, the background thread saves the calculation results as an Excel file to a temporary directory, calls the numerical fitting function to fit the simulation results to a log-normal distribution, generates the fitted value, expected value and standard deviation at the specified confidence level and stores them in the global task dictionary, marks the task status as complete, and encapsulates the simulation results and numerical fitting results into JSON format response data and returns it to the front end. The front-end retrieves JSON response data, parses it, and dynamically updates the resilience index table. Based on the unique task ID, it generates download links for the simulation results Excel file and the resilience index fitted value Excel file, enabling one-click download of the results files.
6. The seismic toughness assessment system for railway passenger station buildings based on the Flask frame as described in claim 1, characterized in that, The post-earthquake recovery process visualization module specifically includes: The front end obtains the resilience index file uploaded by the user, as well as the input downtime parameters and recovery curve shape coefficients for different repair stages, and submits the data asynchronously to the Flask backend in FormData format; The Flask backend extracts the resilience index file, downtime, and recovery curve shape coefficients for different repair stages, and saves the resilience index file to the server's temporary directory. The Flask backend calls the numerical calculation module to construct piecewise nonlinear functions using the NumPy library based on the read resilience index data, downtime, and recovery curve shape coefficients at different repair stages. This simulates the post-earthquake function recovery process, where the post-earthquake function remains constant during the downtime stage and smoothly increases according to the trigonometric function law at each repair stage. The ratio of the area under the post-earthquake function recovery curve to the baseline area is calculated through integral calculation to obtain the quantified seismic resilience index. The numerical calculation module generates a post-earthquake functional recovery curve that changes with repair time by calling the Matplotlib library, saves the image to a static folder on the server, and returns the access path of the image to the Flask backend. The Flask backend encapsulates the image path and seismic toughness index into JSON format response data and returns it to the frontend. The front end receives JSON format response data, parses it, and then refreshes and displays the generated post-earthquake functional recovery curve in real time according to the image access path. The seismic toughness index is also displayed in the corresponding position on the interface for easy user evaluation.
7. The seismic toughness assessment system for railway passenger station buildings based on the Flask frame as described in claim 1, characterized in that, The phased post-earthquake recovery strategy specifically includes: The post-earthquake repair strategy was formulated as "structure first, then enclosure, then electromechanical," which means repairing structural components and vertical transportation components, enclosure structure and water supply and drainage system, HVAC system and power and main signal equipment, and secondary signal equipment in four stages.
8. The seismic toughness assessment system for railway passenger station buildings based on the Flask frame as described in claim 7, characterized in that, The structural components and vertical transportation components include: reinforced concrete frame columns, reinforced concrete frame beams, reinforced concrete shear walls, reinforced concrete connecting beams, steel structure beams, steel structure columns, steel support components, steel-concrete composite columns, steel-concrete composite beams, steel space frames, steel trusses, stairs, and elevators. The enclosure structure and water supply and drainage system include: infill walls, glass curtain walls, suspended ceilings, water supply pipes, fire sprinkler pipes, and sprinkler head risers; The HVAC system and power and main signaling equipment include: suspended lighting fixtures, switchgear, distribution boxes, air outlets, HVAC ducts, HVAC fans, air conditioning system fans, battery cabinets, cable systems, ISFS cabinets, ISFSI cabinets, ISRC cabinets, train control cabinets, CTC cabinets, interlocking cabinets, RBC cabinets, and TSRS cabinets. The secondary signaling equipment includes: IFS cabinet, IFSI cabinet, and IRC cabinet.