Data refill method and device, storage medium and electronic equipment

By performing time stamp alignment and synchronization processing on multi-module data files, the problem of difficult data signal synchronization is solved, and the consistency and accuracy of data recharge are achieved.

CN118520645BActive Publication Date: 2025-04-01BEIJING YINWO AUTOMOBILE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410525841.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2025-04-01
Estimated Expiration
2044-04-28

AI Technical Summary

Technical Problem

During the simulation process, the synchronization of multi-module data signals is difficult to ensure, resulting in disorder or loss of data recharge.

Method used

By determining the data files of each target module and aligning them based on the timestamp information, the orderliness and integrity of the data files are ensured, and the processing is synchronized during refilling.

Benefits of technology

The synchronous recharge of data files is realized, ensuring the consistency and accuracy of data, and improving the efficiency of data recharge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520645B_ABST
    Figure CN118520645B_ABST
Patent Text Reader

Abstract

The present application provides a data re-injection method and device, a storage medium and an electronic device, and relates to the field of data processing. The data re-injection method includes: determining N data files of each of M target modules, each data file contains timestamp information, and the N data files are arranged from the first data file to the Nth data file according to their respective timestamp information, and M and N are both positive integers; based on the timestamp information of the initial frame data of the first data files of the M target modules, aligning the first data files of the M target modules; based on the aligned first data files of the M target modules, synchronously re-injecting the frame data in the N data files of the M target modules to the target domain controller in turn. The scheme in the present application ensures the continuity of the data and improves the efficiency of data re-injection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a data re-injection method and device, a storage medium and an electronic device. Background Art

[0002] In order to conveniently and quickly verify and debug the algorithms of multiple modules, and to ignore the differences between the algorithm versions and the algorithm versions on the actual domain controller, it is usually necessary to simulate the data signals in the actual vehicle environment. For such simulations, the general practice is to record the data signals of multiple modules in the actual vehicle and feed the data back to the domain controller. However, the data signals are periodic and dynamically changing, so it is difficult to ensure the synchronization of the data signals of multiple modules when feeding back. Summary of the invention

[0003] In view of this, embodiments of the present application provide a data re-injection method and device, a storage medium, and an electronic device.

[0004] In a first aspect, an embodiment of the present application provides a data reinjection method, including: determining N data files of M target modules, each data file containing timestamp information, and arranging the N data files from the first data file to the Nth data file according to their respective timestamp information, where M and N are both positive integers; aligning the first data files of the M target modules based on the timestamp information of the initial frame data of the first data files of the M target modules; and synchronously reinjecting the frame data in the N data files of the M target modules to the target domain controller in turn based on the aligned first data files of the M target modules.

[0005] In combination with the first aspect, in certain implementations of the first aspect, determining N data files for each of M target modules includes: obtaining P data files, where P is a positive integer greater than N; traversing the timestamp information of the P data files, and dividing the data files with the same timestamp information into the same group of data files to obtain K groups of data files, where K is a positive integer; and classifying the data files in the K groups of data files according to the type of the target module to obtain N data files for each of the M target modules.

[0006] In combination with the first aspect, in certain implementations of the first aspect, traversing the timestamp information of P data files, and dividing the data files with the same timestamp information into the same group of data files to obtain K groups of data files, includes: traversing the timestamp information of P data files, and dividing the data files with the same timestamp information into the same group of data files to obtain L groups of data files, where L is a positive integer greater than or equal to K; among the L groups of data files, if a group of data files contains M target modules, then retaining the group of data files; if a group of data files lacks any one of the M target modules, then deleting the group of data files, so as to obtain K groups of data files from the L groups of data files.

[0007] In combination with the first aspect, in certain implementations of the first aspect, the first data files of the M target modules are aligned based on the timestamp information of the initial frame data of the first data files of the M target modules, including: determining the reference frame data with the largest timestamp information from the initial frame data of the first data files of the M target modules based on the timestamp information of the initial frame data of the first data files of the M target modules; determining the reference module from the M target modules; if the timestamp information of the initial frame data of the reference module is less than the timestamp information of the reference frame data, time-shifting the first data file of the reference module until the timestamp information of the first data file of the reference module is not less than the timestamp information of the reference frame data.

[0008] In combination with the first aspect, in certain implementations of the first aspect, frame data in N data files of each of M target modules are synchronously fed back to the target domain controller in sequence, including: in the process of feeding back the i-th data file of each of the M target modules to the target domain controller, determining a reference module and a sub-module from the M target modules, 1≤i≤N; determining the g-th frame data from the reference module, and based on the timestamp information of the g-th frame data, reading frame data whose timestamp information is within a target frame error from the sub-module; if the reading is successful, the g-th frame data in the reference module and the frame data whose timestamp information is within a target frame error with the timestamp information of the g-th frame data in the sub-module are synchronously fed back to the target domain controller.

[0009] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: if the reading is unsuccessful, cyclically reading frame data whose timestamp information is within the target file error with the g-th frame data from the secondary module until the number of cyclic readings reaches a target number threshold, wherein the target file error increases with the increase in the number of cyclic readings; if frame data whose timestamp information is within the target file error with the g-th frame data is successfully read from the secondary module before the number of cyclic readings reaches the target number threshold, then the g-th frame data in the reference module and the frame data in the secondary module that are synchronously re-injected with the g-1th frame data of the reference module are synchronously re-injected to the target domain controller.

[0010] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: if frame data whose timestamp information is within the target file error with respect to the g-th frame data has not been successfully read from the secondary module when the number of cyclic readings reaches the target number threshold, then determining that the refill of the i-th data file of the secondary module is completed, and switching to the i+1-th data file of the secondary module; determining frame data whose timestamp information is within the target frame error with respect to the g-th frame data from the i+1-th data file of the secondary module, and synchronously refilling the g-th frame data in the reference module and the frame data whose timestamp information is within the target frame error with respect to the g-th frame data determined in the i+1-th data file of the secondary module to the target domain controller.

[0011] In a second aspect, an embodiment of the present application provides a data re-injection device, including: a determination module, used to determine N data files of M target modules, each data file includes timestamp information, and the N data files are arranged from a first data file to an Nth data file according to their respective timestamp information, and M and N are both positive integers; a data alignment module, used to align the first data files of the M target modules based on the timestamp information of the initial frame data of the first data files of the M target modules;

[0012] The re-injection module is used to synchronously re-inject the frame data in the N data files of the M target modules to the target domain controller in sequence based on the first data files of the M target modules after alignment.

[0013] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is used to execute the data re-injection method described in the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; and the processor is used to execute the data re-injection method described in the first aspect.

[0015] In this embodiment, the N data files of each target module are arranged according to the timestamp information of the data files, which ensures the order and integrity of the N data files. This order and integrity further ensures the consistency of the data and avoids confusion or loss during data re-injection. In addition, the first data files of the M target modules are aligned based on the timestamp information of the data files, which can ensure that the starting data files to be re-injected in each module are synchronized in time, which is also very important for ensuring the accuracy of subsequent data processing and analysis. Finally, through data alignment and synchronous re-injection, the time and cost of data processing and transmission are reduced, and the efficiency of data re-injection is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0017] Figure 1 FIG. 1 is a flow chart of a data re-injection method provided in an embodiment of the present application.

[0018] Figure 2 The figure is a schematic diagram of a process for determining N data files of M target modules respectively provided by an embodiment of the present application.

[0019] Figure 3 The figure is a schematic diagram of a process of aligning data files provided in one embodiment of the present application.

[0020] Figure 4 The figure is a schematic diagram of a process of returning data to a target domain controller according to an embodiment of the present application.

[0021] Figure 5 FIG. 1 is a schematic diagram of a data re-injection process provided by an embodiment of the present application.

[0022] Figure 6 FIG. 1 is a schematic diagram of the structure of a data recharging device provided in one embodiment of the present application.

[0023] Figure 7 Shown is a schematic structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0025] Figure 1 FIG. 1 is a flow chart of a data re-injection method provided by an embodiment of the present application. Figure 1 As shown, the data re-injection method provided in this embodiment includes the following steps.

[0026] Step S110, determining N data files of each of the M target modules.

[0027] The target module here refers to a specific software or system module that needs to be data-reinjected, usually different functional components or subsystems in the domain controller. Exemplarily, the M target modules include a power module and a chassis module. A data file refers to a file containing configurations, settings, logs or other relevant information about the target module. Each data file contains timestamp information, and the N data files are arranged from the first data file to the Nth data file according to their respective timestamp information. In other words, for each target module, the N data files of the module are arranged in chronological order. For example, if N=5, then the five data files are recorded as the first data file, the second data file, the third data file, the fourth data file, and the fifth data file according to their respective timestamp information.

[0028] Exemplarily, for each target module, a previously created backup file can be used as the data file; alternatively, the data file can be generated by exporting data on the domain controller; or, depending on the circumstances, the data file can be obtained from other systems or applications. For example, if the target domain controller is integrated with other systems, data files can be exported from these systems.

[0029] Step S120: aligning the first data files of the M target modules based on the timestamp information of the initial frame data of the first data files of the M target modules.

[0030] The alignment in this step refers to sorting and adjusting the data files according to their timestamp information to ensure that they are consistent in time. Exemplarily, the data files are arranged in chronological order according to the timestamp information. According to the arrangement result, the data files are adjusted so that they are continuous in time. In addition, it can be further confirmed whether the order of the adjusted data files is consistent with the timestamp information to ensure that the alignment operation is completed correctly.

[0031] Step S130 , based on the aligned first data files of the M target modules, frame data in the N data files of the M target modules are synchronously fed back to the target domain controller in sequence.

[0032] The target domain controller is an electronic control unit used to centrally control different functional areas of a car to improve the intelligence and information level of the car. Exemplarily, first, use a synchronization signal or timestamp or other methods to align the M target modules to ensure their consistency in time and space. Afterwards, use the first data file of each of the aligned M target modules as the starting point, and transfer the frame data in the first data file to the communication interface of the target domain controller to synchronize the frame data in the first data file back to the target domain controller. Next, process the remaining N-1 data files one by one, and for each data file, synchronize its frame data back to the target domain controller in the same way.

[0033] In this embodiment, the N data files of each target module are arranged according to the timestamp information of the data files, which ensures the order and integrity of the N data files. This order and integrity further ensures the consistency of the data and avoids confusion or loss during data re-injection. In addition, the first data files of the M target modules are aligned based on the timestamp information of the data files, which can ensure that the starting data files to be re-injected in each module are synchronized in time, which is also very important for ensuring the accuracy of subsequent data processing and analysis. Finally, through data alignment and synchronous re-injection, the time and cost of data processing and transmission are reduced, and the efficiency of data re-injection is improved.

[0034] Figure 2 The figure is a schematic diagram of a process for determining N data files of M target modules according to an embodiment of the present application. Figure 1 Based on the embodiment shown, Figure 2 The embodiment shown is described below in detail. Figure 2 The embodiment shown and Figure 1 The differences and similarities of the illustrated embodiments are not described in detail.

[0035] like Figure 2 As shown, in an embodiment of the present application, determining N data files of each of M target modules includes the following steps.

[0036] Step S210, obtaining P data files.

[0037] Specifically, when obtaining P data files, the file name of the data file is recorded at the same time. Assuming that the timestamp information of the data file is included in the file name, then the file name of the data file can be expressed as: X_20180312_121212_333_Y.bin. Among them, "X" may be an identifier or represent a specific name or code; "20180312" represents the date, the format is year-month-day, that is, March 12, 2018; "121212" represents the time, the format is hours, minutes and seconds, that is, 12 hours, 12 minutes and 12 seconds; "333" is a number or version number; "Y" is the extension name or other identifier of the data file. In addition, each frame of data in the data file in the present application also corresponds to a timestamp field with higher precision.

[0038] Step S220, traversing the timestamp information of P data files, and dividing the data files with the same timestamp information into the same group of data files, so as to obtain K groups of data files.

[0039] For example, the p data files are A_20180312_121212_333.bin, A_20180312_131212_333.bin, A_20190312_121212_333.bin, B_20180312_121212_333.bin, B_20180312_131212_3 33.bin、B_20190312_121212_333.bin、C_20180312_121212_333.bin、C_20180312_131212_333.bin、D_20180312_121212_333.bin、D_20180312_131212_333.bin。 Among them, A, B, C, D at the beginning of the data file represent the target module corresponding to the data file, for example, A_20180312_121212_333.bin corresponds to target module A.

[0040] Furthermore, the data files can be grouped according to the timestamp information in the file name. Then, A_20180312_121212_333.bin, B_20180312_121212_333.bin, C_20180312_121212_333.bin, and D_20180312_121212_333.bin have the same timestamp information and are grouped together. This group is recorded as the first group of data files; A_20180312_131212_333.bin , B_20180312_131212_333.bin, C_20180312_131212_333.bin, and D_20180312_131212_333.bin have the same timestamp information, are grouped together, and the group is recorded as the second group of data files; A_20190312_121212_333.bin and B_20190312_121212_333.bin have the same timestamp information, are grouped together, and the group is recorded as the third group of data files. So far, three groups of data files are obtained, that is, K groups of data files are obtained after the grouping described in step S220.

[0041] For step S220, in another implementation, the timestamp information of P data files is traversed, and the data files with the same timestamp information are divided into the same group of data files to obtain L groups of data files, where L is a positive integer greater than or equal to K; among the L groups of data files, if a group of data files contains M target modules, then the group of data files is retained; if a group of data files lacks any one of the M target modules, then the group of data files is deleted, so as to obtain K groups of data files from the L groups of data files.

[0042] In combination with the previous example, among the three groups of data files obtained, the group of data files A_20190312_121212_333.bin and B_20190312_121212_333.bin only contain target module A and target module B. Therefore, this group of data files is deleted, and only the first group of data files and the second group of data files are retained, that is, the K group of data files described in step S220.

[0043] It is understandable that an incomplete data file group may introduce misleading information, which may lead to erroneous conclusions or decisions if used in the analysis process. This embodiment involves a data re-injection scenario of multiple target modules, and the data of each module is indispensable. Therefore, deleting the incomplete data file group can ensure the integrity of the data for subsequent analysis or processing to avoid misleading.

[0044] Step S230: classify the data files in the K groups of data files according to the types of the target modules to obtain N data files for each of the M target modules.

[0045] Exemplarily, the data files in the data file group that retains the complete target module are classified according to the type of the target module. Therefore, the data file group to be classified is the first group of data files: A_20180312_121212_333.bin, B_20180312_121212_333.bin, C_20180312_121212_333.bin, D_20180312_121212_333.bin; the second group of data files: A_20180312_131212_333.bin, B_20180312_131212_333.bin, C_20180312_131212_333.bin, D_20180312_131212_333.bin.

[0046] For these two groups of data files, they are grouped again according to the type of target modules, and the results are: grouping of target module A: 20180312_121212_333.bin, 20180312_131212_333.bin; grouping of target module B: 20180312_121212_333.bin, B_20180312_131212_333.bin; grouping of target module C: 20180312_121212_333.bin, C_20180312_131212_333.bin; grouping of target module D: 20180312_121212_333.bin, D_20180312_131212_333.bin.

[0047] In this embodiment, data files with the same timestamp information are divided into the same group, which can ensure that data at the same time point is processed centrally, which helps to restore the actual scene at that time during analysis. This classification method is particularly important for analysis tasks that require continuous time series data. Afterwards, the data files are classified according to the type of target module, which can make the data of each module clearer and more structured. This classification helps each module to independently process and analyze its own data, avoiding confusion and misuse of data.

[0048] Figure 3 FIG. 1 is a flow chart of aligning data files according to an embodiment of the present application. Figure 1 Based on the embodiment shown, Figure 2 The embodiment shown is described below in detail. Figure 3 The embodiment shown and Figure 2 The differences and similarities of the illustrated embodiments are not described in detail.

[0049] like Figure 3 As shown, in this embodiment, based on the timestamp information of the initial frame data of the first data files of the M target modules, the first data files of the M target modules are aligned, including the following steps.

[0050] Step S310 , based on the timestamp information of the initial frame data of the first data files of the M target modules, determine the reference frame data with the largest timestamp information from the initial frame data of the first data files of the M target modules.

[0051] Specifically, the initial frame data of the first data file of each target module refers to the first group or first part of data in the data file. Further, the timestamp information of the initial frame data of the first data files of the M target modules is compared, and the initial frame data with the largest timestamp is determined as the reference frame data.

[0052] Step S320, determining a reference module from the M target modules.

[0053] The reference module refers to a main or core module selected from the M target modules, which is used as a reference or reference point in the data reinjection process. In one implementation, any one target module is selected from the M target modules and used as the reference module. In another implementation, the target module corresponding to the reference frame data can be directly determined as the reference module; or, the target module with a relatively complete and stable data file can be determined as the reference module to avoid errors in the alignment process caused by missing or damaged data; or, according to specific business logic or system requirements, a module that plays a more important role or has higher reliability in the target domain controller is used as the reference module. In yet another implementation, the reference module has been configured in the configuration file, so the configuration file can be read to determine the reference module from the M target modules.

[0054] Step S330: If the timestamp information of the initial frame data of the reference module is less than the timestamp information of the reference frame data, time shift the first data file of the reference module until the timestamp information of the first data file of the reference module is not less than the timestamp information of the reference frame data.

[0055] Specifically, time-shifting the first data file of the reference module means adjusting the first data file of the reference module so that the timestamp of its first frame data is not less than the timestamp of the reference frame data obtained by comparison. Exemplarily, a fixed amount of time is added to each frame data in the first data file of the reference module so that the entire data file moves backward on the timeline. The amount of time added can be selected according to actual conditions, and it is only necessary to ensure that after the shift, the timestamp information of the first data file of the reference module is not less than the timestamp information of the reference frame data.

[0056] Due to the different signal cycles of each module, the errors of the recording software and the influence of the actual environment, the timestamps of the first frame data in the same set of data files recorded may not necessarily be equal, so a time alignment is required to obtain the starting position of the same timestamp. This embodiment can ensure that the data of all target modules has a clear reference point in time by determining the reference frame data with the largest timestamp information, which helps to maintain the synchronization of data between different target modules and avoid processing errors or inconsistencies caused by time differences. When the timestamp information of the initial frame data of the reference module is less than the timestamp information of the reference frame data, the first data file of the reference module is time-shifted, which can effectively reduce data processing errors caused by inconsistent timestamps, ensure the accuracy and reliability of the data, and improve the quality of data re-injection.

[0057] Figure 4 FIG. 1 is a flow chart of a method for returning data to a target domain controller according to an embodiment of the present application. Figure 1 Based on the embodiment shown, Figure 4 The embodiment shown is described below in detail. Figure 4 The embodiment shown and Figure 1 The differences and similarities of the illustrated embodiments are not described in detail.

[0058] like Figure 4 As shown, in this embodiment, synchronously injecting frame data in N data files of M target modules respectively to the target domain controller in sequence includes the following steps.

[0059] Step S410 , in the process of injecting the i-th data file of each of the M target modules back to the target domain controller, determining a reference module and a secondary module from the M target modules.

[0060] The secondary module is a module that is secondary or subordinate to the reference module. There is a certain dependency between the secondary module and the reference module. During the data re-injection process, the data file of the secondary module needs to be adjusted and calibrated according to the data file of the reference module to ensure synchronization and consistency with the frame data in the data file of the reference module.

[0061] It should be noted that the determination method of the reference module and the secondary module varies according to different application scenarios and system requirements. In actual operation, it is necessary to select a suitable module as the reference module according to the specific situation and correctly handle the relationship between the reference module and this module.

[0062] Step S420, determining the g-th frame data from the reference module, and based on the timestamp information of the g-th frame data, reading frame data whose timestamp information is within a target frame error from the secondary module.

[0063] The target frame error represents a time tolerance range between frames, that is, an allowable deviation range, which is used to determine whether the frame data of the secondary module is close enough to the g-th frame data of the reference module in time so as to match the corresponding frame data. Exemplarily, the target frame error is configured in the configuration file.

[0064] Specifically, when determining the g-th frame data from the reference module, its timestamp information is also obtained, and then this timestamp information is used to search for matching frame data in the secondary module. However, due to various reasons (such as slight time differences in data acquisition, slight deviations in the system clock, etc.), the timestamp of the frame data of the secondary module may not completely match the timestamp of the g-th frame data of the reference module. Based on this, a target frame error is set. This error allows a certain difference between the timestamp of the frame data of the secondary module and the timestamp of the g-th frame data of the reference module. As long as this difference does not exceed the range of the target frame error, these frame data can be considered to match.

[0065] Assuming the target frame error is diff, and the timestamp information of the g-th frame data is time A, it is necessary to read the frame data with the timestamp information within [time A, time A+diff] from the secondary module. For example, if the timestamp of the g-th frame data of the reference module is 10:00:00, and the target frame error is ±0.01 seconds, then the frame data with the timestamp between 10:00:00 and 10:00:00.01 or between 9:59:59.99 and 10:00:00 in the secondary module can be regarded as the frame data matching the g-th frame data.

[0066] In this way, the difference between the timestamps of the frame data can be handled more flexibly, ensuring that the frame data read from the secondary module is close enough in time to the g-th frame data of the reference module, so that subsequent data synchronization or analysis operations can be performed.

[0067] In actual situations, for step S420, if the reading is successful, step S430 is executed; otherwise, step S440 is executed.

[0068] Step S430 , synchronously injecting the g-th frame data in the reference module and the frame data in the secondary module whose timestamp information is within the target frame error of the g-th frame data back to the target domain controller.

[0069] That is, the g-th frame data in the reference module and the frame data in the secondary module whose timestamp information is within the target frame error of the g-th frame data will be combined and forwarded to the target domain controller for further analysis and processing.

[0070] Step S440, reading frame data whose timestamp information is within the target file error range with respect to the g-th frame data from the secondary module.

[0071] The target file error is also a time tolerance range, which is used to determine whether the i-th data file of the submodule has ended. When the frame data matching the g-th frame data cannot be obtained in the submodule according to the target frame error, the target file error can be used to make a decision. Exemplarily, the target file error is a specific multiple of the maximum period in the M target modules, and exemplary, the specific multiple is 2-3 times.

[0072] Assuming that the target file error is DIFF, and the timestamp information of the g-th frame data is time A, it is necessary to read the frame data with the timestamp information within [time A, time A+DIFF] from the secondary module.

[0073] During the data re-injection process, you may encounter a situation where there is no timestamp information of the frame data in the secondary module and the timestamp information of the g-th frame data of the reference module is within the target frame error. At this time, you can consider expanding the search range and using the target file error to find frame data close to the timestamp information of the g-th frame data.

[0074] It should be noted that the setting of the target file error should be determined according to the specific application scenario and requirements to ensure that the matching frame data can be found accurately and to avoid introducing too many errors or mismatched data.

[0075] In actual situations, for step S440, if the reading is successful, execute step 450; otherwise, execute step S460.

[0076] Step S450 , synchronously re-injecting the g-th frame data in the reference module and the frame data in the secondary module that is synchronously re-injected with the g-1-th frame data in the reference module to the target domain controller.

[0077] The frame data whose timestamp information is within the target file error of the g-th frame data is successfully read from the secondary module, indicating that the timestamp error between the frame data and the g-th frame data is large. At this time, if the frame data in the secondary module is used to synchronize and re-inject with the g-th frame data in the reference module, a large error will be generated. Therefore, the g-th frame data in the reference module and the frame data synchronized and re-injected with the g-1-th frame data in the secondary module are synchronized and re-injected to the target domain controller.

[0078] It is understandable that the error between the frame data in the secondary module that is synchronously re-injected with the g-1 frame data of the reference module and the g-th frame data in the reference module is a target frame error of one unit. In some cases, due to various reasons (such as file damage, hardware failure, etc.), it may not be possible to read the expected frame data from the secondary module. Using the frame data that was re-injected last time as the frame data that is re-injected this time can be used as a fault-tolerant mechanism to ensure that data re-injection can continue when problems occur, rather than completely failing.

[0079] Step S460, determining whether the number of reads reaches a target number threshold.

[0080] Exemplarily, the target number threshold is 3 times.

[0081] For step S460, if the target number threshold is not reached, step S440 is executed; if the target number threshold is reached, step S470 is executed.

[0082] The target file error increases with the number of loop reads. In one example, a fixed target file error a is set. When the matching frame data is read in the submodule for the first time, the target file error is a; when the matching frame data is read in the submodule for the second time, the target file error is 2*a; when the matching frame data is read in the submodule for the third time, the target file error is 3*a, and so on. In another example, a fixed target file error b can be set, and then a fixed value c is added to each loop read. For example, when the second loop reads, the corresponding target file error is b+c, and when the third loop reads, the corresponding target file error is b+2c, and so on.

[0083] That is to say, if the data frame that meets the timestamp requirement cannot be successfully read in the submodule, the read will be attempted in the submodule in a loop, and each attempt will relax the error tolerance range of the timestamp match (target file error) until the set upper limit of the number of attempts, that is, the target number threshold, is reached. Continuing with the example in step S440, in each loop, it is necessary to read the frame data with timestamp information within [time A, time A+n*DIFF] from the submodule, where n is the number of loops.

[0084] By setting the target number threshold, you can allow retrying to read data within a certain number of times. However, if the number of cyclic reads is too many, it may cause system performance degradation or delays in other tasks. Therefore, by setting the target number threshold, you can control the number of cyclic reads within a reasonable range to ensure efficient operation of the system.

[0085] Step S470, determine that the re-injection of the i-th data file of the sub-module is completed, and switch to the i+1-th data file of the sub-module, determine the frame data with the timestamp information of the g-th frame data within the target frame error from the i+1-th data file of the sub-module, and synchronously re-inject the g-th frame data in the reference module and the frame data with the timestamp information of the g-th frame data determined in the i+1-th data file of the sub-module within the target frame error to the target domain controller.

[0086] If the matching data frame is not successfully read in the secondary module when the upper limit of the loop reading is reached, the current data file refill of the secondary module is terminated, the next data is switched to, and the synchronization process is continued.

[0087] By searching for frame data that matches the timestamp information of the g-th frame data in the i+1-th data file of the secondary module, the continuity of the data can be maintained as much as possible to avoid data discontinuity and inconsistency. In addition, since the frame data in the data file are arranged in chronological order, the i+1-th data file of the secondary module is often immediately following the i-th data file. Therefore, searching for matching frame data from the i+1-th data file of the secondary module is also more likely to find frame data with a timestamp information close to the g-th frame data.

[0088] Combination Figure 4 The embodiment shown, the present application also provides Figure 5 . Figure 5 FIG. 1 is a schematic diagram of a data re-injection process provided by an embodiment of the present application. Figure 5As shown, A, B, C, and D represent target module A, target module B, target module C, and target module D, respectively. It can be seen that, assuming that target module A is the reference module, the time span of the first data file of target module B is smaller than that of the reference module. Therefore, at the end of recharging the first data files of these four target modules, "situation 1" will occur, that is, in the first data file of target module B, frame data that matches the frame data in the first data file of target module A cannot be found. At this time, a file switch will be performed, and frame data that matches a certain frame data in the first data file of target module A will be searched in the second data file of target module B. In addition, during the recharging process, "situation 2" may also occur, that is, a certain data file of the reference module has been recharged, but some frame data in the corresponding data files of other target modules have not been recharged. At this time, the file switch will be performed on the reference module, and the other target modules will continue to recharge the frame data in the current data file in chronological order. For example, in "Case 2", after the second data file of target module A is injected back, it will switch to its third data file. However, for target module C, it still searches the second data file for frame data that matches the frame data of the third data file of target module A.

[0089] In this embodiment, by determining the reference module and the sub-module, the data re-injection operation can be performed more effectively, ensuring that the data between different modules can be correctly and efficiently integrated and synchronized, thereby improving the performance and stability of the entire system. By searching for frame data that matches the g-th frame data of the reference module in the sub-module through the target frame error, it can be ensured that the frame data read from the sub-module is close enough in time to the g-th frame data of the reference module, so that subsequent data synchronization or analysis operations can be performed. In addition, when performing data re-injection, the continuity of the data is very important. If the frame data in a sub-module that is within the target frame error with the g-th frame data cannot be obtained in time due to network delays, file reading errors, etc., the frame data of the last re-injection in the sub-module is used, which can maintain the continuity of the data stream and avoid interruption of data re-injection or errors due to missing data.

[0090] Combination of the above Figures 1 to 5 , describes in detail the data re-injection method embodiment of the present application, and the following is combined with Figure 6 , the data recharging device embodiment of the present application is described in detail. It should be understood that the description of the data recharging method embodiment corresponds to the description of the data recharging device embodiment, so the parts not described in detail can refer to the previous method embodiment.

[0091] Figure 6 FIG. 1 is a schematic diagram of the structure of a data recharging device provided by an embodiment of the present application. Figure 6As shown, the data recharging device 60 provided in the embodiment of the present application includes:

[0092] A determination module 610 is used to determine N data files of each of the M target modules, each data file includes timestamp information, and the N data files are arranged from the first data file to the Nth data file according to their respective timestamp information, and M and N are both positive integers;

[0093] A data alignment module 620, configured to align the first data files of the M target modules based on the timestamp information of the initial frame data of the first data files of the M target modules;

[0094] The refill module 630 is used to synchronously refill the frame data in the N data files of the M target modules to the target domain controller in sequence based on the aligned first data files of the M target modules.

[0095] In one embodiment of the present application, the determination module 610 is also used to obtain P data files, where P is a positive integer greater than N; traverse the timestamp information of the P data files, and divide the data files with the same timestamp information into the same group of data files to obtain K groups of data files, where K is a positive integer; classify the data files in the K groups of data files according to the type of the target module to obtain N data files for each of the M target modules.

[0096] In one embodiment of the present application, the determination module 610 is also used to traverse the timestamp information of P data files, divide the data files with the same timestamp information into the same group of data files, and obtain L groups of data files, where L is a positive integer greater than or equal to K; among the L groups of data files, if a group of data files contains M target modules, then the group of data files is retained; if a group of data files lacks any one of the M target modules, then the group of data files is deleted, so as to obtain K groups of data files from the L groups of data files.

[0097] In one embodiment of the present application, the data alignment module 620 is also used to determine, based on the timestamp information of the initial frame data of the first data files of each of the M target modules, the reference frame data with the largest timestamp information from the initial frame data of the first data files of each of the M target modules; determine the reference module from the M target modules; if the timestamp information of the initial frame data of the reference module is less than the timestamp information of the reference frame data, time-shift the first data file of the reference module until the timestamp information of the first data file of the reference module is not less than the timestamp information of the reference frame data.

[0098] In one embodiment of the present application, the re-injection module 630 is also used to, in the process of re-injecting the i-th data file of each of the M target modules to the target domain controller, determine a reference module and a sub-module from the M target modules, 1≤i≤N; determine the g-th frame data from the reference module, and based on the timestamp information of the g-th frame data, read the frame data whose timestamp information is within the target frame error from the sub-module; if the reading is successful, the g-th frame data in the reference module and the frame data whose timestamp information is within the target frame error with the timestamp information of the g-th frame data in the sub-module are synchronously re-injected to the target domain controller.

[0099] In one embodiment of the present application, the re-injection module 630 is also used to, if the reading is unsuccessful, cyclically read the frame data whose timestamp information is within the target file error with the g-th frame data from the secondary module until the number of cyclic readings reaches the target number threshold, wherein the target file error increases with the increase in the number of cyclic readings; if the frame data whose timestamp information is within the target file error with the g-th frame data is successfully read from the secondary module before the number of cyclic readings reaches the target number threshold, then the g-th frame data in the reference module and the frame data in the secondary module that are synchronously re-injected with the g-1-th frame data of the reference module are synchronously re-injected to the target domain controller.

[0100] In one embodiment of the present application, the re-injection module 630 is also used to, if frame data whose timestamp information is within the target file error with the g-th frame data has not been successfully read from the secondary module when the number of cyclic readings reaches the target number threshold, then determine that the re-injection of the i-th data file of the secondary module is completed and switch to the i+1-th data file of the secondary module; determine the frame data whose timestamp information is within the target frame error with the g-th frame data from the i+1-th data file of the secondary module, and synchronously re-inject the g-th frame data in the reference module and the frame data whose timestamp information is within the target frame error determined in the i+1-th data file of the secondary module to the target domain controller.

[0101] Below, reference Figure 7 To describe an electronic device according to an embodiment of the present application. Figure 7 Shown is a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present application.

[0102] like Figure 7 As shown, the electronic device 70 includes one or more processors 701 and a memory 702 .

[0103] The processor 701 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 70 to perform desired functions.

[0104] The memory 702 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 701 may run the program instructions to implement the data recharge method of each embodiment of the present application described above and / or other desired functions. Various contents such as N data files including each of the M target modules, timestamp information of the data files, frame data in each data file, etc. may also be stored in the computer-readable storage medium.

[0105] In one example, the electronic device 70 may further include: an input device 703 and an output device 704, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0106] The input device 703 may include, for example, a keyboard, a mouse, etc.

[0107] The output device 704 can output various information to the outside, including N data files of each of the M target modules, timestamp information of the data files, frame data in each data file, etc. The output device 704 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.

[0108] Of course, to simplify, Figure 7 Only some of the components related to the present application in the electronic device 70 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application conditions, the electronic device 70 may also include any other appropriate components.

[0109] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the data re-injection method according to various embodiments of the present application described above in this specification.

[0110] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0111] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the data re-injection method according to various embodiments of the present application described above in this specification.

[0112] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0113] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, not for limitation, and the above details do not limit the present application to being implemented by adopting the above specific details.

[0114] The block diagrams of the devices, apparatuses, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.

[0115] It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.

[0116] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0117] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A data re-injection method, characterized in that: include: Determine N data files of each of the M target modules, each of the data files includes timestamp information, and the N data files are arranged from a first data file to an Nth data file according to their respective timestamp information, and both M and N are positive integers; Based on the timestamp information of the initial frame data of the first data files of the M target modules, aligning the first data files of the M target modules respectively; Based on the aligned first data files of the M target modules, synchronously injecting frame data in the N data files of the M target modules to the target domain controller in sequence; The step of synchronously feeding the frame data in the N data files of the M target modules to the target domain controller in sequence includes: In the process of injecting the i-th data file of each of the M target modules back to the target domain controller, determining a reference module and a secondary module from the M target modules, 1≤i≤N; Determine the g-th frame data from the reference module, and based on the timestamp information of the g-th frame data, read the frame data whose timestamp information is within a target frame error from the secondary module; If the reading is successful, the g-th frame data in the reference module and the frame data in the secondary module with the timestamp information of the g-th frame data within the target frame error are synchronously fed back to the target domain controller; If the reading is unsuccessful, frame data whose timestamp information is within the target file error from the sub-module is cyclically read until the number of cyclic readings reaches a target number threshold, wherein the target file error increases with the increase in the number of cyclic readings; If frame data whose timestamp information is within the target file error range with respect to the g-th frame data is successfully read from the secondary module before the number of cyclic readings reaches the target number threshold, the g-th frame data in the reference module and the frame data in the secondary module that are synchronously re-injected with the g-1-th frame data of the reference module are synchronously re-injected to the target domain controller; The target frame error represents a time tolerance range between frames; the target file error is a time tolerance range used to determine whether the i-th data file of the secondary module has ended.

2. The data re-injection method according to claim 1, characterized in that: The determining of the N data files of the respective M target modules includes: Get P data files, where P is a positive integer greater than N; Traversing the timestamp information of the P data files, dividing the data files with the same timestamp information into the same group of data files, so as to obtain K groups of data files, where K is a positive integer; The data files in the K groups of data files are classified according to the types of target modules to obtain N data files for each of the M target modules.

3. The data re-injection method according to claim 2, characterized in that: The traversing the timestamp information of the P data files and dividing the data files with the same timestamp information into the same group of data files to obtain K groups of data files includes: Traversing the timestamp information of the P data files, dividing the data files with the same timestamp information into the same group of data files, to obtain L groups of data files, where L is a positive integer greater than or equal to K; Among the L groups of data files, if a group of data files contains the M target modules, then the group of data files is retained; If a group of data files lacks any one of the M target modules, the group of data files is deleted so as to obtain the K group of data files from the L group of data files.

4. The data re-injection method according to any one of claims 1 to 3, characterized in that: The aligning the first data files of the M target modules based on the timestamp information of the initial frame data of the first data files of the M target modules respectively includes: Based on the timestamp information of the initial frame data of the first data files of the M target modules, determine the reference frame data with the earliest timestamp information from the initial frame data of the first data files of the M target modules; Determine a reference module from the M target modules; If the timestamp information of the initial frame data of the reference module is smaller than the timestamp information of the reference frame data, the first data file of the reference module is time-shifted until the timestamp information of the first data file of the reference module is not smaller than the timestamp information of the reference frame data.

5. The data re-injection method according to any one of claims 1 to 3, characterized in that: Also includes: If, when the number of cyclic readings reaches the target number threshold, frame data whose timestamp information of the g-th frame data is within the error of the target file has not been successfully read from the sub-module, it is determined that the i-th data file of the sub-module is finished being refilled, and the i+1-th data file of the sub-module is switched; Determine the frame data whose timestamp information is within the target frame error with respect to the g-th frame data from the i+1th data file of the secondary module, and synchronously feed back the g-th frame data in the reference module and the frame data whose timestamp information is within the target frame error with respect to the g-th frame data determined in the i+1th data file of the secondary module to the target domain controller.

6. A data refill device, characterized in that: include: A determination module, used to determine N data files of each of the M target modules, each of the data files comprising timestamp information, the N data files being arranged from a first data file to an Nth data file according to their respective timestamp information, and M and N being positive integers; A data alignment module, configured to align the first data files of the M target modules based on timestamp information of initial frame data of the first data files of the M target modules; A refill module, configured to synchronously refill the frame data in the respective N data files of the M target modules to the target domain controller in sequence based on the aligned respective first data files of the M target modules; The re-injection module is further used to, in the process of re-injecting the i-th data file of each of the M target modules to the target domain controller, determine a reference module and a secondary module from the M target modules, 1≤i≤N; determine the g-th frame data from the reference module, and based on the timestamp information of the g-th frame data, read the frame data whose timestamp information is within the target frame error from the secondary module; If the reading is successful, the g-th frame data in the reference module and the frame data in the secondary module whose timestamp information is within the target frame error are synchronously re-injected to the target domain controller; if the reading is unsuccessful, the frame data whose timestamp information is within the target file error are cyclically read from the secondary module until the number of cyclic readings reaches the target number threshold, wherein the target file error increases with the increase in the number of cyclic readings; if the frame data whose timestamp information is within the target file error is successfully read from the secondary module before the number of cyclic readings reaches the target number threshold, the g-th frame data in the reference module and the frame data in the secondary module that are synchronously re-injected with the g-1-th frame data of the reference module are synchronously re-injected to the target domain controller; wherein the target frame error represents a time tolerance range between frames; and the target file error is a time tolerance range used to determine whether the i-th data file of the secondary module has ended.

7. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the data re-injection method according to any one of claims 1 to 5.

8. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is used to execute the data re-injection method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Multi-sensor data file playback method, electronic equipment and storage medium

    CN112988669A

  • Multi-type log data processing method, multi-type log data playing method and related equipment

    CN114724276A