Data smoothing method and device, computer equipment and storage medium
By introducing a signal cache queue and a smoothing time window into the data smoothing processing method, the problem of complex and inefficient vehicle data smoothing processing in the prior art is solved, and more efficient data smoothing processing is achieved.
Patent Information
- Application Number
- CN202311633430.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, data smoothing processing is performed for different types of vehicle configuration, resulting in complex and inefficient processing.
A data smoothing processing method is provided, by obtaining the electronic signal data reported by the vehicle and the target timestamp in the signal cache queue, based on the signal acquisition timestamp and the preset smoothing time window, the signal to be smoothed in the signal cache queue, and the signal to be smoothed.
This method can improve the efficiency of data smoothing processing, simplify the processing flow, be suitable for different types of vehicle data, and effectively process signals with vacant values.
Smart Images

Figure CN120067526A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and particularly to a data smoothing processing method, apparatus, computer device, storage medium, and computer program product. Background Art
[0002] Vehicles connected to a big data platform vary in terms of model, software version, data collection function, data collection frequency, etc. In the prior art, a set of methods is configured for each type of vehicle for smoothing, and this method has a complex processing process and low efficiency. Summary of the Invention
[0003] Based on this, in view of the above technical problems, it is necessary to provide a data smoothing processing method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the efficiency of smoothing processing.
[0004] In a first aspect, the present application provides a data smoothing processing method, including:
[0005] Obtain electronic signal data reported by a vehicle, where the electronic signal data includes signal values under multiple signal dimensions and a signal acquisition timestamp;
[0006] Obtain a target timestamp in a signal record at the head of a signal buffer queue, where each signal record in the signal buffer queue is arranged in the order of timestamps, and each signal record includes a timestamp and a signal value under a preset signal dimension;
[0007] When the signal acquisition timestamp is greater than or equal to the target timestamp, based on the signal acquisition timestamp and a preset smoothing time window, search for a signal record to be smoothed in the signal buffer queue, and perform smoothing processing on the signal record to be smoothed based on the signal values under multiple signal dimensions.
[0008] In one embodiment, searching for a signal record to be smoothed in the signal buffer queue based on the signal acquisition timestamp and a preset smoothing time window includes: matching the signal acquisition timestamp with the timestamp in each signal record in the signal buffer queue respectively; when the matching is successful, update the signal value in the signal record with the successful matching using the signal values under multiple signal dimensions to obtain an updated signal record, and search for a signal record to be smoothed in the signal buffer queue based on the updated signal record and the preset smoothing time window; when the matching fails, generate a target signal record based on the electronic signal data, insert the target signal record into the signal buffer queue based on the signal acquisition timestamp to obtain an inserted signal record, and search for a signal record to be smoothed in the signal buffer queue based on the inserted signal record and the preset smoothing time window.
[0009] In one embodiment, based on the updated signal record and a preset smoothing time window, finding the signal record to be smoothed in the signal cache queue includes: determining whether the updated signal record is at the head of the signal cache queue; if so, determining the backward smoothing range based on the timestamp in the updated signal record and the preset smoothing time window; finding, among the signal records following the updated signal record in the signal cache queue, the signal records whose timestamps are within the backward smoothing range as the signal records to be smoothed; if not, determining the forward smoothing range and the backward smoothing range based on the timestamp in the updated signal record and the preset smoothing time window; finding, among the signal records preceding the updated signal record in the signal cache queue, the signal records whose timestamps are within the forward smoothing range as the first signal records; finding, among the signal records following the updated signal record in the signal cache queue, the signal records whose timestamps are within the backward smoothing range as the second signal records, and taking both the first signal records and the second signal records as the signal records to be smoothed.
[0010] In one embodiment, based on the inserted signal record and a preset smoothing time window, finding the signal record to be smoothed in the signal cache queue includes: determining the forward smoothing range and the backward smoothing range based on the timestamp in the inserted signal record and the preset smoothing time window; finding, among the signal records preceding the inserted signal record in the signal cache queue, the signal records whose timestamps are within the forward smoothing range as the third signal records; finding, among the signal records following the inserted signal record in the signal cache queue, the signal records whose timestamps are within the backward smoothing range as the fourth signal records, and taking both the third signal records and the fourth signal records as the signal records to be smoothed.
[0011] In one embodiment, smoothing the signal record to be smoothed based on the signal values in multiple signal dimensions includes: obtaining a value identification queue corresponding to the signal cache queue, where the identification records in the value identification queue correspond one-to-one with the signal records in the signal cache queue, and each identification record contains the value identification information of each signal in the corresponding signal record; finding the identification information of each signal in the signal record to be smoothed from the value identification queue, and screening out the signals with null value identification information as the signals to be filled; filling the signals to be filled with the signal values in multiple signal dimensions.
[0012] In one embodiment, the target signal record is inserted into the signal buffer queue based on the signal acquisition timestamp to obtain the inserted signal record. Based on the inserted signal record and the preset smoothing time window, the signal record to be smoothed is searched for in the signal buffer queue. After smoothing the signal record to be smoothed based on the signal values in multiple signal dimensions, the method further includes: determining whether the number of signal records cached in the signal buffer queue reaches the preset cache quantity threshold. If so, the signal record at the head of the signal buffer queue is stored in the database, and the signal record at the head of the signal buffer queue is deleted.
[0013] In a second aspect, the present application further provides a data smoothing processing device, including:
[0014] A first acquisition module, configured to acquire the electronic signal data reported by the vehicle, where the electronic signal data includes signal values in multiple signal dimensions and the signal acquisition timestamp;
[0015] A second acquisition module, configured to acquire the target timestamp in the signal record at the head of the signal buffer queue, where the signal records in the signal buffer queue are arranged in the order of the timestamps, and each signal record includes a timestamp and a signal value in a preset signal dimension;
[0016] A smoothing module, configured to, when the signal acquisition timestamp is greater than or equal to the target timestamp, search for the signal record to be smoothed in the signal buffer queue based on the signal acquisition timestamp and the preset smoothing time window, and smooth the signal record to be smoothed based on the signal values in multiple signal dimensions.
[0017] In a third aspect, the present application further provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0018] Acquire the electronic signal data reported by the vehicle, where the electronic signal data includes signal values in multiple signal dimensions and the signal acquisition timestamp;
[0019] Acquire the target timestamp in the signal record at the head of the signal buffer queue, where the signal records in the signal buffer queue are arranged in the order of the timestamps, and each signal record includes a timestamp and a signal value in a preset signal dimension;
[0020] When the signal acquisition timestamp is greater than or equal to the target timestamp, search for the signal record to be smoothed in the signal buffer queue based on the signal acquisition timestamp and the preset smoothing time window, and smooth the signal record to be smoothed based on the signal values in multiple signal dimensions.
[0021] Fourthly, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0022] Obtain the electronic signal data reported by the vehicle, where the electronic signal data includes signal values under multiple signal dimensions and a signal acquisition timestamp;
[0023] Obtain the target timestamp in the signal record at the head of the signal buffer queue. The signal records in the signal buffer queue are arranged in the order of timestamps. Each signal record includes a timestamp and signal values under a preset signal dimension;
[0024] When the signal acquisition timestamp is greater than or equal to the target timestamp, based on the signal acquisition timestamp and a preset smoothing time window, search for the signal record to be smoothed in the signal buffer queue, and perform smoothing processing on the signal record to be smoothed based on the signal values under multiple signal dimensions.
[0025] Fifthly, the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0026] Obtain the electronic signal data reported by the vehicle, where the electronic signal data includes signal values under multiple signal dimensions and a signal acquisition timestamp;
[0027] Obtain the target timestamp in the signal record at the head of the signal buffer queue. The signal records in the signal buffer queue are arranged in the order of timestamps. Each signal record includes a timestamp and signal values under a preset signal dimension;
[0028] When the signal acquisition timestamp is greater than or equal to the target timestamp, based on the signal acquisition timestamp and a preset smoothing time window, search for the signal record to be smoothed in the signal buffer queue, and perform smoothing processing on the signal record to be smoothed based on the signal values under multiple signal dimensions.
[0029] The above data smoothing method, device, computer device, storage medium and computer program product. The streaming data processing device in the big data platform can read the cached data in the real-time data stream engine service, and use this cached data as the electronic signal data to be processed. The streaming data processing device can obtain the target timestamp in the signal record at the head of the signal cache queue. The signal records in the signal cache queue are arranged in the order of timestamps. Each signal record includes a timestamp and a signal value under a preset signal dimension. When the signal acquisition timestamp in the electronic signal data is greater than or equal to the target timestamp, based on the signal acquisition timestamp and the preset smoothing time window, search for the signal record to be smoothed in the signal cache queue, and smooth the signal record to be smoothed based on the signal values under multiple signal dimensions. It can integrate the data reported by different types of vehicles, solve the problem of difficult heterogeneous signal data processing, and can also smooth the signals with missing values, providing a data basis for subsequent data analysis. Moreover, the above introduction of the signal cache queue for streaming smoothing processing greatly improves the data smoothing efficiency. Description of the Drawings
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0031] Figure 1 It is a framework diagram of the data smoothing method in an embodiment;
[0032] Figure 2 It is a flowchart of the data smoothing method in an embodiment;
[0033] Figure 3 It is a flowchart of the data smoothing method in another embodiment;
[0034] Figure 4 It is a structural block diagram of the data smoothing device in an embodiment;
[0035] Figure 5 It is an internal structure diagram of a computer device in an embodiment. Detailed Embodiments
[0036] In order to make the purpose, technical solutions and advantages of the present application clearer, the following further details the present application in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0037] The data smoothing processing method provided by the embodiments of this application can be applied to Figure 1 the framework shown in Figure 1 The framework shown includes an in-vehicle data acquisition system and a big data platform. The in-vehicle data acquisition system is a component of the vehicle. The in-vehicle data acquisition system includes an Electronic Control Unit (ECU), a Vehicle Gateway Module (VGM), and a Telematics&Connectivity Antenna Module (TCAM). The big data platform includes a real-time data stream engine service, such as DataHub; it also includes a streaming data processing device. The streaming data processing device can adopt a streaming data processing framework, such as Flink; it also includes a database, such as Hologres.
[0038] Among them, the ECU is used to collect signal values of the vehicle in multiple signal dimensions. The multiple signal dimensions can include, for example, engine temperature, vehicle speed, torque, accelerator pedal depression degree, etc. The ECU can transmit the collected signal values and signal acquisition timestamps to the VGM, and the VGM further transmits them to the TCAM. The TCAM encapsulates the signal values and signal acquisition timestamps according to the communication protocol to obtain a signal reporting message, and sends the signal reporting message to the real-time data stream engine service in the big data platform. The real-time data stream engine service decodes the signal reporting message based on the communication protocol to obtain the signal values and signal acquisition timestamps in multiple signal dimensions. The ECU can collect the signal values of the vehicle in multiple signal dimensions at a configured frequency. For example, it can be collected once every 1s, once every 5s, etc. After each collection of the signal values in multiple signal dimensions, the above process is performed.
[0039] It can be understood that there are many vehicles connected to the big data platform. The above process is only an interaction process between one vehicle and the big data platform. Each vehicle connected to the big data platform can interact with the big data platform according to the above process. The frequencies at which the ECU in each vehicle connected to the big data platform collects signal values can be the same or different. The real-time data stream engine service can cache each decoded signal value and signal acquisition timestamp as a piece of cached data, and all the cached data is arranged in the order of the signal acquisition timestamps.
[0040] Among them, the streaming data processing device can read the cached data from the real-time data stream engine service, execute the data smoothing processing method provided by the embodiments of the present application based on the read cached data, and the database can be used to store the data after smoothing processing. The data in the database can be used for online data analysis and real-time data services. The data smoothing processing method provided by the present application will be described in detail below in combination with specific embodiments.
[0041] In an exemplary embodiment, as Figure 2 shown, a data smoothing processing method is provided. Taking the method applied to the Figure 1 streaming data processing device therein as an example, it includes the following steps 202 to step 206. Among them:
[0042] Step 202, obtain the electronic signal data reported by the vehicle. The electronic signal data includes signal values under multiple signal dimensions and signal acquisition timestamps.
[0043] Among them, the streaming data processing device can use the cached data in the real-time data stream engine service as the electronic signal data. As described above, the cached data in the real-time data stream engine service is reported by the vehicle connected to the big data platform. All the cached data in the real-time data stream engine service is arranged in the order of the signal acquisition timestamps. Each cached data can be read one by one from the real-time data stream engine service according to the arrangement order of all the cached data, and the read cached data is used as the electronic signal data in this step.
[0044] Among them, the electronic signal data includes signal values under multiple signal dimensions and signal acquisition timestamps. Here, the multiple signal dimensions are related to the configuration of the corresponding vehicle. In the case where the vehicle is configured with N signal acquisition functions, the multiple signal dimensions here are the N signal dimensions corresponding to the N signal acquisition functions.
[0045] Exemplarily, in the case where the vehicle is configured with an engine temperature acquisition function, a vehicle speed acquisition function, a torque acquisition function, and an accelerator pedal depression degree acquisition function, the multiple signal dimensions can be engine temperature, vehicle speed, torque, accelerator pedal depression degree, etc.
[0046] Step 204, obtain the target timestamp in the signal record at the head of the signal cache queue. Each signal record in the signal cache queue is arranged in the order of timestamps, and each signal record includes a timestamp and a signal value under a preset signal dimension.
[0047] Among them, the signal cache queue is used to cache signal records. Each signal record includes a timestamp and signal values under a preset signal dimension. The signal records in the signal cache queue are arranged in the order of the timestamps. It should be noted that: the preset signal dimension here includes multiple signal dimensions in step 202. The preset signal dimension here can be the union of the signal dimensions in all cached data, or can be the union of the signal dimensions corresponding to the signal acquisition functions determined based on the configurations of all vehicles connected to the big data platform. The union here is the union of the signal dimensions corresponding to each signal acquisition function.
[0048] Among them, each signal record in the signal cache queue includes a timestamp and signal values under a preset signal dimension. The timestamp in the signal record at the head of the queue in the signal cache queue can be used as the target timestamp.
[0049] Step 206: When the signal acquisition timestamp is greater than or equal to the target timestamp, based on the signal acquisition timestamp and a preset smoothing time window, search for the signal record to be smoothed in the signal cache queue, and smooth the signal record to be smoothed based on the signal values under multiple signal dimensions.
[0050] Among them, after obtaining the electronic signal data in step 202, extract the signal acquisition timestamp in the electronic signal data, compare the signal acquisition timestamp with the target timestamp obtained in step 204. When the signal acquisition timestamp is less than the target timestamp, directly store the electronic signal data in the database; when the signal acquisition timestamp is greater than or equal to the target timestamp, based on the signal acquisition timestamp and a preset smoothing time window, search for the signal record to be smoothed in the signal cache queue, and smooth the signal record to be smoothed based on the signal values under multiple signal dimensions.
[0051] Among them, the smoothing time window can be flexibly set according to the actual situation. Exemplarily, the smoothing time window can be 2s. The embodiments of the present application do not limit this.
[0052] Among them, the streaming data processing device can determine a reference signal record in the signal cache queue based on the signal acquisition timestamp in step 202, search for the signal record to be smoothed in the signal cache queue based on the reference signal record and a preset smoothing time window, and further smooth the signal record to be smoothed based on the signal values under multiple signal dimensions.
[0053] In the above embodiments, the streaming data processing device in the big data platform can read the cached data in the real-time data stream engine service, and use the cached data as the electronic signal data to be processed. The streaming data processing device can obtain the target timestamp in the signal record at the head of the signal cache queue. Each signal record in the signal cache queue is arranged in the order of the timestamps. Each signal record includes a timestamp and signal values under preset signal dimensions. When the signal acquisition timestamp in the electronic signal data is greater than or equal to the target timestamp, based on the signal acquisition timestamp and the preset smoothing time window, search for the signal record to be smoothed in the signal cache queue, and smooth the signal record to be smoothed based on the signal values under multiple signal dimensions. It can integrate the data reported by different types of vehicles, solve the problem of difficult heterogeneous signal data processing, and can also smooth the signals with missing values, providing a data basis for subsequent data analysis. Moreover, the above introduction of the signal cache queue for streaming smoothing processing greatly improves the data smoothing efficiency.
[0054] In some embodiments, the step of searching for the signal record to be smoothed in the signal cache queue based on the signal acquisition timestamp and the preset smoothing time window specifically includes: matching the signal acquisition timestamp with the timestamps in each signal record in the signal cache queue respectively; when the matching is successful, use the signal values under multiple signal dimensions to update the signal values in the successfully matched signal record to obtain the updated signal record, and based on the updated signal record and the preset smoothing time window, search for the signal record to be smoothed in the signal cache queue; when the matching fails, generate a target signal record based on the electronic signal data, insert the target signal record into the signal cache queue based on the signal acquisition timestamp to obtain the inserted signal record, and based on the inserted signal record and the preset smoothing time window, search for the signal record to be smoothed in the signal cache queue.
[0055] Among them, the signal cache queue is used to cache signal records. Each signal record includes a timestamp and signal values under preset signal dimensions. Each signal record in the signal cache queue is arranged in the order of the timestamps. After obtaining the electronic signal data, extract the signal acquisition timestamp in the electronic signal data, compare the signal acquisition timestamp with the target timestamp. When the signal acquisition timestamp is greater than or equal to the target timestamp, further match the signal acquisition timestamp with the timestamps in each signal record in the signal cache queue respectively. When the matching is successful, use the signal values under multiple signal dimensions to replace the corresponding signal values in the successfully matched signal record, so as to obtain the updated signal record, and based on the updated signal record and the preset smoothing time window, search for the signal record to be smoothed in the signal cache queue.
[0056] In the case where the signal acquisition timestamp fails to match the timestamps in each signal record in the signal buffer queue, a signal record is generated based on the signal acquisition timestamp included in the electronic signal data and the signal values in multiple signal dimensions. For the convenience of description, in the embodiments of the present application, this signal record is referred to as the target signal record. Since the signal records in the signal buffer queue are arranged in the order of timestamps, the target signal record can be inserted into the signal buffer queue according to the signal acquisition timestamp and the timestamps in each signal record in the signal buffer queue to obtain the inserted signal record. Based on the inserted signal record and the pre-set smoothing time window, the signal record to be smoothed is searched for in the signal buffer queue.
[0057] In the above embodiment, when the signal acquisition timestamp is greater than or equal to the target timestamp in the signal record at the head of the signal buffer queue, it is further checked whether the signal acquisition timestamp already exists in the signal buffer queue. If it exists, the corresponding signal record is updated to obtain the updated signal record. Based on the updated signal record and the pre-set smoothing time window, the signal record to be smoothed is searched for in the signal buffer queue; if it does not exist, a target signal record is generated based on the obtained electronic signal data, the target signal record is inserted into the signal buffer queue according to the signal acquisition timestamp to obtain the inserted signal record, and based on the inserted signal record and the pre-set smoothing time window, the signal record to be smoothed is searched for in the signal buffer queue. Subsequently, the signal record to be smoothed is smoothed based on the signal values in multiple signal dimensions in the electronic signal data, providing a data basis for subsequent data analysis.
[0058] In some embodiments, the step of searching for the signal record to be smoothed in the signal buffer queue based on the updated signal record and the pre-set smoothing time window includes: determining whether the updated signal record is at the head of the signal buffer queue; if so, determining the backward smoothing range based on the timestamp in the updated signal record and the pre-set smoothing time window; searching for the signal record whose timestamp is within the backward smoothing range among the signal records after the updated signal record in the signal buffer queue as the signal record to be smoothed; if not, determining the forward smoothing range and the backward smoothing range based on the timestamp in the updated signal record and the pre-set smoothing time window; searching for the signal record whose timestamp is within the forward smoothing range among the signal records before the updated signal record in the signal buffer queue as the first signal record; searching for the signal record whose timestamp is within the backward smoothing range among the signal records after the updated signal record in the signal buffer queue as the second signal record, and taking both the first signal record and the second signal record as the signal records to be smoothed.
[0059] Among them, the streaming data processing device in the big data platform matches the signal acquisition timestamps with the timestamps in each signal record in the signal cache queue respectively. In the case of successful matching, it uses the signal values in multiple signal dimensions to replace the signal values in the corresponding signal dimensions of the successfully matched signal record, so as to obtain the updated signal record. Further, it determines whether the updated signal record is at the head of the signal cache queue. If it is at the head, it adds the preset smoothing time window to the timestamp in the updated signal record and smooths the maximum timestamp backward. Based on the timestamp in the updated signal record and the backward-smoothed maximum timestamp, it determines the backward smoothing range, and searches for the signal records whose timestamps are within the backward smoothing range among the signal records following the updated signal record in the signal cache queue as the signal records to be smoothed.
[0060] Exemplarily, assume that the timestamp in the updated signal record is 8s and the preset smoothing time window is 2s. Then the backward-smoothed maximum timestamp is 8 + 2 = 10s, and the backward smoothing range is (8s, 10s].
[0061] If the updated signal record is not at the head of the signal cache queue, based on the timestamp in the updated signal record and the preset smoothing time window, it determines the forward-smoothed maximum timestamp and the backward-smoothed maximum timestamp. Based on the timestamp in the updated signal record and the forward-smoothed maximum timestamp, it determines the forward smoothing range. Based on the timestamp in the updated signal record and the backward-smoothed maximum timestamp, it determines the backward smoothing range. It searches for the signal records whose timestamps are within the forward smoothing range among the signal records preceding the updated signal record in the signal cache queue as the first signal record; it searches for the signal records whose timestamps are within the backward smoothing range among the signal records following the updated signal record in the signal cache queue as the second signal record, and takes both the first signal record and the second signal record as the records to be smoothed.
[0062] Exemplarily, assume that the timestamp in the updated signal record is 8s and the preset smoothing time window is 2s. Then the forward-smoothed maximum timestamp is 8 - 2 = 6s, the forward smoothing range is [6s, 8s), the backward-smoothed maximum timestamp is 8 + 2 = 10s, and the backward smoothing range is (8s, 10s].
[0063] In the above embodiments, after obtaining the updated signal record, it is further determined whether the updated signal record is at the head of the signal cache queue; if it is at the head, only backward smoothing is required, and if it is not at the head, both forward and backward smoothing are performed, which can achieve the filling of missing values and prepare data for subsequent data analysis and other tasks.
[0064] In some embodiments, the step of finding the signal record to be smoothed in the signal buffer queue based on the inserted signal record and the preset smoothing time window includes: determining the forward smoothing range and the backward smoothing range based on the timestamp in the inserted signal record and the preset smoothing time window; finding, among the signal records preceding the inserted signal record in the signal buffer queue, the signal records whose timestamps are within the forward smoothing range as the third signal records; finding, among the signal records following the inserted signal record in the signal buffer queue, the signal records whose timestamps are within the backward smoothing range as the fourth signal records, and taking both the third signal records and the fourth signal records as the records to be smoothed.
[0065] As described in the foregoing embodiments, in the case where the signal acquisition timestamp fails to match the timestamps in each signal record in the signal buffer queue, a target signal record is generated based on the signal acquisition timestamp included in the electronic signal data and the signal values in multiple signal dimensions. Since the signal records in the signal buffer queue are arranged in the order of timestamps, the target signal record can be inserted into the signal buffer queue according to the signal acquisition timestamp and the timestamps in each signal record in the signal buffer queue to obtain the inserted signal record. Then, based on the timestamp in the inserted signal record and the preset smoothing time window, the forward smoothing range and the backward smoothing range are determined. Exemplarily, assuming that the timestamp in the inserted signal record is 8 s and the preset smoothing time window is 2 s, the maximum forward smoothing timestamp is 8 - 2 = 6 s, the backward smoothing range is [6 s, 8 s), the maximum backward smoothing timestamp is 8 + 2 = 10 s, and the backward smoothing range is (8 s, 10 s]. Among the signal records preceding the inserted signal record in the signal buffer queue, the signal records whose timestamps are within [6 s, 8 s) are found as the third signal records; among the signal records following the inserted signal record in the signal buffer queue, the signal records whose timestamps are within (8 s, 10 s] are found as the fourth signal records, and both the third signal records and the fourth signal records are taken as the records to be smoothed.
[0066] In the foregoing embodiments, after obtaining the inserted signal record, the signal record to be smoothed is found in the signal buffer queue based on the inserted signal record and the preset smoothing time window, and the signal record to be smoothed is smoothed, so as to fill in the missing values and prepare data for subsequent data analysis and other tasks.
[0067] In some embodiments, the step of smoothing a signal record to be smoothed based on signal values in multiple signal dimensions includes: obtaining a value identification queue corresponding to the signal buffer queue, where the identification records in the value identification queue correspond one-to-one with the signal records in the signal buffer queue, and each identification record includes value identification information of each signal in the corresponding signal record; searching for the identification information of each signal in the signal record to be smoothed from the value identification queue, and screening out the signals with null value identification information as the signals to be filled; using the signal values in multiple signal dimensions to fill the values of the signals to be filled.
[0068] Among them, both the signal buffer queue and the value identification queue can be stored in a pre-configured cache space. The identification records in the value identification queue correspond one-to-one with the signal records in the signal buffer queue. Each identification record includes value identification information of each signal in the corresponding signal record, and the value identification information may be a null value, a true value, or a filled value. The signal record to be smoothed may include multiple signal records. For each signal record, the value identification information of each signal in the signal record can be searched from the value identification queue, and the signals with null value identification information are screened out as the signals to be filled. The signals to be filled are searched from multiple signal dimensions included in the electronic signal data, and the values of the signals to be filled in the electronic signal data are filled into the signals to be filled in the signal record.
[0069] In the above embodiments, the specific process of smoothing is introduced. This smoothing method can achieve the filling of missing values and prepare data for subsequent data analysis and other tasks.
[0070] In some embodiments, after inserting a target signal record into the signal buffer queue based on the signal acquisition timestamp to obtain an inserted signal record, searching for the signal record to be smoothed in the signal buffer queue based on the inserted signal record and a pre-set smoothing time window, and smoothing the signal record to be smoothed based on the signal values in multiple signal dimensions, the data smoothing method provided by the embodiments of the present application further includes: determining whether the number of signal records cached in the signal buffer queue reaches a pre-set cache quantity threshold. If so, the signal record at the head of the signal buffer queue is stored in the database, and the signal record at the head of the signal buffer queue is deleted.
[0071] Among them, a cache quantity threshold can be pre-configured for the signal buffer queue. After inserting the target signal record into the signal buffer queue and completing the smoothing process, it can be determined whether the number of signal records cached in the signal buffer queue reaches the cache quantity threshold. If it reaches, the signal record at the head of the signal buffer queue is stored in the database, and the signal record at the head of the signal buffer queue is deleted, so as to ensure that the number of signal records in the signal buffer queue is below the cache quantity threshold and improve the data smoothing efficiency.
[0072] In the above embodiments, after inserting the target signal record into the signal buffer queue, it is determined whether the number of signal records cached in the signal buffer queue reaches a preset cache quantity threshold. If so, the signal record at the head of the signal buffer queue is stored in the database, and the signal record at the head of the signal buffer queue is deleted, ensuring that the number of signal records in the signal buffer queue is below the cache quantity threshold and improving the data smoothing efficiency.
[0073] In some embodiments, referring to Figure 3 as shown, a data smoothing processing method is provided, including:
[0074] Obtain the electronic signal data reported by the vehicle, and determine whether the signal acquisition timestamp in the electronic signal data is less than the target timestamp in the signal record at the head of the signal cache queue. If so, directly store the electronic signal data in the database and then process the next piece of data. If not, check whether the signal acquisition timestamp already exists in the signal cache queue. If it already exists, update the existing signal record to obtain the updated signal record. Further, determine whether the updated signal record is at the head of the signal cache queue. If it is at the head, perform backward smoothing processing, that is, execute the following steps: Determine the backward smoothing range based on the timestamp in the updated signal record and the pre-set smoothing time window; In each signal record after the updated signal record in the signal cache queue, find the signal record whose timestamp is within the backward smoothing range as the signal record to be smoothed, smooth the signal record to be smoothed based on the signal values under multiple signal dimensions, and then process the next piece of data; If it is not at the head, perform forward smoothing processing and backward smoothing processing, that is, execute the following steps: Determine the forward smoothing range and the backward smoothing range based on the timestamp in the updated signal record and the pre-set smoothing time window; In each signal record before the updated signal record in the signal cache queue, find the signal record whose timestamp is within the forward smoothing range as the first signal record; In each signal record after the updated signal record in the signal cache queue, find the signal record whose timestamp is within the backward smoothing range as the second signal record. Both the first signal record and the second signal record are used as the signal records to be smoothed, smooth the signal records to be smoothed based on the signal values under multiple signal dimensions, and then process the next piece of data; If the signal acquisition timestamp does not exist, generate a target signal record based on the electronic signal data, insert the target signal record into the signal cache queue based on the signal acquisition timestamp to obtain the inserted signal record, and perform forward smoothing processing and backward smoothing processing based on the inserted signal record, that is, execute the following steps: Determine the forward smoothing range and the backward smoothing range based on the timestamp in the inserted signal record and the pre-set smoothing time window; In each signal record before the inserted signal record in the signal cache queue, find the signal record whose timestamp is within the forward smoothing range as the third signal record; In each signal record after the inserted signal record in the signal cache queue, find the signal record whose timestamp is within the backward smoothing range as the fourth signal record. Both the third signal record and the fourth signal record are used as the signal records to be smoothed, smooth the signal records to be smoothed based on the signal values under multiple signal dimensions. In this branch, further, it can be determined whether the number of signal records cached in the signal cache queue reaches the pre-set cache quantity threshold. If so, store the signal record at the head of the signal cache queue in the database, delete the signal record at the head of the signal cache queue, and then process the next piece of data.
[0075] The data smoothing processing method provided by the embodiments of the present application will be described below in combination with a specific example.
[0076] It is assumed that the cache quantity threshold is configured to be 10 for the signal cache queue in advance, and the smoothing time window set in advance is 2 s. It is assumed that the signal records in the current signal cache queue are as shown in Table 1, and the value identification queue is as shown in Table 2. The streaming data processing device obtains an electronic signal data, and the acquisition timestamp in the electronic signal data is: 8 s. The electronic signal data also includes the signal values under signals A, B, C, D, and E. Referring to Table 1, it can be seen that there is a signal record with a timestamp of 8 s in the signal cache queue. Then, the signal values under signals A, B, C, D, and E in the electronic signal data are used to update the signal record with a timestamp of 8 s in the signal cache queue. The update result is as shown in Table 3. Since the signal values in the signal record with a timestamp of 8 s are updated to the true values, correspondingly, it is necessary to update the identification records corresponding to the signal record with a timestamp of 8 s in the value identification queue. The update result is as shown in Table 4. Referring to Table 3, the signal record with a timestamp of 8 s is not at the head of the signal cache queue. Based on the timestamp 8 s and the smoothing time window of 2 s set in advance, the forward smoothing range can be calculated as [6 s, 8 s), and the backward smoothing range is (8 s, 10 s]. Referring to Table 3, there is 1 signal record in the range of [6 s, 8 s): the signal record with a timestamp of 6 s; there are 2 signal records in the range of (8 s, 10 s]: the signal record with a timestamp of 9 s and the signal record with a timestamp of 10 s. The above 3 signal records can be used as the records to be smoothed. The identification information of each signal in the records to be smoothed can be found from the value identification queue, and the signals with null value identification information can be screened out as the signals to be filled. Combining Table 5 and Table 6, the signals to be filled include: signal E in the signal record with a timestamp of 6 s, signals A - E in the signal record with a timestamp of 9 s, and signals C and D in the signal record with a timestamp of 10 s. The value of signal E in the signal record with a timestamp of 8 s can be filled under signal E in the signal record with a timestamp of 6 s; the values of signals A - E in the signal record with a timestamp of 8 s can be filled under signals A - E in the signal record with a timestamp of 9 s; the values of signals C and D in the signal record with a timestamp of 8 s can be filled under signals C and D in the signal record with a timestamp of 10 s. The filled result is as shown in Table 7. Correspondingly, in the value identification queue: the value identification information corresponding to signal E in the signal record with a timestamp of 6 s, the value identification information corresponding to signals A - E in the signal record with a timestamp of 9 s, and the value identification information corresponding to signals C and D in the signal record with a timestamp of 10 s are updated to the filled value 0. The updated result is as shown in Table 8. Thus, the data smoothing processing process is completed.
[0077] Table 1
[0078]
[0079] Table 2
[0080]
[0081] Table 3
[0082]
[0083]
[0084] Table 4
[0085]
[0086] Table 5
[0087]
[0088] Table 6
[0089]
[0090] Table 7
[0091]
[0092] Table 8
[0093]
[0094]
[0095] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0096] Based on the same inventive concept, an embodiment of the present application further provides a data smoothing processing device for implementing the data smoothing processing method involved above. The solution provided by this device for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the data smoothing processing device provided below can refer to the limitations on the data smoothing processing method in the above text and will not be elaborated here.
[0097] In an exemplary embodiment, as Figure 4 shown, a data smoothing processing device is provided, including:
[0098] A first acquisition module 401, configured to acquire electronic signal data reported by a vehicle, where the electronic signal data includes signal values under multiple signal dimensions and a signal acquisition timestamp;
[0099] A second acquisition module 402, configured to acquire a target timestamp in the signal record at the head of the signal buffer queue. Each signal record in the signal buffer queue is arranged in the order of timestamps, and each signal record includes a timestamp and a signal value under a preset signal dimension;
[0100] A smoothing module 403, configured to, when the signal acquisition timestamp is greater than or equal to the target timestamp, based on the signal acquisition timestamp and a preset smoothing time window, search for a signal record to be smoothed in the signal buffer queue, and perform smoothing processing on the signal record to be smoothed based on the signal values under multiple signal dimensions.
[0101] In some embodiments, the smoothing module 403 is specifically configured to: match the signal acquisition timestamp with the timestamp in each signal record in the signal buffer queue respectively; in the case of a successful match, update the signal value in the successfully matched signal record with the signal values under multiple signal dimensions to obtain an updated signal record, and based on the updated signal record and a preset smoothing time window, search for a signal record to be smoothed in the signal buffer queue; in the case of a failed match, generate a target signal record based on the electronic signal data, insert the target signal record into the signal buffer queue based on the signal acquisition timestamp to obtain an inserted signal record, and based on the inserted signal record and a preset smoothing time window, search for a signal record to be smoothed in the signal buffer queue.
[0102] In some embodiments, the smoothing module 403 is specifically configured to: determine whether the updated signal record is at the head of the signal cache queue; if so, determine the backward smoothing range based on the timestamp in the updated signal record and the preset smoothing time window; in each signal record arranged after the updated signal record in the signal cache queue, search for the signal record whose timestamp is within the backward smoothing range as the signal record to be smoothed; if not, determine the forward smoothing range and the backward smoothing range based on the timestamp in the updated signal record and the preset smoothing time window; in each signal record arranged before the updated signal record in the signal cache queue, search for the signal record whose timestamp is within the forward smoothing range as the first signal record; in each signal record arranged after the updated signal record in the signal cache queue, search for the signal record whose timestamp is within the backward smoothing range as the second signal record, and use both the first signal record and the second signal record as the records to be smoothed.
[0103] In some embodiments, the smoothing module 403 is specifically configured to: determine the forward smoothing range and the backward smoothing range based on the timestamp in the inserted signal record and the preset smoothing time window; in each signal record arranged before the inserted signal record in the signal cache queue, search for the signal record whose timestamp is within the forward smoothing range as the third signal record; in each signal record arranged after the inserted signal record in the signal cache queue, search for the signal record whose timestamp is within the backward smoothing range as the fourth signal record, and use both the third signal record and the fourth signal record as the records to be smoothed.
[0104] In some embodiments, the smoothing module 403 is specifically configured to: obtain a value identification queue corresponding to the signal cache queue, where the identification records in the value identification queue correspond one-to-one with the signal records in the signal cache queue, and each identification record includes the value identification information of each signal in the corresponding signal record; search for the identification information of each signal in the signal record to be smoothed from the value identification queue, and filter out the signals with null value identification information as the signals to be filled; use the signal values in multiple signal dimensions to fill the values of the signals to be filled.
[0105] In some embodiments, the smoothing module 403 is further configured to: determine whether the number of signal records cached in the signal cache queue reaches the preset cache quantity threshold; if so, store the signal record at the head of the signal cache queue into the database, and delete the signal record at the head of the signal cache queue.
[0106] Each module in the above data smoothing processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor of the computer device in hardware form or independent thereof, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0107] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 5 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store signal records and value identification information. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a data smoothing processing method.
[0108] Those skilled in the art can understand that Figure 5 the structure shown in
[0109] is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0109] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0110] Obtain the electronic signal data reported by the vehicle. The electronic signal data includes signal values under multiple signal dimensions and a signal acquisition timestamp;
[0111] Obtain the target timestamp in the signal record at the head of the signal cache queue. Each signal record in the signal cache queue is arranged in the order of the timestamps. Each signal record includes a timestamp and a signal value under a preset signal dimension;
[0112] When the signal acquisition timestamp is greater than or equal to the target timestamp, based on the signal acquisition timestamp and the preset smoothing time window, search for the signal record to be smoothed in the signal buffer queue, and smooth the signal record to be smoothed based on the signal values in multiple signal dimensions.
[0113] In one embodiment, when the processor executes the computer program, the following steps are further implemented: match the signal acquisition timestamp with the timestamps in each signal record in the signal buffer queue respectively; in the case of successful matching, update the signal values in the successfully matched signal record using the signal values in multiple signal dimensions to obtain the updated signal record, and based on the updated signal record and the preset smoothing time window, search for the signal record to be smoothed in the signal buffer queue; in the case of failed matching, generate a target signal record based on the electronic signal data, insert the target signal record into the signal buffer queue based on the signal acquisition timestamp to obtain the inserted signal record, and based on the inserted signal record and the preset smoothing time window, search for the signal record to be smoothed in the signal buffer queue.
[0114] In one embodiment, when the processor executes the computer program, the following steps are further implemented: determine whether the updated signal record is at the head of the signal buffer queue; if so, determine the backward smoothing range based on the timestamp in the updated signal record and the preset smoothing time window; search for the signal record whose timestamp is within the backward smoothing range among the signal records arranged after the updated signal record in the signal buffer queue as the signal record to be smoothed; if not, determine the forward smoothing range and the backward smoothing range based on the timestamp in the updated signal record and the preset smoothing time window; search for the signal record whose timestamp is within the forward smoothing range among the signal records arranged before the updated signal record in the signal buffer queue as the first signal record; search for the signal record whose timestamp is within the backward smoothing range among the signal records arranged after the updated signal record in the signal buffer queue as the second signal record, and use both the first signal record and the second signal record as the records to be smoothed.
[0115] In one embodiment, when the processor executes the computer program, the following steps are further implemented: determine the forward smoothing range and the backward smoothing range based on the timestamp in the inserted signal record and the preset smoothing time window; search for the signal record whose timestamp is within the forward smoothing range among the signal records arranged before the inserted signal record in the signal buffer queue as the third signal record; search for the signal record whose timestamp is within the backward smoothing range among the signal records arranged after the inserted signal record in the signal buffer queue as the fourth signal record, and use both the third signal record and the fourth signal record as the records to be smoothed.
[0116] In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtaining a value identification queue corresponding to the signal cache queue, where the identification records in the value identification queue correspond one-to-one with the signal records in the signal cache queue, and each identification record includes the value identification information of each signal in the corresponding signal record; searching for the identification information of each signal in the signal record to be smoothed from the value identification queue, and screening out the signals with null value identification information as the signals to be filled; filling the signals to be filled with signal values in multiple signal dimensions.
[0117] In one embodiment, when the processor executes the computer program, the following steps are further implemented: determining whether the number of signal records cached in the signal cache queue reaches a preset cache quantity threshold; if so, storing the signal record at the head of the signal cache queue into the database, and deleting the signal record at the head of the signal cache queue.
[0118] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0119] Obtaining the electronic signal data reported by the vehicle, where the electronic signal data includes signal values in multiple signal dimensions and a signal acquisition timestamp;
[0120] Obtaining the target timestamp in the signal record at the head of the signal cache queue, where the signal records in the signal cache queue are arranged in the order of timestamps, and each signal record includes a timestamp and signal values in a preset signal dimension;
[0121] When the signal acquisition timestamp is greater than or equal to the target timestamp, based on the signal acquisition timestamp and a preset smoothing time window, searching for the signal record to be smoothed in the signal cache queue, and performing smoothing processing on the signal record to be smoothed based on the signal values in multiple signal dimensions.
[0122] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: matching the signal acquisition timestamp with the timestamps in each signal record in the signal cache queue respectively; in the case of successful matching, updating the signal values in the successfully matched signal record with the signal values in multiple signal dimensions to obtain an updated signal record, and based on the updated signal record and a preset smoothing time window, searching for the signal record to be smoothed in the signal cache queue; in the case of failed matching, generating a target signal record based on the electronic signal data, inserting the target signal record into the signal cache queue based on the signal acquisition timestamp to obtain an inserted signal record, and based on the inserted signal record and a preset smoothing time window, searching for the signal record to be smoothed in the signal cache queue.
[0123] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining whether the updated signal record is at the head of the signal cache queue; if so, determining a backward smoothing range based on the timestamp in the updated signal record and a preset smoothing time window; searching for signal records whose timestamps are within the backward smoothing range among the signal records that are after the updated signal record in the signal cache queue as the signal records to be smoothed; if not, determining a forward smoothing range and a backward smoothing range based on the timestamp in the updated signal record and the preset smoothing time window; searching for signal records whose timestamps are within the forward smoothing range among the signal records that are before the updated signal record in the signal cache queue as the first signal records; searching for signal records whose timestamps are within the backward smoothing range among the signal records that are after the updated signal record in the signal cache queue as the second signal records, and using both the first signal records and the second signal records as the records to be smoothed.
[0124] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining a forward smoothing range and a backward smoothing range based on the timestamp in the inserted signal record and the preset smoothing time window; searching for signal records whose timestamps are within the forward smoothing range among the signal records that are before the inserted signal record in the signal cache queue as the third signal records; searching for signal records whose timestamps are within the backward smoothing range among the signal records that are after the inserted signal record in the signal cache queue as the fourth signal records, and using both the third signal records and the fourth signal records as the records to be smoothed.
[0125] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: obtaining a value identification queue corresponding to the signal cache queue, where the identification records in the value identification queue correspond one-to-one with the signal records in the signal cache queue, and each identification record contains the value identification information of each signal in the corresponding signal record; searching for the identification information of each signal in the signal records to be smoothed from the value identification queue, and screening out the signals whose value identification information is a null value as the signals to be filled; filling the signals to be filled with the signal values in multiple signal dimensions.
[0126] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining whether the number of signal records cached in the signal cache queue reaches a preset cache quantity threshold; if so, storing the signal record at the head of the signal cache queue into the database and deleting the signal record at the head of the signal cache queue.
[0127] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0128] Obtain the electronic signal data reported by the vehicle, where the electronic signal data includes signal values under multiple signal dimensions and a signal acquisition timestamp;
[0129] Obtain the target timestamp in the signal record at the head of the signal buffer queue. Each signal record in the signal buffer queue is arranged in the order of timestamps, and each signal record includes a timestamp and a signal value under a preset signal dimension;
[0130] When the signal acquisition timestamp is greater than or equal to the target timestamp, based on the signal acquisition timestamp and a preset smoothing time window, search for the signal record to be smoothed in the signal buffer queue, and perform smoothing processing on the signal record to be smoothed based on the signal values under multiple signal dimensions.
[0131] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: match the signal acquisition timestamp with the timestamp in each signal record in the signal buffer queue respectively; in the case of successful matching, update the signal value in the successfully matched signal record with the signal values under multiple signal dimensions to obtain an updated signal record, and based on the updated signal record and a preset smoothing time window, search for the signal record to be smoothed in the signal buffer queue; in the case of failed matching, generate a target signal record based on the electronic signal data, insert the target signal record into the signal buffer queue based on the signal acquisition timestamp to obtain an inserted signal record, and based on the inserted signal record and a preset smoothing time window, search for the signal record to be smoothed in the signal buffer queue.
[0132] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determine whether the updated signal record is at the head of the signal buffer queue; if so, determine the backward smoothing range based on the timestamp in the updated signal record and a preset smoothing time window; search for the signal record whose timestamp is within the backward smoothing range among the signal records arranged after the updated signal record in the signal buffer queue as the signal record to be smoothed; if not, determine the forward smoothing range and the backward smoothing range based on the timestamp in the updated signal record and a preset smoothing time window; search for the signal record whose timestamp is within the forward smoothing range among the signal records arranged before the updated signal record in the signal buffer queue as the first signal record; search for the signal record whose timestamp is within the backward smoothing range among the signal records arranged after the updated signal record in the signal buffer queue as the second signal record, and use both the first signal record and the second signal record as the records to be smoothed.
[0133] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining a forward smoothing range and a backward smoothing range based on the timestamps in the inserted signal record and a preset smoothing time window; searching, among the signal records preceding the inserted signal record in the signal cache queue, for the signal records whose timestamps are within the forward smoothing range as the third signal records; searching, among the signal records following the inserted signal record in the signal cache queue, for the signal records whose timestamps are within the backward smoothing range as the fourth signal records, and regarding both the third signal records and the fourth signal records as the signal records to be smoothed.
[0134] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: obtaining a value identification queue corresponding to the signal cache queue, where the identification records in the value identification queue correspond one-to-one with the signal records in the signal cache queue, and each identification record contains the value identification information of each signal in the corresponding signal record; searching for the identification information of each signal in the signal record to be smoothed from the value identification queue, and screening out the signals whose value identification information is a null value as the signals to be filled; filling the signals to be filled with the signal values in multiple signal dimensions.
[0135] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining whether the number of signal records cached in the signal cache queue reaches a preset cache quantity threshold, and if so, storing the signal record at the head of the signal cache queue into the database and deleting the signal record at the head of the signal cache queue.
[0136] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0137] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0138] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A data smoothing method, characterized in that, the method includes: obtaining electronic signal data reported by a vehicle, where the electronic signal data includes signal values under multiple signal dimensions and a signal acquisition timestamp; obtaining a target timestamp in a signal record at the head of a signal buffer queue, where each signal record in the signal buffer queue is arranged in the order of timestamps, and each signal record includes a timestamp and a signal value under a preset signal dimension; when the signal acquisition timestamp is greater than or equal to the target timestamp, based on the signal acquisition timestamp and a preset smoothing time window, searching for a signal record to be smoothed in the signal buffer queue, and smoothing the signal record to be smoothed based on the signal values under the multiple signal dimensions.
2. The method according to claim 1, characterized in that, searching for a signal record to be smoothed in the signal buffer queue based on the signal acquisition timestamp and a preset smoothing time window includes: matching the signal acquisition timestamp with the timestamp in each signal record in the signal buffer queue respectively; when the matching is successful, updating the signal value in the signal record with successful matching using the signal values under the multiple signal dimensions to obtain an updated signal record, and searching for a signal record to be smoothed in the signal buffer queue based on the updated signal record and a preset smoothing time window; when the matching fails, generating a target signal record based on the electronic signal data, inserting the target signal record into the signal buffer queue based on the signal acquisition timestamp to obtain an inserted signal record, and searching for a signal record to be smoothed in the signal buffer queue based on the inserted signal record and a preset smoothing time window.
3. The method according to claim 2, characterized in that, searching for a signal record to be smoothed in the signal buffer queue based on the updated signal record and a preset smoothing time window includes: judging whether the updated signal record is at the head of the signal buffer queue; if so, determining a backward smoothing range based on the timestamp in the updated signal record and the preset smoothing time window; searching for a signal record whose timestamp is within the backward smoothing range among the signal records arranged after the updated signal record in the signal buffer queue as the signal record to be smoothed; if not, determining a forward smoothing range and a backward smoothing range based on the timestamp in the updated signal record and the preset smoothing time window; searching for a signal record whose timestamp is within the forward smoothing range among the signal records arranged before the updated signal record in the signal buffer queue as the first signal record; searching for a signal record whose timestamp is within the backward smoothing range among the signal records arranged after the updated signal record in the signal buffer queue as the second signal record, and taking both the first signal record and the second signal record as the signal records to be smoothed.
4. The method according to claim 2, characterized in that, Finding the signal record to be smoothed in the signal cache queue based on the inserted signal record and the preset smoothing time window includes: Determining a forward smoothing range and a backward smoothing range based on the timestamp in the inserted signal record and the preset smoothing time window; Among the signal records preceding the inserted signal record in the signal cache queue, finding the signal records whose timestamps are within the forward smoothing range as the third signal records; among the signal records following the inserted signal record in the signal cache queue, finding the signal records whose timestamps are within the backward smoothing range as the fourth signal records, and taking both the third signal records and the fourth signal records as the records to be smoothed.
5. The method according to claim 1, wherein, The smoothing process of the signal record to be smoothed based on the signal values in the multiple signal dimensions includes: Obtaining a value identification queue corresponding to the signal cache queue, where the identification records in the value identification queue correspond one-to-one with the signal records in the signal cache queue, and each identification record contains the value identification information of each signal in the corresponding signal record; Finding the identification information of each signal in the signal record to be smoothed from the value identification queue, and screening out the signals with null value identification information as the signals to be filled; Using the signal values in the multiple signal dimensions to fill the values of the signals to be filled.
6. The method according to claim 2, wherein, After inserting the target signal record into the signal cache queue based on the signal acquisition timestamp to obtain an inserted signal record, finding the signal record to be smoothed in the signal cache queue based on the inserted signal record and the preset smoothing time window, and smoothing the signal record to be smoothed based on the signal values in the multiple signal dimensions, the method further includes: Judging whether the number of signal records cached in the signal cache queue reaches a preset cache quantity threshold, and if so, storing the signal record at the head of the signal cache queue into the database and deleting the signal record at the head of the signal cache queue.
7. A data smoothing processing device, wherein, The device includes: A first acquisition module for acquiring the electronic signal data reported by the vehicle, where the electronic signal data includes signal values in multiple signal dimensions and a signal acquisition timestamp; A second acquisition module for acquiring the target timestamp in the signal record at the head of the signal cache queue, where the signal records in the signal cache queue are arranged in the order of timestamps, and each signal record includes a timestamp and signal values in preset signal dimensions; A smoothing module for, when the signal acquisition timestamp is greater than or equal to the target timestamp, finding the signal record to be smoothed in the signal cache queue based on the signal acquisition timestamp and the preset smoothing time window, and smoothing the signal record to be smoothed based on the signal values in the multiple signal dimensions.
8. A computer device, comprising a memory and a processor, the memory storing a computer program, wherein, when the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, having a computer program stored thereon, wherein, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, wherein, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.