Data processing method and processing system suitable for engineering machinery edge calculation
By using edge computing to achieve millisecond-level data sampling frequency and data processing, the problems of data lag and incompleteness in engineering machinery are solved, improving data accuracy and real-time performance, and supporting scalability for different types and models.
Patent Information
- Application Number
- CN202510949863.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-10-17
AI Technical Summary
The low data acquisition frequency of existing construction machinery leads to data lag and incompleteness, making it difficult to conduct accurate equipment monitoring and analysis. Furthermore, existing edge computing systems lack efficient time slicing and calculation result acquisition mechanisms, which cannot support long-term equipment status analysis and prediction.
By employing edge computing, a millisecond-level data sampling frequency is achieved. The process involves initializing data, loading configuration files, acquiring and parsing CAN bus data in real time, controlling data processing and storage using timers, and finally encapsulating the result data into a CAN frame format for uploading, ensuring the real-time performance and accuracy of the data.
It improves the accuracy and real-time performance of data, solves the problems of data statistical bias and business logic misjudgment, realizes efficient data processing and analysis of construction machinery, and supports scalability for different types and models.
Smart Images

Figure CN120804017A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of engineering machinery, in particular to a data processing method and system suitable for edge computing of engineering machinery. BACKGROUND
[0002] At present, the engineering machinery industry generally adopts the technical scheme of "GPS periodic uploading + Internet of Vehicles" in vehicle data analysis and application. By combining GPS positioning equipment and Internet of Vehicles technology, this scheme realizes real-time position tracking and driving state monitoring of engineering vehicles, thereby supporting fleet management to a certain extent, such as mileage statistics, electronic fence setting, etc.
[0003] In addition, some technical schemes also incorporate edge computing technology. For example, a crane Internet of Things data acquisition and analysis system and method in Chinese patent CN115180520B performs data processing locally on the vehicle through a vehicle-mounted computing terminal, and transmits the results to the Internet of Things platform, and then performs life prediction and maintenance reminders on the server side. Another Chinese patent CN119622240A engineering machinery performance analysis method and system and excavator acquires high-frequency device data from a multi-source data acquisition platform through a main controller at the device end, transmits it to an edge calculator, uses a deployed model to identify working conditions, and then analyzes the performance of the engineering machinery device.
[0004] In the above-mentioned technical schemes, the "GPS periodic uploading + Internet of Vehicles" solution is limited by network bandwidth and traffic cost. The GPS data acquisition method is usually in units of minutes, and its data update frequency is low. Based on the existing scheme, part of the business logic analysis is difficult to carry out due to the lag and incompleteness of the data, and the device monitoring situation also has a delay.
[0005] In the current edge computing system, it is mostly based on scenarios, and the data storage mechanism lacks efficient time slicing, which cannot provide strong support for long-term device state analysis and prediction. The existing scheme is not convenient for the system to expand between different types of engineering machinery and different models. Some systems have not established an effective calculation result collection mechanism, resulting in that after completing data processing and analysis, valuable calculation results cannot be collected and integrated in time and accurately, and it is difficult to apply the analysis results to actual production decisions. SUMMARY
[0006] The present application aims to solve the technical problems mentioned in the background. The first aspect provides a data processing method suitable for edge computing of engineering machinery, which adopts edge computing mode to realize millisecond-level data sampling frequency, improve data accuracy and real-time performance, and solve the problems of data statistical deviation and business logic misjudgment caused by limited sampling frequency in traditional data collection mode.
[0007] The second aspect provides a processing system as the operating basis of the data processing method suitable for edge computing of engineering machinery provided in the first aspect.
[0008] According to the first aspect of the present invention, the technical solution provided by the present invention is: a data processing method suitable for edge computing of engineering machinery, comprising the following steps: S1. Initialize data and load configuration files; S2. Acquire CAN bus data in real time and parse it according to DBC file rules; store the parsed data in the form of key-value pairs; and obtain the ACC status from the standard data set once when parsing begins to control the timer start; activate the specified timer according to the ACC status; S3, the data is processed and stored at a fixed frequency, and it runs uninterruptedly at the set frequency when ACC is turned on; S4, data reporting, encapsulates the result data into multiple CAN frame formats, sends them to the CAN bus, and uses GPS for data collection.
[0009] Further; S1. Initialize data and load configuration files; including loading model configuration files, establishing CAN communication channels, loading DBC protocol files, initializing database table structures, and initializing variable values; S1.1. When initializing the database, the device information configuration files must be loaded. These configuration files include the device model, number of CAN interfaces, names of each CAN interface, baud rate of the CAN interface, average and extreme value calculation indicators, and database table structure information. In addition, they also contain parameter data necessary for business processing, such as idle threshold data for different models, and establish communication connections with the CAN bus through sockets based on the number of CAN interfaces of each model. S1.2. Load the DBC file of the SAE J1939 protocol for the current vehicle model, GPS modules, and engine, and generate parsing rules. The DBC file consists of two parts: the first part is the message, message name, message length, and included signal list; the second part is the signal name, start bit, length, byte order, symbolicity, resolution, and offset. These serve as input for subsequent CAN data parsing rules. S1.3. Initialize the database table according to the database table structure information in the configuration file; S1.4. Load historical data. The device data that needs to be counted includes the cumulative value, average value, and extreme value of the current day and the total history.
[0010] Further; S1.4. Load historical data; At the program startup, the need to load historical data according to different start, initialization of variables, for correct processing of cumulative value, daily average, daily extreme value data; When the program is the first time to start history, no need to load historical data; When the program has a start history, generated historical business data, but in a day is the first time to start, need to load the total cumulative value of historical data; When the program has a start history and restart in the day, need to load the total cumulative value, daily cumulative value, daily average, daily extreme value of historical data.
[0011] Further; S2, real-time acquisition of CAN bus data and according to the DBC file rules for parsing; the parsed data is stored in the form of key-value pair; and in the beginning of parsing from the standard data set to get once ACC state, used to control the timer start; according to the ACC situation to enable the specified timer; S2.1, using a separate thread to continuously listen to the CAN channel established in S1, real-time acquisition of CAN original data; S2.2, according to the CAN data parsing rules loaded in S1.2, the real-time CAN data obtained in S2.1 is parsed and stored in the standard data set, the standard data set is in the form of dictionary (key-value pair); the key is the signal name, and the value is the physical value of the parsed signal. The key in the standard data set is unique, and when the same signal data is received again, the physical value in the standard data set will be updated; S2.3, judge ACC state; From the standard data set to get once ACC state data and judge, if the ACC state is open (ACC=1), start the main timer, used to capture the ACC open state under the close signal, and then control the data processing timer to close, at the same time, start the fault processing timer, periodic basic data storage timer, action state tracking timer, event state tracking timer, average value calculation timer, extreme value calculation timer, CAN data back timer, used for fixed frequency processing data and data result back; If the ACC state is closed (ACC=0), start the ACC monitoring timer, used to monitor the ACC state to open when the device is powered on to trigger the program restart process.
[0012] Further; S3, fixed frequency processing of data and data storage; in the ACC open state, according to the set frequency uninterrupted running, multiple timers running at the same time, no interference; Timer 1: Get data for 500ms frequency-based data storage from the standard data set in S1.4, then sort according to the database table structure sequence, and then complete (if there is no corresponding data in the standard data set, the signal physical value is set to Null); first cache this frequency data, when the cache data reaches the set number, store it centrally to reduce the database operation frequency; Timer 2: Get data for 5s frequency-based data storage from the standard data set in S1.4, then sort according to the database table structure sequence, and then complete (if there is no corresponding data in the standard data set, the signal physical value is set to Null); the data generated by this timer is written into the database immediately; Timer 3: Get data for 1min frequency-based data storage from the standard data set in S1.4, first sort according to the database table structure sequence, and then complete (if there is no corresponding data in the standard data set, the signal physical value is set to Null); the data generated by this timer is written into the database immediately; Timer 4: Get data for alarm fault management from the standard data set in S1.4, when a new alarm fault code appears in the obtained data, it is considered that the alarm or fault corresponding to the code is activated and the start time is recorded, when no alarm fault code in the active state is found in the obtained data, it is considered that the alarm or fault has ended, and the end time is recorded; Timer 5: When the program starts, set the last action state value to None; get data for action state recording from the standard data set in S1.4, and judge the current action state; When the current action state is not equal to the last action state, if the last state value is None, it is considered that the current action state starts, and the start time of the current action state is recorded; If the last state value is not None, it is considered that the last action state ends and the current action state starts, and the end time of the last action state and the start time of the current action state are recorded; If the current action state is equal to the last action state, it is considered that the state continues, and the natural change duration is added to the current state duration; Timer 6: When the program starts, set the state value of all events to None; get data for event state recording from the standard data set in S1.4, and the current event state is the signal physical value; all event state records are executed in sequence; When the current event state is not equal to the last event state, if the last state is None, it is considered that the state of the current event starts, and the start time of the current action state is recorded; If the last state is not None, it is considered that the last action state ends and the current action state starts, and the end time of the last action state and the start time of the current action state are recorded. If the current action state is equal to the last action state, it is considered that the state continues, and the natural change duration is added to the current state duration. Timer 7: When the program starts, load the initialization data of the average value to be calculated; when timer 7 runs, obtain the data for average value calculation from the standard data set in S1.4, and record the average value calculation times. The average value calculation method uses real-time average value, and the calculation formula is: (last average value * average value calculation times + this data value) / (average value calculation times + 1), which can reduce the memory consumption caused by constantly storing historical data; Timer 8: When the program starts, load the initialization data of the extreme value to be calculated; when timer 8 runs, obtain the data for extreme value calculation from the standard data set in S1.4, and compare it with the current extreme value. Only when the extreme value changes, the database data will be updated, reducing the database write operation.
[0013] According to the second aspect, the application provides a technical solution: a processing system, comprising: a processor and a memory readable by a computer, the memory is adapted to store a plurality of program codes, the program codes are adapted to be loaded and run by the processor to execute the data processing method for edge computing of engineering machinery according to any one of claims 1-5; It also includes a CAN bus data processing framework based on edge computing, which includes a data acquisition and analysis layer, a data processing layer, a data storage layer, and a data reporting layer connected in sequence. The data acquisition and analysis layer is in communication connection with the CAN bus.
[0014] In some embodiments, the data acquisition and analysis layer uses socket to establish communication with the CAN bus, and inputs the CAN bus data and the DBC protocol file as program basic data. The main functions of the data acquisition and analysis layer include: I. Load the protocol analysis rules defined in the relevant DBC file content of the current machine type as the basic tool for CAN data analysis; II. Use threads to continuously monitor CAN channel data, and use the loaded analysis rules to real-time analyze signal physical values; III. Form a standard data set in the form of key-value pairs with signal physical values, for calling by the data processing module.
[0015] In some embodiments, the data processing layer is used to load machine type configuration items, and then obtain the analyzed signal physical values for processing according to requirements. The main functions of the data processing layer include: I. Periodic data storage: organize the basic analysis data that needs to be stored; II. Statistical data calculation: the extreme value is the maximum or minimum value of a signal recorded on the same day, the average value is the dynamic average value of some signals in a certain state, and the cumulative value is the time length or quantity statistics of some signals in a certain state; III. Business calculation logic: alarm and fault processing, action and event state machine and other specific business logic; Alarm and fault processing: generate historical alarm and fault records according to CAN bus data; Action and event state machine: state statistics of device action and event; action refers to the running condition of vehicle equipment, and event refers to the on-off signal of vehicle equipment; action is counted after being judged by defined rules, and event is counted directly according to the physical value transmitted by the protocol; Other specific business logic, including tire state monitoring of truck.
[0016] In some embodiments, the data storage layer adopts a Sqlite database, and the stored data includes periodic basic data, statistical data, alarm and fault history records and other specific business logic data.
[0017] In some embodiments, the data reporting layer is in communication connection with the CAN bus, and is provided with a multi-CAN frame transmission protocol; after the program statistical result data is converted into a multi-channel CAN frame form, it is sent to the CAN bus, and then uploaded to the business system through GPS.
[0018] Compared with the prior art, the advantages of the present application are: 1. The DBC file encrypted by using SM4 algorithm is introduced as a standardized protocol tool for CAN bus data analysis, combined with dynamically configured vehicle type parameters, and using corresponding decryption algorithm to realize efficient analysis of CAN bus data of different vehicle types, which ensures the security of protocol data while having scalability; 2. The data reporting layer contains a set of standardized data uploading mechanism, which can encapsulate the result data into CAN frame format, send it to the CAN bus, and then use GPS to collect data, meet the data statistics and health management requirements of vehicle management system, and also has a multi-frame transmission protocol to ensure that all result data can be uploaded completely; 3. By combining high-frequency data with low-frequency statistics, accurate calculation of key indicators such as vehicle working hours, load, fuel consumption, etc. is realized; 4. Good scalability, on the one hand, different models of data acquisition, data statistics, action judgment and other basic needs can be adapted through standardized configuration file interface, on the other hand, different specific business processing logic can be deployed to enhance the scene application.
[0019] Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will become apparent to those skilled in the art upon examination of the following and the attendant drawings or can be learned by practice of the application. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 A schematic diagram of an edge computing-based CAN bus data processing framework of a processing system according to an embodiment of the application; Figure 2 A schematic diagram of a step flow of a data processing method suitable for edge computing of engineering machinery according to an embodiment of the application. DETAILED DESCRIPTION
[0021] The application will be further described in detail below.
[0022] To make the objects, technical solutions and advantages of embodiments of the application clearer, the technical solutions in the embodiments will be described clearly and completely below with reference to the drawings of the embodiments of the application. The following embodiments are used to explain the application but are not used to limit the scope of the application.
[0023] As shown in Figure 1 A processing system mainly comprises an edge computing-based CAN bus data processing framework, which comprises a data acquisition and analysis layer, a data processing layer, a data storage layer and a data reporting layer connected in sequence. The data acquisition and analysis layer and the data reporting layer are connected with the CAN bus.
[0024] The data acquisition and analysis layer uses a socket to establish communication with the CAN bus and inputs CAN bus data and a DBC protocol file as program basic data. The functions are mainly divided into two parts: 1. loading the protocol analysis rules defined in the relevant DBC file content of the current machine type as the basic tool for CAN data analysis; 2. continuously listening to CAN channel data using threads and using the loaded analysis rules to analyze the signal physical value in real time; 3. forming a standard data set in the form of key-value pairs with the signal physical value for calling by the data processing module.
[0025] The data processing layer first loads the machine configuration items and then acquires the analyzed signal physical value for processing according to requirements.
[0026] The data acquisition and analysis layer introduces a DBC file encrypted using an SM4 algorithm as a standardized protocol tool for CAN bus data analysis, combines with dynamically configured vehicle type parameters, uses the corresponding decryption algorithm to realize efficient analysis of CAN bus data of different vehicle types, and ensures the security of the protocol data while having scalability.
[0027] 1. Periodic data storage: sorting the basic analysis data that needs to be stored; 2、Statistical data calculation: the extreme value is the maximum or minimum value of a signal recorded on the day, the average value is the dynamic average value of certain signals under certain conditions, and the cumulative value is the time length or quantity statistics of certain signals under certain conditions; 3、Business calculation logic: alarm and fault handling, action and event state machine and other specific business logic.
[0028] Alarm and fault handling: generate historical alarm and fault records according to CAN bus data; Action and event state machine: state statistics of device action and event, action refers to the running condition of vehicle equipment, such as driving, stopping, heavy load, light load, etc.; event refers to vehicle equipment switch signal, etc.; action is counted after being judged by defined rules, and event is counted directly according to physical value transmitted by protocol; Other specific business logic: there are other specific business logic for different models, such as truck tire state monitoring.
[0029] Data storage layer, using Sqlite database, storing data including periodic basic data, statistical data, alarm and fault history records, and other business logic data.
[0030] Data reporting layer: after converting the program statistical result data into multi-channel CAN frame form, it is sent to the CAN bus, and then uploaded to the business system through GPS, meeting the needs of device testing and device monitoring. The data reporting layer contains a standardized data uploading mechanism, which can encapsulate the result data into CAN frame format, send it to the CAN bus, and use GPS to collect data after sending it to the CAN bus, meeting the requirements of vehicle management system data statistics and health management. It also has a multi-frame transmission protocol to ensure that all result data can be uploaded completely.
[0031] The processing system provided by the embodiment has good expansibility. On the one hand, it can adapt to the basic needs of data acquisition, data statistics, action judgment, etc. of different models through standardized configuration file interface, and on the other hand, it can deploy different specific business processing logic to enhance the scene application. In combination Figure 2 As shown in the figure, a data processing method suitable for engineering machinery edge calculation includes the following steps: Step 1: initialization operation when starting the program, including loading model configuration file and CAN communication channel establishment, DBC protocol file loading, database table structure initialization, variable value initialization, etc.
[0032] 1.1 In the initialization of the database, the device information configuration file needs to be loaded. These configuration files cover the model of the device, the number of CAN interfaces, the name of each CAN interface, the baud rate of the CAN interface, the average value and the extreme value calculation index, and the database table structure information. In addition, they also contain parameter data necessary in the business processing process, such as idle speed threshold data for different models. According to the number of CAN interfaces of each model, a communication connection is established with the CAN bus through a socket; DBC files encrypted using the SM4 algorithm are introduced as standardized protocol tools for CAN bus data analysis, combined with dynamically configured vehicle type parameters, and using corresponding decryption algorithms to achieve efficient analysis of CAN bus data for different vehicle models, while ensuring the security of protocol data.
[0033] 1.2 Load the DBC file of the engine SAE J1939 protocol of the current model of the whole vehicle and GPS module, etc. Generate parsing rules, including two parts, the first part is message, message name, message length, and signal list contained; the second part is signal name, start bit, length, byte sequence, symbolic, resolution, offset; as the rule input for subsequent CAN data analysis.
[0034] 1.3 According to the database table structure information in the configuration file, initialize the database table.
[0035] 1.4 Load historical data. For the device, the data that needs to be counted includes the cumulative value, average value and extreme value of the day and total history two dimensions; at the start of the program, it is necessary to load historical data according to different start conditions, and initialize variables for correct processing of cumulative value, daily average value, daily extreme value, etc.; when the program is started for the first time, there is no need to load historical data; when the program has a start history and generates historical business data, but it is the first time to start on a certain day, it is necessary to load the historical data of the total cumulative value; when the program has a start history on the day and restarts, it is necessary to load the historical data of the total cumulative value, daily cumulative value, daily average value and daily extreme value.
[0036] Step 2: Real-time acquisition of CAN bus data and parsing according to DBC file rules; store the parsed data in the form of key-value pairs; and get ACC status from the standard data set once at the beginning of parsing, for controlling the start of the timer; enable the specified timer according to the ACC condition.
[0037] ACC refers to the engine start-stop state that the protocol itself has or is converted from the protocol data. According to different vehicle models, it can be obtained through different signals such as key switch signal and engine shutdown countdown signal in the CAN protocol.
[0038] In some models, there will be a power switch, so the vehicle and the controller will be powered on, and the edge computing program in the controller will also start accordingly, but the engine has not started, which is the non-working condition at this time, the CAN bus data is less, and the data is not necessary for edge computing to record and analyze. The edge computing program needs to record and analyze the data when the engine is working.
[0039] Based on the above reasons, the edge computing records and obtains data when the engine is started by controlling the ACC state from the protocol itself or the conversion during program running, so as to calculate the average value, extreme value and various data; instead of starting to record and analyze data only by powering on the controller.
[0040] 2.1 Continuously monitor the CAN channel established in 1.1 using a separate thread to obtain real-time CAN raw data.
[0041] 2.2 According to the CAN data parsing rules loaded in 1.2, the real-time CAN data obtained in 2.1 is parsed and stored in a standard data set. The standard data set is in the form of a dictionary (key-value pair); the key is the signal name, and the value is the physical value of the parsed signal. The key in the standard data set is unique, and when the same signal data is received again, the physical value in the standard data set will be updated.
[0042] 2.3 Determine the ACC state: obtain ACC state data from the standard data set and determine it. If the ACC state is on, start the main timer to capture the ACC on-off signal, and then control the data processing timer to turn off, while starting the fault processing timer, periodic basic data storage timer, action state tracking timer, event state tracking timer, average value calculation timer, extreme value calculation timer, and CAN data back timer for data processing and data result back. If the ACC state is off, start the ACC monitoring timer to monitor the ACC state when the device is powered on and trigger the program restart process.
[0043] Step 3: This step is data processing and data storage. Different types of data processing have different frequencies, so steps 3.1-3.7 are performed simultaneously and do not interfere with each other. In the ACC on state, they run continuously according to the set frequency.
[0044] 3.1 Timer 1: First, obtain the data for 500ms frequency basic data storage from the standard data set in 1.4, then sort according to the database table structure in order, and then complete (if there is no corresponding data in the standard data set, set the signal physical value to Null). The system will first cache this frequency data, and when the cache data reaches the set number, it will be stored centrally to reduce the database operation frequency.
[0045] 3.2, Timer 2: First, get the data for 5s frequency-based data storage from the standard data set in 1.4, second, sort according to the database table structure sequence, and then complete (if there is no corresponding data in the standard data set, the signal physical value is set to Null); the data generated by this timer is written into the database in real time.
[0046] 3.3, Timer 3: Get the data for 1min frequency-based data storage from the standard data set in 1.4, first sort according to the database table structure sequence, and then complete (if there is no corresponding data in the standard data set, the signal physical value is set to Null); the data generated by this timer is written into the database in real time.
[0047] 3.4, Timer 4: Get the data for alarm fault management from the standard data set in 1.4, when a new alarm fault code appears in the obtained data, it is considered that the alarm or fault corresponding to the code is activated and the start time is recorded, when no alarm fault code in the active state is found in the obtained data, it is considered that the alarm or fault has ended, and the end time is recorded.
[0048] 3.5, Timer 5: When the program starts, set the last action state value to None; get the data for action state recording from the standard data set in 1.4, judge the current action state; when the current action state is not equal to the last action state, if the last state is None, it is considered that the current action state starts, and the start time of the current action state is recorded, if the last state is not None, it is considered that the last action state ends, the current action state starts, and the end time of the last action state and the start time of the current action state are recorded; if the current action state is equal to the last action state, it is considered that the state continues, and the natural change duration is added to the current state duration.
[0049] 3.6, Timer 6: When the program starts, set the state value of all events to None; get the data for event state recording from the standard data set in 1.4, the current event state is the signal physical value; all event state records are executed in sequence; when the current event state is not equal to the last event state, if the last state is None, it is considered that the state of the current event starts, and the start time of the current action state is recorded, if the last state is not None, it is considered that the last action state ends, the current action state starts, and the end time of the last action state and the start time of the current action state are recorded; if the current action state is equal to the last action state, it is considered that the state continues, and the natural change duration is added to the current state duration.
[0050] 3.7, Timer 7: When the program starts, load the initialization data of the average value to be calculated; when the timer runs, get the data for average value calculation from the standard data set in 1.4, and record the average value calculation times. The average value calculation method uses real-time average value, and the calculation formula is: (last average value * average value calculation times + this data value) / (average value calculation times + 1), which can reduce the memory consumption caused by constantly storing historical data.
[0051] 3.8, Timer 8: When the program starts, load the initialization data of the extreme value to be calculated; when the timer runs, get the data for extreme value calculation from the standard data set in 1.4, and compare it with the current extreme value. Only when the extreme value changes, the database data will be updated, reducing the database write operation.
[0052] Step 4: After converting the program statistics result data into multi-channel CAN frame form, it is sent to the CAN bus, and then uploaded to the business system through GPS, meeting the needs of device testing and device monitoring.
[0053] Although the embodiments of the present application have been shown and described, those skilled in the art can understand that various changes, modifications, replacements and variations can be made to these embodiments without departing from the principles and purposes of the present application, and the scope of the present application is defined by the claims and their equivalents.
Claims
1. A data processing method suitable for edge computing of engineering machinery, characterized in that: The steps include: S1. Initialize data and load configuration files; S2. Acquire CAN bus data in real time and parse it according to DBC file rules; store the parsed data in the form of key-value pairs; and obtain the ACC status from the standard data set once when parsing begins to control the timer start; Enable the specified timer according to the ACC situation; S3: Data fixed frequency processing and data storage, running continuously at the set frequency when ACC is turned on; S4, data reporting, encapsulates the result data into multiple CAN frame formats, sends them to the CAN bus, and uses GPS for data collection.
2. The data processing method applicable to edge computing of engineering machinery according to claim 1, characterized in that: S1. Initialize data and load configuration files; including loading model configuration files, establishing CAN communication channels, loading DBC protocol files, initializing database table structures, and initializing variable values; S1.
1. When initializing the database, the device information configuration files must be loaded. These configuration files include the device model, number of CAN interfaces, names of each CAN interface, baud rate of the CAN interface, average and extreme value calculation indicators, and database table structure information. In addition, they also contain parameter data necessary for business processing, such as idle threshold data for different models, and establish communication connections with the CAN bus through sockets based on the number of CAN interfaces of each model. S1.
2. Load the DBC file of the SAE J1939 protocol for the current vehicle model, GPS modules, and engine, and generate parsing rules. The DBC file consists of two parts: the first part is the message, message name, message length, and included signal list; the second part is the signal name, start bit, length, byte order, symbolicity, resolution, and offset. These serve as input for subsequent CAN data parsing rules. S1.
3. Initialize the database table according to the database table structure information in the configuration file; S1.
4. Load historical data. The device data that needs to be counted includes the cumulative value, average value, and extreme value of the current day and the total history.
3. The data processing method applicable to edge computing of engineering machinery according to claim 2, characterized in that: S1.
4. Load historical data; When the program starts, it is necessary to load historical data according to different startup situations and initialize variables to correctly process data such as cumulative values, daily average values, and daily extreme values; When the program is started for the first time, there is no need to load historical data; When a program has a startup history and generates historical business data, but is started for the first time on a certain day, the historical data of the total accumulated value needs to be loaded; When the program has a history of being started on the same day and is restarted, the historical data of the total cumulative value, the cumulative value of the day, the average value of the day, and the extreme value of the day need to be loaded.
4. The data processing method applicable to edge computing of engineering machinery according to claim 2, characterized in that: S2. Acquire CAN bus data in real time and parse it according to DBC file rules; store the parsed data in the form of key-value pairs; and obtain the ACC status from the standard data set once when parsing begins to control the timer start; activate the specified timer according to the ACC status; S2.
1. Use a separate thread to continuously monitor the CAN channel established in S1 and obtain CAN raw data in real time. S2.
2. According to the CAN data parsing rules loaded in S1.2, the real-time CAN data acquired in S2.1 is parsed and stored in a standard data set in the form of a dictionary (key-value pairs); The key is the signal name, and the value is the physical value of the signal after parsing. The key is unique in the standard data set. When the same signal data is received again, the physical value in the standard data set will be updated. S2.
3. Determine ACC status; The ACC status data is obtained from the standard data set and judged. If the ACC status is on (ACC=1), the main timer is started to capture the shutdown signal when the ACC is on, thereby controlling the shutdown of the data processing timer. At the same time, the fault processing timer, periodic basic data storage timer, action status tracking timer, event status tracking timer, average value calculation timer, extreme value calculation timer, and CAN data return timer are enabled for fixed-frequency data processing and data result return. If the ACC status is off (ACC=0), the ACC monitoring timer is started to trigger the program restart process when the ACC status changes to on when the device is powered on.
5. The data processing method applicable to edge computing of engineering machinery according to claim 4, characterized in that: S3, fixed frequency data processing and data storage; when ACC is turned on, it runs continuously at the set frequency, and multiple timers run simultaneously without interfering with each other; Timer 1: Obtains data for 500ms frequency basic data storage from the standard data set in S1.4, sorts it according to the database table structure, and then completes it (if there is no corresponding data in the standard data set, the signal physical value is set to Null). This frequency data is first cached. When the cached data reaches the set amount, it is centrally stored to reduce the frequency of database operations. Timer 2: Obtains data for 5-second frequency basic data storage from the standard data set in S1.4, sorts it according to the database table structure, and then completes it (if there is no corresponding data in the standard data set, the signal physical value is set to Null). The data generated by this timer is immediately written to the database. Timer 3: Obtains data for 1-minute frequency basic data storage from the standard data set in S1.4, first sorts it according to the database table structure, and then completes it (if there is no corresponding data in the standard data set, the signal physical value is set to Null). The data generated by this timer is immediately written to the database; Timer 4: Acquires data for alarm and fault management from the standard data set in S1.
4. When a new alarm or fault code appears in the acquired data, it is considered that the alarm or fault corresponding to the code is activated and the start time is recorded. When no active alarm or fault code is found in the acquired data, it is considered that the alarm or fault has ended and the end time is recorded. Timer 5: When the program starts, the last action state value is set to None; the data used for action state recording is obtained from the standard data set in S1.4 to determine the current action state; When the current action state is not equal to the previous action state, if the previous state value is None, it is considered that the current action state has started, and the start time of the current action state is recorded; If the last state value is not None, it is considered that the last action state has ended and the current action state has started, and the end time of the last action state and the start time of the current action state are recorded; If the current action state is equal to the previous action state, it is considered as a continuous state, and the natural change duration is added to the current state duration; Timer 6: When the program starts, the status values of all events are set to None; the data used for event status recording is obtained from the standard data set in S1.
4. The current event status is the physical value of the signal; All event status records are executed in sequence; When the current event state is not equal to the previous event state, if the previous state is None, it is considered that the state of the current event has started, and the start time of the current action state is recorded; If the last state is not None, it is considered that the last action state has ended and the current action state has started, and the end time of the last action state and the start time of the current action state are recorded; If the current action state is equal to the previous action state, it is considered as a continuous state, and the natural change duration is added to the current state duration; Timer 7: When the program starts, it loads the initialization data for the average value to be calculated. When Timer 7 is running, it obtains the data used for average calculation from the standard data set in S1.4 and records the number of average calculations. The average calculation method uses the real-time average value, and the calculation formula is: (last average value * number of average calculations + current data value) / (number of average calculations + 1). This can reduce the memory consumption caused by continuously storing historical data. Timer 8: When the program starts, it loads the initialization data for the extreme values to be calculated. When Timer 8 is running, it obtains the data used for extreme value calculation from the standard data set in S1.4 and compares it with the current extreme value. The database data is updated only when the extreme value changes, reducing database write operations.
6. A processing system, characterized in that The processing system includes: a processor and a computer-readable memory, the memory being suitable for storing a plurality of program codes, the program codes being suitable for being loaded and run by the processor to execute the data processing method applicable to edge computing of engineering machinery according to any one of claims 1 to 5; It also includes a CAN bus data processing framework based on edge computing, which includes a data acquisition and parsing layer, a data processing layer, a data storage layer, and a data reporting layer that are sequentially connected in communication; The data acquisition and analysis layer is communicatively connected to the CAN bus.
7. The processing system according to claim 6, characterized in that The data acquisition and analysis layer uses socket to establish communication with the CAN bus, and inputs the CAN bus data and DBC protocol files as program basic data. The main functions of the data acquisition and analysis layer are: Ⅰ. Load the protocol parsing rules defined in the relevant DBC file content of the current model as the basic tool for CAN data parsing; II. Use a thread to continuously monitor CAN channel data and use the loaded parsing rules to parse the signal physical value in real time; III. The signal physical values are converted into a standard data set in the form of key-value pairs for the data processing module to call.
8. The processing system according to claim 6, characterized in that The data processing layer is used to load the model configuration items, and then obtain the parsed signal physical values and process them according to the requirements; the main functions of the data processing layer are: Ⅰ. Periodic data storage: organize the basic analytical data that needs to be stored; II. Statistical data calculation: Extreme value is the maximum or minimum value of a signal on a given day, average value is the dynamic average value of certain signals under specific conditions, and cumulative value is the duration or quantity of certain signals under specific conditions. III. Business computing logic: alarm and fault handling, action and event state machines, and other specific business logic; Alarm and fault handling: Generate historical alarm and fault records based on CAN bus data; Action and event state machine: statistics on the actions and events of the device; Action refers to the operating status of vehicle equipment, and event refers to the switch signal of vehicle equipment, etc. Actions are counted after being judged by defined rules, while events are counted directly based on the physical values transmitted by the protocol; Other specific business logic, including tire condition monitoring of trucks.
9. The processing system according to claim 8, characterized in that The data storage layer uses a Sqlite database, and the stored data includes periodic basic data, statistical data, alarm fault history records and other specific business logic data.
10. The processing system according to claim 6, wherein: The data reporting layer is connected to the CAN bus and has a multi-CAN frame transmission protocol. After converting the program statistical result data into a multi-channel CAN frame format, it is sent to the CAN bus and then uploaded to the business system through GPS.
Citation Information
Patent Citations
A crane Internet of Things data collection and analysis system and method
CN115180520B
Engineering mechanical property analysis method and system and excavator
CN119622240A