Urban multi-element joint simulation method and device

By designing the communication mechanism and simulation system of the city simulation system, the synchronization and data exchange between multiple city factor simulation programs are achieved, which solves the limitations of single-field simulation in the existing technology and improves the accuracy of the joint simulation of multiple cities in the multi-factors and application value.

CN119167592APending Publication Date: 2024-12-20TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411043345.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The existing urban simulation system is based on single-field simulation, ignoring the influence of multiple domains, multi-dimensional and multi-factors, making it difficult to coordinate simulation software for multiple urban specific areas, and is unable to realize joint simulation of multi-factors in cities.

Method used

Design a reasonable communication mechanism and simulation system, and realize synchronization and data exchange between multiple city element simulation programs through clock synchronization function modules, data exchange function modules and configuration distribution and input and output function modules, and build a unified and general simulation simulation program. intercommunication components and software systems.

Benefits of technology

The joint simulation of multiple simulation software for specific urban fields is realized, reflecting the strong correlation between multiple fields and multiple elements in urban simulation, and improving the accuracy and application value of the joint simulation of multiple elements in urban areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119167592A_ABST
    Figure CN119167592A_ABST
Patent Text Reader

Abstract

The invention provides a city multi-element joint simulation method and device. The method comprises the following steps: starting a target simulation program; under the condition that each target simulation program sends out a clock request, responding to each clock request through a clock synchronization function module, and executing data preparation work; acquiring a data state of a target simulation program to be subjected to data exchange; based on the data state, executing or delaying data updating work of the target simulation program to be subjected to data exchange through a data exchange function module; and after the execution of the data updating work is finished, receiving a next clock request sent by each target simulation program, executing the next round of data preparation work and data updating work of each target simulation program until a preset simulation time is reached, and outputting a simulation result. According to the method, strong relevance among multiple fields and multiple elements in city simulation is considered, joint simulation of multiple pieces of simulation software for specific city field elements is achieved, and the accuracy of city multi-element joint simulation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of simulation technology, and in particular to a method and device for joint simulation of multiple elements in a city. Background Art

[0002] At present, urban simulation systems are often based on simulation in a single field, ignoring the influence of multiple fields, multiple dimensions and multiple factors. Therefore, it is difficult to coordinate a variety of city-specific simulation software, design reasonable communication mechanisms and simulation systems, and realize the joint simulation of multiple elements in the city. Summary of the invention

[0003] The present invention provides a method and device for joint simulation of multiple elements in a city, which are used to solve the defects of the prior art that the simulation is based on a single field, ignores the influence of multiple fields, multiple dimensions and multiple elements, and is difficult to coordinate multiple simulation software in specific urban fields. By designing a reasonable communication mechanism and simulation system, the joint simulation of multiple elements in a city can be realized.

[0004] The present invention provides a city multi-factor joint simulation method, the method is implemented by a city multi-factor joint simulation system, the system includes a clock synchronization function module, a data exchange function module and a configuration distribution and input and output function module; The method comprises: Starting a target simulation program, wherein the target simulation program is a plurality of city element simulation programs to be jointly simulated, and each of the target simulation programs issues a clock request after starting; In the case where each of the target simulation programs issues a clock request, the clock synchronization function module responds to each of the clock requests and performs data preparation work for each of the target simulation programs, wherein the data preparation work includes data writing and data updating within the simulation program; Acquire the data state of the target simulation program to be exchanged, wherein the data state includes a data exchangeable state after data preparation work is completed and a data non-exchangeable state before data preparation work is completed; Based on the data status, executing or delaying the data update work of the target simulation program to be data exchanged through the data exchange function module, wherein the data update work includes one or more of data reading, data exchange between target simulation programs, data output and simulation; After the data update work of each target simulation program is completed, the next clock request issued by each target simulation program is received, and the next round of data preparation and data update work of each target simulation program is executed until the preset simulation time is reached, and the simulation result is output.

[0005] According to the urban multi-factor joint simulation method provided by the present invention, the step of starting the target simulation program specifically includes: Starting a target simulation program and a simulation program on which the target simulation program depends; Initialize the target simulator after startup.

[0006] According to the city multi-factor joint simulation method provided by the present invention, the configuration distribution and input-output function module includes a first database, wherein the first database is used to store input data for simulation by each of the target simulation programs; The step of starting the target simulation program and the simulation program on which the target simulation program depends specifically includes: Obtaining input data of a target simulation program from the first database; Based on the input data, starting the target simulation program; Obtain the communication address and communication port of the target simulation program that the started target simulation program depends on; Based on the communication address and communication port fields, determining whether the target simulation program that the started target simulation program depends on is started; In the case that the target simulator that the started target simulator depends on is not started, polling waits for the dependent target simulator to start.

[0007] According to the city multi-factor joint simulation method provided by the present invention, the data exchange function module includes a second database, wherein the second database stores data status, configuration files, and communication address and communication port fields of multiple simulation programs; The steps of initializing the target simulation program after startup include: Registering the communication address and communication port of the started target simulation program in the second database; Based on the configuration file preset in the second database, each of the registered target simulation programs is initialized.

[0008] According to the city multi-factor joint simulation method provided by the present invention, before responding to each of the clock requests, the clock synchronization function module is also used to: The data state of each of the target simulation programs is set to a data non-exchangeable state.

[0009] According to the urban multi-factor joint simulation method provided by the present invention, the responding to each of the clock requests through the clock synchronization function module specifically includes: When any of the target simulation programs does not issue a clock request, the clock synchronization function module does not respond to the received clock request. When each of the target simulation programs issues a clock request, the clock synchronization function simulation responds to the clock request of each of the target simulation programs.

[0010] According to the urban multi-factor joint simulation method provided by the present invention, after the data preparation work is completed, each target simulation program updates the data state of the target simulation program to a data exchangeable state, and stores the data state in the second database.

[0011] According to the city multi-factor joint simulation method provided by the present invention, the step of obtaining the data status of the target simulation program to be exchanged specifically includes: The data status of the target simulation program is obtained through the monitoring mechanism preset in the second database.

[0012] According to the city multi-factor joint simulation method provided by the present invention, based on the data status, the step of executing or delaying the data update work of the target simulation program to be exchanged with data through the data exchange function module specifically includes: When the data state of the target simulation program to be exchanged with data is in a data exchangeable state, updating the data of the target simulation program to be exchanged with data; When the data state of the target simulation program to be exchanged with data is a data non-exchangeable state, data updating work on the target simulation program to be exchanged with data is delayed until the data state of the target simulation program to be exchanged with data is a data exchangeable state.

[0013] According to the city multi-factor joint simulation method provided by the present invention, the configuration distribution and input-output function module also includes a third database, and the third database is used to store the simulation results of each of the target simulation programs.

[0014] According to the urban multi-factor joint simulation method provided by the present invention, the first database is a JSON-like database, the second database is a key-value pair database, and the third database is an SQL database.

[0015] The present invention also provides a city multi-factor joint simulation device, the device is arranged in a city multi-factor joint simulation system, the system includes a clock synchronization function module, a data exchange function module and a configuration distribution and input and output function module; The device comprises: A starting unit, used for starting a target simulation program, wherein the target simulation program is a plurality of city element simulation programs to be jointly simulated, and each of the target simulation programs issues a clock request after starting; A data preparation unit, used for responding to each of the clock requests through the clock synchronization function module when each of the target simulation programs issues a clock request, and performing data preparation work for each of the target simulation programs, wherein the data preparation work includes data writing and data updating in the simulation program; A data status acquisition unit, used for acquiring the data status of the target simulation program to be exchanged, wherein the data status includes a data exchangeable state after the data preparation work is completed and a data non-exchangeable state before the data preparation work is completed; A data updating unit, configured to execute or delay the data updating work of the target simulation program to be exchanged with data through the data exchange function module based on the data state, wherein the data updating work includes one or more of data reading, data exchange between target simulation programs, data output and simulation calculation; The result output unit is used to receive the next clock request issued by each target simulation program after the data update work of each target simulation program is completed, execute the next round of data preparation work and data update work of each target simulation program until the preset simulation time is reached, and output the simulation result.

[0016] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for joint simulation of multiple elements of a city as described above is implemented.

[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for joint simulation of urban multiple elements as described in any one of the above is implemented.

[0018] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for joint simulation of urban multiple elements.

[0019] The city multi-factor joint simulation method and device provided by the present invention start the target simulation program; when each of the target simulation programs sends a clock request, respond to each of the clock requests through the clock synchronization function module, and perform data preparation work for each of the target simulation programs; obtain the data status of the target simulation program to be exchanged; based on the data status, execute or delay the data update work of the target simulation program to be exchanged through the data exchange function module; after the data update work of each of the target simulation programs is completed, receive the next clock request sent by each of the target simulation programs, perform the next round of data preparation work and data update work of each of the target simulation programs, until the preset simulation time is reached, and output the simulation result. The present invention constructs a unified and universal communication component and software system between simulation programs, takes into account the strong correlation between multiple fields and multiple elements in urban simulation, realizes the joint simulation of multiple simulation software for specific urban field elements, and improves the accuracy of the joint simulation of urban multi-factors. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 This is one of the flow charts of the urban multi-factor joint simulation method provided in an embodiment of the present invention.

[0022] Figure 2 It is a schematic diagram of the initialization process of the urban multi-factor joint simulation system provided by an embodiment of the present invention.

[0023] Figure 3 This is the second flow chart of the urban multi-factor joint simulation method provided in the embodiment of the present invention.

[0024] Figure 4 It is a schematic diagram of the implementation principle of the clock synchronization function module provided in an embodiment of the present invention.

[0025] Figure 5 It is a schematic diagram of the implementation principle of the data exchange function module provided in an embodiment of the present invention.

[0026] Figure 6 It is a schematic diagram of the operation flow of the urban multi-factor joint simulation system provided by an embodiment of the present invention.

[0027] Figure 7 It is a structural schematic diagram of the urban multi-factor joint simulation device provided by the present invention.

[0028] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] Urban simulation refers to the process of computer modeling of one or more areas of a city, designing simulation algorithms and simulation programs for the operation of these urban areas, solving and calculating the future operation of these urban areas based on the initial state of the simulation or user input data, and using iterative calculations in each period to extrapolate for a long enough time to produce simulation results with practical application value. Urban simulation technology can help city managers, planners, and researchers optimize management measures and make management strategies that can improve urban efficiency, fairness, safety, etc. by simulating the future dynamics of the city under a specific initial state. Therefore, urban simulation has high application value and social value.

[0031] Since a city is an extremely complex system, it includes at least the fields of transportation, electricity, water supply, drainage, etc., and there are close connections between the fields. For example, power outages will affect traffic lights. Therefore, building a system that can effectively simulate the elements of various fields in the city is of great value for promoting the implementation of urban simulation and is one of the key technical challenges in this field. However, most of the current systems related to urban simulation only focus on simulation in a single field, such as SUMO, SWMM, MATPOWER, etc. Among them, SUMO realizes the simulation of urban micro-traffic behavior and can model and simulate the travel of citizens and the operation of the transportation system; SWMM realizes the simulation of the urban water supply and drainage network and can model the operation of the water supply network and drainage network; MATPOWER realizes the simulation of the urban power grid and can automatically solve the working conditions of substations at all levels according to the power load. Based on the above situation, for urban simulation, how to design a reasonable communication mechanism and system to coordinate a variety of city-specific field simulation software and realize the joint simulation of multiple elements in the city has become an important problem to be solved.

[0032] Specifically, the prior art 1 provides a method for identifying urban traffic risk hotspots, which builds a city simulator by acquiring a three-dimensional model of the target city, vehicle trajectory data, and weather data; identifies traffic violations based on target detection and relationship detection based on the built city simulator; extracts parking hotspots based on the built city simulator, and models environmental features to obtain traffic accident hotspots; and calculates traffic risk hotspots based on a weighted clustering algorithm for the identified traffic violations and the obtained traffic accident hotspots.

[0033] Prior art 2 provides a method for simulating urban expansion based on cellular automata. According to the urban simulation map, urban land is divided into six types: industrial land, commercial and service land, residential land, water bodies, roads and unused land. Key planning areas are divided according to urban planning. The land cell attribute layer is defined. The neighbor matrix of the land cell at a specific moment is defined. The neighbor matrix at the current moment is iterated by one step to obtain the state of the unused land cell at the next moment. The unused land is converted into construction land according to the rules.

[0034] Prior art 3 provides a dynamic urban model system based on scenario planning, including an urban growth module, an urban land decision module and a comprehensive evaluation module for detecting the output results of the model; wherein the urban growth module includes a basic growth rate identification module for delineating the basic elastic boundary of urban land based on the historical urban growth rate and a growth rate correction module associated with the preset scenario for determining the elastic boundary under the influence of different scenarios; the urban land decision module is a sub-model system for making land use type decisions within the urban land boundary based on the output results of the urban growth module; the urban land decision module includes a land conflict identification module based on the preset scenario for dealing with uncertain disturbances; the comprehensive evaluation module includes a regulatory detection module for ensuring that the output results of the model comply with the superior planning, a parameter detection module for ensuring that the output results of the model meet the future construction needs of the target city, and a scenario detection module for ensuring that the output results of the model can be adjusted to the disturbance after the corresponding scenario occurs.

[0035] The main problems of the above three existing technologies are: they only focus on the simulation of elements in a specific field of the city, lack of communication mechanism and software system that combine simulations in multiple fields of the city, and cannot realize the joint simulation of multiple elements of the city, which limits the application value of urban simulation.

[0036] To solve the above problems, the present invention provides a method and device for joint simulation of multiple elements in a city. By constructing a unified and universal communication component and software system between simulation programs, multiple simulation software for specific urban field elements can be jointly simulated, thereby reflecting the strong correlation between multiple fields and multiple elements in urban simulation, accurately simulating the future dynamics of the city, and giving full play to the application value of urban simulation.

[0037] The present invention first designs a system framework to describe the access method of simulation software in a specific field according to the characteristics of urban environment and urban simulation. Secondly, a parallel and secure urban element simulation program design method is given to ensure the correctness of the parallel calculation process of multi-element simulation. Finally, three key functional modules of clock synchronization, data exchange, configuration distribution and input and output are realized.

[0038] Combine the following Figure 1-Figure 6 The urban multi-factor joint simulation method of the present invention is described.

[0039] In a possible implementation scheme of the present invention, the urban multi-factor joint simulation method is implemented through an urban multi-factor joint simulation system, which includes a clock synchronization function module, a data exchange function module, and a configuration distribution and input-output function module.

[0040] In some possible implementations, Figure 1 is a flow chart of a method for joint simulation of multiple urban elements provided by an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps: Step 101, start a target simulation program, wherein the target simulation program is a plurality of city element simulation programs to be jointly simulated, and each of the target simulation programs issues a clock request after being started; Step 102: When each of the target simulation programs sends a clock request, the clock synchronization function module responds to each of the clock requests and performs data preparation work for each of the target simulation programs, wherein the data preparation work includes data writing and data updating in the simulation program; Step 103, obtaining the data status of the target simulation program to be exchanged, wherein the data status includes a data exchangeable state after data preparation work is completed and a data non-exchangeable state before data preparation work is completed; Step 104: Based on the data status, the data exchange function module executes or delays the data update work of the target simulation program to be exchanged, wherein the data update work includes one or more of data reading, data exchange between target simulation programs, data output and simulation; Step 105, after the data update work of each target simulation program is completed, receive the next clock request issued by each target simulation program, execute the next round of data preparation work and data update work of each target simulation program until the preset simulation time is reached, and output the simulation result.

[0041] It should be noted that different simulation programs have different levels of complexity and efficiency in simulation calculations. They may iterate in different rounds within the same running time, resulting in inconsistent clocks in various fields and elements of the entire city simulation. To achieve joint simulation of multiple fields and multiple elements in the city, the key issue is how to enable multiple simulation programs to perform simulation operations at the same speed and exchange related data in an appropriate manner to reflect the mutual influence and correlation between different urban elements.

[0042] Therefore, in the embodiment of the present invention, it is considered that all simulation programs of the access system are calculated in a discrete time simulation mode, that is, the program is calculated in a loop iteration mode, and each loop represents a fixed time for the simulation environment to run forward. The clock synchronization function module in the embodiment of the present invention is used to synchronize the clocks of each simulation program, so that the faster simulation program waits for the slower simulation program to complete execution.

[0043] In some possible implementations of the present invention, the step of starting the target simulation program specifically includes: Starting a target simulation program and a simulation program on which the target simulation program depends; Initialize the target simulator after startup.

[0044] Specifically, this embodiment provides an implementation method for starting a target simulation program, by starting the target simulation program and other target simulation programs on which the target simulation program depends, and initializing the started simulation program, to prepare for the subsequent multi-factor joint simulation.

[0045] Specifically, the configuration distribution and input-output function module includes a first database, wherein the first database is used to store input data for simulation by each of the target simulation programs; The step of starting the target simulation program and the simulation program on which the target simulation program depends specifically includes: Obtaining input data of a target simulation program from the first database; Based on the input data, starting the target simulation program; Obtain the communication address and communication port of the target simulation program that the started target simulation program depends on; Based on the communication address and communication port fields, determining whether the target simulation program that the started target simulation program depends on is started; In the case that the target simulator that the started target simulator depends on is not started, polling waits for the dependent target simulator to start.

[0046] In a possible embodiment, the first database is a JSON-like database for input data storage.

[0047] Specifically, for the input data required for simulation by each simulation program, the input function stores it in JSON format into a JSON-like database so that users can intuitively view and modify the stored data items, which is more in line with the characteristics of frequent changes in data content in urban simulation applications.

[0048] Further, the data exchange function module includes a second database, wherein the second database stores data status, configuration files, and communication address and communication port fields of a plurality of simulation programs; The steps of initializing the target simulation program after startup include: Registering the communication address and communication port of the started target simulation program in the second database; Based on the configuration file preset in the second database, each of the registered target simulation programs is initialized.

[0049] In a possible embodiment, the second database is a high-performance key-value database used for runtime state storage and synchronization.

[0050] Specifically, since the urban multi-factor joint simulation system is a system composed of multiple simulation programs deployed in a distributed manner, centralized management and distribution of configurations can greatly facilitate the system startup process. In this embodiment, the configuration of each simulation program is pre-stored in the form of a string in a key-value database, and each field element simulation program actively obtains it from the key-value database when it is started.

[0051] In a possible embodiment, Figure 2 As shown, Figure 2 is a schematic diagram of the initialization process of the urban multi-factor joint simulation system provided by an embodiment of the present invention, Figure 2 Describes how the various components coordinate work in a parallel and safe manner to load configurations, download data, and start simulation calculations.

[0052] Specifically, the initialization process of the urban multi-factor joint simulation system includes the following four steps: Step 1: Register the simulation program: In this step, each domain element simulation program registers the communication address and communication port of the program in the key-value database, retrieves the configuration file, and initializes the program; Step 2: Download input data: In this step, each simulation program downloads the input data required for starting the program from the JSON-like database; Step 3: Wait for the dependent program to start: In this step, each simulation program checks the communication address and communication port fields of the simulation program it depends on in the key-value pair database to confirm whether the simulation program it depends on is started, and if not, it polls and waits; Step 4: Send initialization command: In this step, after each simulation program is completely started successfully, an initialization instruction is sent to the clock synchronization function module server, which is the first clock request. The time number indicated in the request content is always 1.

[0053] Specifically, this embodiment provides an implementation method for initializing a city multi-factor joint simulation system by coordinating work in a parallel and secure manner to load configurations, download data, and start simulation calculations.

[0054] In some specific embodiments of the present invention, another embodiment of a method for joint simulation of multiple factors in a city is provided, such as Figure 3 As shown, Figure 3 This is the second flowchart of the urban multi-factor joint simulation method provided in an embodiment of the present invention. The flowchart of the urban multi-factor joint simulation method includes data partitioning and two-stage update operations.

[0055] Specifically, see Figure 3 ,The urban multi-factor joint simulation method requires the simulation program to ,divide the data used in the simulation into three partitions: current data, data snapshot, and data buffer, and ,divide each simulation loop iteration into a preparation phase and an update phase, ,to avoid the use of a large number of thread synchronization mechanisms such as ,mutex locks or barriers and improve the system performance.

[0056] In more detail, the current data is data that is only read and written by the current simulation program. It is used to store the internal state of the field element simulation program and is not used for data output, data exchange and other usage scenarios. The parallel security of the data is managed by the simulation program itself. The data snapshot is used to store the read-only data that the current simulation program discloses to the outside, including data output, read-type data exchange, etc. The data is synchronized from the current data area for update during the preparation phase. The data buffer is used to store write-type data exchange from other programs to avoid data conflicts that may be caused by directly modifying the current data area. For the preparation phase and update phase, in each simulation cycle, when the clock synchronization module responds, the preparation phase is always executed first. After the preparation phase is completed, the simulation program reports the status update, and then executes the update phase. After the update is completed, the clock synchronization request is issued again and waits for the response. In the preparation phase, there is no data exchange, data output, or simulation calculation between the various programs. Only the synchronization from the current data area to the data snapshot area and the writing of the data buffer to the current data are processed. At this time, since there is no data exchange between the simulation programs, the simulation program does not need to protect the data through thread mutual exclusion mechanisms (such as mutexes, etc.) in this phase to avoid additional processing overhead. In the update phase, the simulation program updates the current data area through its own simulation algorithm, while the read-type data exchange with the external program is obtained from the read-only data snapshot area, and the write-type data exchange only modifies the write-only data buffer. Through the two design strategies of read-write separation and internal-external separation, the mutual influence of data sources such as simulation program algorithms and external program data exchange is effectively avoided, the use of thread mutual exclusion mechanisms (such as mutex locks, etc.) is greatly reduced, and the computing performance is improved.

[0057] Specifically, this embodiment provides another implementation method of the urban multi-factor joint simulation method. Through three data partitions of current data, data snapshot, and data buffer and two-stage calculations of preparation stage and update stage, the computing performance under multi-factor joint simulation can be improved, and the burden on developers and the probability of program errors can be reduced by reducing the use of thread mutual exclusion mechanism.

[0058] In a possible embodiment, the clock synchronization function module is divided into a server and a client, and both ends perform request-response data transmission through network communication. Figure 4 FIG. 1 is a schematic diagram showing a clock synchronization function module according to an embodiment of the present invention. Figure 4 As shown, the implementation process of the clock synchronization function module can be reflected as a token queue consumption process.

[0059] In some possible implementations of the present invention, before responding to each clock request, the clock synchronization function module is further used to: set the data state of each target simulation program to a data non-exchangeable state.

[0060] In some possible implementations of the present invention, before responding to each of the clock requests through the clock synchronization function module, the method further includes: When any of the target simulation programs does not issue a clock request, the clock synchronization function module does not respond to the received clock request. When each of the target simulation programs issues a clock request, the clock synchronization function simulation responds to the clock request of each of the target simulation programs.

[0061] Specifically, the main design purpose of the clock synchronization function module is to achieve clock synchronization between multiple simulation programs, so as to control the clocks of each simulation program to always be at the same time, which is the key basis for the correctness of the urban multi-factor joint simulation. In the urban multi-factor joint simulation system, different simulation programs may have different simulation cycles. For example, each loop iteration of the traffic simulation simulates 1 second, while each loop iteration of the water network simulation may simulate 5 minutes. To this end, the clock synchronization function module adopts a token queue consumption process design, and each loop iteration of the simulation program is reflected as a time token group.

[0062] In more detail, the specific implementation process of the clock synchronization function module includes: Step 1: Whenever the simulation program completes a loop iteration, it sends a clock request to the clock synchronization function module server, with the content being the number of moments represented by this loop iteration (unit: seconds), and starts waiting for the clock synchronization function module server to respond.

[0063] Step 2: The server of the clock synchronization function module maintains multiple time token queues, the number of which is consistent with the total data of the simulation program accessing the system. The server will create a time token group for each clock request and add it to the corresponding queue. The number of tokens in the token group is consistent with the number of moments in the request. The token consumer on the server always tries to consume 1 token from all queues at the same time. Once the consumption is successful, the next round of consumption will start immediately. When a token group is completely consumed, a clock response is immediately sent to the simulation program corresponding to the token group, so that the simulation program can continue to the next round of simulation cycle iteration.

[0064] Step 3: After receiving the response from the server, the simulation program immediately starts to execute the preparation phase and the update phase. After the update phase is completed, step 1 is repeated.

[0065] Through the above process, one round of token consumption means that the urban multi-factor joint simulation system simulates one moment forward. The program with faster simulation speed will be delayed for the next round of simulation because its moment token cannot be consumed, thus achieving clock synchronization and fast simulation program waiting for slow simulation program.

[0066] In some possible implementations of the present invention, after completing the data preparation work, each of the target simulation programs updates the data state of the target simulation program to a data exchangeable state, and stores the data state in the second database.

[0067] Specifically, Figure 5 is a schematic diagram of the data exchange function module provided by an embodiment of the present invention, such as Figure 5 As shown, the data exchange function module is composed of a key-value database, a status update routine of the clock synchronization server, and a data exchange submodule on the simulation program. The main design purpose of the data exchange function module is to ensure that the simulation program that issues the request only exchanges data when the simulation program that receives the request is in the update phase. To achieve this goal, the data exchange function module introduces a high-performance key-value database to store the available status of the simulation programs of various field elements, and realizes the active push of the available status to the simulation program through the monitoring mechanism provided by the key-value database. In order to make the simulation program status recorded in the key-value database accurately reflect the running status of the simulation program, the process of setting the simulation program status to unavailable is completed by the clock synchronization server. Before issuing a clock response, the clock synchronization server always updates the status of the corresponding simulation program in the key-value database to unavailable, and then issues a response to notify the simulation program to enter the preparation phase. After the simulation program completes the preparation phase, it actively updates the status in the key-value database to available.

[0068] In some possible implementations of the present invention, based on the data state, the step of executing or delaying the data update work of the target simulation program to be data exchanged by the data exchange function module specifically includes: When the data state of the target simulation program to be exchanged with data is in a data exchangeable state, updating the data of the target simulation program to be exchanged with data; When the data state of the target simulation program to be exchanged with data is a data non-exchangeable state, data updating work on the target simulation program to be exchanged with data is delayed until the data state of the target simulation program to be exchanged with data is a data exchangeable state.

[0069] Specifically, the simulation program that needs to send a data exchange request to the simulation program can promptly learn the state changes of the target simulation program through the monitoring mechanism of the key-value database. When the target simulation program is unavailable, the issuance of the data exchange request is delayed until the target program state becomes available.

[0070] Through the above functional design, data exchange between simulation programs is always carried out in the update phase, so that the multi-factor joint simulation process always complies with the parallel and safe urban element simulation program design method, avoiding data access conflicts and ensuring the correctness of program operation.

[0071] In some specific embodiments of the present invention, Figure 6 As shown, Figure 6 is a schematic diagram of the operation flow of the urban multi-factor joint simulation system provided by an embodiment of the present invention, Figure 6 Describes how to perform computational iterations, data exchange, and data output in a parallel and safe manner.

[0072] It should be noted that for the output data stream of each simulation program, due to its huge data volume, high requirements are placed on data retrieval speed.

[0073] In some possible implementations of the present invention, the configuration distribution and input-output function module further includes a third database, wherein the third database is used to store simulation results of each of the target simulation programs.

[0074] In a possible embodiment, the third database is a high-performance SQL database for output data storage.

[0075] Specifically, in this embodiment, an SQL database is used to store the output data of the simulation program, and a storage table and a storage index are pre-built according to the format specified by the simulation program when the simulation system is initialized to accelerate the subsequent retrieval process. For writing to the SQL database, this system uses a binary stream batch writing method to accelerate.

[0076] The configuration distribution and input / output function modules adopted in the embodiment of the present invention include a configuration distribution function based on a key-value pair database, an input function based on a JSON-like database, and an output function based on an SQL database.

[0077] It should be noted that since the urban multi-factor joint simulation system is a system composed of multiple simulation programs deployed in a distributed manner, centralized management and distribution of configurations can greatly facilitate the system startup process.

[0078] Therefore, in an embodiment of the present invention, the configuration of each simulation program is pre-stored in a key-value database in the form of a string, and each field element simulation program actively obtains it from the key-value database when it is started. For the input data required for simulation by each simulation program, the input function stores it in a JSON-like database in JSON format so that users can intuitively view and modify the stored data items, which is more in line with the characteristics of frequent changes in data content in urban simulation applications. The configuration distribution and input-output function module mainly provides help tools for the basic functions such as configuration distribution, input, and output of each simulation program, facilitating the access of the simulation program.

[0079] In a specific embodiment, after all simulation programs have sent the first clock request, the clock synchronization module will send a clock response to all simulation programs. After that, all simulation programs enter the operation process and perform simulation cycle iteration. The operation process of the urban multi-factor joint simulation system includes the following five steps: Step 1: Before sending a clock response to the simulation program, the clock synchronization function module first sets the simulation program status in the key-value pair database to unavailable; Step 2: The clock synchronization function module responds to the clock request of the simulation program, and guides the simulation program to enter the preparation stage; Step 3: After receiving the clock response, the simulation program executes the preparation phase routine, and after completion, changes the program status in the key-value database to available; Step 4: The simulation program enters the update phase. In the update phase, the simulation program executes the simulation algorithm and performs data exchange and data output as needed. Step 5: After the simulation program update phase routine is executed, the next clock request is sent to the clock synchronization server, and the clock synchronization server starts to wait for a response, and then returns to step 1.

[0080] Through the above process steps, the urban multi-factor joint simulation system can start the simulation, perform the simulation, and output and store the simulation results until the preset simulation time arrives and the simulation task is terminated.

[0081] In general, the city multi-element joint simulation system designed in the present invention introduces three types of databases as supporting software, including a high-performance key-value database for runtime state storage and synchronization, a JSON-like database for input data storage, and a high-performance SQL database for output data storage. In terms of design methods and database support, the system design implements three key functions: clock synchronization function module, data exchange function module, and configuration distribution and input-output function module, thereby realizing a parallel and secure city element simulation program design method. The present invention transforms existing specific element simulation programs to access the system, realizes speed alignment between multiple simulation programs through the clock synchronization function module, realizes correct data exchange between multiple simulation programs through the data exchange function module, and manages and standardizes the configuration, input data, and output data streams of multiple simulation programs through the configuration distribution and input-output function module.

[0082] The above-mentioned urban multi-factor joint simulation method is further explained below through some specific embodiments.

[0083] In a specific implementation scheme of the present invention, a city multi-factor joint simulation method is used to simulate the traffic operation status and power facility operation status and their correlation in District B of City A throughout the day on June 1, 2022.

[0084] First, the etcd database is selected as the key-value pair database referred to in the embodiment of the present invention, the MongoDB database is selected as the JSON-like database referred to in the embodiment of the present invention, and PostgreSQL is selected as the SQL database referred to in the embodiment of the present invention.

[0085] In order to simulate the traffic operation and power facility operation conditions of City A throughout the day, the user selected the urban micro-traffic simulation program independently developed based on the Golang programming language and the open source PYPOWER power grid flow calculation simulation program as the simulation programs for various field elements referred to in the embodiments of the present invention. The former is used to simulate the flow of people and vehicles in the city, and the latter is used to simulate the changes in power load in the city.

[0086] Then, the user also used the Golang programming language and the gRPC remote procedure call framework to implement the clock synchronization function module and the token consumption mechanism therein, and used the Golang programming language and the gRPC framework to develop a communication interface for data exchange between simulation programs, and managed the availability status of the communication interface through the etcd database. The user can set the key of the availability status of the urban micro-traffic simulation program to " / traffic / ok", set the value of available to "1", and set the value of unavailable to "0", and establish a watch function connection between the simulation program and the etcd database. Through this connection, etcd can actively push the change of the value of " / traffic / ok" to the PYPOWER simulation program. According to the received " / traffic / ok" value, when the value is "0", the PYPOWER simulation program delays the request to obtain the real-time number of people in each area from the micro-traffic simulation program until it receives the notification from etcd that the value of " / traffic / ok" has changed to 1.

[0087] In this embodiment, the user stores the complete configuration files of the two programs in the form of strings in " / traffic / config" and " / power / config" of the etcd database, respectively, for loading at initialization. The input data of each program is stored in the collections traffic and power of the MongoDB database in BSON format. The micro traffic simulation program outputs the longitude and latitude data of people and vehicles within the specified range every second, forming an SQL table with column names of "t", "id", "lng", and "lat", and uses PostgreSQL's COPY FROM instruction for write acceleration; the PYPOWER simulation program outputs the total load of all power stations within the range every minute, forming an SQL table with column names of "t", "id", and "power" and writing it into the PostgreSQL database.

[0088] By adopting the above implementation mode, after the user configures the configurations of each simulation program in the etcd database and inputs data into MongoDB, each database, simulation program and functional component can be started to simulate the traffic operation conditions and power facility operation conditions and their correlation in District B of City A throughout the day on June 1, 2022.

[0089] In another specific embodiment of the present invention, the user uses the urban multi-factor joint simulation method and system to simulate the traffic operation conditions and mobile communication network operation conditions and their correlation in the urban area of ​​City C throughout the day on January 18, 2021.

[0090] Specifically, the user selects the redis database as the key-value pair database referred to in the present invention, selects the MongoDB database as the JSON-like database referred to in the present invention, and selects MySQL as the SQL database referred to in the present invention.

[0091] Furthermore, in order to simulate the traffic operation and mobile communication network operation of City C throughout the day, the user selected the SUMO micro-traffic simulation program based on the C++ programming language and the mobile communication network simulation program independently developed based on C++ as the simulation programs for various field elements referred to in the present invention. The former is used to simulate the flow of people and vehicles in the city, and the latter is used to simulate the mobile cellular network signals received by each person in the city and the load of the base station.

[0092] The user also used Python programming language and HTTP JSON interface to implement the clock synchronization function module and the token consumption mechanism therein, and used Python programming language and HTTP JSON framework to develop the communication interface for data exchange between simulation programs, and managed the communication interface availability status through the redis database. The user can set the key of the availability status of the urban micro-traffic simulation program to "sumo:ok", set the value indicating availability to "true", and set the value indicating unavailability to "false", and set polling access to the redis database for the simulation program. The simulation program will continuously request the "sumo:ok" field in the redis database in a loop to update the traffic simulation status stored in the simulation program. The mobile communication network simulation program takes the value of "sumo:ok" according to the query. When the value is "false", it delays the request to the micro-traffic simulation program to obtain the location and speed of all people in the city until the query result of the "sumo:ok" value changes to "true".

[0093] In this embodiment, the user stores the complete configuration files of the two programs in the form of strings in the redis database "sumo:config" and "com:config" for loading at initialization. The input data of each program is stored in the MongoDB database collection sumo and com in BSON format. The micro traffic simulation program outputs the latitude and longitude data and moving speed of people and vehicles within the specified range every second, and the SQL table with column names of "t", "id", "lng", "lat", and "v" is stored in the MySQL database; the mobile communication network simulation program outputs the base station load ratio within all ranges every second, and the column names of "t", "id", and "ratio" are written into the MySQL database.

[0094] Using the above implementation method, the user configures the contents of "sumo:config" and "com:config" in the redis database, inputs data into MongoDB, and then starts each database, simulation program and functional component to simulate the traffic operation conditions and mobile communication network operation conditions and their correlation in the urban area of ​​City C throughout the day on January 18, 2021.

[0095] The city multi-element joint simulation method and device provided by the embodiment of the present invention synchronizes the clocks of each simulation program through a clock synchronization function module, so that the faster simulation program waits for the slower simulation program to be executed; maintains the data provider's data preparation information through a high-performance key-value database, and delays the request from the data requester until the data provider is ready. The present invention proposes a parallel and secure city element simulation program design method to achieve efficient and stable operation of the city multi-element joint simulation system; the configuration distribution and input-output function module referred to in the present invention uses a key-value database for configuration distribution, and a JSON-like database for input data management, and sends it to the simulation program after the module converts the format, and the module converts the output data stream format and writes it to the SQL database in binary stream mode to improve output throughput.

[0096] The urban multi-factor joint simulation device provided by the present invention is described below. The urban multi-factor joint simulation device described below and the urban multi-factor joint simulation method described above can be referenced to each other.

[0097] Figure 7 is a schematic diagram of the structure of the urban multi-factor joint simulation device provided by the present invention, such as Figure 7 As shown, the urban multi-factor joint simulation device provided by the embodiment of the present invention is arranged in an urban multi-factor joint simulation system, and the system includes a clock synchronization function module, a data exchange function module and a configuration distribution and input and output function module.

[0098] The urban multi-factor joint simulation device includes: A starting unit 71 is used to start a plurality of target simulation programs, wherein the target simulation programs are city multi-factor simulation programs to be jointly simulated, and each of the target simulation programs issues a clock request after the startup is completed; The data preparation unit 72 is used for responding to each of the clock requests through the clock synchronization function module when each of the target simulation programs sends a clock request, and performing data preparation work for each of the target simulation programs, wherein the data preparation work includes data writing and data updating in the simulation program; A data status acquisition unit 73, used for acquiring the data status of the target simulation program to be exchanged, wherein the data status includes a data exchangeable state after the data preparation work is completed and a data non-exchangeable state before the data preparation work is completed; A data updating unit 74 is used to execute or delay the data updating work of the target simulation program to be exchanged with data through the data exchange function module based on the data state, wherein the data updating work includes one or more of data reading, data exchange between target simulation programs, data output and simulation calculation; The result output unit 75 is used to receive the next clock request issued by each target simulation program after the data update work of each target simulation program is completed, execute the next round of data preparation work and data update work of each target simulation program until the preset simulation time is reached, and output the simulation result.

[0099] The implementation principle and beneficial effects of the urban multi-factor joint simulation device provided in the embodiment of the present invention are similar to the implementation principle and beneficial effects of the urban multi-factor joint simulation method shown in the above embodiment. Please refer to the implementation principle and beneficial effects of the urban multi-factor joint simulation method shown in the above embodiment, and no further details will be given here.

[0100] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communications interface 820 and the memory 830 communicate with each other via the communications bus 840. The processor 810 may call the logic instructions in the memory 830 to execute a method for joint simulation of multiple urban elements, the method comprising: starting a target simulation program, wherein the target simulation program is a plurality of urban element simulation programs to be jointly simulated, and each of the target simulation programs issues a clock request after the startup is completed; in the case where each of the target simulation programs issues a clock request, each of the clock requests is responded to through the clock synchronization function module, and data preparation work for each of the target simulation programs is performed, wherein the data preparation work includes data writing and data updating within the simulation program; obtaining the data status of the target simulation program to be exchanged, wherein the data status The state includes a data exchangeable state after the data preparation work is completed and a data non-exchangeable state before the data preparation work is completed; based on the data state, the data update work of the target simulation program to be exchanged is executed or delayed through the data exchange function module, wherein the data update work includes one or more of data reading, data exchange between target simulation programs, data output and simulation; after the data update work of each target simulation program is completed, the next clock request issued by each target simulation program is received, and the next round of data preparation work and data update work of each target simulation program is executed until the preset simulation time is reached, and the simulation result is output.

[0101] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0102] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the urban multi-element joint simulation method provided by the above-mentioned methods, and the method includes: starting a target simulation program, wherein the target simulation program is a plurality of urban element simulation programs to be jointly simulated, and each of the target simulation programs issues a clock request after the startup is completed; when each of the target simulation programs issues a clock request, each of the clock requests is responded to through the clock synchronization function module, and data preparation work of each of the target simulation programs is performed, wherein the data preparation work includes data writing and data in the simulation program. Update; obtain the data status of the target simulation program to be exchanged, wherein the data status includes the data exchangeable status after the data preparation work is completed and the data non-exchangeable status before the data preparation work is completed; based on the data status, execute or delay the data update work of the target simulation program to be exchanged through the data exchange function module, wherein the data update work includes one or more of data reading, data exchange between target simulation programs, data output and simulation; after the data update work of each target simulation program is completed, receive the next clock request issued by each target simulation program, execute the next round of data preparation work and data update work of each target simulation program, until the preset simulation time is reached, and output the simulation result.

[0103] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the city multi-element joint simulation method provided by the above-mentioned methods, the method comprising: starting a target simulation program, wherein the target simulation program is a plurality of city element simulation programs to be jointly simulated, and each of the target simulation programs issues a clock request after the startup is completed; in the case where each of the target simulation programs issues a clock request, responding to each of the clock requests through the clock synchronization function module, and performing data preparation work for each of the target simulation programs, wherein the data preparation work includes data writing and data updating in the simulation program; obtaining the target simulation program to be exchanged The data status of the simulation program, wherein the data status includes a data exchangeable status after the data preparation work is completed and a data non-exchangeable status before the data preparation work is completed; based on the data status, the data update work of the target simulation program to be exchanged is executed or delayed through the data exchange function module, wherein the data update work includes one or more of data reading, data exchange between target simulation programs, data output and simulation; after the data update work of each target simulation program is completed, the next clock request issued by each target simulation program is received, and the next round of data preparation work and data update work of each target simulation program is executed until the preset simulation time is reached, and the simulation result is output.

[0104] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for joint simulation of multiple urban elements, characterized in that: The method is implemented through a city multi-factor joint simulation system, which includes a clock synchronization function module, a data exchange function module, and a configuration distribution and input and output function module; The method comprises: Starting a target simulation program, wherein the target simulation program is a plurality of city element simulation programs to be jointly simulated, and each of the target simulation programs issues a clock request after starting; In the case where each of the target simulation programs issues a clock request, the clock synchronization function module responds to each of the clock requests and performs data preparation work for each of the target simulation programs, wherein the data preparation work includes data writing and data updating within the simulation program; Acquire the data state of the target simulation program to be exchanged, wherein the data state includes a data exchangeable state after data preparation work is completed and a data non-exchangeable state before data preparation work is completed; Based on the data status, executing or delaying the data update work of the target simulation program to be data exchanged through the data exchange function module, wherein the data update work includes one or more of data reading, data exchange between target simulation programs, data output and simulation; After the data update work of each target simulation program is completed, the next clock request issued by each target simulation program is received, and the next round of data preparation and data update work of each target simulation program is executed until the preset simulation time is reached, and the simulation result is output.

2. The urban multi-factor joint simulation method according to claim 1 is characterized in that: The steps to start the target simulation program include: Starting a target simulation program and a simulation program on which the target simulation program depends; Initialize the target simulator after startup.

3. The urban multi-factor joint simulation method according to claim 2 is characterized in that: The configuration distribution and input-output function module includes a first database, wherein the first database is used to store input data for simulation by each of the target simulation programs; The step of starting the target simulation program and the simulation program on which the target simulation program depends specifically includes: Obtaining input data of a target simulation program from the first database; Based on the input data, starting the target simulation program; Obtain the communication address and communication port of the target simulation program that the started target simulation program depends on; Based on the communication address and communication port fields, determining whether the target simulation program that the started target simulation program depends on is started; In the case that the target simulator that the started target simulator depends on is not started, polling waits for the dependent target simulator to start.

4. The urban multi-factor joint simulation method according to claim 3 is characterized in that: The data exchange function module includes a second database, wherein the second database stores data status, configuration files, and communication address and communication port fields of multiple simulation programs; The steps of initializing the target simulation program after startup include: Registering the communication address and communication port of the started target simulation program in the second database; Based on the configuration file preset in the second database, each of the registered target simulation programs is initialized.

5. The urban multi-factor joint simulation method according to claim 4 is characterized in that: Before responding to each of the clock requests, the clock synchronization function module is further used to: The data state of each of the target simulation programs is set to a data non-exchangeable state.

6. The urban multi-factor joint simulation method according to claim 5 is characterized in that: The responding to each of the clock requests through the clock synchronization function module specifically includes: When any of the target simulation programs does not issue a clock request, the clock synchronization function module does not respond to the received clock request. When each of the target simulation programs issues a clock request, the clock synchronization function simulation responds to the clock request of each of the target simulation programs.

7. The urban multi-factor joint simulation method according to claim 6 is characterized in that: After the data preparation work is completed, each of the target simulation programs updates the data state of the target simulation program to a data exchangeable state, and stores the data state in the second database.

8. The urban multi-factor joint simulation method according to claim 7 is characterized in that: The step of obtaining the data status of the target simulation program to be exchanged specifically includes: The data status of the target simulation program is obtained through the monitoring mechanism preset in the second database.

9. The urban multi-factor joint simulation method according to claim 8, characterized in that: Based on the data state, the step of executing or delaying the data update work of the target simulation program to be data exchanged through the data exchange function module specifically includes: When the data state of the target simulation program to be exchanged with data is in a data exchangeable state, updating the data of the target simulation program to be exchanged with data; When the data state of the target simulation program to be exchanged with data is a data non-exchangeable state, data updating work on the target simulation program to be exchanged with data is delayed until the data state of the target simulation program to be exchanged with data is a data exchangeable state.

10. The urban multi-factor joint simulation method according to any one of claims 4 to 9, characterized in that: The configuration distribution and input-output function module also includes a third database, and the third database is used to store the simulation results of each target simulation program.

11. The urban multi-factor joint simulation method according to any one of claim 10, characterized in that: The first database is a JSON-like database, the second database is a key-value pair database, and the third database is a SQL database.

12. A city multi-factor joint simulation device, characterized in that: The device is arranged in a city multi-factor joint simulation system, and the system comprises a clock synchronization function module, a data exchange function module and a configuration distribution and input and output function module; The device comprises: A starting unit, used for starting a target simulation program, wherein the target simulation program is a plurality of city element simulation programs to be jointly simulated, and each of the target simulation programs issues a clock request after starting; A data preparation unit, used for responding to each of the clock requests through the clock synchronization function module when each of the target simulation programs issues a clock request, and performing data preparation work for each of the target simulation programs, wherein the data preparation work includes data writing and data updating in the simulation program; A data status acquisition unit, used for acquiring the data status of the target simulation program to be exchanged, wherein the data status includes a data exchangeable state after the data preparation work is completed and a data non-exchangeable state before the data preparation work is completed; A data updating unit, configured to execute or delay the data updating work of the target simulation program to be exchanged with data through the data exchange function module based on the data state, wherein the data updating work includes one or more of data reading, data exchange between target simulation programs, data output and simulation calculation; The result output unit is used to receive the next clock request issued by each target simulation program after the data update work of each target simulation program is completed, execute the next round of data preparation work and data update work of each target simulation program until the preset simulation time is reached, and output the simulation result.