Data processing method and device, electronic equipment and storage medium
By using a single channel data processing method in the data acquisition driver and using the configuration table to map data characteristics to the processing function, the problem of inflexibility in traditional data acquisition driver processing multi-sampling paths is solved, and the flexibility and development efficiency of data processing are improved.
Patent Information
- Application Number
- CN202510015789.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-05-02
AI Technical Summary
When traditional data acquisition drivers process data in an array form when processing multi-sampling channels, they use arrays to uniformly process data, resulting in single and inflexible business functions, and refactoring codes when business changes, which increases the workload of developers and the maintenance costs of software engineers.
The single-channel data processing method is adopted. Each single-channel independently analyzes the target data characteristics of the original data and obtains the corresponding target processing functions from the pre-built configuration table. The configuration table contains processing functions corresponding to different data characteristics. Developers can select or create custom functions based on the new data characteristics and add them to the configuration table.
Improves the flexibility of data processing, avoids the limitations of traditional unified processing, reduces the workload of developers to refactor code, and reduces the maintenance costs of software engineers.
Smart Images

Figure CN119917188A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, device, electronic equipment and storage medium. Background Art
[0002] The AUTOSAR standard, which is widely used in the current automotive industry, aims to achieve a standardized process for automotive development. However, the data acquisition driver in the complex driver is directly connected to the microcontroller hardware layer and needs to be customized for different hardware platforms, making it difficult to achieve standardization and reuse. At the same time, the traditional data acquisition driver uniformly processes data in the form of an array for multiple sampling paths, and the business function is single and inflexible. When the business changes, the code needs to be refactored, which increases the workload of developers and increases the design cost, implementation cost and maintenance cost of software engineers when maintaining AUTOSAR complex drivers. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a data processing method, device, electronic device and storage medium to solve the problem that traditional data acquisition drivers uniformly process data in the form of arrays for multiple sampling paths, the business functions are single and inflexible, and the code needs to be reconstructed when the business changes, which increases the workload of developers.
[0004] In a first aspect, an embodiment of the present invention provides a data processing method, the method comprising:
[0005] Get and import the original data of each single channel;
[0006] Analyze the target data characteristics corresponding to the original data, and obtain the target processing function corresponding to the data characteristics through a pre-built configuration table, wherein the configuration table includes processing functions corresponding to different data characteristics;
[0007] The target processing function is called in each of the single channels to process the original data to obtain target data.
[0008] Furthermore, the obtaining and importing of the original data of each single channel includes:
[0009] Determining a target hardware device associated with the single channel;
[0010] Acquire original data output by the target hardware device, wherein the original data is obtained by the hardware device performing a data acquisition operation;
[0011] A preconfigured data input method is called to import the raw data into the single channel.
[0012] Furthermore, before determining the target hardware device associated with the single channel, the method further includes:
[0013] Determining a driving mode according to device characteristics of an original hardware device associated with the single channel;
[0014] The original hardware device is initialized and configured according to the driving mode, and the initialized original hardware device is used as the target hardware device.
[0015] Furthermore, the analyzing the target data characteristics corresponding to the original data and obtaining the target processing function corresponding to the data characteristics through a pre-built configuration table includes:
[0016] Detecting the changing pattern, fluctuation range and jump degree of the original data;
[0017] Analyzing the variation rule, the fluctuation range, and the jump degree to obtain target data characteristics of the original data;
[0018] Querying whether there is a processing function corresponding to the target data characteristic in a pre-built configuration table, wherein the configuration table includes processing functions corresponding to different data characteristics;
[0019] If a processing function corresponding to the target data characteristic exists in the configuration table, the processing function corresponding to the target data characteristic is used as the target processing function.
[0020] Furthermore, the method further comprises:
[0021] If the processing function corresponding to the target data characteristic does not exist in the configuration table, obtaining a user-defined function created based on the target data characteristic;
[0022] The user-defined function is used as the target processing function, and the target processing function and the user-defined function are added to the configuration table.
[0023] Furthermore, the method further comprises:
[0024] Determining new data characteristics based on the configuration operation for the configuration table;
[0025] Acquire candidate data characteristics similar to the newly added data characteristics from the configuration table, and acquire candidate processing functions corresponding to the candidate data characteristics;
[0026] The candidate processing function is optimized based on the difference between the newly added data characteristic and the candidate data characteristic to obtain the processing function corresponding to the newly added data characteristic, and the newly added data characteristic and the processing function corresponding to the newly added data characteristic are added to the configuration table.
[0027] Furthermore, after calling the target processing function in each of the single channels to process the original data and obtaining the target data, the method further includes:
[0028] The preset configuration interface is called to transmit the target data to the runtime environment in the automotive open system architecture according to preset rules, and each software component obtains the target data from the runtime environment.
[0029] In a second aspect, an embodiment of the present invention provides a data processing device, the device comprising:
[0030] The acquisition module is used to acquire and import the original data of each single channel;
[0031] An analysis module, used to analyze target data characteristics corresponding to the original data, and obtain target processing functions corresponding to the data characteristics through a pre-built configuration table, wherein the configuration table includes processing functions corresponding to different data characteristics;
[0032] The processing module is used to call the target processing function in each of the single channels to process the original data to obtain target data.
[0033] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0034] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0035] This application first adopts a single-channel data processing method. Each single channel independently analyzes the target data characteristics corresponding to the original data, and obtains the corresponding target processing function from the pre-built configuration table. In this way, even when facing multiple sampling paths, the data processing processes of different channels can be inconsistent, avoiding the limitations of traditional unified data processing in array form and improving the flexibility of data processing. At the same time, the configuration table contains processing functions corresponding to different data characteristics. When business needs change, developers can select appropriate processing functions from the configuration table according to the new data characteristics, or create custom functions and add them to the configuration table when there is no corresponding processing function in the configuration table, without having to reconstruct the entire code, greatly reducing the workload of developers. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 is a schematic diagram of the overall framework of a data processing flow according to some embodiments of the present invention;
[0038] Figure 2 is a flowchart of a data processing method according to some embodiments of the present invention;
[0039] Figure 3 is a schematic diagram of a single-channel processing flow in the case of multi-sampling input according to some embodiments of the present invention;
[0040] Figure 4 is a structural block diagram of a data processing device according to an embodiment of the present invention;
[0041] Figure 5 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0043] According to an embodiment of the present invention, a data processing method, apparatus, electronic device and storage medium are provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0044] The data processing method provided in the embodiment of the present application is implemented based on the automotive open system architecture (AUTOSAR). Figure 1 As shown, before implementing the data processing method, you need to configure the data processing method, hardware equipment and configuration table. The specific configuration process is as follows:
[0045] First, clarify the key links involved in the data acquisition process, namely driver initialization, data input, filtering, conversion, diagnosis and output. At the code level, create an abstract class and define an abstract method for each key link. These methods will serve as specifications and interfaces for subsequent specific implementations. For example, the driver initialization method can be defined as an abstract function that accepts necessary parameters, such as hardware device identification, etc. Its purpose is to prepare the hardware and software environment for data acquisition. The data input method can be defined as an interface for receiving data from external devices, and parameters such as data format and source may need to be specified. Data filtering methods, data conversion methods, data diagnosis methods, and data output methods are also similarly abstractly defined to provide a framework for subsequent specific implementations. The definitions of each method are as follows:
[0046] The driver initialization method is shown in Table 1, which is an initialization function made by the development engineer based on the specific source code and configured as a specific initialization execution function through a function pointer.
[0047]
[0048] Table 1 Definition table of driver initialization method
[0049] The data input method is shown in Table 2. In the case of multiple external sampling path inputs, the object-oriented concept is adopted to abstract the data processing process. Taking the single sampling path input as the benchmark, it is convenient to configure the specific execution function of each data processing step. Different sampling paths are independent of each other.
[0050]
[0051] Table 2 Definition table of data input method
[0052] The data filtering methods are shown in Table 3. The driver should implement multiple filtering methods such as mean filtering and weight filtering. Development engineers can select them through input parameters, or they can develop their own filtering algorithms and configure business functions through function pointers.
[0053]
[0054] Table 3 Definition of data filtering methods
[0055] The data conversion methods are shown in Table 4. The driver should implement a variety of basic data conversion methods such as voltage, current, pressure, temperature, speed, flow, etc. The data conversion algorithm can also be developed by inputting callback functions and configuring macro definitions. Development engineers can select by entering parameters, or they can develop their own filtering algorithms and configure business functions through function pointers.
[0056]
[0057] Table 4 Definition of data filtering methods
[0058] The data diagnosis methods are shown in Table 5. The data diagnosis methods that should be implemented in the driver should include various basic data diagnosis methods such as threshold judgment method, standard deviation method, normal distribution assumption method, etc. The corresponding post-diagnosis processing is input through the callback function.
[0059]
[0060] Table 5 Definition of data diagnosis methods
[0061]
[0062] Table 6 Definition of data output method
[0063] Secondly, for each abstract method defined, a specific code implementation is performed. Specifically, for the driver initialization method, specific initialization code is written according to different hardware devices and requirements. It may involve operations such as interaction with hardware registers and configuration of communication interfaces. The implementation of the data input method may include reading data from a specific port, receiving data through a communication protocol, etc. The data filtering method can implement various filtering algorithms, such as mean filtering, median filtering, etc., and perform filtering processing based on the input data. The data conversion method can realize the conversion between different data formats, such as converting from analog signals to digital signals, or performing unit conversion, etc. The data diagnosis method can check the validity and integrity of the data, such as determining whether the data is within a reasonable range by setting a threshold. The data output method outputs the processed data to the specified target, which may be transmitted to other modules through a specific interface or stored in a specific location.
[0064] Then, determine which external devices are needed for data acquisition and the corresponding complex driver modules according to the needs. If static source code can be generated through hardware configuration software (such as EngineeringBase, EB), then use the cooperation between EB software and hardware driver manufacturers to select the appropriate hardware device model and configuration options. EB will generate static source code containing hardware register configuration and integrate it into the project. In this process, set the driver initialization and input parameters to ensure that the hardware device can be initialized and receive data correctly. If the software development engineer needs to write to the chip register through the integrated circuit bus (Inter-Integrated Circuit, I2C) or serial peripheral interface (Serial Peripheral Interface, SPI) to complete the initialization configuration, then write the corresponding initialization code according to the documentation and specifications of the hardware device, pass in the custom initialization function through the function pointer, and call the function through the callback function at runtime to complete the initialization and parameter setting.
[0065] Finally, a configuration table is constructed to store the mapping relationship between different data characteristics and corresponding business functions. For example, for data such as current and voltage that are easy to jump and allow jumping, you can select processing functions such as mean filtering and configure them to the business function corresponding to the data filtering method. For data such as temperature that are not allowed to jump, you can select weight filtering and set the weight ratio, and configure it to the corresponding data filtering business function. For data conversion methods, data diagnosis methods, and data output methods, business functions are similarly configured according to different requirements. All business functions are passed in through function pointers, so that the corresponding functions can be dynamically called according to the configuration table at runtime.
[0066] In this embodiment, a data processing method is provided. Figure 2 is a flow chart of a data processing method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0067] Step S101, obtaining and importing the original data of each single channel.
[0068] In the embodiment of the present application, obtaining and importing the raw data of each single channel includes the following steps A1, A2 and A3:
[0069] Step A1, determining a target hardware device associated with a single channel in a data acquisition system.
[0070] In an embodiment of the present application, before determining the target hardware device associated with a single channel in a data acquisition system, the method also includes: determining a driving mode based on device characteristics of the original hardware device associated with the single channel; initializing and configuring the original hardware device according to the driving mode, and using the initialized original hardware device as the target hardware device.
[0071] Specifically, first, carefully study the various characteristics of the original hardware device associated with the single channel. Check the device model, specifications, functions, and supported communication methods. For example, if the device is a sensor, understand its measured physical quantity, accuracy, response time and other characteristics. You can also check the technical documentation of the device to determine whether it is compatible with EB software and whether it supports register configuration via I2C or SPI.
[0072] If the original hardware device is produced by some special manufacturers, and it is clearly mentioned in the technical documentation that it can be configured through EB, then you can consider using EB to generate static source code. In this case, check whether the EB software supports the device model, and understand the cooperation method and configuration process between EB and the hardware driver manufacturer. If the device does not support EB configuration, or there is no relevant cooperation channel, then you need to consider the development engineer writing to the chip register through I2C or SPI.
[0073] If you choose to generate static source code using EB, follow the steps below to initialize the configuration:
[0074] ① Ensure that the EB software is compatible with the development environment and make necessary settings according to the device requirements. ② Connect the original hardware device to the development computer through a suitable interface to ensure that the EB software can recognize the device. ③ According to the device characteristics and requirements, select the corresponding device model in the EB software and set the configuration parameters of the hardware registers. ④ The EB software generates static source code based on the configuration options, which includes the configuration of the hardware registers. Integrate the generated source code into the project. ⑤ Since the initialization function generated by EB is reusable, the function can be directly called in this framework to initialize the device.
[0075] If the development engineer chooses to configure the registers by himself through I2C or SPI, follow the steps below to initialize the configuration:
[0076] ①Query the I2C or SPI communication protocol, as well as the register structure and function of the original hardware device. ②According to the device requirements, write a custom initialization function to write to the chip register through the I2C or SPI interface to complete the initialization configuration of the device. ③Pass the custom initialization function into this framework through a function pointer so that the function can be called through the callback function at runtime. ④After completing the writing and passing of the initialization function, test and verify to ensure that the device can work normally and output data as expected.
[0077] After the above initialization configuration process, the original hardware device has completed the initialization and can be used as the target hardware device for subsequent data collection and processing operations. In the subsequent steps, according to the characteristics and requirements of the target hardware device, the appropriate data processing method and business function are selected to achieve efficient data collection and processing.
[0078] After initializing the configuration of the original hardware device, determine the object and source of data collection according to product requirements and system design. The target hardware device associated with a single channel can be determined in the following ways: Check the hardware connection line and interface identification. Determine the connection point between the single channel and the specific hardware device through physical connection, such as checking the identification of the data line, interface plug, etc. to determine the connected hardware device. Alternatively, use a hardware detection tool to identify the hardware device connected to the system and determine its model and parameters. You can also view the list of connected hardware devices through the device management software in the system to determine the target hardware device associated with the single channel.
[0079] Step A2, obtaining original data output by the target hardware device, wherein the original data is obtained by the hardware device performing a data acquisition operation.
[0080] Specifically, obtain the data output method of the target hardware device. Different hardware devices output data in different ways, such as analog signal output, digital signal output, and output data through specific communication protocols (such as I2C, SPI, etc.). According to the data output method of the hardware device, select the appropriate data acquisition method. If it is an analog signal output, an analog to digital converter (ADC) can be used to convert the analog signal into a digital signal. If it is a digital signal output, the data can be read through the corresponding digital interface (such as General Purpose Input / Output, GPIO). If the data is output through a communication protocol, it is necessary to write a corresponding communication program according to the protocol specification to read the data.
[0081] According to the characteristics of the hardware device and the requirements of data acquisition, set appropriate data acquisition parameters, such as sampling frequency, resolution, data range, etc. Start the data acquisition operation by calling the driver of the hardware device or using the data acquisition module to obtain the original data output by the target hardware device.
[0082] Step A3, calling a pre-configured data input method to import the raw data into a single channel.
[0083] Specifically, determine the pre-configured data input method. The development engineer pre-defines the data input method in the data acquisition abstract class. Depending on the specific implementation, there are multiple data input methods to choose from. For example, it can be to directly assign the original data to the buffer of a single channel, or it can be to pass the data to the processing module of a single channel through a function call.
[0084] According to the determined input method, call the corresponding function or method to import the raw data into the single channel. After the raw data is imported into the single channel, some data verification and preprocessing operations can be performed to ensure the validity and integrity of the data. For example, you can check whether the value range of the data is reasonable and whether there are abnormal values or erroneous data. If problems are found, you can take corresponding treatment measures, such as data filtering, error prompts, etc.
[0085] Step S102, analyzing target data characteristics corresponding to the original data, and obtaining target processing functions corresponding to the data characteristics through a pre-built configuration table, wherein the configuration table includes processing functions corresponding to different data characteristics.
[0086] In the embodiment of the present application, the target data characteristics corresponding to the original data are analyzed, and the target processing function corresponding to the data characteristics is obtained through a pre-built configuration table, including the following steps B1-B4:
[0087] Step B1, detecting the changing pattern, fluctuation range and jump degree of the original data.
[0088] Specifically, by observing the trend of data changes over time, determine whether the data presents linear changes, periodic changes, random changes or other specific patterns. Data analysis tools or algorithms, such as time series analysis and trend analysis, can be used to identify the law of data changes. The maximum, minimum and mean values of the original data can be calculated to determine the range of data fluctuations. For example, statistical methods such as standard deviation and variance can be used to measure the degree of dispersion of data. By checking whether there are sudden and large changes in the data, that is, jumps. Specifically, a threshold can be set, and when the amplitude of the data change exceeds the threshold, it is considered that a jump has occurred. Alternatively, the degree of jump can be evaluated by comparing the difference between adjacent data points or using a rate of change indicator.
[0089] Step B2, analyzing the variation pattern, fluctuation range and jump degree to obtain the target data characteristics of the original data.
[0090] Specifically, the characteristics of the original data are comprehensively analyzed in combination with the detected change pattern, fluctuation range and jump degree. For example, if the data shows periodic changes and the fluctuation range is small, it has stable periodic characteristics; if the data change pattern is not obvious but the jump degree is large, it has high noise or unstable characteristics.
[0091] According to the analysis results, one or more data characteristic labels are assigned to the original data. These labels can describe the main characteristics of the data, such as "periodic stable data", "high noise data", "easy to jump data", etc. In addition, for some complex data characteristics, the description can be further refined. For example, for easy to jump data, it can be distinguished whether the jump is allowed or not; for periodic data, the length and amplitude of the period can be determined.
[0092] Step B3, querying whether there is a processing function corresponding to the target data characteristic in the pre-built configuration table, wherein the configuration table includes processing functions corresponding to different data characteristics.
[0093] Specifically, during the system design phase, development engineers pre-build a configuration table that contains mappings between different data characteristics and corresponding processing functions. The processing functions include different types of processing functions such as data filtering methods, data conversion methods, and data diagnosis methods.
[0094] First, carefully analyze the characteristics of the target data, including its changing rules, fluctuation range, and jump degree. Then, check the processing functions corresponding to different data characteristics one by one against the configuration table. For the processing functions of the data filtering method, if the target data has specific noise characteristics or change patterns, it is necessary to select a suitable filtering algorithm, such as mean filtering, median filtering, or weight filtering, to remove noise or smooth data. For the processing functions of the data conversion method, if the target data needs to be converted from one format to another, or operations such as unit conversion need to be performed, it is necessary to find the corresponding data conversion function to perform these tasks. For the processing functions of the data diagnosis method, when it is necessary to detect whether the target data has outliers, erroneous data, or whether it meets specific quality standards, the data diagnosis function will be used, such as by setting thresholds, calculating statistical indicators, etc. to judge the validity of the data. By finding the processing function that matches the characteristics of the target data in the configuration table, you can quickly determine the processing method suitable for the current data and improve the efficiency and accuracy of data processing.
[0095] Step B4: If there is a processing function corresponding to the target data characteristic in the configuration table, the processing function corresponding to the target data characteristic is used as the target processing function.
[0096] Specifically, if a processing function corresponding to the target data characteristic is found in the configuration table, the function is marked as the target processing function. The function name, pointer or other identification information can be stored for subsequent calls. Prepare the necessary parameters and data structures according to the requirements of the target processing function. This includes passing the original data, setting the input parameters of the function, allocating memory, etc. When appropriate, call the target processing function through a function pointer or other calling mechanism to process the original data. Ensure that the function is called in the correct way and handle error conditions.
[0097] As an example, collect the raw data of the pressure sensor over a period of time, such as collecting 50 data points continuously. It is observed that the pressure data has a tendency to rise and fall slowly within a certain range, but the overall change is relatively smooth. By calculating the maximum, minimum and mean of these 50 data points, it is found that the fluctuation range is relatively small. Assume that the maximum value is 105kPa, the minimum value is 102kPa, and the mean value is 103.5kPa. Check the difference between adjacent data points in the data and find that the difference is small. Occasionally there will be a slightly larger change, but it does not constitute an obvious jump. After comprehensive analysis, it is determined that the pressure data has the characteristics of relatively smooth changes, small fluctuation range, and basically no jump is allowed. Checking the configuration table, it is found that for data that basically does not allow jumps and has small fluctuations, the corresponding median filter processing function is used. Since the characteristics of the pressure data match the characteristics in the configuration table, the median filter processing function is selected as the target processing function to remove outliers and ensure the stability of the pressure data.
[0098] As another example, collect the raw data of the light intensity sensor within a certain period of time, such as collecting 80 data points continuously. It is observed that the light intensity data changes randomly over time, and sometimes it rises or falls suddenly. By calculating the maximum, minimum and mean of these 80 data points, it is found that the fluctuation range is large. Assume that the maximum value is 1500 lux, the minimum value is 500 lux, and the mean value is 1000 lux. Check the difference between adjacent data points in the data and find that there are often large differences and obvious jumps. Analyze the change rules, fluctuation range and jump degree to obtain the target data characteristics of the raw data. After comprehensive analysis, it is determined that the light intensity data has the characteristics of random changes, large fluctuation range and allowed jumps. Check the configuration table and find that the corresponding mean filter processing function is for data that allows jumps and has large fluctuations. Since the characteristics of the light intensity data match the characteristics in the configuration table, the mean filter processing function is selected as the target processing function to smooth the random fluctuations of the data.
[0099] In an embodiment of the present application, the method also includes: if there is no processing function corresponding to the target data characteristic in the configuration table, obtaining a custom function created by the user based on the target data characteristic, using the custom function as the target processing function, and adding the target processing function and the custom function to the configuration table.
[0100] Specifically, first, the development engineer (i.e., the user) needs to create a custom function based on the characteristics of the target data. For example, if the target data is data collected by a new type of sensor, it has a special noise pattern and change trend, and there is no matching processing function in the existing configuration table. The user can choose the appropriate algorithm and method to design a custom function based on the specific situation of the data. After the custom function is created, this function is used as the target processing function to process the current target data. In actual applications, the target data needs to be passed into this custom function, and data filtering, conversion, or diagnosis operations need to be performed according to the logic of the function.
[0101] At the same time, in order to better handle similar data features in the future, this custom function and the corresponding target data features need to be added to the configuration table. In this way, the next time you encounter data with the same features, you can directly find the corresponding processing function from the configuration table without having to create the custom function again. The adding process can include recording the description information of the target data features, as well as the name, parameters, and implementation logic of the custom function. In this way, the configuration table can be continuously enriched and improved to improve its adaptability and processing capabilities for different data features.
[0102] Step S103, calling the target processing function in each single channel to process the original data to obtain target data.
[0103] In the embodiment of the present application, in a data acquisition system in a single-channel form, when facing multiple sampling paths, each single channel performs data processing independently. First, in the case of multiple sampling path input, for example, Figure 3 As shown, when raw data is input to channel 1 and channel 2, the corresponding target processing function will be determined according to the data characteristics associated with the channel. If the voltage value is collected, although in the traditional data processing method, when distinguishing the overall category of voltage, array form batch processing is usually used, all voltage data will be processed in the same way. However, in the single-channel form, channel 1 and channel 2 can have different data processing processes.
[0104] For example, the voltage data collected by channel 1 has a specific change pattern, fluctuation range and jump degree. After analysis, it is determined that the mean filter processing function is suitable for processing. However, the voltage data collected by channel 2 has different characteristics. Perhaps it fluctuates greatly and allows jumps. In this case, another more suitable processing function is selected, such as median filtering.
[0105] After the target processing function is determined, this function is called in the single channel to process the original data. The processing process includes data filtering, removing noise and outliers; data conversion, converting data into a specific format or unit; data diagnosis, checking the validity and integrity of the data, etc. Through the specific algorithm and logic of the target processing function, a series of operations are performed on the original data to finally obtain the processed target data.
[0106] The single-channel processing method provided in the embodiment of the present application improves the flexibility of the data processing process, because each channel can be customized according to its unique data characteristics, rather than using a unified batch processing method. At the same time, this more abstract processing method for the data process enables the data acquisition framework to better adapt to different application scenarios and data types, which is conducive to forming a mature and efficient data acquisition system.
[0107] This application first adopts a single-channel data processing method. Each single channel independently analyzes the target data characteristics corresponding to the original data, and obtains the corresponding target processing function from the pre-built configuration table. In this way, even when facing multiple sampling paths, the data processing processes of different channels can be inconsistent, avoiding the limitations of traditional unified data processing in array form and improving the flexibility of data processing. At the same time, the configuration table contains processing functions corresponding to different data characteristics. When business needs change, developers can select appropriate processing functions from the configuration table according to the new data characteristics, or create custom functions and add them to the configuration table when there is no corresponding processing function in the configuration table, without having to reconstruct the entire code, greatly reducing the workload of developers.
[0108] In an embodiment of the present application, after calling the target processing function in each single channel to process the original data and obtain the target data, the method also includes: calling a preset configuration interface to transmit the target data to a runtime environment in the automotive open system architecture according to preset rules, and each software component obtains the target data from the runtime environment.
[0109] First of all, the preset configuration interface here refers to the DaVinci configuration interface. The DaVinci configuration interface is a tool designed specifically for data transmission. It has specific functions and rules to ensure that data can be transmitted accurately and efficiently. When the target data is processed by the target processing function in a single channel to obtain the final target data form, it needs to be transmitted to the runtime environment (RTE) in the automotive open system architecture (AUTOSAR). According to the preset rules, the DaVinci configuration interface comes into play. It will identify the characteristics of the target data, such as type, format, and size, and transfer the target data from the current data processing module or storage location to the RTE according to the pre-set transmission protocol and parameters.
[0110] During the transmission process, steps such as data format conversion, data verification, and error handling are involved to ensure the integrity and accuracy of the data. Once the target data is successfully transmitted to the RTE, each software component (SWC) can obtain the target data from this runtime environment. Different SWCs have different functions and requirements. They extract the required target data from the RTE according to their own tasks and logic.
[0111] In an embodiment of the present application, the method also includes: determining new data characteristics based on configuration operations on the configuration table; obtaining candidate data characteristics similar to the new data characteristics from the configuration table, and obtaining candidate processing functions corresponding to the candidate data characteristics; optimizing the candidate processing functions based on the differences between the new data characteristics and the candidate data characteristics, obtaining processing functions corresponding to the new data characteristics, and adding the new data characteristics and the processing functions corresponding to the new data characteristics to the configuration table.
[0112] Specifically, during the data collection and processing process, as the system runs and new application scenarios emerge, data features that were not previously in the configuration table will be encountered. New data features are determined in the following ways: ① Development engineers or system administrators receive feedback from users, pointing out special performance or specific requirements of certain data. By analyzing these feedbacks, it can be determined whether there are new data features. ② When a new hardware device is connected to the system, the data it outputs has unique data features, thereby determining the new data features.
[0113] First, the newly added data features are compared with the existing data features in the configuration table one by one. The dimensions of comparison may include the similarity of the change rules, the closeness of the fluctuation range, the degree of jump, etc. According to the comparison results, one or more existing data features that are most similar to the newly added data features are selected as candidate data features. For example, if the newly added data features show a certain periodicity and small fluctuations, then look for existing data features with similar periodicity and fluctuation range in the configuration table as candidates. Once the candidate data features are determined, the processing functions corresponding to these candidate data features are obtained from the configuration table. These processing functions are processing functions of data filtering methods, data conversion methods, or data diagnosis methods.
[0114] Secondly, analyze the differences between the characteristics of the newly added data and the characteristics of the candidate data. The differences are reflected in many aspects, such as subtle differences in the change rules, differences in the size of the fluctuation range, and the tolerance for jumps. According to the specific situation of the differences, adjust the parameters of the candidate processing function. If it is a filtering processing function, you can adjust the parameters of the filtering algorithm, such as window size, weight coefficient, etc.; if it is a conversion processing function, you can modify the conversion rules and parameters.
[0115] Then, test and verify the optimized processing function. Use actual data with the newly added data characteristics to test and observe whether the effect of the processing function meets expectations. If the effect is not ideal, continue to adjust the parameters or try other optimization methods. After multiple adjustments and tests, when the processing function can effectively process data with the newly added data characteristics, it is determined to be the processing function corresponding to the newly added data characteristics.
[0116] Finally, add the processing functions corresponding to the newly added data features to the configuration table to establish a corresponding relationship with the newly added data features. Ensure that the configuration table is updated accurately and completely so that the system can correctly identify and apply the processing functions corresponding to the newly added data features in subsequent data processing.
[0117] In the present embodiment, a data processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also and is conceived.
[0118] This embodiment provides a data processing device, such as Figure 4 As shown, including:
[0119] The acquisition module 401 is used to acquire the raw data imported into each single channel;
[0120] An analysis module 402 is used to analyze target data characteristics corresponding to the original data, and obtain target processing functions corresponding to the data characteristics through a pre-built configuration table, wherein the configuration table includes processing functions corresponding to different data characteristics;
[0121] The processing module 403 is used to call the target processing function in each single channel to process the original data to obtain the target data.
[0122] In an embodiment of the present application, the acquisition module 401 is used to determine the target hardware device associated with a single channel in a data acquisition system; obtain the original data output by the target hardware device, wherein the original data is obtained by the hardware device performing a data acquisition operation; and call a pre-configured data input method to import the original data into the single channel.
[0123] In an embodiment of the present application, the device also includes: an initialization module, which is used to determine the driving mode according to the device characteristics of the original hardware device associated with the single channel; initialize and configure the original hardware device according to the driving mode, and use the initialized original hardware device as the target hardware device.
[0124] In the embodiment of the present application, the analysis module 402 is used to detect the change pattern, fluctuation range and jump degree of the original data; analyze the change pattern, fluctuation range and jump degree to obtain the target data characteristics of the original data; query whether there is a processing function corresponding to the target data characteristics in a pre-constructed configuration table, wherein the configuration table includes processing functions corresponding to different data characteristics; if there is a processing function corresponding to the target data characteristics in the configuration table, the processing function corresponding to the target data characteristics is used as the target processing function.
[0125] In an embodiment of the present application, the device also includes: a configuration module, which is used to obtain a custom function created by a user based on the target data characteristics if there is no processing function corresponding to the target data characteristics in the configuration table; use the custom function as the target processing function, and add the target processing function and the custom function to the configuration table.
[0126] In an embodiment of the present application, the device also includes: an update module, which is used to determine the new data characteristics based on the configuration operation on the configuration table; obtain candidate data characteristics similar to the new data characteristics from the configuration table, and obtain candidate processing functions corresponding to the candidate data characteristics; optimize the candidate processing functions based on the differences between the new data characteristics and the candidate data characteristics, obtain the processing functions corresponding to the new data characteristics, and add the new data characteristics and the processing functions corresponding to the new data characteristics to the configuration table.
[0127] In an embodiment of the present application, the device also includes: a transmission module, which is used to call a preset configuration interface to transmit the target data to a runtime environment in the automotive open system architecture according to preset rules, and each software component obtains the target data from the runtime environment.
[0128] See also Figure 5 , Figure 5 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0129] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0130] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0131] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of an electronic device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0132] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0133] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.
[0134] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0135] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data processing method, characterized in that: The method comprises: Get and import the original data of each single channel; Analyze the target data characteristics corresponding to the original data, and obtain the target processing function corresponding to the data characteristics through a pre-built configuration table, wherein the configuration table includes processing functions corresponding to different data characteristics; The target processing function is called in each of the single channels to process the original data to obtain target data.
2. The method according to claim 1, characterized in that The step of obtaining and importing the raw data of each single channel includes: Determining a target hardware device associated with the single channel; Acquire original data output by the target hardware device, wherein the original data is obtained by the hardware device performing a data acquisition operation; A preconfigured data input method is called to import the raw data into the single channel.
3. The method according to claim 2, characterized in that Before determining the target hardware device associated with the single channel, the method further includes: Determining a driving mode according to device characteristics of an original hardware device associated with the single channel; The original hardware device is initialized and configured according to the driving mode, and the initialized original hardware device is used as the target hardware device.
4. The method according to claim 1, characterized in that: The analyzing the target data characteristics corresponding to the original data and obtaining the target processing function corresponding to the data characteristics through a pre-built configuration table includes: Detecting the changing pattern, fluctuation range and jump degree of the original data; Analyzing the variation rule, the fluctuation range, and the jump degree to obtain target data characteristics of the original data; Querying whether there is a processing function corresponding to the target data characteristic in a pre-built configuration table, wherein the configuration table includes processing functions corresponding to different data characteristics; If a processing function corresponding to the target data characteristic exists in the configuration table, the processing function corresponding to the target data characteristic is used as the target processing function.
5. The method according to claim 4, characterized in that The method further comprises: If the processing function corresponding to the target data characteristic does not exist in the configuration table, obtaining a user-defined function created based on the target data characteristic; The user-defined function is used as the target processing function, and the target processing function and the user-defined function are added to the configuration table.
6. The method according to claim 1, characterized in that The method further comprises: Determining new data characteristics based on the configuration operation for the configuration table; Acquire candidate data characteristics similar to the newly added data characteristics from the configuration table, and acquire candidate processing functions corresponding to the candidate data characteristics; The candidate processing function is optimized based on the difference between the newly added data characteristic and the candidate data characteristic to obtain the processing function corresponding to the newly added data characteristic, and the newly added data characteristic and the processing function corresponding to the newly added data characteristic are added to the configuration table.
7. The method according to claim 1, characterized in that After calling the target processing function in each of the single channels to process the original data and obtaining the target data, the method further includes: The preset configuration interface is called to transmit the target data to the runtime environment in the automotive open system architecture according to preset rules, and each software component obtains the target data from the runtime environment.
8. A data processing device, characterized in that: The device comprises: The acquisition module is used to acquire and import the original data of each single channel; An analysis module, used to analyze target data characteristics corresponding to the original data, and obtain target processing functions corresponding to the data characteristics through a pre-built configuration table, wherein the configuration table includes processing functions corresponding to different data characteristics; The processing module is used to call the target processing function in each of the single channels to process the original data to obtain target data.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-channel digital signal processing method
CN111597051A
Dynamic configuration method and device, equipment and storage medium
CN113687860A
Message processing method and device, electronic equipment and computer readable storage medium
CN115580505A
Data processing method and device, electronic equipment, storage medium and program product
CN115951993A
Data processing device, data processing method and program
US20210041859A1