CN-122002244-A - Data reporting method, device, equipment and storage medium
Abstract
The application discloses a data reporting method, a device, equipment and a storage medium, which relate to the field of vehicle-mounted equipment and are applied to target vehicle-mounted equipment, and comprise the steps of starting target background application on the target vehicle-mounted equipment, and reading and analyzing a target configuration file by utilizing the target background application to determine a target reporting item switch, target reporting configuration and target reporting parameters; the target configuration file is a JSON file, a target data acquisition interface is utilized to acquire data of a target report item of target vehicle-mounted equipment based on a target report item switch so as to acquire a target data packet, a target report path and target report logic corresponding to the target vehicle-mounted equipment are determined based on the target report configuration and the target report parameter, and the target data packet is reported through the target report path based on the target report logic. The application realizes the flexible reporting of the data of the vehicle-mounted equipment.
Inventors
- ZHU JUNXIAN
Assignees
- 杭州麦唐科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260210
Claims (10)
- 1. The data reporting method is characterized by being applied to target vehicle-mounted equipment and comprising the following steps of: starting a target background application on the target vehicle-mounted equipment, and reading and analyzing a target configuration file by using the target background application to determine a target reporting item switch, target reporting configuration and target reporting parameters, wherein the target configuration file is a JSON file; acquiring data of a target report item of the target vehicle-mounted equipment based on the target report item switch by using a target data acquisition interface to acquire a target data packet; And determining a target reporting path and target reporting logic corresponding to the target vehicle-mounted equipment based on the target reporting configuration and the target reporting parameters, and reporting the target data packet through the target reporting path based on the target reporting logic.
- 2. The method for reporting data according to claim 1, wherein the reading and parsing the target configuration file by the target background application to determine a target reporting item switch, a target reporting configuration, and a target reporting parameter includes: reading a first target configuration file local to the target vehicle-mounted equipment by using the target background application, and analyzing the first target configuration file to obtain a corresponding analysis result; if the analysis result represents that the target background application successfully analyzes the first target configuration file, determining a target reporting item switch, target reporting configuration and target reporting parameters based on the first target configuration file; And if the analysis result represents that the target background application does not successfully analyze the first target configuration file, reading a second target configuration file under a corresponding path of the target background application by using the target background application so as to determine a target reporting item switch, target reporting configuration and target reporting parameters based on the second target configuration file.
- 3. The method of claim 1, wherein the determining the target reporting path and the target reporting logic corresponding to the target vehicle device based on the target reporting configuration and the target reporting parameter includes: If the target reporting configuration corresponds to a first target reporting path, constructing first target reporting logic based on a first target reporting parameter corresponding to the first target reporting path, wherein the first target reporting path is a data transmission path for reporting a target data packet corresponding to the target vehicle-mounted equipment to a cloud; And if the target reporting configuration corresponds to a second target reporting path, constructing second target reporting logic based on a second target reporting parameter corresponding to the second target reporting path, wherein the second target reporting path is a data transmission path for writing a target data packet corresponding to the target vehicle-mounted data into the local target vehicle-mounted equipment.
- 4. The method for reporting data according to claim 1, wherein the step of acquiring the data of the target report item of the target in-vehicle device based on the target report item switch to acquire the target data packet includes: Determining a target data filtering rule based on the target configuration file, and acquiring data of a target report item of the target vehicle-mounted equipment based on the target report item switch and the target data filtering rule to acquire a target data packet; correspondingly, the reporting the target data packet through the target reporting path based on the target reporting logic includes: Judging whether a data packet of the same type as the target data packet exists in a current preset data reporting period or not based on the target data filtering rule, and if the data packet of the same type as the target data packet is uploaded in the current preset data reporting period, terminating the reporting flow of the target data packet.
- 5. The method for reporting data according to claim 1, wherein before the reporting the target data packet through the target reporting path based on the target reporting logic, the method further comprises: adjusting the target reporting path and the target reporting logic based on the current network condition of the target vehicle-mounted equipment; correspondingly, the reporting the target data packet through the target reporting path based on the target reporting logic includes: and reporting the target data packet through the adjusted target reporting path based on the adjusted target reporting logic.
- 6. The data reporting method of claim 1, further comprising: And determining target network configuration based on the target configuration file by utilizing the target background application, and judging whether a bidirectional communication channel between the target vehicle-mounted equipment and the cloud is started or not based on the target network configuration, wherein the bidirectional communication channel is a communication channel constructed based on an MQTT protocol.
- 7. The method for reporting data according to claim 6, wherein after the reporting the target data packet through the target reporting path based on the target reporting logic, further comprises: acquiring a data reporting result corresponding to the target data packet, and generating a corresponding data reporting log based on the data reporting result; And if the data reporting result represents that the reporting of the target data packet fails, storing the target data packet into a preset buffer space, and asynchronously reporting the target data packet based on a preset reporting period.
- 8. The utility model provides a data reporting device which characterized in that is applied to target on-vehicle equipment, includes: The system comprises a configuration file analysis module, a target report item switch, a target report configuration and target report parameters, wherein the configuration file analysis module is used for starting a target background application on the target vehicle-mounted equipment, and reading and analyzing a target configuration file by utilizing the target background application to determine the target report item switch, the target report configuration and the target report parameters; the data acquisition module is used for acquiring data of a target report item of the target vehicle-mounted equipment based on the target report item switch by utilizing a target data acquisition interface so as to acquire a target data packet; And the data reporting module is used for determining a target reporting path and target reporting logic corresponding to the target vehicle-mounted equipment based on the target reporting configuration and the target reporting parameters, and reporting the target data packet through the target reporting path based on the target reporting logic.
- 9. An electronic device, comprising: A memory for storing a computer program; a processor for executing the computer program to implement the data reporting method of any one of claims 1 to 7.
- 10. A computer readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements a data reporting method according to any one of claims 1 to 7.
Description
Data reporting method, device, equipment and storage medium Technical Field The present invention relates to the field of vehicle devices, and in particular, to a method, an apparatus, a device, and a storage medium for reporting data. Background With the development of intelligent vehicles, vehicle-mounted equipment (such as an Android system terminal) needs to be in real-time bidirectional communication with a cloud end so as to realize functions of data reporting, state monitoring and the like. The conventional reporting system usually adopts a hard coding manner, that is, a reporting target (cloud or local), a data format, a filtering rule and the like are fixedly defined in a reporting logic. This approach is applicable to a single device, but when multiple device platforms (e.g., different models) need to be adapted, the developer must modify the code to recompile, resulting in poor system scalability and complex maintenance. In addition, the reported data items (such as the VIN code of the device, the CPU utilization rate, etc.) are often fixed, and cannot be dynamically selected according to specific requirements, which easily causes data redundancy or loss. Disclosure of Invention In view of the above, the present invention aims to provide a data reporting method, device, equipment and storage medium, which can implement flexible reporting of vehicle-mounted equipment data. The specific scheme is as follows: in a first aspect, the present application discloses a data reporting method, applied to a target vehicle-mounted device, including: starting a target background application on the target vehicle-mounted equipment, and reading and analyzing a target configuration file by using the target background application to determine a target reporting item switch, target reporting configuration and target reporting parameters, wherein the target configuration file is a JSON file; acquiring data of a target report item of the target vehicle-mounted equipment based on the target report item switch by using a target data acquisition interface to acquire a target data packet; And determining a target reporting path and target reporting logic corresponding to the target vehicle-mounted equipment based on the target reporting configuration and the target reporting parameters, and reporting the target data packet through the target reporting path based on the target reporting logic. Optionally, the reading and analyzing the target configuration file by using the target background application to determine a target reporting item switch, a target reporting configuration and a target reporting parameter includes: reading a first target configuration file local to the target vehicle-mounted equipment by using the target background application, and analyzing the first target configuration file to obtain a corresponding analysis result; if the analysis result represents that the target background application successfully analyzes the first target configuration file, determining a target reporting item switch, target reporting configuration and target reporting parameters based on the first target configuration file; And if the analysis result represents that the target background application does not successfully analyze the first target configuration file, reading a second target configuration file under a corresponding path of the target background application by using the target background application so as to determine a target reporting item switch, target reporting configuration and target reporting parameters based on the second target configuration file. Optionally, the determining, based on the target reporting configuration and the target reporting parameter, a target reporting path and target reporting logic corresponding to the target vehicle-mounted device includes: If the target reporting configuration corresponds to a first target reporting path, constructing first target reporting logic based on a first target reporting parameter corresponding to the first target reporting path, wherein the first target reporting path is a data transmission path for reporting a target data packet corresponding to the target vehicle-mounted equipment to a cloud; And if the target reporting configuration corresponds to a second target reporting path, constructing second target reporting logic based on a second target reporting parameter corresponding to the second target reporting path, wherein the second target reporting path is a data transmission path for writing a target data packet corresponding to the target vehicle-mounted data into the local target vehicle-mounted equipment. Optionally, the acquiring, based on the target report item switch, the data of the target report item of the target vehicle-mounted device to obtain the target data packet includes: Determining a target data filtering rule based on the target configuration file, and acquiring data of a target report item of the target vehicle-mounted equipme