Data coding method of multimode semi-physical simulation system
By analyzing the frequency and change trends of sensor data, identifying key stages and calculating coding priority, the problem that traditional Hoffmann encoding fails to consider the importance of the test stage in semi-physical simulation systems is solved, and more efficient data encoding and system response is achieved.
Patent Information
- Application Number
- CN202510733389.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-04
AI Technical Summary
In the prior art, the traditional Hoffmann encoding method fails to effectively consider the importance of different testing stages in the semi-physical simulation testing system, resulting in poor encoding effects at critical moments.
By analyzing the frequency, change trend and time distribution characteristics of sensor data, we identify key stages, calculate coding priority, and optimize data encoding using Hoffman encoding.
It improves the effectiveness and efficiency of data encoding, ensures high responsiveness in key stages, reduces data transmission delay, and improves the real-time performance of the system.
Smart Images

Figure CN120263195A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data encoding, and specifically relates to a data encoding method for a multi-mode hardware-in-the-loop simulation system. Background Art
[0002] In a hardware-in-the-loop simulation test system, real-time interaction between physical objects and simulation models can be achieved, generating relatively realistic input and output responses to obtain relatively reliable test results. During the whole process, to better simulate the actual operating state of the system, it is usually necessary to select a suitable data encoding method to encode and transmit efficiently and accurately, so that the optimized encoding can reduce the delay of data transmission, improve the transmission efficiency, and enable the system to respond more quickly to changes in the external environment and user operations.
[0003] In the prior art, traditional Huffman coding is used to encode the acquired data according to the occurrence frequency of the data. The greater the occurrence frequency, the shorter the encoding length; the smaller the occurrence frequency, the longer the encoding length. However, during the system test process, there are test stages with different levels of importance. In critical moments that require high response speed, there may also be a possibility of low data frequency. Traditional Huffman coding only uses the occurrence frequency of data as the measurement standard for the encoding length, resulting in a relatively long encoding length and poor encoding effect for the corresponding critical moments. Summary of the Invention
[0004] In order to solve the technical problem of poor data encoding effect due to not considering the different levels of importance of test stages, the purpose of the present invention is to provide a data encoding method for a multi-mode hardware-in-the-loop simulation system, and the specific technical solution adopted is as follows: The present invention proposes a data encoding method for a multi-mode hardware-in-the-loop simulation system, and the method includes: Obtain various sensor data of the multi-mode hardware-in-the-loop simulation system in each historical test according to the time sequence; Traverse all sensor data in all historical tests to obtain the occurrence frequency of each character data in the sensor data; For any historical test, according to the change trend of the corresponding data values between each character data under each sensor and the character data within different preset neighborhood ranges, obtain the possibility that each character data under each sensor is in a critical stage; obtain a preset number of initial critical stages under each sensor according to the possibility; according to the time distribution characteristics of the character data in each initial critical stage with the same serial number between different sensors, obtain the time proximity degree of each initial critical stage with the same serial number under all sensors; screen out the final critical stage in each historical test according to the time proximity degree; Traverse the character data in the final critical stage of all historical tests to obtain the critical frequency of each character data; according to the occurrence frequency and the critical frequency of each character data, obtain the coding priority of each character data. Encode all sensor data according to the coding priority.
[0005] Further, the method for obtaining the possibility includes: For any sensor in each historical test, the different preset neighborhood ranges include the left neighborhood range and the right neighborhood range of each character data. Obtain the average value of the differences between the corresponding data values of each character data and different character data within the left neighborhood range as the first change feature. Obtain the average value of the differences between the corresponding data values of each character data and different character data within the right neighborhood range as the second change feature. According to the first change feature and the second change feature, obtain the possibility that each character data is in the critical stage under each sensor in each historical test. The first change feature is positively correlated with the possibility, and the second change feature is negatively correlated with the possibility.
[0006] Further, the method for obtaining the initial critical stage includes: Select a preset number of character data with the greatest possibility of being in the critical stage as the starting points of a preset number of initial critical stages; obtain the character data with the smallest possibility after each starting point as the end point of the initial critical stage corresponding to each starting point.
[0007] Further, the method for obtaining the time approximation degree includes: In any sensor in each historical test, obtain the average value of the time series corresponding to all character data in each initial critical stage as the occurrence time of each initial critical stage. Obtain the average value of the occurrence times of the initial critical stages with the same serial number under all sensors as the average occurrence time under each initial critical stage with the same serial number. According to the difference between the occurrence time of the initial critical stage with the same serial number under different sensors and the corresponding average occurrence time, obtain the time approximation degree of the initial critical stage with the same serial number under all sensors in each historical test. The difference is negatively correlated with the time approximation degree.
[0008] Further, the method for obtaining the final critical stage includes: If the time approximation degree of the initial critical stage with the same serial number under all sensors in each historical test is greater than the preset approximation threshold, the initial critical stage with the corresponding serial number is used as the final critical stage.
[0009] Further, the method for obtaining the key frequency includes: For the character data included in the final critical stage, obtain the ratio between the number of occurrences of each character data in all final critical stages and the number of all character data, as the key frequency of the corresponding character data; For the character data not included in the final critical stage, the key frequency of the corresponding character data is zero.
[0010] Further, the method for obtaining the encoding priority includes: Calculate the sum of the key frequency corresponding to each character data and the positive integer 1 as the weight value; Weight the occurrence frequency of each character data according to the weight value to obtain the encoding priority of each character data.
[0011] Further, the encoding of all sensor data according to the encoding priority includes: Based on the encoding priority, perform Huffman encoding on all sensor data.
[0012] Further, the method for obtaining the occurrence frequency includes: Obtain the character data of each type of sensor data, and obtain the ratio between the number of occurrences of each character data in all historical tests and the number of all character data as the occurrence frequency of each character data.
[0013] Further, the preset approach threshold is 0.5.
[0014] The present invention has the following beneficial effects: The present invention traverses all sensor data in all historical tests to obtain the occurrence frequency of each character data in the sensor data, so as to understand which character data appears frequently, which may reveal potential patterns or periodicities of the data; since the critical stage has mutability, in order to capture the dynamic changes of each type of sensor data over time, for any historical test, according to the change trend of the corresponding data values between each character data under each sensor and the character data within different preset neighborhood ranges, the possibility that each character data under each sensor is in the critical stage is obtained, and the positions where significant changes in the data values occur are identified; according to the possibility, a preset number of initial critical stages under each sensor are obtained, initially focusing on the stages that are most likely to represent important changes, reducing the amount of data to be analyzed; since multiple sensors simultaneously monitor the simulation test process of the same system, ideally, the changes in the data should be somewhat consistent to a certain extent. According to the time distribution characteristics of the character data corresponding to the initial critical stages with the same serial number between different sensors, the time proximity degree of the initial critical stages with the same serial number under all sensors is obtained, and the change consistency degree of the critical stages between sensors is evaluated; according to the time proximity degree, the final critical stages in each historical test are selected to ensure that the finally selected critical stages have high consistency and representativeness under all sensors; traverse the character data in the final critical stages in all historical tests to obtain the critical frequency of each character data, which reflects the importance degree of the character data in the critical stage; according to the occurrence frequency and critical frequency of each character data, the coding priority of each character data is obtained, more comprehensively evaluating the importance of the character data, so as to determine its priority in the coding process, which helps to optimize the coding strategy and improve the coding efficiency and accuracy; encode all sensor data according to the coding priority. By considering the different importance degrees of the test process, the present invention obtains the accurate coding priority of each character data, improving the effectiveness of data coding. Description of the Drawings
[0015] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required to be used in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings.
[0016] Figure 1 It is a flowchart of a data coding method for a multi-mode hardware-in-the-loop simulation system provided by an embodiment of the present invention; Figure 2 It is a flowchart of a method for obtaining a possibility provided by an embodiment of the present invention; Figure 3Flowchart of a method for obtaining the degree of time approximation provided by an embodiment of the present invention. Detailed implementation manners
[0017] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following combines the accompanying drawings and preferred embodiments to detail the specific implementation manners, structures, features, and effects of a data encoding method for a multi-mode hardware-in-the-loop simulation system according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.
[0019] The following specifically describes the specific solution of a data encoding method for a multi-mode hardware-in-the-loop simulation system provided by the present invention with reference to the accompanying drawings.
[0020] Please refer to Figure 1 , which shows a flowchart of a data encoding method for a multi-mode hardware-in-the-loop simulation system provided by an embodiment of the present invention. The specific method includes: Step S1: Obtain various sensor data of the multi-mode hardware-in-the-loop simulation system in each historical test according to the time sequence.
[0021] In an embodiment of the present invention, in order to reduce the delay of data transmission in the simulation system, improve the transmission efficiency, and better simulate the actual operating state of the system, it is necessary to perform encoding processing on various types of data in the system; first, in the multi-mode hardware-in-the-loop simulation system, there are various sensors for capturing physical parameters and environmental conditions during the operation of the actual system, analyzing the operating state of the system, and obtaining various sensor data of the multi-mode hardware-in-the-loop simulation system in each historical test according to the time sequence; among them, the various sensors at least include a pressure sensor, a temperature sensor, and a position sensor.
[0022] It should be noted that in an embodiment of the present invention, the time range of each historical test is 10 minutes, and the interval is 2s; in other embodiments of the present invention, the time range and interval of each historical test can be specifically set according to specific circumstances, and will not be limited and elaborated here.
[0023] Step S2: Traverse all sensor data in all historical tests to obtain the occurrence frequency of each character data in the sensor data.
[0024] Since the number of occurrences of each sensor character data in the sensor data may vary, understanding which character data appears frequently may reveal potential patterns or periodicity in the data.
[0025] It should be noted that the same sensor data contains the same information, and the corresponding character data is the same; in an embodiment of the present invention, the method for obtaining the occurrence frequency includes: obtaining the character data of each type of sensor data, and obtaining the ratio of the number of occurrences of each character data in all historical tests to the number of all character data as the occurrence frequency of each character data. The more the number of occurrences, the greater the occurrence frequency.
[0026] It should be noted that in the embodiments of the present invention, information such as numerical values and symbols in the sensor data can be converted into a readable character form through existing ASCII codes, Unicode, etc. The specific means are well-known technical means to those skilled in the art and will not be elaborated here.
[0027] Among them, the formula for the occurrence frequency is expressed as: ; where represents the occurrence frequency of the th character data; represents the number of occurrences of the th character data in all historical tests; represents the number of character data in all historical tests.
[0028] Step S3: For any historical test, according to the change trend of the corresponding data values between each character data under each sensor and the character data within different neighborhood ranges, obtain the possibility that each character data under each sensor is in a critical stage; obtain a preset number of initial critical stages under each sensor according to the possibility; according to the time distribution characteristics of the character data corresponding to the initial critical stages with the same serial number between different sensors, obtain the time proximity degree of the initial critical stages with the same serial number under all sensors; screen out the final critical stages in each historical test according to the time proximity degree.
[0029] For the normal test stage, that is, the calibration and debugging stage, the magnitude change of its data value is similar, so that the data character frequency usually occupies the dominant position of high-frequency data, which will cause the data character frequency corresponding to some critical stages in the test to be relatively low, resulting in the data transmission efficiency in the critical stage of the test being lower than that in the normal stage of the test, affecting the data transmission efficiency. Therefore, it is necessary to consider the critical stages in the system test.
[0030] Since the critical stage has mutability, in order to capture the dynamic changes of each sensor data over time, the change trend of the data value at different time points is concerned; by comparing the difference between the current character data of each character and the character data within different neighborhood ranges, the positions where the data value changes significantly are identified, and these positions may be in the critical stage. Therefore, for any historical test, according to the change trend of the corresponding data values between the character data of each character under each sensor and the character data within different preset neighborhood ranges, the possibility that the character data of each character under each sensor is in the critical stage is obtained.
[0031] Preferably, in an embodiment of the present invention, for the method of obtaining the possibility, please refer to Figure 2 , which shows a flowchart of a method for obtaining a possibility provided by an embodiment of the present invention. The method includes: Step S201: For any sensor in each historical test, the different preset neighborhood ranges include the left neighborhood range and the right neighborhood range of each character data.
[0032] Since in each historical test, a series of calibrations and adjustments are usually required, and for the critical stage, which requires a high-response stage of the system, the data in the critical stage is significantly different from the data presented before, and the data corresponding to the critical stage increases significantly; by comparing the character data with the character data after it, the persistence of the data change can be understood; if the difference between the character data and the character data after it is not large, it may indicate that the data is in a relatively critical stage.
[0033] It should be noted that, in an embodiment of the present invention, the method for obtaining different preset neighborhood ranges includes: taking each character data as a reference, forming a left neighborhood range with the M character data adjacent to the left, and forming a right neighborhood range with the M character data adjacent to the right, where M is 15; wherein, if the number of character data in the neighborhood range does not meet M, it is filled with zeros; in other embodiments of the present invention, the size of the neighborhood range can be specifically set according to the specific situation, and no limitation and elaboration are made here.
[0034] Step S202: Obtain the mean value of the differences between the corresponding data values of each character data and different character data within the left neighborhood range as the first change feature.
[0035] For the normal test phase and the critical phase, since the critical phase is more sudden than the normal test phase, the data values corresponding to the critical phase are significantly greater than those of the normal test phase. The greater the difference feature, by calculating the mean value of the differences between the corresponding data values of each character data and the different character data within the left neighborhood range, the overall level of the difference from the left neighborhood range can be quantified. If the difference is greater, the corresponding mean value is greater, the greater the difference change, and the more likely the corresponding character data is in the critical phase, and the greater the first change feature.
[0036] Step S203: Obtain the mean value of the differences between the corresponding data values of each character data and the different character data within the right neighborhood range as the second change feature.
[0037] The second change feature can evaluate the degree of difference between the data and the data within the right neighborhood range. By calculating the mean value of the differences between the corresponding data values of each character data and the different character data within the right neighborhood range, the smaller the difference, the smaller the mean value of the differences, the smaller the fluctuation, the more consistent the data size. If it may be in a continuous critical phase, the second change feature is also smaller.
[0038] Step S204: According to the first change feature and the second change feature, obtain the possibility that each character data of each sensor in each historical test is in the critical phase. The first change feature is positively correlated with the possibility, and the second change feature is negatively correlated with the possibility.
[0039] Among them, the positive correlation means that the dependent variable will increase as the independent variable increases, and the dependent variable will decrease as the independent variable decreases. That is, the greater the first change feature, the greater the corresponding data value of each character data than the corresponding data value of the character data within the left neighborhood range, with an obvious difference, and the more likely it is not in the same phase as the character data within the left neighborhood range, and the greater the possibility of being in the critical phase; the negative correlation means that the dependent variable will decrease as the independent variable increases, and the dependent variable will increase as the independent variable decreases. That is, the greater the second change feature, the greater the difference between the corresponding data values of each character data and the character data within the right neighborhood range, that is, the greater the fluctuation of the data and the more uneven the distribution, and the smaller the possibility of being in the critical phase.
[0040] In an embodiment of the present invention, the formula for the possibility is expressed as: ; Among them, represents the possibility that the th character data of the th sensor in the th historical test is in the critical phase; represents the number of character data within each neighborhood range; represents the the data value corresponding to the th sensor in the th character data in the indicating the th historical test; th sensor; data value corresponding to the th character data within the left neighborhood range of the indicating the th historical test; th sensor; data value corresponding to the th character data within the right neighborhood range of the indicating the adjustment parameter; indicating the linear normalization function; indicating taking the absolute value.
[0041] In the formula of possibility, represents calculating the mean difference of the data values corresponding to each character data and different character data within the left neighborhood range, that is, the first change feature. The larger the first change feature, that is, the larger the difference of the data values corresponding to each character data and different character data within the left neighborhood range, the more likely it is to be in the critical stage, and the greater the possibility. The smaller the first change feature, that is, the smaller the difference of the data values corresponding to each character data and different character data within the left neighborhood range, the smaller the possibility of being in the critical stage; represents calculating the mean difference of the data values corresponding to each character data and different character data within the right neighborhood range, that is, the second change feature. The larger the second change feature, that is, the larger the difference of the data values corresponding to each character data and different character data within the right neighborhood range, the more inconsistent the data sizes are, and the smaller the possibility of being in the same critical stage. The smaller the second change feature, that is, the smaller the difference of the data values corresponding to each character data and different character data within the right neighborhood range, the more uniform the data distribution is, and the greater the possibility of being in the same critical stage; Therefore, the larger the first change feature and the smaller the second change feature, the greater the possibility of being in the critical stage.
[0042] It should be noted that in an embodiment of the present invention, to avoid the denominator of the formula being 0, the adjustment parameter can be set to 0.01; in other embodiments of the present invention, it can also be set to other values according to specific situations, which will not be limited and elaborated here.
[0043] Since the amount of data may be very large, directly processing all potential critical data would be very complex. Considering that the critical phases have mutability, the possibility corresponding to the starting point should be greater, and for the end part of the critical phase, the corresponding possibility is smaller. By screening the key points with high and low possibilities, it is possible to focus on the phases that are most likely to represent important changes. Therefore, a preset number of initial critical phases are obtained for each sensor according to the possibility.
[0044] Preferably, in an embodiment of the present invention, the method for obtaining the initial critical phase includes: Select a preset number of character data with the greatest possibility of being in the critical phase as the starting points of the preset number of initial critical phases; obtain the character data with the smallest possibility after each starting point as the end points of the initial critical phases corresponding to each starting point.
[0045] It should be noted that in the embodiments of the present invention, the preset number can be specifically set by the implementer according to the specific situation. For example, the value is 5, which is not limited and elaborated here.
[0046] Since multiple sensors simultaneously monitor the simulation test process of the same system, ideally, the data between the sensors should corroborate each other to a certain extent, and the changes in the data should be consistent to a certain extent; by analyzing whether different sensors have similar time characteristics in the critical phases with the same serial number, the time proximity degree between the sensors is analyzed, and more accurate and reliable critical phases are further screened. According to the time distribution characteristics corresponding to the character data in the initial critical phases with the same serial number between different sensors, the time proximity degree of the initial critical phases with the same serial number under all sensors is obtained.
[0047] Preferably, in an embodiment of the present invention, for the method of obtaining the time proximity degree, please refer to Figure 3 , which shows a flowchart of a method for obtaining the time proximity degree provided by an embodiment of the present invention. The method includes: Step S301: In any sensor during each historical test, obtain the mean value of the time series corresponding to all character data in each initial critical phase as the occurrence time of each initial critical phase.
[0048] By calculating the mean value of the time series corresponding to all character data in each initial critical phase, a representative time point can be obtained, which can better reflect the occurrence time series characteristics of this phase in the entire historical test.
[0049] Step S302: Obtain the mean value of the occurrence times of the initial critical phases with the same serial number under all sensors as the average occurrence time under each initial critical phase with the same serial number.
[0050] Since different sensors may be affected by factors such as equipment, different response changes may occur. By calculating the average occurrence time of the initial critical phases with the same serial number under all sensors, it can be used as a benchmark to evaluate the deviation of the occurrence time of each sensor in the corresponding initial critical phase, so as to analyze the change state between sensors subsequently.
[0051] Step S303: According to the difference between the occurrence time of each initial critical phase with the same serial number under different sensors and the corresponding average occurrence time, obtain the time approximation degree of each initial critical phase with the same serial number under all sensors in each historical test. The difference is negatively correlated with the time approximation degree.
[0052] Among them, the negative correlation means that the dependent variable will decrease as the independent variable increases, and the dependent variable will increase as the independent variable decreases. That is, the greater the difference, the more inconsistent the occurrence time of the initial critical phase with the same serial number under the corresponding sensor is with the overall occurrence time among all sensors, and the smaller the time approximation degree.
[0053] In an embodiment of the present invention, the formula for the time approximation degree is expressed as: ; Among them, represents the time approximation degree of the th initial critical phase under all sensors in the th historical test; represents the occurrence time of the th historical test, the th type of sensor, and the th initial critical phase; represents the average occurrence time of the th historical test, all sensors, and the th initial critical phase; represents the number of sensors; represents the linear normalization function.
[0054] In the formula for the time approximation degree, represents calculating the mean value of the difference between the occurrence time and the average occurrence time of the th historical test, different sensors, and the th initial critical phase. The greater the mean value of the difference, the less close the occurrence time of the th historical test, each type of sensor, and the th initial critical phase is to the average occurrence time, the greater the time deviation, and the smaller the corresponding time approximation degree.
[0055] It should be noted that in other embodiments of the present invention, Negative correlation can also be achieved by taking the reciprocal of i.e., the larger is, the smaller it becomes after taking the reciprocal, and the smaller the degree of time approximation; among them, if the method of taking the reciprocal is used to achieve negative correlation, an adjustment parameter, such as 0.01, needs to be artificially added to the denominator of the formula to avoid the denominator of the formula being 0; the specific means are well-known technical fields to those skilled in the art and will not be elaborated here.
[0056] The degree of time approximation can evaluate the consistency of changes in critical stages between sensors; if different sensors detect critical changes in data at similar time points, then these time points are more likely to represent the true critical stages in the system or process, and those critical stages that only appear in a single sensor and are not verified by other sensors can be excluded, thereby optimizing the final critical stage identification result and ensuring that the finally selected critical stages have high consistency and representativeness under all sensors. Therefore, the final critical stages in each historical test are selected according to the degree of time approximation.
[0057] Preferably, in an embodiment of the present invention, the method for obtaining the final critical stage includes: If the degree of time approximation of the initial critical stages with the same serial number under all sensors in each historical test is greater than the preset approximation threshold, the initial critical stage corresponding to the serial number is used as the final critical stage.
[0058] It should be noted that, in an embodiment of the present invention, the preset approximation threshold is 0.5; in other embodiments of the present invention, the size of the preset approximation threshold can be specifically set according to specific situations and will not be limited and elaborated here.
[0059] Step S4: Traverse the character data in the final critical stages in all historical tests to obtain the key frequency of each character data; according to the occurrence frequency and key frequency of each character data, obtain the coding priority of each character data.
[0060] In order to comprehensively understand and analyze which character data are important or frequently appear in the critical stages of historical tests, traverse the character data in the final critical stages in all historical tests to obtain the key frequency of each character data, and the key frequency reflects the importance degree of the character data in the critical stages.
[0061] Preferably, in an embodiment of the present invention, the method for obtaining the key frequency includes: For the character data included in the final critical stage, obtain the ratio of the number of occurrences of each character data in all final critical stages to the number of all character data as the key frequency of the corresponding character data; For character data not included in the final critical stage, the critical frequency of the corresponding character data is zero.
[0062] If the key character appears more times in the final critical stage, it is more necessary to perform priority encoding to improve the real-time performance of the overall system.
[0063] The occurrence frequency can understand the distribution of character data in the entire dataset, reflecting the universality or activity of the character data; by comprehensively considering the occurrence frequency and the critical frequency, the importance of the character data can be evaluated more comprehensively, thereby determining its priority in the encoding process, which helps to optimize the encoding strategy and improve the encoding efficiency and accuracy. Therefore, according to the occurrence frequency and the critical frequency of each character data, the encoding priority of each character data is obtained.
[0064] Preferably, in an embodiment of the present invention, the method for obtaining the encoding priority includes: Calculate the sum of the critical frequency corresponding to each character data and the positive integer 1 as the weight value; Weight the occurrence frequency of each character data according to the weight value to obtain the encoding priority of each character data.
[0065] In an embodiment of the present invention, the formula for the encoding priority is expressed as: ; Wherein, represents the encoding priority of the th character data; represents the occurrence frequency of the th character data; represents the critical frequency of the th character data.
[0066] In the formula for the encoding priority, represents calculating the sum of the critical frequency corresponding to each character data and the positive integer 1, that is, the weight value. The greater the critical frequency and the more times it appears in the critical stage, the more necessary it is to increase the occurrence frequency of the character data, and the greater the encoding priority.
[0067] It should be noted that in other embodiments of the present invention, other basic mathematical methods such as addition can also be used to obtain a positive correlation relationship where the greater the occurrence frequency and the greater the critical frequency, the greater the encoding priority. The specific means are well-known technical means to those skilled in the art and will not be elaborated here.
[0068] Step S5: Encode all sensor data according to the encoding priority.
[0069] During data transmission or storage, the higher the encoding priority of character data, the more representative it is of critical stage data or commonly occurring data, and the more it needs to be retained or processed preferentially. By encoding according to the encoding priority, data can be compressed more effectively while ensuring that important information is not lost. All sensor data is encoded according to the encoding priority.
[0070] Preferably, in an embodiment of the present invention, encoding all sensor data according to the encoding priority includes: Based on the encoding priority, Huffman coding is used to encode all sensor data.
[0071] By combining the encoding priority, Huffman coding can more accurately allocate the encoding length according to the importance of each type of sensor data. Data values with high priority, that is, data that frequently appears or commonly appears in critical stages, have higher importance and will be assigned shorter encodings, thereby further improving the data encoding effect. It should be noted that the specific Huffman coding is a well-known technical means to those skilled in the art and will not be elaborated here.
[0072] After performing Huffman coding on the data values of all sensors, the data volume can be reduced, effectively reducing the bandwidth and transmission time required during data transmission, improving the efficiency and real-time performance of data transmission, thereby reducing the response time corresponding to tests in high-response stages, and further enhancing the real-time performance of the overall system, making the multi-mode hardware-in-the-loop simulation test more accurate.
[0073] In summary, the present invention traverses all sensor data in all historical tests to obtain the occurrence frequency of each character data in the sensor data; for any historical test, according to the change trend of the corresponding data values between each character data under each sensor and the character data within different preset neighborhood ranges, the possibility of each character data under each sensor being in a critical stage is obtained; according to the possibility, a preset number of initial critical stages under each sensor are obtained; according to the time distribution characteristics of the character data corresponding to the initial critical stages with the same serial number between different sensors, the time proximity degree of the initial critical stages with the same serial number under all sensors is obtained; the final critical stages in each historical test are selected according to the time proximity degree; the character data in the final critical stages in all historical tests is traversed to obtain the critical frequency of each character data; according to the occurrence frequency and critical frequency of each character data, the encoding priority of each character data is obtained; all sensor data is encoded. The present invention improves the effectiveness of data encoding by obtaining the accurate encoding priority of each character data.
[0074] It should be noted that: the above order of the embodiments of the present invention is only for description and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0075] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. The key point of each embodiment is to illustrate the differences from other embodiments.
Claims
1. A data encoding method for a multi-mode hardware-in-the-loop simulation system, characterized in that The method includes: Obtaining various sensor data of a multi-mode hardware-in-the-loop simulation system in each historical test according to time sequence; Traversing all sensor data in all historical tests to obtain the occurrence frequency of each character data in the sensor data; For any historical test, according to the change trend of the corresponding data values between each character data and the character data within different preset neighborhood ranges under each type of sensor, obtaining the possibility that each character data under each type of sensor is in a critical stage; obtaining a preset number of initial critical stages under each type of sensor according to the possibility; according to the time distribution characteristics of the character data corresponding to the initial critical stages with the same serial number between different sensors, obtaining the time approximation degree of the initial critical stages with the same serial number under all sensors; screening out the final critical stages in each historical test according to the time approximation degree; Traversing the character data in the final critical stages in all historical tests to obtain the critical frequency of each character data; obtaining the coding priority of each character data according to the occurrence frequency and the critical frequency of each character data; Encoding all sensor data according to the coding priority.
2. The data encoding method of a multi-mode hardware-in-the-loop simulation system according to claim 1, characterized in that, The method for obtaining the possibility includes: For any sensor in each historical test, the different preset neighborhood ranges include the left neighborhood range and the right neighborhood range of each character data; Obtaining the mean value of the differences between the corresponding data values of each character data and different character data within the left neighborhood range as the first change feature; Obtaining the mean value of the differences between the corresponding data values of each character data and different character data within the right neighborhood range as the second change feature; According to the first change feature and the second change feature, obtaining the possibility that each character data under each type of sensor in each historical test is in a critical stage, where the first change feature is positively correlated with the possibility, and the second change feature is negatively correlated with the possibility.
3. The data encoding method of a multi-mode hardware-in-the-loop simulation system according to claim 1, wherein The method for obtaining the initial critical stages includes: Selecting a preset number of character data with the greatest possibility of being in a critical stage as the starting points of a preset number of initial critical stages; obtaining the character data with the smallest possibility after each starting point as the end point of the initial critical stage corresponding to each starting point.
4. The data encoding method of a multi-mode hardware-in-the-loop simulation system according to claim 1, characterized in that The method for obtaining the time approximation degree includes: In any sensor in each historical test, obtaining the mean value of the time sequences corresponding to all character data in each initial critical stage as the occurrence time of each initial critical stage; Obtaining the mean value of the occurrence times of the initial critical stages with the same serial number under all sensors as the average occurrence time under each initial critical stage with the same serial number; According to the difference between the occurrence time of the initial critical stage with the same serial number under different sensors and the corresponding average occurrence time, obtaining the time approximation degree of the initial critical stages with the same serial number under all sensors in each historical test, where the difference is negatively correlated with the time approximation degree.
5. The data encoding method of a multi-mode hardware-in-the-loop simulation system according to claim 1, characterized in that, The method for obtaining the final critical stages includes: If the degree of approximation of the time of each initial critical stage with the same serial number under all sensors in each historical test is greater than a preset approximation threshold, the initial critical stage corresponding to the serial number is used as the final critical stage.
6. A data encoding method for a multi-mode hardware-in-the-loop simulation system according to claim 1, characterized in that The method for obtaining the key frequency includes: For the character data included in the final critical stage, obtaining the ratio between the number of occurrences of each character data in all final critical stages and the number of all character data as the key frequency of the corresponding character data; For the character data not included in the final critical stage, the key frequency of the corresponding character data is zero.
7. A data encoding method for a multi-mode hardware-in-the-loop simulation system according to claim 1, characterized in that The method for obtaining the encoding priority includes: Calculating the sum of the key frequency corresponding to each character data and the positive integer 1 as the weight value; Weighting the occurrence frequency of each character data according to the weight value to obtain the encoding priority of each character data.
8. A data encoding method for a multi-mode hardware-in-the-loop simulation system according to claim 1, characterized in that, The encoding of all sensor data according to the encoding priority includes: Based on the encoding priority, performing Huffman encoding on all sensor data.
9. A data encoding method for a multi-mode hardware-in-the-loop simulation system according to claim 1, characterized in that The method for obtaining the occurrence frequency includes: Obtaining the character data of each type of sensor data, and obtaining the ratio between the number of occurrences of each character data in all historical tests and the number of all character data as the occurrence frequency of each character data.
10. A data encoding method for a multi-mode hardware-in-the-loop simulation system according to claim 5, characterized in that The preset approximation threshold is 0.5.
Citation Information
Patent Citations
Motor data de-noising method and system
CN118467935A
Device and method for coding and decoding keyword data
CN1428742A
Method and apparatus for encoding and decoding bit stream and orientation interpolator
CN1878311A
Text compression method, module, chip, electronic device, and storage medium
US20230394225A1