A Data Management and Persistence Method and System for a Real-Time Simulation System
By forming independent data frames in real-time simulation simulation system, eliminating non-essential data and adjusting the timestamp interval, the performance bottlenecks and data volume imbalance in data management and persistence are solved, efficient data storage and playback are achieved, and the performance and reliability of the system are improved.
Patent Information
- Application Number
- CN202510428391.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-04-08
AI Technical Summary
In real-time simulation simulation systems, data management and persistence have problems such as performance bottlenecks, unbalanced data volume, low index management efficiency and difficulty in effective data storage.
By forming independent data frames based on the simulation frame sequence number and the preset data packet header structure, eliminating non-essential data, adjusting the timestamp interval, recalculating the track point position, generating a dynamic playback track, and performing coordinate transformation of the track point through the rotation matrix to optimize data storage and playback.
It improves the performance and efficiency of the simulation system, optimizes the data storage and playback process, reduces the waste of storage resources, and enhances the flexibility and reliability of data management.
Smart Images

Figure CN119937936B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and in particular to a data management and persistence method and system for a real-time simulation system. Background Art
[0002] In real-time simulation systems, data management and persistence is a complex technical issue. The system contains multiple sub-item simulation software, and each software will generate a large amount of real-time data during the simulation process. These data need to be effectively managed and stored so that the simulation process can be accurately restored in subsequent simulation playback. First, an independent data set needs to be established for each sub-item simulation software, and the content of the data set includes all the key data generated by the software during the simulation process. Secondly, the simulation system uses the simulation clock beat as the frequency, and uses the sequence number of the current frame as the header index of the data packet to store each data set in frames. This storage method ensures the timing of the data and facilitates subsequent playback operations. However, this data management method faces several technical difficulties in practical applications.
[0003] First, due to the high real-time requirements of the simulation system, the frequency of data storage must be synchronized with the simulation clock, which may cause performance bottlenecks in the storage system at high frequencies.
[0004] Secondly, the amount of data for each simulation software may vary greatly. Some software will generate a large amount of data at a specific simulation stage, while other software will generate relatively less data. This uneven data distribution may lead to waste or insufficient storage resources.
[0005] In addition, although the packet header index of the data packet can identify the frame sequence number, in large-scale simulation scenarios, the management and retrieval efficiency of the index may become a bottleneck, especially when it is necessary to quickly locate a frame of data, the complexity of the index will increase.
[0006] Another technical problem is the storage of valid data. During the simulation process, not all data needs to be persisted. Some data may only be valuable at a specific stage, while other data may be important throughout the entire simulation cycle. How to dynamically identify and filter these valid data and store them efficiently is a technical difficulty that needs to be solved urgently.
[0007] In addition, the playback process of simulation data needs to ensure the integrity and timing of the data, but due to the possible data loss or damage during the storage process, data inconsistency or timing disorder may occur during playback. These technical problems require careful optimization and adjustment in all aspects of data management and persistence to ensure the stability and reliability of the simulation system. Summary of the invention
[0008] To solve the problems in the prior art that the high real-time requirement of the simulation system leads to performance bottlenecks in the storage system at high frequencies, uneven distribution of data volume among sub-simulation software, and inability to dynamically identify and screen effective data, this application proposes a data management and persistence method for a real-time simulation system, including:
[0009] Form independent data frames for different types of sub-simulation software according to the simulation frame number and the preset data packet header structure;
[0010] During the data playback process, eliminate unnecessary data, adjust the timestamp interval according to the playback speed parameter, recalculate the trajectory point position, and generate a dynamic playback trajectory;
[0011] According to the direction parameter, perform coordinate transformation on the trajectory points through a rotation matrix to obtain an adjusted motion path, and perform dynamic update playback based on the adjusted motion path.
[0012] Optionally, the forming of independent data frames for different types of sub-simulation software according to the simulation frame number and the preset data packet header structure includes:
[0013] Obtain the simulation frame number according to the preset simulation clock frequency, and generate a unique identifier according to the predefined frame number format;
[0014] According to the preset data packet header structure, encapsulate the unique identifier into the data packet header to form a data packet with timing information;
[0015] For different types of sub-simulation software, extract the key data types, and bind the key data types to the timing information in the data packet header;
[0016] Organize the key data with timing information according to the preset independent data set structure to form an independent data frame.
[0017] Optionally, the eliminating of unnecessary data during the data playback process includes:
[0018] Step 1: Judge whether a certain frame of data meets the determination criteria for unnecessary data. If it does not meet, mark it as permanent data, otherwise it is not marked as permanent data;
[0019] Step 2: Judge whether the timing information not marked as permanent data is within the timing range of the current playback stage. If not, mark the timing information not marked as permanent data as a data frame to be eliminated, otherwise do not mark it;
[0020] Step 3: Remove all data frames marked as data frames to be eliminated from the playback data set according to the data automatic elimination rule;
[0021] Step 4: Calculate the reduction amplitude of the playback load before and after data elimination through the correlation analysis model between data elimination and playback load;
[0022] Step 5: Determine whether the non-essential data elimination is completed based on whether the reduction amplitude of the playback load reaches the expected target and whether the playback process ends.
[0023] Optionally, the determination of whether the non-essential data elimination is completed based on whether the reduction amplitude of the playback load reaches the expected target and whether the playback process ends includes:
[0024] When the reduction amplitude of the playback load does not reach the expected target, determine whether the playback process ends. If it has not ended, dynamically adjust the non-essential data determination criteria; otherwise, complete the non-essential data elimination.
[0025] When the reduction amplitude of the playback load reaches the expected target, complete the non-essential data elimination.
[0026] Optionally, the adjustment of the timestamp interval according to the playback speed parameter, recalculation of the trajectory point positions, and generation of the dynamic playback trajectory include:
[0027] Obtain the original trajectory data, extract the timestamps and position information of the trajectory points, and store them as a time series and a coordinate series.
[0028] According to the playback speed parameter, calculate the adjustment ratio of the timestamp interval to generate a new timestamp interval value.
[0029] Adopt the linear interpolation method. Based on the time series and the new timestamp interval value, recalculate the timestamp of each trajectory point. According to the recalculated timestamps and through the position information, use the interpolation algorithm to calculate the new trajectory point coordinates.
[0030] Combine the recalculated timestamps and the coordinate series to generate the initial playback trajectory data.
[0031] Determine whether the initial playback trajectory data meets the continuity requirement. If there are discontinuous points, use the smoothing algorithm to correct the trajectory point coordinates and store the corrected trajectory point coordinates in a structured format; otherwise, do not correct the trajectory point coordinates and store the trajectory point coordinates in a structured format.
[0032] According to the business requirements, match the structured dynamic playback trajectory data with the map or scene data to generate the dynamic playback trajectory.
[0033] Optionally, the coordinate transformation of the trajectory points through the rotation matrix according to the direction parameter to obtain the adjusted motion path includes:
[0034] Based on the direction parameter, extract the rotation angle and rotation axis information, and construct a three-dimensional rotation matrix based on the rotation angle and rotation axis information.
[0035] Store the coordinate data of the trajectory points in the form of three-dimensional vectors, and perform matrix multiplication on the three-dimensional vectors and the rotation matrix to obtain the rotated coordinate data of the trajectory points;
[0036] Generate an adjusted motion path based on the rotated coordinate data of the trajectory points.
[0037] Optionally, the dynamic update playback based on the adjusted motion path includes:
[0038] Based on the adjusted motion path, extract the timestamps, coordinate information, and related parameters of the trajectory points to generate structured trajectory data;
[0039] Use a trajectory optimization algorithm to smooth the structured trajectory data, eliminate noise points, and obtain optimized trajectory data;
[0040] Determine whether there is a deviation between the optimized trajectory data and the preset parameters. If so, dynamically correct the trajectory data and perform dynamic update playback on the corrected trajectory data. Otherwise, directly perform dynamic update playback on the trajectory data.
[0041] On the other hand, the present application also provides a data management and persistence system for a real-time simulation system, including:
[0042] A data sorting module for forming independent data frames for different types of sub-simulation software according to the simulation frame number and the preset data packet header structure;
[0043] A dynamic playback module for eliminating unnecessary data during data playback, adjusting the timestamp interval according to the playback speed parameter, recalculating the trajectory point positions, and generating a dynamic playback trajectory;
[0044] An update playback module for performing coordinate transformation on the trajectory points through a rotation matrix according to the direction parameter to obtain an adjusted motion path, and performing dynamic update playback based on the adjusted motion path.
[0045] Optionally, the data sorting module is specifically used for:
[0046] Obtain the simulation frame number according to the preset simulation clock frequency, and generate a unique identifier according to the predefined frame number format;
[0047] According to the preset data packet header structure, encapsulate the unique identifier into the data packet header to form a data packet with timing information;
[0048] For different types of sub-simulation software, extract the key data types and bind the key data types to the timing information in the data packet header;
[0049] Organize the key data with timing information according to the preset independent dataset structure to form an independent data frame.
[0050] Optionally, the dynamic playback module includes: a data elimination module and a recalculation module;
[0051] The data elimination module is used to eliminate unnecessary data based on the determination criteria of unnecessary data and the timing range of the playback phase during the data playback process;
[0052] The recalculation module is used to adjust the timestamp interval according to the playback speed parameter, recalculate the trajectory point positions, and generate a dynamic playback trajectory.
[0053] Optionally, the data elimination module specifically is used for:
[0054] Step 1: Determine whether a certain frame of data meets the determination criteria of unnecessary data. If it does not meet, mark it as permanent data; otherwise, do not mark it as permanent data;
[0055] Step 2: Determine whether the timing information that is not marked as permanent data is within the timing range of the current playback phase. If it is not, mark the timing information that is not marked as permanent data as a data frame to be eliminated; otherwise, do not mark it;
[0056] Step 3: According to the data automatic elimination rule, remove all the data frames marked as data frames to be eliminated from the playback dataset;
[0057] Step 4: Through the correlation analysis model between data elimination and playback load, calculate the reduction amplitude of the playback load before and after data elimination;
[0058] Step 5: Determine whether the elimination of unnecessary data is completed based on whether the reduction amplitude of the playback load reaches the expected target and whether the playback process is over.
[0059] Optionally, the data elimination module specifically is used for:
[0060] When the reduction amplitude of the playback load does not reach the expected target, determine whether the playback process is over. If it is not over, dynamically adjust the determination criteria of unnecessary data; otherwise, complete the elimination of unnecessary data;
[0061] When the reduction amplitude of the playback load reaches the expected target, complete the elimination of unnecessary data.
[0062] Optionally, the recalculation module specifically is used for:
[0063] Obtain the original trajectory data, extract the timestamps and position information of the trajectory points, and store them as time series and coordinate series;
[0064] Calculate the time - stamp interval adjustment ratio according to the playback speed parameter to generate a new time - stamp interval value;
[0065] Adopt the linear interpolation method. Based on the time series and the new time - stamp interval value, recalculate the time - stamp of each trajectory point. According to the recalculated time - stamp, through the position information, use the interpolation algorithm to calculate the coordinates of new trajectory points;
[0066] Combine the recalculated time - stamps and the coordinate sequence to generate the initial playback trajectory data;
[0067] Judge whether the initial playback trajectory data meets the continuity requirement. If there are discontinuous points, use the smoothing algorithm to correct the coordinates of the trajectory points and store the corrected coordinates of the trajectory points in a structured format. Otherwise, do not correct the coordinates of the trajectory points and store the coordinates of the trajectory points in a structured format;
[0068] According to the business requirements, match the dynamic playback trajectory data in the structured format with the map or scene data to generate the dynamic playback trajectory.
[0069] Optionally, it further includes a secondary processing module for continuously monitoring the noise level of the trajectory data during the playback process. If the noise level exceeds the preset threshold, trigger the smoothing algorithm for secondary processing. Otherwise, do not trigger the smoothing algorithm for secondary processing.
[0070] Optionally, the playback update module includes: a parameter adjustment module and a display module;
[0071] The parameter adjustment module is used to perform coordinate transformation on the trajectory points through the rotation matrix according to the direction parameter to obtain the adjusted motion path;
[0072] The display module is used to perform dynamic update playback based on the adjusted motion path;
[0073] If there is a deviation between the optimized trajectory data and the preset parameters, call the parameter adjustment module to dynamically correct the trajectory data. Through the data encapsulation protocol, pack the corrected trajectory data into a data format recognizable by the display module to generate a transmission data packet;
[0074] According to the communication interface requirements, use the real - time transport protocol to send the data packet to the display module to ensure the real - time and integrity of data transmission;
[0075] After receiving the data packet, the display module parses the content of the data packet, extracts the trajectory point information and parameters, and generates a dynamic update instruction;
[0076] If the display module detects that the trajectory point information is inconsistent with the current screen, it calls the screen rendering engine to redraw the trajectory screen according to the dynamic update instruction; through the screen refresh mechanism of the display module, the redrawn trajectory screen is displayed in real time to ensure that the screen is synchronized with the trajectory data;
[0077] According to the operating state of the display module, record the screen update log and generate trajectory playback data for subsequent analysis.
[0078] Optionally, the parameter adjustment module is specifically used for:
[0079] Based on the direction parameter, extract the rotation angle and rotation axis information, and construct a three-dimensional rotation matrix based on the rotation angle and rotation axis information;
[0080] Store the coordinate data of the trajectory points in the form of three-dimensional vectors, and perform matrix multiplication on the three-dimensional vectors and the rotation matrix to obtain the rotated coordinate data of the trajectory points;
[0081] Generate an adjusted motion path according to the rotated coordinate data of the trajectory points.
[0082] Optionally, the display module is specifically used for:
[0083] Based on the adjusted motion path, extract the timestamp, coordinate information, and related parameters of the trajectory points to generate structured trajectory data;
[0084] Use a trajectory optimization algorithm to smooth the structured trajectory data and eliminate noise points to obtain optimized trajectory data;
[0085] Judge whether there is a deviation between the optimized trajectory data and the preset parameters. If so, dynamically correct the trajectory data and perform dynamic update playback on the corrected trajectory data. Otherwise, directly perform dynamic update playback on the trajectory data.
[0086] On the other hand, the present application also provides an electronic device, including: at least one processor and a memory; the memory and the processor are connected by a bus;
[0087] The memory is used to store one or more programs;
[0088] When the one or more programs are executed by the at least one processor, the data management and persistence method of a real-time simulation system as described above is implemented.
[0089] On the other hand, the present application also provides a readable storage medium, on which an execution program is stored. When the execution program is executed, the data management and persistence method of a real-time simulation system as described above is implemented.
[0090] Compared with the prior art, the beneficial effects of the present application are as follows:
[0091] The present application provides a data management and persistence method for a real-time simulation system, including: forming independent data frames for different types of sub-simulation software according to the simulation frame serial number and a preset data packet header structure; during data playback, eliminating unnecessary data, adjusting the timestamp interval according to the playback speed parameter, recalculating the trajectory point positions, and generating a dynamic playback trajectory; according to the direction parameter, performing coordinate transformation on the trajectory points through a rotation matrix to obtain an adjusted motion path, and performing dynamic update playback based on the adjusted motion path. The present application forms independent data frames for different types of sub-simulation software, classifies the data according to the simulation software, solves the problem of performance bottlenecks in the storage system at high frequencies and the problem of uneven data volume distribution among sub-simulation software. On the other hand, in a single simulation, the data protocol and length of the data frame are fixed contents, facilitating data storage and management; the effective data is dynamically identified and screened through an automatic elimination mechanism.
[0092] The present application also introduces a correlation analysis model between data elimination and playback load. By calculating the playback load indicators before and after elimination, the contribution of data elimination to reducing the playback load is evaluated, significantly improving the performance and efficiency of the simulation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] Figure 1 is a flowchart of a data management and persistence method for a real-time simulation system of the present application;
[0094] Figure 2 is a schematic structural diagram of an electronic device of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0095] The present application proposes a data management and persistence method for a real-time simulation system. By adding timing information to the simulation data, binding the key data generated by different types of simulation software with the timing information, forming independent data frames and storing them in sequence; during data playback, judging whether the data is unnecessary data according to a preset screening rule, and marking the non-permanent data not within the timing range of the current playback stage as to be eliminated; removing this data through an automatic elimination mechanism to reduce the data processing volume during playback. The present application also introduces a correlation analysis model between data elimination and playback load. By calculating the playback load indicators before and after elimination, the contribution of data elimination to reducing the playback load is evaluated. If the effect does not meet the expectation, the present application can dynamically adjust the screening rule, continuously optimize the data elimination effect, and finally achieve efficient simulation data playback, significantly improving the performance and efficiency of the simulation system.
[0096] To better understand the present application, the content of the present application will be further described below in conjunction with the accompanying drawings of the specification and embodiments.
[0097] Embodiment 1:
[0098] A data management and persistence method for a real-time simulation system, as Figure 1 shown, includes:
[0099] Step S1: Form independent data frames for different types of sub-simulation software according to the simulation frame number and the preset data packet header structure;
[0100] Step S2: During data playback, eliminate unnecessary data, adjust the timestamp interval according to the playback speed parameter, recalculate the trajectory point position, and generate a dynamic playback trajectory;
[0101] Step S3: According to the direction parameter, perform coordinate transformation on the trajectory points through a rotation matrix to obtain an adjusted motion path, and perform dynamic update playback based on the adjusted motion path.
[0102] The following further introduces each step:
[0103] Before step S1, it also includes: collecting and storing simulation data.
[0104] The concept of valid data is proposed, specifically: that is, in the normal simulation mode, when the current data value changes, the network value is driven to change, and the data value of this frame data set is recorded. Otherwise, the data that has not changed is not stored, effectively reducing the data storage space;
[0105] During the simulation process, the recording of operation behaviors adopts the triggering method of registering key frames, and all key frame data needs to be sent during data playback.
[0106] In the normal simulation mode, it is necessary to store valid data frames according to data trigger drive. Since the maximum value of medium storage is a fixed value, there may be a situation where the storage space overflows and the storage fails. Therefore, the present application adopts a storage space warning design. When it is calculated that the storage space is less than a certain threshold, the storage location is transferred to another storage medium, and so on, until all storage spaces are about to overflow, a storage alarm is issued.
[0107] When performing data storage, the local data storage capacity is certain, and the storage space of each disk drive is a fixed value. There may be a situation where the storage space is insufficient and the storage fails. The present application adopts a space warning method to avoid the above situation.
[0108] Before each simulation activity starts, first judge the storage space of the drive letter under the current specified path. When it is less than a certain threshold, perform storage space transfer, find the next drive letter that meets the space requirements, change the storage path of the data file, and display a message to prompt the user that the storage space of this drive letter is insufficient and has been transferred to the next drive letter.
[0109] When the storage space of the last drive letter that can be found is also about to be insufficient, a machine storage space alarm will be issued, indicating that all disk spaces are insufficient and data files cannot be stored continuously. Please deal with it in time.
[0110] Step S1: Form independent data frames for different types of sub-simulation software according to the simulation frame number and the preset data packet header structure, including:
[0111] Step S101: Obtain the simulation frame number according to the preset simulation clock frequency, and generate a unique identifier according to the predefined frame number format;
[0112] Step S102: According to the preset data packet header structure, encapsulate the unique identifier into the data packet header to form a data packet with timing information;
[0113] Step S103: For different types of sub-simulation software, extract the key data types, and bind the key data types to the timing information in the data packet header;
[0114] Step S104: Organize the key data with timing information according to the preset independent data set structure to form an independent data frame.
[0115] Further, step S101 obtains the simulation frame number according to the preset simulation clock frequency and generates a unique identifier according to the predefined frame number format, including:
[0116] Use the preset simulation clock frequency as the time reference to obtain the frame number of the current simulation cycle; determine the generation rule of the unique identifier according to the preset frame number format definition; through the time synchronization mechanism, ensure that the simulation cycle is consistent with the clock frequency;
[0117] Adopt a sequence generation algorithm to convert the frame number into an encoded data that conforms to the format definition. According to the identification rule, combine the encoded data with the time reference, judge whether the current frame number exceeds the preset range. If it exceeds the limit, reset the frame number, and generate a unique identifier through the data encoding method for the combined information.
[0118] Specifically, in the simulation system, the clock frequency is set to 100 MHz, that is, 100 million clock cycles are generated per second. Assuming that each frame of simulation consumes 1000 clock cycles, then 100,000 frames of simulation data can be generated per second. To obtain the current simulation frame number, it can be obtained by reading the counter inside the system. This counter increments by 1 in each clock cycle. Therefore, the current frame number can be obtained by dividing the counter value by 1000 and taking the integer part. For example, when the counter value is 123456789, the current frame number is 123456. To generate a unique identifier, a predefined frame number format can be used, such as "SIM_YYYYMMDD_HHMMSS_FRAMENUM", where YYYYMMDD represents the current date, HHMMSS represents the current time, and FRAMENUM represents the frame number. For example, at 14:30:45 on October 15, 2023, when the frame number is 123456, the generated unique identifier is "SIM_20231015_143045_123456". This format not only contains the time information of the simulation but also ensures the uniqueness of each identifier. To further ensure the global uniqueness of the identifier, the ID of the simulation task can be added before the identifier, such as "TASK123_SIM_20231015_143045_123456". In this way, even when multiple simulation tasks are running in parallel, the identifier of each simulation frame can be guaranteed to be unique.
[0119] Further, step S102 encapsulates the unique identifier into the data packet header according to the preset data packet header structure to form a data packet with timing information, including:
[0120] Adopt the preset data packet header structure to obtain the content of the data packet to be encapsulated; for the content of the data packet, extract the frame number from the preset timing generation module; embed the frame number as the unique identifier into the data packet header.
[0121] Generate a data packet with timing information according to the embedded header information; when the content of the data packet matches the header information, the encapsulation is completed; obtain the encapsulated data packet, and verify the uniqueness of the frame number through the timing verification module. According to the verification result, determine the accuracy of the timing information of the data packet.
[0122] Specifically, a frame sequence number field is added to the packet header structure to uniquely identify the sending order of packets. Assume the header length is 16 bytes, where the first 4 bytes are the frame sequence number field and the remaining 12 bytes are other control information. The frame sequence number is represented by a 32-bit unsigned integer, ranging from 0 to 4294967295, and the frame sequence number is incremented by 1 each time a packet is sent. For example, the initial frame sequence number is 0. When sending the first packet, the frame sequence number is set to 0. When sending the second packet, the frame sequence number is set to 1, and so on. To ensure the uniqueness of the frame sequence number, a counter can be maintained at the sending end. Each time a packet is sent, the counter value is assigned to the frame sequence number field and the counter is incremented. At the receiving end, by parsing the frame sequence number field in the packet header, the receiving order of the packets can be determined. For example, after receiving a packet with a frame sequence number of 5, if the frame sequence number of the next received packet is 7, it can be inferred that the packet with a frame sequence number of 6 may be lost or delayed, and corresponding handling measures can be taken. In this way, timing information can be encapsulated in the packet header to ensure the order and integrity of the packets.
[0123] Furthermore, in step S103, for different types of sub-item simulation software, key data types are extracted, and the key data types are bound to the timing information in the packet header, including:
[0124] (1) Obtain the original data generated by the sub-item simulation software, determine the data type and simulation type; extract the timestamp information from the packet header and judge its timing relationship with the simulation data; for key data, use a preset extraction method to separate the target data content; establish a binding relationship between the data and the timing according to the header information and the timestamp; verify the accuracy and integrity of the binding relationship through association rules; if there is an error in the binding relationship, adjust the extraction method or the association rules, and integrate the processed data with the timing information to generate the final packet;
[0125] Specifically, in the sub-item simulation software, for different types of simulation tasks, it is first necessary to extract the types of key data generated. For example, in power system simulation, the key data may include parameters such as voltage, current, and power. These data can be collected and calculated in real time through specific algorithms. Taking voltage as an example, assuming the voltage value at a certain moment is 220 volts, the current is 10 amperes, and the power factor is 0.9. Through the power calculation formula P = UIcosφ, the active power at this time can be obtained as 1980 watts. Next, these key data are bound to the timing information in the data packet header to ensure the accuracy and consistency of the data. The timing information usually includes the timestamp, data packet sequence number, etc. For example, the timestamp is 14:30:00 on October 15, 2023, and the data packet sequence number is 12345. By associating this timing information with the key data, a complete data record can be formed. For example, binding the voltage of 220 volts, current of 10 amperes, and power of 1980 watts to the timestamp of 14:30:00 on October 15, 2023 and the data packet sequence number 12345 forms a data packet. This binding process can be implemented through a hash algorithm. For example, the SHA-256 algorithm is used to encrypt the data to ensure the security and integrity of the data. In this way, the key data generated by the sub-item simulation software can be closely combined with the timing information, providing a reliable basis for subsequent data analysis and processing.
[0126] (2) Organize the key data with timing information according to the preset independent dataset structure to form independent data frames, and store them according to the timing information granularity.
[0127] Obtain the key data with timing information, extract the timestamp and key fields from it, and divide them according to the preset independent dataset structure. For the divided datasets, generate independent data frames, and each frame contains the key data within the corresponding time period. According to the preset time granularity, group the data frames at time intervals to generate a grouped data set. Use the time series alignment algorithm to determine whether the timestamps of the data frames are continuous. If there are missing timestamps, perform interpolation processing. Through the independence of the data frames, map each frame to an independent storage unit to ensure the isolation of data storage. According to the preset storage structure, write the grouped data set into the database and index it according to the time granularity. Check the quality of the stored data to determine whether it meets the preset structural and timing requirements. If it does not meet the requirements, reorganize the data frames.
[0128] Specifically, during the data processing, it is first necessary to extract key data with time series information from the original data. Assume that the original data is hourly sensor readings, including information such as timestamps, temperature, and humidity. By parsing the timestamps, the time granularity of each data point can be determined. For example, the timestamp "2023-10-01 12:00:00" corresponds to the data at 12:00 on October 1, 2023. Next, organize it according to the preset independent dataset structure, and store the data at each time point as an independent data frame. For example, the data frame at 12:00 contains the timestamp "2023-10-01 12:00:00", temperature "23°C", and humidity "60%". To ensure the independence of the data frame, each data frame is stored in JSON format, such as {"timestamp": "2023-10-01 12:00:00", "temperature": 23, "humidity": 60}. Subsequently, store it according to the time series information granularity, and it can be grouped by hour, day, or month. For example, store the data frame at 12:00 on October 1, 2023, under the path "2023-10-01 / 1json". To further optimize the storage efficiency, a compression algorithm such as GZIP can be used to compress the data frame, reducing the storage space occupation. In this way, the system can efficiently manage and retrieve data with time series information, providing a reliable basis for subsequent data analysis.
[0129] The present application has the following effects on generating independent data frames for different types of sub-simulation software:
[0130] 1. Improved data interaction and communication efficiency
[0131] Independent data frames can provide a standardized data interaction format for different simulation software, making the data transmission between simulation models more efficient and accurate. For example, in power system simulation, seamless docking can be achieved between simulation software for different links such as power generation, power transmission, and power consumption through independent data frames.
[0132] 2. Enhanced system flexibility and scalability
[0133] The independent data frame design allows different types of simulation software to run without interfering with each other, while being able to share information through data frames. This enables the system to more easily expand new functional modules or integrate new simulation tools.
[0134] 3. Improved data processing accuracy
[0135] Through independent data frames, different types of data can be classified and processed, reducing the complexity of data encapsulation and decapsulation. For example, in the discrimination and recognition of power protocol data frames, independent data frames can reduce errors in the data processing process, improving the accuracy and efficiency of data processing.
[0136] 4. Optimize resource allocation
[0137] Independent data frames can better support the optimal allocation of resources. For example, in power market simulations, through independent data frames, the behaviors and resource allocation strategies of different market players can be more clearly simulated, thus providing decision-making support for the optimal allocation of power resources.
[0138] 5. Support co-simulation of complex systems
[0139] In complex power system simulations, different types of simulation software may need to work together. Independent data frames can serve as a bridge for data interaction, supporting the co-simulation of new entities such as virtual power plants and smart microgrids with traditional power systems.
[0140] 6. Enhance system security and reliability
[0141] Independent data frames can enhance data security through multi-dimensional feature extraction and recognition technologies. For example, through techniques such as time-frequency transformation and clustering analysis, data frames can be accurately distinguished and recognized, thereby improving the anti-interference ability and reliability of the system.
[0142] 7. Promote intelligence and automation
[0143] Independent data frames can better support the development of intelligent simulation systems. For example, through machine learning and deep reinforcement learning technologies, data frames can be automatically classified and processed, thus realizing intelligent power system simulations.
[0144] In summary, the application of independent data frames in sub-item simulation software can improve data interaction efficiency, enhance system flexibility, increase data processing accuracy, and support the co-simulation of complex systems, thus providing important support for the intelligence and optimal operation of power systems.
[0145] In step S2 during data playback, unnecessary data is removed, including:
[0146] Step 1: Determine whether a certain frame of data meets the criteria for unnecessary data. If it does not meet the criteria, it is marked as permanent data; otherwise, it is not marked as permanent data.
[0147] Specifically, during the data playback process, it is first necessary to analyze each frame of data according to the preset data screening rules. Assume the preset screening rule is: if the temperature value of a certain frame of data is greater than 30°C and the humidity value is less than 50%, then it is determined as non-essential data. In specific implementation, the data is read frame by frame through an algorithm. For each frame of data, the temperature and humidity values are extracted.
[0148] Step 2: Determine whether the timing information not marked as permanent data is within the timing range of the current playback stage. If not, mark the timing information not marked as permanent data as a data frame to be excluded, otherwise do not mark.
[0149] For example, when the temperature of a certain frame of data is read as 32°C and the humidity is 45%, then according to the rule, this frame is determined as non-essential data. To further improve the accuracy of the determination, a sliding window algorithm is adopted, and the window size is set to 5 frames. If in 5 consecutive frames, more than 3 frames of data meet the determination criteria for non-essential data, then all frames within this window are marked as non-essential data. For example, in 5 consecutive frames of data, the temperature values of 4 frames are 31°C, 32°C, 35°C, 35°C, and the humidity values are 48%, 47%, 49%, 46% respectively. Then, through the sliding window algorithm, these 5 frames are determined as non-essential data. In addition, to improve the data processing efficiency, multi-thread technology is adopted to process the screening of each frame of data in parallel, ensuring a high analysis speed even during the playback of a large amount of data. Through the above method, the precise screening of each frame of data during the data playback process is achieved, ensuring the effectiveness and accuracy of data processing.
[0150] Step 3: According to the data automatic exclusion rule, remove all data frames marked as data frames to be excluded from the playback dataset.
[0151] Specifically, in the playback dataset, all data frames are first marked through a preset elimination rule, which is set based on attributes such as the timestamp, frame rate, and resolution of the data frames. For example, data frames with a timestamp interval greater than 50 milliseconds are set as frames to be eliminated, data frames with a frame rate lower than 25 frames per second are set as frames to be eliminated, and data frames with a resolution less than 720p are set as frames to be eliminated. Then, the quicksort algorithm is used to sort all data frames according to the timestamp to ensure that the data frames are arranged in chronological order. After the sorting is completed, the sorted data frame list is traversed, and the binary search algorithm is used to quickly locate the positions of the frames to be eliminated, and these frames are removed from the dataset through a linked list structure. During the removal process, the index information of the dataset is updated simultaneously to ensure that the remaining data frames can be correctly accessed in subsequent playback operations. Finally, the remaining data frames are compressed. The LZ77 algorithm is used for lossless compression, and the compression ratio can reach 60%, thereby further reducing the data processing volume during the playback process. The entire processing process uses multi-threaded parallel computing to ensure that the elimination and compression operations can still be efficiently completed on large-scale datasets.
[0152] Step 4: Calculate the reduction amplitude of the playback load before and after data elimination through the correlation analysis model between data elimination and playback load;
[0153] Specifically, in the correlation analysis model between data elimination and playback load, the measurement index of the playback load needs to be determined first, such as the number of requests processed per second (QPS) or the system response time (RT). Assume that the initial dataset contains 1 million records, the QPS of the playback load is 500, and the RT is 200 milliseconds. By setting data elimination rules, such as eliminating duplicate data or invalid data, a data cleaning algorithm is applied to process the dataset. Assume that the dataset is reduced to 800,000 records after cleaning. Next, a playback load simulator is used to perform playback tests on the dataset before and after cleaning, and the playback load indexes after cleaning are calculated. Assume that the QPS after cleaning is increased to 600 and the RT is reduced to 150 milliseconds. By comparing the indexes before and after cleaning, the contribution degree of data elimination to reducing the playback load can be calculated. For example, the QPS is increased by 20% and the RT is reduced by 25%. Through further analysis, a regression model can be established to quantify the relationship between the amount of data elimination and the playback load indexes. Assume that for every 100,000 pieces of data eliminated, the QPS is increased by 10% and the RT is reduced by 15%. Through these analyses, the specific contribution of data elimination in optimizing the playback load can be obtained, providing data support for subsequent system optimization.
[0154] Step 5: Determine whether the non-essential data elimination is completed based on whether the reduction amplitude of the playback load reaches the expected target and whether the playback process ends.
[0155] Specifically, when the reduction amplitude of the playback load fails to reach the expected target, first, by analyzing historical data, it is found that the determination criterion for non-essential data in the current data screening rule is that the data access frequency is lower than 100 times per second and the data storage duration exceeds 30 days. To further optimize the data elimination effect, the screening rule is dynamically adjusted, and the determination criterion for non-essential data is adjusted to records with a data access frequency lower than 50 times per second and a storage duration exceeding 15 days. At the same time, a machine learning algorithm is introduced to perform clustering analysis on the data based on the Gaussian Mixture Model (GMM), identify data points with an access frequency lower than 50 times per second and a storage duration exceeding 15 days, and mark them as non-essential data. Through this adjustment, the system automatically generates a new data elimination strategy to remove the data that meets the new standard from storage, thus effectively reducing the playback load. Further through simulation tests, it is verified that the playback load has been reduced by 15% under the new strategy, reaching the expected optimization target.
[0156] During the simulation data playback process, first, the current load is monitored in real-time through the load balancing algorithm. Assume that the current system load is 75% and the target load is 50%. The dynamic weight adjustment strategy is adopted to gradually reduce the weight of high-load nodes from 0 to 6, and at the same time, increase the weight of low-load nodes from 8 to 2 to achieve balanced load distribution. Next, a prediction model based on time series is used to predict the load trend in the next 10 minutes. The prediction result shows that the load will drop to 65%. Based on this prediction result, the system automatically adjusts the playback strategy to reduce the playback rate from 1000 data items per second to 800 data items per second to reduce system pressure. At the same time, a data compression algorithm is adopted to compress the original data to 70% of the original, further reducing the burden of data transmission and processing. During the playback process, the system continuously monitors the load change. When the load drops to 60%, the playback rate is adjusted again to 700 data items per second, and the data caching mechanism is enabled to cache the frequently used data in memory to improve the data access speed. Finally, through multiple iterative adjustments, the system load gradually drops to the expected 50%, achieving efficient simulation data playback.
[0157] The adjusting the timestamp interval according to the playback speed parameter, recalculating the trajectory point positions, and generating a dynamic playback trajectory in step S2 includes:
[0158] Obtain the original trajectory data, extract the timestamps and position information of the trajectory points, and store them as a time series and a coordinate series;
[0159] According to the playback speed parameter, calculate the adjustment ratio of the timestamp interval to generate a new timestamp interval value;
[0160] Using the linear interpolation method, based on the time series and the new time stamp interval value, recalculate the time stamp of each trajectory point, and according to the recalculated time stamp, calculate the coordinates of the new trajectory point by using the interpolation algorithm through the position information;
[0161] Combine the recalculated time stamp and the coordinate sequence to generate the initial playback trajectory data;
[0162] Determine whether the initial playback trajectory data meets the continuity requirement. If there are discontinuous points, use the smoothing algorithm to correct the coordinates of the trajectory points, and store the corrected coordinates of the trajectory points in a structured format. Otherwise, do not correct the coordinates of the trajectory points and store the coordinates of the trajectory points in a structured format;
[0163] According to the business requirements, match the dynamic playback trajectory data in the structured format with the map or scene data to generate the dynamic playback trajectory.
[0164] Specifically: Assume that the playback speed input by the user is 2, indicating playback at twice the normal speed. In the original trajectory data, the time stamp interval is 1 second, that is, one trajectory point is recorded per second. For example, the original trajectory data is [(0, 10, 20), (1, 12, 25), (2, 15, 30), (3, 18, 35)], where the first element of each tuple is the time stamp (in seconds), and the last two elements are the longitude and latitude coordinates. Then, adjust the time stamp interval according to the speed value. Since the speed is 2, the time stamp interval should be reduced to 0.5 seconds. Next, we need to recalculate the trajectory point positions. Since the time stamp interval has changed, we need to use an interpolation algorithm to calculate the trajectory point positions corresponding to the new time stamps. Here we can use linear interpolation. For example, for the new time stamp of 0.5 seconds, its corresponding trajectory point position can be obtained by linear interpolation between the original trajectory points (0, 10, 20) and (1, 12, 25). The specific calculation process is as follows: longitude = 10 + (12 - 10) * (0.5 - 0) / (1 - 0) = 11, latitude = 20 + (25 - 20) * (0.5 - 0) / (1 - 0) = 22.5. Therefore, the trajectory point position corresponding to the new time stamp of 0.5 seconds is (0.5, 11, 22.5). Similarly, we can calculate the trajectory point positions corresponding to other new time stamps. To achieve dynamic trajectory playback on the page, after completing the recalculation of all trajectory point positions, transmit all trajectory point information to the front-end page. The front-end page uses JavaScript and a map library (such as the Baidu Map API) to draw the trajectory. Use a timer to update the display position of the trajectory point on the map every 0.5 seconds (consistent with the adjusted time stamp interval). Since the speed has increased, the trajectory that originally took 3 seconds to complete can now be completed in 1.5 seconds. The final generated dynamic playback trajectory data is [(0, 10, 20), (0.5, 11, 22.5), (1, 12, 25), (1.5, 13.5, 27.5), (2, 15, 30), (2.5, 16.5, 32.5), (3, 18, 35)].
[0165] Step S3: According to the direction parameter, perform coordinate transformation on the trajectory points through a rotation matrix to obtain an adjusted motion path, and perform dynamic update playback based on the adjusted motion path, including:
[0166] Extract the rotation angle and rotation axis information based on the direction parameter, and construct a three-dimensional rotation matrix based on the rotation angle and rotation axis information;
[0167] Store the coordinate data of the trajectory points in the form of a three-dimensional vector, and perform matrix multiplication on the three-dimensional vector and the rotation matrix to obtain the rotated coordinate data of the trajectory points;
[0168] Generate an adjusted motion path based on the rotated coordinate data of the trajectory points.
[0169] Specifically for step S3, assume that the input direction parameter by the user is a 30-degree clockwise rotation, and there is a set of trajectory point coordinates (10, 20), (15, 25), (20, 30). First, we need to construct a two-dimensional rotation matrix. According to the rotation angle θ, the formula for the rotation matrix R is: R = [[cos(θ), -sin(θ)], [sin(θ), cos(θ)]]. Substitute θ = 30 degrees. Since the angle needs to be converted to radians, θ = 30 * π / 180 ≈ 0.5236 radians. Calculate cos(0.5236) ≈ 0.866 and sin(0.5236) ≈ 0.5. Therefore, the rotation matrix R ≈ [[0.866, -0.5], [0.5, 0.866]]. Next, we regard each trajectory point as a column vector and multiply it by the rotation matrix. For the first trajectory point (10, 20), we can represent it as the column vector [
[10] ,
[20] ]. Perform matrix multiplication: [[0.866, -0.5], [0.5, 0.866]] * [
[10] ,
[20] ] = [[0.866 * 10 - 0.5 * 20], [0.5 * 10 + 0.866 * 20]] = [[8.66 - 10], [5 + 17.32]] = [[-1.34], [22.32]]. Therefore, the coordinates of the first trajectory point after rotation are approximately (-1.34, 22.32). Similarly, perform the same operation on the second trajectory point (15, 25), [[0.866, -0.5], [0.5, 0.866]] * [
[15] ,
[25] ] = [[0.866 * 15 - 0.5 * 25], [0.5 * 15 + 0.866 * 25]] = [[12.99 - 12.5], [7.5 + 21.65]] = [[0.49], [29.15]], and the coordinates after rotation are approximately (0.49, 29.15). For the third trajectory point (20, 30), [[0.866, -0.5], [0.5, 0.866]] * [
[20] ,
[30] ] = [[0.866 * 20 - 0.5 * 30], [0.5 * 20 + 0.866 * 30]] = [[17.32 - 15], [10 + 25.98]] = [[2.32], [35.98]], and the coordinates after rotation are approximately (2.32, 35.98). To ensure data integrity, we can store the original trajectory points and the rotated trajectory points in the database and record parameters such as the rotation angle. For example, create a data table named "trajectory_data" with fields "point_id", "original_x", "original_y", "rotated_x", "rotated_y", and "rotation_angle". Insert the above calculation results into the table and record the rotation angle as 30 degrees. In this way, we have completed the coordinate transformation of the trajectory points, obtained the adjusted motion path, and ensured data traceability.
[0170] Extract the timestamps, coordinate information, and related parameters of the trajectory points from the trajectory data to generate structured trajectory data. Use a trajectory optimization algorithm to smooth the structured trajectory data, eliminate noise points, and obtain optimized trajectory data;
[0171] If there is a deviation between the optimized trajectory data and the preset parameters, dynamically correct the trajectory data, generate a dynamic update instruction, redraw the trajectory screen based on the dynamic update instruction, and display the redrawn trajectory screen in real time to ensure that the screen is synchronized with the trajectory data. Record the screen update log and generate trajectory playback data for subsequent analysis.
[0172] Among them, dynamically correcting the trajectory data is to ensure that the trajectory is consistent with the parameters.
[0173] Step S3 can also dynamically correct and display the trajectory data through a parameter adjustment module and a display module. The specific implementation method is as follows:
[0174] If there is a deviation between the optimized trajectory data and the preset parameters, call the parameter adjustment module to dynamically correct the trajectory data;
[0175] Through a data encapsulation protocol, pack the corrected trajectory data into a data format recognizable by the display module to generate a transmission data packet;
[0176] According to the communication interface requirements, use the real-time transport protocol to send the data packet to the display module to ensure the real-time and integrity of data transmission;
[0177] After the display module receives the data packet, parse the content of the data packet, extract the trajectory point information and parameters, and generate a dynamic update instruction;
[0178] If the display module detects that the trajectory point information is inconsistent with the current screen, call the screen rendering engine to redraw the trajectory screen according to the dynamic update instruction; through the screen refresh mechanism of the display module, display the redrawn trajectory screen in real time to ensure that the screen is synchronized with the trajectory data;
[0179] According to the running state of the display module, record the screen update log and generate trajectory playback data for subsequent analysis.
[0180] After step S3, it also includes:
[0181] During the playback process, continuously monitor the noise level of the trajectory data. If the noise exceeds the preset threshold, trigger the smoothing algorithm for secondary processing.
[0182] Use a trajectory data acquisition module to obtain trajectory data during the playback process in real time, including information such as position, speed, and timestamp; according to the collected trajectory data, calculate the change rate between adjacent data points to obtain the local fluctuation characteristics of the trajectory;
[0183] Through a noise level evaluation algorithm, analyze the local fluctuation characteristics, calculate the noise level value of the current trajectory data; if the noise level value exceeds the preset threshold, trigger a noise detection flag and enter the smoothing process; otherwise, continue to monitor the trajectory data;
[0184] Adopt a sliding window technique to segment the trajectory data with excessive noise, extract the set of data points within the window, and apply the Kalman filter algorithm according to the set of data points within the window to perform preliminary smoothing processing on the trajectory data to obtain filtered trajectory points;
[0185] Through a secondary smoothing algorithm, further optimize the filtered trajectory points, and use the spline interpolation method to generate a smooth trajectory curve; according to the smooth trajectory curve, recalculate the noise level value to determine whether it meets the preset threshold requirements; if the recalculated noise level value still exceeds the threshold, adjust the smoothing algorithm parameters and repeat the above steps until the noise level value meets the requirements.
[0186] Specifically, in the entire process of trajectory playback, it is set to collect 10 trajectory points per second, and each trajectory point contains longitude and latitude information. Then, the distance between adjacent trajectory points can be calculated in real time, and the speed can be calculated in combination with the time difference. For example, if the longitude and latitude of a certain moment point p1 is (11404, 3915), and the longitude and latitude of the next moment point p2 is (11405, 3916), and the time difference is 1 second, by calculating the distance between the two points is about 140 meters, then the speed can be calculated as 1400 meters / second, which significantly exceeds the normal moving speed and is judged as noise. Set the speed threshold to 50 meters / second. When the calculated speed exceeds this threshold, it is determined that there is noise in this segment of trajectory data. After detecting the noise, the system immediately triggers the data smoothing algorithm. For example, a 5-point moving average filtering algorithm can be used to smooth the noise point and the two points before and after it. Assume that the speeds of 5 consecutive trajectory points including the noise point are [25, 30, 1400, 35, 40] meters / second. By calculating the average speed of these 5 points, a new speed value of 306 meters / second is obtained. Although the value is still relatively high, the impact of the noise has been significantly reduced. Then, replace the original noise value with the smoothed speed value. During the whole process, continuously record the number of noise points and the processing effect. When the proportion of noise points exceeds 5% of the total number of trajectory points, the system can automatically mark the quality of this segment of trajectory data as poor, and perform weighted processing or exclusion on these data in subsequent analysis to improve the overall data quality.
[0187] Embodiment 2:
[0188] On the other hand, the present application also provides a data management and persistence system for a real-time simulation system, including:
[0189] A data sorting module, configured to form independent data frames for different types of sub-simulation software according to the simulation frame number and a preset data packet header structure;
[0190] A dynamic playback module, configured to eliminate unnecessary data during data playback, adjust the timestamp interval according to the playback speed parameter, recalculate the trajectory point positions, and generate a dynamic playback trajectory;
[0191] An updated playback module, configured to perform coordinate transformation on the trajectory points through a rotation matrix according to the direction parameter to obtain an adjusted motion path, and perform dynamic updated playback based on the adjusted motion path.
[0192] Optionally, the data sorting module is specifically configured to:
[0193] Obtain the simulation frame number according to a preset simulation clock frequency, and generate a unique identifier according to a predefined frame number format;
[0194] Encapsulate the unique identifier into the data packet header according to the preset data packet header structure to form a data packet with timing information;
[0195] For different types of sub-simulation software, extract the key data types, and bind the key data types to the timing information in the data packet header;
[0196] Organize the key data with timing information according to a preset independent data set structure to form an independent data frame.
[0197] Optionally, the dynamic playback module includes: a data elimination module and a recalculation module;
[0198] The data elimination module is configured to eliminate unnecessary data during data playback based on the determination criteria for unnecessary data and the timing range of the playback stage;
[0199] The recalculation module is configured to adjust the timestamp interval according to the playback speed parameter, recalculate the trajectory point positions, and generate a dynamic playback trajectory.
[0200] Optionally, the data elimination module is specifically configured to:
[0201] Step 1: Determine whether a certain frame of data meets the determination criteria for unnecessary data. If it does not meet, mark it as permanent data; otherwise, do not mark it as permanent data;
[0202] Step 2: Determine whether the timing information not marked as permanent data is within the timing range of the current playback phase. If not, mark the timing information not marked as permanent data as a data frame to be excluded, otherwise do not mark it;
[0203] Step 3: Remove all data frames marked as data frames to be excluded from the playback dataset according to the data automatic exclusion rule;
[0204] Step 4: Calculate the reduction amplitude of the playback load before and after data exclusion through the correlation analysis model between data exclusion and playback load;
[0205] Step 5: Determine whether the non-essential data exclusion is completed based on whether the reduction amplitude of the playback load reaches the expected target and whether the playback process is over.
[0206] Optionally, the specific implementation steps for determining whether the non-essential data exclusion is completed in the data exclusion module based on whether the reduction amplitude of the playback load reaches the expected target and whether the playback process is over include:
[0207] When the reduction amplitude of the playback load does not reach the expected target, determine whether the playback process is over. If not, dynamically adjust the non-essential data determination criterion, otherwise complete the non-essential data exclusion;
[0208] When the reduction amplitude of the playback load reaches the expected target, complete the non-essential data exclusion.
[0209] Optionally, the re-calculation module is specifically used for:
[0210] Obtain the original trajectory data, extract the timestamps and position information of the trajectory points, and store them as a time series and a coordinate series;
[0211] Calculate the adjustment ratio of the timestamp interval according to the playback speed parameter to generate a new timestamp interval value;
[0212] Adopt the linear interpolation method, based on the time series and the new timestamp interval value, re-calculate the timestamp of each trajectory point. According to the re-calculated timestamp, through the position information, use the interpolation algorithm to calculate the new trajectory point coordinates;
[0213] Combine the re-calculated timestamps and the coordinate series to generate the initial playback trajectory data;
[0214] Determine whether the initial playback trajectory data meets the continuity requirement. If there are discontinuous points, use the smoothing algorithm to correct the trajectory point coordinates and store the corrected trajectory point coordinates in a structured format, otherwise do not correct the trajectory point coordinates and store the trajectory point coordinates in a structured format;
[0215] According to business requirements, match the dynamic playback trajectory data in structured format with map or scene data to generate a dynamic playback trajectory.
[0216] Optionally, it further includes a secondary processing module for continuously monitoring the noise level of the trajectory data during playback. If the noise level exceeds a preset threshold, trigger a smoothing algorithm for secondary processing; otherwise, do not trigger the smoothing algorithm for secondary processing.
[0217] Optionally, the playback update module includes: a parameter adjustment module and a display module;
[0218] The parameter adjustment module is used to perform coordinate transformation on the trajectory points through a rotation matrix according to the direction parameters to obtain an adjusted motion path;
[0219] The display module is used to perform dynamic update playback based on the adjusted motion path;
[0220] If there is a deviation between the optimized trajectory data and the preset parameters, call the parameter adjustment module to dynamically correct the trajectory data. Through the data encapsulation protocol, pack the corrected trajectory data into a data format recognizable by the display module to generate a transmission data packet;
[0221] According to the communication interface requirements, use the real-time transport protocol to send the data packet to the display module to ensure the real-time and integrity of data transmission;
[0222] After receiving the data packet, the display module parses the content of the data packet, extracts the trajectory point information and parameters, and generates a dynamic update instruction;
[0223] If the display module detects that the trajectory point information is inconsistent with the current screen, call the screen rendering engine to redraw the trajectory screen according to the dynamic update instruction; through the screen refresh mechanism of the display module, display the redrawn trajectory screen in real time to ensure the synchronization of the screen and the trajectory data;
[0224] According to the running state of the display module, record the screen update log and generate trajectory playback data for subsequent analysis.
[0225] Optionally, the parameter adjustment module is specifically used for:
[0226] Based on the direction parameters, extract the rotation angle and rotation axis information, and construct a three-dimensional rotation matrix based on the rotation angle and rotation axis information;
[0227] Store the coordinate data of the trajectory points in the form of three-dimensional vectors, and perform matrix multiplication operation on the three-dimensional vectors and the rotation matrix to obtain the rotated trajectory point coordinate data;
[0228] Generate an adjusted motion path according to the rotated trajectory point coordinate data.
[0229] Optionally, the display module is specifically configured to:
[0230] Based on the adjusted motion path, extract the timestamps, coordinate information, and related parameters of the trajectory points to generate structured trajectory data;
[0231] Use a trajectory optimization algorithm to smooth the structured trajectory data, eliminate noise points, and obtain optimized trajectory data;
[0232] Determine whether there is a deviation between the optimized trajectory data and the preset parameters. If so, dynamically correct the trajectory data and perform dynamic update and playback on the corrected trajectory data. Otherwise, directly perform dynamic update and playback on the trajectory data.
[0233] Embodiment 3
[0234] As Figure 2 shown, the present invention also provides an electronic device, which may be a computer device, a single-chip microcomputer device, a smart mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, the processor, and the transceiver component are connected through a bus; the memory can be used to store an execution program, and an exemplary execution program may include instructions; the processor is used to execute the instructions stored in the memory. The memory can also be used to store data, and this data can be called and / or modified when the instructions are executed.
[0235] The processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the storage medium to implement the corresponding method flow or corresponding function, so as to implement the steps of a data management and persistence method of a real-time simulation system in the above embodiment.
[0236] Embodiment 4
[0237] Based on the same inventive concept, the present application also provides a readable storage medium, specifically an electronic device-readable storage medium (Memory). The electronic device-readable storage medium is a memory device in an electronic device, used to store programs and data. It can be understood that the storage medium here can include both the built-in storage medium in the electronic device and, of course, the extended storage medium supported by the electronic device. The storage medium provides a storage space, and this storage space stores the operating system of the terminal. Moreover, in this storage space, there is also stored one or more instructions suitable for being loaded and executed by a processor. These instructions can be one or more executable programs (including program codes). It should be noted that the storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. By loading and executing one or more instructions stored in the storage medium by the processor, the steps of the data management and persistence method of a real-time simulation system in the above embodiments can be implemented.
[0238] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0239] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0240] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured product including an instruction device, and the instruction device implements the functions in Figure 1 one flow or multiple flows and / or blocks Figure 1The functions specified in one or more boxes.
[0241] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide for implementing the steps of the functions specified in one Figure 1 One process or more processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes.
[0242] The above are only examples of the present application and are not used to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included within the scope of the claims of the present application pending approval.
Claims
1. A data management and persistence method for a real-time simulation system, characterized in that: include: According to the simulation frame sequence number and the preset data packet header structure, independent data frames are formed for different types of sub-item simulation software; During data playback, unnecessary data is removed, and the timestamp interval is adjusted according to the playback speed parameter, and the trajectory point position is recalculated to generate a dynamic playback trajectory; According to the direction parameters, coordinate transformation of the trajectory points is performed through a rotation matrix to obtain an adjusted motion path, and dynamic update playback is performed based on the adjusted motion path; The forming of independent data frames for different types of sub-item simulation software according to the simulation frame sequence number and the preset data packet header structure includes: According to the preset simulation clock frequency, the simulation frame number is obtained, and a unique identifier is generated according to the predefined frame number format; According to a preset data packet header structure, encapsulating the unique identifier into the data packet header to form a data packet with timing information; For different types of sub-item simulation software, extract key data types and bind the key data types with the timing information in the data packet header; Organize the key data with time series information according to the preset independent data set structure to form an independent data frame; During the data playback process, unnecessary data is removed, including: Step 1: Determine whether a frame of data meets the criteria for non-essential data. If not, it is marked as permanent data. Otherwise, it is not marked as permanent data. Step 2: Determine whether the timing information not marked as permanent data is within the timing range of the current playback stage. If not, mark the timing information not marked as permanent data as a data frame to be removed. Otherwise, do not mark it. Step 3: According to the data automatic elimination rules, all data frames marked as to be eliminated are removed from the playback data set; Step 4: Calculate the reduction of playback load before and after data elimination through the correlation analysis model between data elimination and playback load; Step 5: Determine whether the elimination of unnecessary data is completed based on whether the reduction in playback load reaches the expected target and whether the playback process is completed.
2. The method according to claim 1, characterized in that The determining whether the elimination of unnecessary data is completed based on whether the reduction of the playback load reaches the expected target and whether the playback process is completed includes: When the reduction of playback load does not reach the expected target, determine whether the playback process is completed. If not, dynamically adjust the non-essential data judgment standard. Otherwise, complete the elimination of non-essential data. When the playback load reduction reaches the expected target, unnecessary data is eliminated.
3. The method according to claim 1, characterized in that The step of adjusting the time stamp interval according to the playback speed parameter, recalculating the position of the track point, and generating a dynamic playback track includes: Get the original trajectory data, extract the timestamp and location information of the trajectory points, and store them as time series and coordinate series; According to the playback speed parameter, the timestamp interval adjustment ratio is calculated to generate a new timestamp interval value; Recalculate the timestamp of each track point based on the time series and the new timestamp interval value by using a linear interpolation method, and calculate the coordinates of the new track point by using an interpolation algorithm according to the recalculated timestamp and the position information; Combine the recalculated timestamps and coordinate sequences to generate initial playback trajectory data; Determine whether the initial playback trajectory data meets the continuity requirements. If there are discontinuous points, use a smoothing algorithm to correct the trajectory point coordinates and store the corrected trajectory point coordinates in a structured format. Otherwise, do not correct the trajectory point coordinates and store them in a structured format. According to business needs, the dynamic playback trajectory data in a structured format is matched with the map or scene data to generate a dynamic playback trajectory.
4. The method according to claim 1, characterized in that The step of performing coordinate transformation on the trajectory points through a rotation matrix according to the direction parameter to obtain an adjusted motion path includes: Based on the direction parameter, the rotation angle and the rotation axis information are extracted, and a three-dimensional rotation matrix is constructed based on the rotation angle and the rotation axis information; The coordinate data of the trajectory point is stored in the form of a three-dimensional vector, and the three-dimensional vector is multiplied by the rotation matrix to obtain the coordinate data of the rotated trajectory point; Generate an adjusted motion path according to the rotated trajectory point coordinate data.
5. The method according to claim 1, characterized in that The dynamically updating playback based on the adjusted motion path includes: Based on the adjusted motion path, the timestamp, coordinate information and related parameters of the trajectory points are extracted to generate structured trajectory data; The trajectory optimization algorithm is used to smooth the structured trajectory data, eliminate noise points, and obtain optimized trajectory data; It is determined whether the optimized trajectory data deviates from the preset parameters. If so, the trajectory data is dynamically corrected and the corrected trajectory data is dynamically updated and replayed. Otherwise, the trajectory data is directly dynamically updated and replayed.
6. A system applicable to the data management and persistence method of the real-time simulation system as claimed in any one of claims 1 to 5, characterized in that: include: A data sorting module is used to form independent data frames for different types of sub-item simulation software according to the simulation frame sequence number and the preset data packet header structure; The dynamic playback module is used to remove unnecessary data during data playback, adjust the timestamp interval according to the playback speed parameter, recalculate the trajectory point position, and generate a dynamic playback trajectory; The update playback module is used to transform the coordinates of the trajectory points through a rotation matrix according to the direction parameters to obtain an adjusted motion path, and dynamically update the playback based on the adjusted motion path.
7. The system according to claim 6, characterized in that The data sorting module is specifically used for: According to the preset simulation clock frequency, the simulation frame number is obtained, and a unique identifier is generated according to the predefined frame number format; According to a preset data packet header structure, encapsulating the unique identifier into the data packet header to form a data packet with timing information; For different types of sub-item simulation software, extract key data types and bind the key data types with the timing information in the data packet header; The key data with time series information is organized according to the preset independent data set structure to form an independent data frame.
8. The system according to claim 6, characterized in that The dynamic playback module includes: a data elimination module and a recalculation module; The data elimination module is used to eliminate unnecessary data during data playback based on the judgment criteria of unnecessary data and the time sequence range of the playback stage; The recalculation module is used to adjust the time stamp interval according to the playback speed parameter, recalculate the trajectory point position, and generate a dynamic playback trajectory.
9. An electronic device, characterized in that: include: at least one processor and memory; The memory and the processor are connected via a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, a data management and persistence method for a real-time simulation system as described in any one of claims 1 to 5 is implemented.
10. A readable storage medium, characterized in that: An execution program is stored thereon, and when the execution program is executed, a data management and persistence method for a real-time simulation system as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Automatic acquisition and playback method, device and equipment for simulation data
CN116662140A
Visual simulation backtracking method based on archive playback controller
CN117850270A