Data reporting method and device, equipment and storage medium
By controlling the data reporting of vehicle-mounted devices through JSON configuration files, the problem of poor scalability in multi-platform adaptation of traditional systems is solved, enabling flexible data reporting and efficient resource utilization, and improving system compatibility and maintenance efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU MAITANG TECH CO LTD
- Filing Date
- 2026-02-10
- Publication Date
- 2026-05-08
AI Technical Summary
Traditional vehicle-mounted equipment data reporting systems have poor scalability and are complex to maintain when adapting to multiple equipment platforms. Furthermore, the reported data items are fixed and cannot be dynamically selected, leading to data redundancy or missing data.
The system uses a JSON-formatted configuration file to control the data reporting method. The target backend application reads and parses the configuration file to determine the reporting item switches, configurations, and parameters. It uses a data acquisition interface to obtain data packets and determines the reporting path and logic based on the reporting configuration and parameters. It supports fine-grained data item switches and dynamic selection of reporting methods.
It enables flexible reporting of data from vehicle-mounted devices, avoids redundancy, saves bandwidth and storage resources, improves system compatibility and scalability, and can adapt to different device platforms without modifying the code.
Smart Images

Figure CN122002244A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle-mounted equipment, and in particular to a data reporting method, apparatus, device, and storage medium. Background Technology
[0002] With the development of intelligent vehicles, in-vehicle devices (such as Android system terminals) need to communicate with the cloud in real time to achieve functions such as data reporting and status monitoring. Traditional reporting systems typically use hard-coding, that is, the reporting target (cloud or local), data format, filtering rules, etc. are fixedly defined in the reporting logic. This approach is suitable for a single device, but when it is necessary to adapt to multiple device platforms (such as different vehicle models), developers must modify the code and recompile, resulting in poor system scalability and complex maintenance. In addition, the reported data items (such as device VIN code, CPU utilization, etc.) are often fixed and cannot be dynamically selected according to specific needs, which can easily lead to data redundancy or missing data. Summary of the Invention
[0003] In view of this, the purpose of this invention is to provide a data reporting method, apparatus, device, and storage medium, capable of flexibly reporting data from vehicle-mounted equipment. The specific solution is as follows: Firstly, this application discloses a data reporting method applied to a target vehicle-mounted device, comprising: A target background application is launched on the target vehicle device. The target background application is used to read and parse the target configuration file to determine the target reporting item switch, target reporting configuration, and target reporting parameters. The target configuration file is a JSON file. Using the target data acquisition interface, data of the target reporting item of the target vehicle-mounted device is collected based on the target reporting item switch to obtain the target data packet; Based on the target reporting configuration and the target reporting parameters, the target reporting path and target reporting logic corresponding to the target vehicle device are determined, and the target data packet is reported through the target reporting path based on the target reporting logic.
[0004] Optionally, the step of using the target backend application to read and parse the target configuration file to determine the target reporting item switch, target reporting configuration, and target reporting parameters includes: The target background application is used to read the first target configuration file locally on the target vehicle device, and the first target configuration file is parsed to obtain the corresponding parsing results; If the parsing result indicates that the target backend application has successfully parsed the first target configuration file, then the target reporting item switch, target reporting configuration, and target reporting parameters are determined based on the first target configuration file. If the parsing result indicates that the target background application has failed to parse the first target configuration file, then the target background application is used to read the second target configuration file under the corresponding path of the target background application, so as to determine the target reporting item switch, target reporting configuration and target reporting parameters based on the second target configuration file.
[0005] Optionally, determining the target reporting path and target reporting logic corresponding to the target vehicle-mounted device based on the target reporting configuration and the target reporting parameters includes: If the target reporting configuration corresponds to a first target reporting path, then a first target reporting logic is constructed based on the first target reporting parameters corresponding to the first target reporting path; the first target reporting path is a data transmission path for reporting the target data packet corresponding to the target vehicle device to the cloud; If the target reporting configuration corresponds to a second target reporting path, then a second target reporting logic is constructed based on the second target reporting parameters corresponding to the second target reporting path; the second target reporting path is a data transmission path that writes the target data packet corresponding to the target vehicle data to the local data of the target vehicle device.
[0006] Optionally, the step of collecting data on the target reporting item of the target vehicle-mounted device based on the target reporting item switch to obtain the target data packet includes: Based on the target configuration file, target data filtering rules are determined, and data of the target reporting items of the target vehicle device are collected based on the target reporting item switch and the target data filtering rules to obtain target data packets; Accordingly, the step of reporting the target data packet through the target reporting path based on the target reporting logic includes: Based on the target data filtering rules, it is determined whether there is a data packet of the same type as the target data packet within the current preset data reporting period. If a data packet of the same type as the target data packet has been uploaded within the current preset data reporting period, the reporting process of the target data packet is terminated.
[0007] Optionally, before reporting the target data packet through the target reporting path based on the target reporting logic, the method further includes: The target reporting path and the target reporting logic are adjusted based on the current network status of the target vehicle device. Accordingly, the step of reporting the target data packet through the target reporting path based on the target reporting logic includes: Based on the adjusted target reporting logic, the target data packet is reported through the adjusted target reporting path.
[0008] Optionally, the data reporting method further includes: The target backend application determines the target network configuration based on the target configuration file, and determines whether to enable the bidirectional communication channel between the target vehicle device and the cloud based on the target network configuration; the bidirectional communication channel is a communication channel built based on the MQTT protocol.
[0009] Optionally, after reporting the target data packet through the target reporting path based on the target reporting logic, the method further includes: Obtain the data reporting result corresponding to the target data packet, and generate the corresponding data reporting log based on the data reporting result; If the data reporting result indicates that the target data packet has failed to be reported, the target data packet is saved to a preset cache space and asynchronously reported based on a preset rereporting period.
[0010] Secondly, this application discloses a data reporting device applied to a target vehicle-mounted device, comprising: The configuration file parsing module is used to launch a target background application on the target vehicle device, and use the target background application to read and parse the target configuration file to determine the target reporting item switch, target reporting configuration, and target reporting parameters; the target configuration file is a JSON file. The data acquisition module is used to acquire data of the target reporting item of the target vehicle device by using the target data acquisition interface and based on the target reporting item switch to obtain the target data packet; The data reporting module is used to determine the target reporting path and target reporting logic corresponding to the target vehicle device based on the target reporting configuration and the target reporting parameters, and to report the target data packet through the target reporting path based on the target reporting logic.
[0011] Thirdly, this application discloses an electronic device, including: Memory, used to store computer programs; A processor is used to execute the computer program to implement the aforementioned data reporting method.
[0012] Fourthly, this application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned data reporting method.
[0013] In this application, when the target vehicle-mounted device reports data, a target background application is launched on the target vehicle-mounted device. This background application reads and parses a target configuration file to determine the target reporting item switch, target reporting configuration, and target reporting parameters. The target configuration file is a JSON file. Using a target data acquisition interface, data on the target reporting items of the target vehicle-mounted device is collected based on the target reporting item switches to obtain target data packets. Based on the target reporting configuration and the target reporting parameters, the target reporting path and target reporting logic corresponding to the target vehicle-mounted device are determined, and the target data packets are reported through the target reporting path based on the target reporting logic. Therefore, this application achieves dynamic selection of the data reporting method by using a JSON-formatted target configuration file and controlling the data reporting method using specific fields within the target configuration file. Simultaneously, the target reporting item switches in the target configuration file enable fine-grained data item switching, allowing for customized reporting content, thereby achieving flexible reporting of vehicle-mounted device data, avoiding redundant reporting, and saving bandwidth and storage resources. Furthermore, the flexible JSON structure in this application allows for the generation of dedicated configuration files for different devices, enabling the switching of reporting logic without modifying the code. This improves development and maintenance efficiency, enhances the compatibility and scalability of the data reporting system implemented based on this application, and is applicable to multi-platform vehicle equipment. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0015] Figure 1 This is a flowchart of a data reporting method disclosed in this application; Figure 2 This is a schematic diagram illustrating a specific data reporting logic determination process disclosed in this application; Figure 3 This is a schematic diagram of a specific data reporting process disclosed in this application; Figure 4 This is a schematic diagram of the structure of a data reporting device disclosed in this application; Figure 5 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] With the development of intelligent vehicles, in-vehicle devices (such as Android system terminals) need to communicate with the cloud in real time to achieve functions such as data reporting and status monitoring. Traditional reporting systems typically use hard-coding, that is, the reporting target (cloud or local), data format, filtering rules, etc. are fixedly defined in the reporting logic. This approach is suitable for a single device, but when it is necessary to adapt to multiple device platforms (such as different vehicle models), developers must modify the code and recompile, resulting in poor system scalability and complex maintenance. In addition, the reported data items (such as device VIN code, CPU utilization, etc.) are often fixed and cannot be dynamically selected according to specific needs, which can easily lead to data redundancy or missing data. To solve the above technical problems, this application discloses a data reporting method that enables flexible reporting of data from in-vehicle devices.
[0018] See Figure 1 As shown, this embodiment of the invention discloses a data reporting method applied to a target vehicle-mounted device, comprising: Step S11: Start the target background application on the target vehicle device, and use the target background application to read and parse the target configuration file to determine the target reporting item switch, target reporting configuration and target reporting parameters; the target configuration file is a JSON file.
[0019] In this embodiment, as Figure 2 As shown, when the target background application on the target vehicle device starts, it reads the target configuration file, which can be a JSON configuration file named proxy.json. Figure 3As shown, the target backend application automatically begins initialization in Application.Create() upon startup or event triggering, using AssetManager or FileInputStream to read JSON strings. This file structure includes report (reporting configuration), cloud (cloud reporting parameters), car (local reporting parameters), consume (consumption configuration), and reportItems (reporting item switches). For example, `report.destination` specifies the reporting target ("cloud" indicates reporting to the cloud, "car" indicates reporting locally); `cloud.filter` being true indicates that filtering is enabled (data of the same type is only reported once a day), `channel` specifies the cloud channel (e.g., "DM2.5"), `size` specifies the daily reported data size (e.g., 5M), and `dataFormat` specifies the data format (e.g., "json"); `car.filter` is similar, `path` specifies the local storage path (e.g., " / data / data / com.ivi.ids / "), `size` specifies the size of each file (e.g., 4M), and `number` specifies the maximum number of files (e.g., 30, overwriting files exceeding this limit); `consume.mqtt` being true indicates that MQTT consumption is enabled; fields in `reportItems` (e.g., `isHeightReport: true`) indicate whether to report the corresponding data items (e.g., height, width, VIN code, CPU utilization, etc.). In one specific implementation, the target configuration file defines reporting parameters (e.g., reporting event type, data fields, transmission protocol, triggering conditions) and reporting logic (e.g., filtering rules, encryption method, batch processing), as shown in the following parsing example: { "report": { "destination": "cloud" }, "cloud": { "filter": true, "channel": "DM2.5", "size": 5, "dataFormat": "json" }, "car": { "filter": true, "path": " / data / data / com.ivi.ids / ", "size": 4, "number": 30 }, "consume": { "mqtt": true }, "reportItems": { "isAvntSnReport": true, "isCoreNumberReport": true, "isNameReport": true, "isTypeReport": true, "isHeightReport": true, "isWidthReport": true, "isVinCodeReport": true, "isUSBStatusReport": true, "isWiFiStatusReport": true, "isbluetoothStatusReport": true, "isAdbOpenedReport": true, "isDebugModeReport": true, "isEngineeringModeReport": true, "isKernalReport": true, "isPatchReport": true, "isSDKReport": true, "isVersionReport": true, "isCpuUsageReport": true, "isMemoryUsageReport": true }; In one specific implementation, the target background application reads and parses the target configuration file to determine the target reporting item switch, target reporting configuration, and target reporting parameters. This includes: using the target background application to read a first target configuration file locally on the target vehicle device and parsing the first target configuration file to obtain the corresponding parsing result; if the parsing result indicates that the target background application successfully parses the first target configuration file, then the target reporting item switch, target reporting configuration, and target reporting parameters are determined based on the first target configuration file; if the parsing result indicates that the target background application failed to parse the first target configuration file, then the target background application reads a second target configuration file under the corresponding path of the target background application to determine the target reporting item switch, target reporting configuration, and target reporting parameters based on the second target configuration file. That is, if the target background application can read and parse the first target configuration file locally on the target vehicle device, then the target reporting item switch, target reporting configuration, and target reporting parameters are determined based on the first target configuration file; if the target background application cannot obtain the first target configuration file, or fails to parse the first target configuration file, then the second target configuration file can be found under the installation path corresponding to the target background application, and the target reporting item switch, target reporting configuration, and target reporting parameters are determined based on the second target configuration file. Figure 3 As shown, during the parsing of the JSON configuration file, a JSON library is used to convert it into an object structure. Then, the process proceeds to the decision node "Parsing successful?". If successful, it continues to the "Configure Collection Module" process, dynamically obtaining the collected reporting fields and determining the reporting method based on the parsed data. Otherwise, it proceeds to the "Load Default Configuration" (i.e., load the second target configuration file) process and re-parses the JSON. An example of JSON parsing code could be: `Gson gson = new Gson(); ReportConfig config = gson.fromJson(jsonString, ReportConfig.class)`. If the configuration file does not exist or fields are missing, a `ConfigException` is thrown, and the default configuration (assets / proxy.json) is converted.
[0020] It should be noted that the target backend application in this embodiment is a system-level application, typically installed under system / app / , and the first target configuration file and the target backend application are in the same directory. The second target configuration file has the same content as the first target configuration file, but it resides within the target backend application. In practice, the first target configuration file can be modified by the user, and the modified first target configuration file can be pushed to the target backend application to achieve synchronous hot updates of the second target configuration file. The updated first target configuration file takes effect after the process restarts, and the reporting strategy can be adjusted in real time by updating the JSON file while the application is running, such as changing the data reporting method. If direct modification of the second target configuration file is required, the application developers must modify, test, and release it, and then the car owner must update the system to bypass the first target configuration file and directly update the second target configuration file. It can be understood that the second target configuration file serves as a fallback solution, mainly used to deal with the abnormal situation where the first target configuration file cannot be parsed. In practice, the combination of the two solutions can ensure the normal operation of data reporting. In addition, compared to YAML or XML configuration files, JSON configuration files have the advantage of being lightweight and natively supported by Android; the reporting logic can use database to store parameters instead of files, but the file method is simpler and requires no additional dependencies.
[0021] In this embodiment, the target backend application can also determine the target network configuration based on the target configuration file, and determine whether to enable the bidirectional communication channel between the target vehicle device and the cloud based on the target network configuration; the bidirectional communication channel is a communication channel built based on the MQTT protocol. Specifically, whether to enable MQTT for bidirectional communication can be determined according to the consume.mqtt file in the target configuration file, thereby supporting bidirectional communication extension.
[0022] Step S12: Using the target data acquisition interface, collect the target reporting item data of the target vehicle device based on the target reporting item switch to obtain the target data packet.
[0023] In this embodiment, the target data interface is used to capture events and extract fields based on the on / off switches of target reporting items such as `reportItems` in the parsed data of the target configuration file. The system API is then used to collect data on enabled items of the target vehicle device, and the collected data is formatted as a JSONObject to form a data packet. The reported data includes SOALib and data tracking points. For example, data on enabled items can be collected based on the on / off switches in `reportItems`; if `isCpuUsageReport` is true, CPU usage is collected. In one specific implementation, collecting data on target reporting items of the target vehicle device based on target reporting item switches to obtain the target data packet includes: determining target data filtering rules based on the target configuration file, and collecting data on target reporting items of the target vehicle device based on target reporting item switches and target data filtering rules to obtain the target data packet. By combining filtering rules during collection, duplicate reporting of the same data can be effectively avoided, improving data reporting efficiency. More sensor items can be integrated into the data collection, but the core purpose is still achieved through dynamic configuration adjustments.
[0024] Step S13: Based on the target reporting configuration and the target reporting parameters, determine the target reporting path and target reporting logic corresponding to the target vehicle device, and report the target data packet through the target reporting path based on the target reporting logic.
[0025] In this embodiment, as Figure 2As shown, after obtaining the target data packet, the target reporting logic can be processed. In one specific implementation, the target reporting path and target reporting logic corresponding to the target vehicle device are determined based on the target reporting configuration and target reporting parameters. This includes: if the target reporting configuration corresponds to a first target reporting path, then constructing a first target reporting logic based on the first target reporting parameters corresponding to the first target reporting path; the first target reporting path is the data transmission path for reporting the target data packet corresponding to the target vehicle device to the cloud; if the target reporting configuration corresponds to a second target reporting path, then constructing a second target reporting logic based on the second target reporting parameters corresponding to the second target reporting path; the second target reporting path is the data transmission path for writing the target data packet corresponding to the target vehicle data to the local machine of the target vehicle device. For example, the reporting path can be selected based on report.destination in the target configuration file. If the parameter is "cloud", the reporting logic is constructed using the "cloud" parameter (e.g., uploading JSON data via the DM2.5 channel, with a size limit of 5MB). If the parameter is "car", the data is written to a local file using the "car" parameter (path " / data / data / com.ivi.ids / ", 4MB per file, maximum 30 files). Customization of cloud parameters adapts to different channels and formats, while customization of local parameters enables file management and overwriting. This size limitation mechanism ensures the efficiency and controllability of the reporting process. A specific code example is shown below: System api: proxy800A.ReportMidDataWithString(data, String.class, newSOAListener() { @Override public void onMessageReceive(Object o) { } @Override public void onTimeOut() { SOAListener.super.onTimeOut(); } }); Data tracking points: Map<String, Object> map = new HashMap<>(1); map.put("data", string); DataCenterClient.getInstance().send(EVENT, PAGE, LOCAL, ACTION, map); CommonReporter reporter = (CommonReporter) DataMiningClientManager.getInstance().getReporter(ReporterType.COMMON); HashMap<String, String> hashMap = new HashMap<>(); hashMap.put("data", string); reporter.reportAppEvent(new AppEvent("IDC_IDPS_DATA", hashMap)).
[0026] It should be noted that if a target data filtering rule is set in the aforementioned steps, the target data packet will be reported through the target reporting path based on the target reporting logic. Specifically, this may include: determining whether there is a data packet of the same type as the target data packet within the current preset data reporting period based on the target data filtering rule; if a data packet of the same type as the target data packet has already been uploaded within the current preset data reporting period, the reporting process of the target data packet will be terminated, thereby avoiding duplicate reporting. Similarly, a batch upload rule can also be set, and the target data packets can be uploaded in batches and sent to the server based on this batch upload rule.
[0027] In this embodiment, before reporting the target data packet through the target reporting path based on the target reporting logic, it may further include: adjusting the target reporting path and target reporting logic based on the current network status of the target vehicle device; correspondingly, reporting the target data packet through the target reporting path based on the target reporting logic includes: reporting the target data packet through the adjusted target reporting path based on the adjusted target reporting logic. Figure 4As shown, after reporting the target data packet through the target reporting path based on the target reporting logic, the process can further include: obtaining the data reporting result corresponding to the target data packet, and generating corresponding data reporting logs based on the data reporting result, including data upload success and data upload failure, such as "Log.d(TAG, "sendMessage----------The data SOA interface successfully reported and received the message from ids: " + jsonIdsObject.toString())". If the data reporting result indicates that the target data packet reporting failed, the target data packet is saved to a preset cache space, and the target data packet is asynchronously reported based on a preset rereporting period. Finally, if all data reporting is completed, the process enters the "End" node. It can be understood that the entire process supports parallel branches.
[0028] As can be seen, this application achieves dynamic selection of data reporting methods by using a target configuration file in JSON format and controlling the data reporting method through specific fields in the target configuration file. Simultaneously, the target reporting item switches in the target configuration file enable fine-grained data item switching, allowing for customized reporting content. This achieves flexible reporting of vehicle-mounted equipment data, avoids redundant reporting, and saves bandwidth and storage resources. Furthermore, the flexible JSON structure in this application allows for the generation of dedicated configuration files for different devices, enabling switching of reporting logic without code modification. This improves development and maintenance efficiency, enhances the compatibility and scalability of the data reporting system implemented based on this application, and makes it suitable for multi-platform vehicle equipment.
[0029] See Figure 4 As shown, this application discloses a data reporting device applied to a target vehicle-mounted device, comprising: The configuration file parsing module 11 is used to launch a target background application on the target vehicle device, and use the target background application to read and parse the target configuration file to determine the target reporting item switch, target reporting configuration and target reporting parameters; the target configuration file is a JSON file. Data acquisition module 12 is used to acquire data of the target reporting item of the target vehicle device based on the target reporting item switch using the target data acquisition interface to obtain the target data packet; The data reporting module 13 is used to determine the target reporting path and target reporting logic corresponding to the target vehicle device based on the target reporting configuration and the target reporting parameters, and to report the target data packet through the target reporting path based on the target reporting logic.
[0030] As can be seen, this application achieves dynamic selection of data reporting methods by using a target configuration file in JSON format and controlling the data reporting method through specific fields in the target configuration file. Simultaneously, the target reporting item switches in the target configuration file enable fine-grained data item switching, allowing for customized reporting content. This achieves flexible reporting of vehicle-mounted equipment data, avoids redundant reporting, and saves bandwidth and storage resources. Furthermore, the flexible JSON structure in this application allows for the generation of dedicated configuration files for different devices, enabling switching of reporting logic without code modification. This improves development and maintenance efficiency, enhances the compatibility and scalability of the data reporting system implemented based on this application, and makes it suitable for multi-platform vehicle equipment.
[0031] In one specific implementation, the configuration file parsing module 11 may include: The file parsing unit is used to read the first target configuration file local to the target vehicle device using the target background application, and parse the first target configuration file to obtain the corresponding parsing result; The first parameter determination unit is used to determine the target reporting item switch, target reporting configuration and target reporting parameters based on the first target configuration file if the parsing result indicates that the target background application has successfully parsed the first target configuration file. The second parameter determination unit is used to read the second target configuration file under the corresponding path of the target background application if the parsing result indicates that the target background application has failed to parse the first target configuration file, so as to determine the target reporting item switch, target reporting configuration and target reporting parameters based on the second target configuration file.
[0032] In one specific implementation, the data reporting module 13 may include: The first reporting logic construction unit is used to construct first target reporting logic based on the first target reporting parameters corresponding to the first target reporting path if the target reporting configuration corresponds to a first target reporting path; the first target reporting path is a data transmission path for reporting the target data packet corresponding to the target vehicle device to the cloud; The second reporting logic construction unit is used to construct second target reporting logic based on the second target reporting parameters corresponding to the second target reporting path if the target reporting configuration corresponds to the second target reporting path; the second target reporting path is a data transmission path for writing the target data packet corresponding to the target vehicle data to the local device of the target vehicle.
[0033] In one specific implementation, the data acquisition module 12 may include: The data acquisition unit is used to determine the target data filtering rules based on the target configuration file, and to acquire the target reporting item data of the target vehicle device based on the target reporting item switch and the target data filtering rules to obtain the target data packet; Accordingly, the data reporting module 13 may specifically include: The data reporting termination unit is used to determine whether there is a data packet of the same type as the target data packet in the current preset data reporting period based on the target data filtering rules. If a data packet of the same type as the target data packet has been uploaded in the current preset data reporting period, the reporting process of the target data packet is terminated.
[0034] In one specific embodiment, the device may further include: The reporting logic adjustment module is used to adjust the target reporting path and the target reporting logic based on the current network status of the target vehicle device; Accordingly, the data reporting module 13 may specifically include: The data reporting unit is used to report the target data packet through the adjusted target reporting path based on the adjusted target reporting logic.
[0035] In one specific embodiment, the device may further include: The communication configuration module is used to determine the target network configuration based on the target configuration file using the target backend application, and to determine whether to enable the bidirectional communication channel between the target vehicle device and the cloud based on the target network configuration; the bidirectional communication channel is a communication channel built based on the MQTT protocol.
[0036] In one specific embodiment, the device may further include: The reporting log generation module is used to obtain the data reporting result corresponding to the target data packet, and generate the corresponding data reporting log based on the data reporting result; The data re-reporting module is used to save the target data packet to a preset cache space and asynchronously report the target data packet based on a preset re-reporting period if the data reporting result indicates that the target data packet has failed to be reported.
[0037] Furthermore, embodiments of this application also disclose an electronic device, Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0038] Figure 5This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data reporting method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0039] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0040] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored thereon can include an operating system 221, computer programs 222, etc., and the storage method can be temporary storage or permanent storage.
[0041] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the data reporting method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0042] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed data reporting method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0043] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0044] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0045] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0046] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0047] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A data reporting method, characterized in that, Applied to target vehicle-mounted devices, including: A target background application is launched on the target vehicle device. The target background application is used to read and parse the target configuration file to determine the target reporting item switch, target reporting configuration, and target reporting parameters. The target configuration file is a JSON file. Using the target data acquisition interface, data of the target reporting item of the target vehicle-mounted device is collected based on the target reporting item switch to obtain the target data packet; Based on the target reporting configuration and the target reporting parameters, the target reporting path and target reporting logic corresponding to the target vehicle device are determined, and the target data packet is reported through the target reporting path based on the target reporting logic.
2. The data reporting method according to claim 1, characterized in that, The step of using the target backend application to read and parse the target configuration file to determine the target reporting item switch, target reporting configuration, and target reporting parameters includes: The target background application is used to read the first target configuration file locally on the target vehicle device, and the first target configuration file is parsed to obtain the corresponding parsing results; If the parsing result indicates that the target backend application has successfully parsed the first target configuration file, then the target reporting item switch, target reporting configuration, and target reporting parameters are determined based on the first target configuration file. If the parsing result indicates that the target background application has failed to parse the first target configuration file, then the target background application is used to read the second target configuration file under the corresponding path of the target background application, so as to determine the target reporting item switch, target reporting configuration and target reporting parameters based on the second target configuration file.
3. The data reporting method according to claim 1, characterized in that, The step of determining the target reporting path and target reporting logic corresponding to the target vehicle-mounted device based on the target reporting configuration and the target reporting parameters includes: If the target reporting configuration corresponds to a first target reporting path, then a first target reporting logic is constructed based on the first target reporting parameters corresponding to the first target reporting path; the first target reporting path is a data transmission path for reporting the target data packet corresponding to the target vehicle device to the cloud; If the target reporting configuration corresponds to a second target reporting path, then a second target reporting logic is constructed based on the second target reporting parameters corresponding to the second target reporting path; the second target reporting path is a data transmission path that writes the target data packet corresponding to the target vehicle data to the local data of the target vehicle device.
4. The data reporting method according to claim 1, characterized in that, The step of collecting data on the target reporting item of the target vehicle-mounted device based on the target reporting item switch to obtain the target data packet includes: Based on the target configuration file, target data filtering rules are determined, and data of the target reporting items of the target vehicle device are collected based on the target reporting item switch and the target data filtering rules to obtain target data packets; Accordingly, the step of reporting the target data packet through the target reporting path based on the target reporting logic includes: Based on the target data filtering rules, it is determined whether there is a data packet of the same type as the target data packet within the current preset data reporting period. If a data packet of the same type as the target data packet has been uploaded within the current preset data reporting period, the reporting process of the target data packet is terminated.
5. The data reporting method according to claim 1, characterized in that, Before reporting the target data packet through the target reporting path based on the target reporting logic, the method further includes: The target reporting path and the target reporting logic are adjusted based on the current network status of the target vehicle device. Accordingly, the step of reporting the target data packet through the target reporting path based on the target reporting logic includes: Based on the adjusted target reporting logic, the target data packet is reported through the adjusted target reporting path.
6. The data reporting method according to claim 1, characterized in that, Also includes: The target backend application determines the target network configuration based on the target configuration file, and determines whether to enable the bidirectional communication channel between the target vehicle device and the cloud based on the target network configuration; the bidirectional communication channel is a communication channel built based on the MQTT protocol.
7. The data reporting method according to claim 6, characterized in that, After the target data packet is reported through the target reporting path based on the target reporting logic, the method further includes: Obtain the data reporting result corresponding to the target data packet, and generate the corresponding data reporting log based on the data reporting result; If the data reporting result indicates that the target data packet has failed to be reported, the target data packet is saved to a preset cache space and asynchronously reported based on a preset rereporting period.
8. A data reporting device, characterized in that, Applied to target vehicle-mounted devices, including: The configuration file parsing module is used to launch a target background application on the target vehicle device, and use the target background application to read and parse the target configuration file to determine the target reporting item switch, target reporting configuration, and target reporting parameters; the target configuration file is a JSON file. The data acquisition module is used to acquire data of the target reporting item of the target vehicle device by using the target data acquisition interface and based on the target reporting item switch to obtain the target data packet; The data reporting module is used to determine the target reporting path and target reporting logic corresponding to the target vehicle device based on the target reporting configuration and the target reporting parameters, and to report the target data packet through the target reporting path based on the target reporting logic.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the data reporting method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the data reporting method as described in any one of claims 1 to 7.