Automatic driving data access method and device, computer equipment and storage medium
By using CSV files and reflection mechanisms in the autonomous driving system, automatic data access is achieved, the problem of inconsistent data formats of different devices is solved, and access efficiency and system maintainability are improved.
Patent Information
- Application Number
- CN202411770885.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-25
AI Technical Summary
In autonomous driving technology, data from sensors, vehicle own systems and communication modules with different equipment and inconsistent formats are required, resulting in the need to write targeted data analysis algorithms, resulting in wasting human resources and time costs.
Provides an automatic driving data access method, by obtaining the data source to be accessed, analyzing its data content, message type and data source, and matching the corresponding data type in the pre-loaded CSV file based on this information, creating a target object, converting the data type and assigning values through the reflection mechanism, and finally updating the data source.
The automated data access process is realized, which reduces the workload of manual encoding, adapts to different data sources and data structures, is universal, and improves the maintainability and performance of the system.
Smart Images

Figure CN119691040A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of autonomous driving technology, and in particular to an autonomous driving data access method, apparatus, computer equipment and storage medium. Background Art
[0002] As one of the important applications in the field of artificial intelligence, autonomous driving technology has become an important development direction for future transportation. This technology enables vehicles to drive autonomously without human intervention through perception, decision-making and control systems.
[0003] In order to realize the needs of autonomous driving environment perception, vehicle status monitoring, traffic status prediction and coordination, it is necessary to access data from various sensors, vehicle systems and communication modules. These data usually come from different manufacturers and are not in a unified format. It is necessary to write specific data analysis algorithms, which wastes human resources and time costs. Therefore, a universal data access method is urgently needed. Summary of the invention
[0004] Based on this, it is necessary to provide a universal autonomous driving data access method, device, computer equipment and storage medium to address the above technical problems.
[0005] In a first aspect, in this embodiment, a method for accessing autonomous driving data is provided, including:
[0006] Obtain the data source to be accessed, and parse to obtain the data content, message type, and data source of the data source;
[0007] According to the data source and the message type, the corresponding data type is matched in the pre-loaded CSV file and a target object of the data content is created; the fields of the data source are bound to the metadata defined in the CSV file;
[0008] By means of a reflection mechanism, the data type of the data content is converted and then assigned to the attribute of the target object;
[0009] The data source to be connected is updated by distributing the target object after the attribute assignment.
[0010] In some of the embodiments, it also includes:
[0011] Pre-configure and load said CSV file;
[0012] The CSV file defines metadata of the data source, which includes field names, data types, and source identifiers.
[0013] In some embodiments, the matching and determining the corresponding data type in the pre-loaded CSV file according to the data source and the message type and creating the target object of the data content includes:
[0014] Traverse the data types in the CSV file and match the data types corresponding to the data source and the message type;
[0015] According to the data type determined by matching, a corresponding target object is created.
[0016] In some of the embodiments, converting the data type of the data content through a reflection mechanism and assigning a value to the attribute of the target object includes:
[0017] According to the data source, determining corresponding data content and type value from the data source;
[0018] Convert the type value into the data type of the data content through a reflection mechanism;
[0019] Based on the data type, the value of the data content is extracted and assigned to the attribute of the target object.
[0020] In some of the embodiments, it also includes:
[0021] The CSV array obtained by parsing the CSV file is traversed, and the attributes corresponding to the target object are obtained through reflection matching; the CSV array includes all field names.
[0022] In some of the embodiments, the method further includes: converting the type name of the target object into a unified base class type.
[0023] In some of the embodiments, it also includes:
[0024] New data sources can be accessed by updating the metadata in the CSV file.
[0025] In a second aspect, an automatic driving data access device is provided in this embodiment, including:
[0026] A data acquisition module is used to acquire the data source to be accessed, and parse the data content, message type and data source of the data source;
[0027] A matching module, used to match and determine the corresponding data type in a pre-loaded CSV file according to the data source and the message type and create a target object of the data content; the fields of the data source are bound to the metadata defined in the CSV file;
[0028] A reflection module, used to convert the data type of the data content through a reflection mechanism and then assign a value to the attribute of the target object;
[0029] The data updating module is used to update the data source to be connected by distributing the target object after the attribute assignment.
[0030] In a third aspect, a computer device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the autonomous driving data access method described in the first aspect is implemented.
[0031] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the autonomous driving data access method described in the first aspect is implemented.
[0032] Compared with the related art, the autonomous driving data access method, device, computer equipment and storage medium provided in this embodiment obtain the data source to be accessed, parse the data content, message type and data source of the data source; match and determine the corresponding data type in the pre-loaded CSV file according to the data source and the message type and create the target object of the data content; bind the field of the data source to the metadata defined in the CSV file; convert the data type of the data content through the reflection mechanism to assign values to the attributes of the target object; and update the data source to be accessed by distributing the target object after the attribute assignment. Through this embodiment, it is possible to realize the automatic attribute assignment of the target object and the parsing and access of different data sources by configuring the CSV file and the reflection mechanism, thereby realizing a universal data access method.
[0033] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0035] Figure 1 is a block diagram of the hardware structure of a terminal of an autonomous driving data access method in an embodiment;
[0036] Figure 2 is a flowchart of a method for accessing autonomous driving data in an embodiment;
[0037] Figure 3 is a flowchart of an autonomous driving data access method in another embodiment;
[0038] Figure 4 The present invention is a structural block diagram of an autonomous driving data access device in an embodiment.
[0039] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 10, data acquisition module; 20, matching module; 30, reflection module; 40, data update module. DETAILED DESCRIPTION
[0040] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0041] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0042] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 is a hardware structure block diagram of a terminal of the automatic driving data access method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0043] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the autonomous driving data access method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0044] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0045] As one of the important applications in the field of artificial intelligence, autonomous driving technology has become an important development direction for future transportation. This technology enables vehicles to drive autonomously without human intervention through perception, decision-making and control systems.
[0046] In order to realize the needs of autonomous driving environment perception, vehicle status monitoring, traffic status prediction and coordination, it is necessary to access data from various sensors, vehicle systems and communication modules. These data usually come from different manufacturers and are not in a unified format. It is necessary to write specific data analysis algorithms, which wastes human resources and time costs. Therefore, a universal data access method is urgently needed.
[0047] In this embodiment, a method for accessing autonomous driving data is provided. Figure 2 is a flow chart of the method for accessing autonomous driving data in this embodiment. Figure 2 As shown, the method comprises the following steps:
[0048] Step S201, obtain the data source to be accessed, and parse to obtain the data content, message type and data source of the data source.
[0049] Specifically, in order to realize the needs of autonomous driving environment perception, vehicle status monitoring, traffic status prediction and coordination, the data sources usually accessed include various sensors, vehicle systems and communication modules, such as data sources of the self-vehicle, remote vehicle, obstacles, paths, traffic, etc. Among them, various sensor devices include but are not limited to laser radar, camera, millimeter wave radar, ultrasonic sensor, inertial measurement unit (IMU), global positioning system (GPS), etc. The vehicle system data includes but is not limited to vehicle speed data, braking system data, steering system data, energy system data, and communication module data includes but is not limited to vehicle-to-vehicle (V2V) communication data: vehicles exchange information through dedicated communication protocols, such as vehicle location, speed, driving direction, etc. These data can help the autonomous driving system understand the status of surrounding vehicles and realize coordinated driving and obstacle avoidance between vehicles. Vehicle-to-infrastructure (V2I) communication data: vehicles communicate with road infrastructure (such as traffic lights, roadside sensors, etc.) to obtain the status of traffic lights, road congestion, construction information, etc., so that the autonomous driving system can adjust the driving strategy according to this information. In-vehicle communication data: includes communication data between various electronic control units (ECUs) inside the vehicle, such as data exchange between the engine control unit, transmission control unit, brake control unit, etc.
[0050] When the data source to be accessed is obtained, the method is called to parse the data source to obtain the data content, message type and data source. In this embodiment, the data source can be JSON data. By calling the "Update" method, "JObject.Parse" is used to parse the JSON string data into a "JObject" instance, and then the key fields of data content (data), message type (msgType) and data source (origin) are extracted. The data content is the specific information (value) of the data source, the message type is the classification of the information conveyed by the data source, such as status messages, data messages, and notification messages, etc. The data source is the source of the data, such as which device or system the data is from.
[0051] Exemplarily, the data source of a traffic light is taken as an example to explain the various fields of the data source. The data source (origin): "TrafficLight_01" indicates that the data comes from the traffic light numbered 01. There are often many traffic lights on urban roads. Through this source identifier, you can accurately know the information sent by the specific traffic light. Message type (msgType): "TrafficLightStatus" indicates that the message conveys the status information of the traffic light. After receiving this type of message, the autonomous driving vehicle can pay attention to key content in the data content (data), such as the color of the traffic light and the remaining time, to decide whether to continue moving forward, slow down or stop, etc. The data content (data) includes the current color of the traffic light, the remaining lighting time, and the geographic coordinates of the location of the traffic light.
[0052] Step S202, according to the data source and the message type, the corresponding data type is matched in the pre-loaded CSV file and a target object of the data content is created; the fields of the data source are bound to the metadata defined in the CSV file.
[0053] Specifically, in this embodiment, an "HMIJsonSerializer" class is defined, through which the interface "IDataContainer" for data source access can be implemented. At startup, the "HMIJsonSerializer" class is instantiated and loads a CSV (Comma-Separated Values) file, which is used to provide metadata for data source parsing, and the fields of the data source are bound to the metadata in the CSV file.
[0054] According to the data source and message type of the data source, combined with the binding relationship between each field and metadata, the corresponding data type is matched in the CSV file, and the data type provides a specific data processing strategy. Among them, the CSV file is parsed into different data structures of metadata. According to the data source and message type of the data source, the corresponding query is performed in the data structure of the data type to obtain the matching data type definition, and the target object of the data content is created in JSON, and the target object has the corresponding data type.
[0055] Step S203: convert the data type of the data content through the reflection mechanism and assign values to the attributes of the target object.
[0056] Specifically, a JSON parser "DynamicJsonPropertyConverter" is implemented in the "HMIJsonSerializer" class through reflection technology, which can process structured JSON data from various data sources. Among them, since the JSON string data is parsed into a "JObject" instance, and then the key fields of data content (data), message type (msgType) and data source (origin) are extracted, the data type of the data content in the "JObject" instance is converted to the type value type of the black box, and the specific data type cannot be directly obtained. The parser can use the reflection mechanism to convert the unknown type value type of the data content, and output the real data type of the data content, such as int, float, bool, list, and custom class, etc., to extract the value of the data content from the data source JSON data according to the output real data type, and assign values to the properties of the target object.
[0057] In addition, the parser can detect and convert the name of the data type of the target object at runtime, as well as obtain all attribute information of the target object and store it in a list.
[0058] Step S204: Update the data source to be connected by distributing the target object with assigned attributes.
[0059] Specifically, the target object after property assignment is assigned to the corresponding property of the interface "IDataContainer" to access these data sources through the methods provided by the interface, and distribute them to the corresponding device system, such as UI (UserInterface), driving game logic or other system components for data update.
[0060] In the above steps, by configuring the CSV file and reflection technology, the fields in the data source and the properties of the target object can be automatically matched, and the automatic assignment of the target object properties can be realized, thereby realizing the parsing and access of the data source, and adapting to the ever-changing multi-source data sources and data structures without modifying the code, which is universal while maintaining the simplicity and maintainability of the code. In addition, by separating the definition of the data source in the CSV file from the data processing logic in the reflection mechanism, a high degree of decoupling is achieved. This decoupling ensures that changes in the data source will not affect the data processing logic, improving the maintainability of the system.
[0061] In some of the embodiments, it also includes:
[0062] Pre-configure and load CSV files; the CSV file defines the metadata of the data source, including field names, data types, and source identifiers.
[0063] Specifically, the metadata of the data source is defined in the CSV file, and the metadata includes field name, data type and source identifier. The field name is used to identify the meaning of each data element in the data source, such as latitude and longitude, image frame data, azimuth, target distance, vehicle model, traffic light status, etc. The data type defines the storage format and operation of the data. Common data types include integers (such as int), floating point numbers (such as float), strings (such as varchar), etc. The source identifier is used to track the origin of the data source, such as the device number, etc. Exemplarily, the data source of vehicle speed is used as an example to explain the various fields of metadata. The field name "vehicle speed" indicates the key information of the vehicle's current driving speed, distance maintenance and other operations. The data type is usually a floating point number (float). The source identifier is the number or name of the vehicle's internal speed sensor, such as "VehicleSpeedSensor_01". This identifier can help determine which sensor of the vehicle itself provides the data.
[0064] CSV files can be parsed into different data structures of metadata, such as the data structure "fieldNameData" for field names and the data structure "msgTypeData" for data types. Call the "Init" method, use Unity's "Resources.Load" method to load the CSV file, and use the "CSVSerializer.Deserialize" method to parse the CSV file content into a C# object array (csvdata object). Among them, the fields of the data source are bound to the metadata defined in the CSV file, the data content corresponds to the field name, the message type corresponds to the data type, and the data source corresponds to the source identifier.
[0065] By configuring, preloading, and parsing CSV files, you can avoid repeated parsing work when processing messages from each data source. This significantly optimizes data processing performance, especially in scenarios with high-frequency data updates.
[0066] In some of the embodiments, according to the data source and the message type, matching and determining the corresponding data type in the pre-loaded CSV file and creating a target object of the data content includes the following steps:
[0067] Traverse the data types in the CSV file and match the data types corresponding to the data source and message type; create the corresponding target object based on the matched data type.
[0068] Specifically, in the data structure "msgTypeData" of the data type obtained by parsing the CSV file, according to the data source and message type of the data source, LINQ is used to query the "msgTypeData" array to match the corresponding data type. The target object of the data content (for example, the self-vehicle, the remote vehicle, the obstacle, the traffic light, and the path, etc.) is created or initialized in JSON. The target object has a corresponding data type, which provides a specific data processing strategy.
[0069] In this embodiment, the corresponding data type is matched in the CSV file according to the data source and the message type of the data source and a target object of the data content is created. Data processing and type conversion can be performed in JSON according to the data type, and the properties of the target object can be assigned values subsequently.
[0070] In some of the embodiments, the data type of the data content is converted through a reflection mechanism to assign a value to a property of a target object, including the following steps:
[0071] According to the data source, the corresponding data content and type value are determined from the data source; through the reflection mechanism, the type value is converted into the data type of the data content; based on the data type, the value of the data content is extracted and assigned to the attributes of the target object.
[0072] Specifically, in the "ReadJson" method, the JSON data of the data source is parsed into a "JObject" instance in the above embodiment, and the "GetValue" method is used to extract the data content from the "JObject" according to the data source's data source (origin). Since the data type of the data content in the "JObject" instance has been converted to a black box type value type, the specific data type cannot be directly obtained, and the extracted data type is an unknown type value type. The CSV array (csvdata object) obtained by traversing the CSV file parsing is matched by reflection to obtain the properties corresponding to the target object; the CSV array includes all field names.
[0073] Among them, through the "GetProperties" method, all property information of the target object is obtained and stored in a list of the "PropertyInfo" type. These property information can be used to dynamically access and modify the state of the object later. Traverse the CVS array, obtain the corresponding properties of the target object through reflection matching, and perform corresponding type conversion and assignment operations according to the type value type of the property (obtained by calling the "Type.GetTypeCode" method). By performing multiple reflections, all field names in the CSV array (corresponding to the properties of the target object) are traversed, and the type value type of the data content is converted into the real data type of the data content in turn, and the value of the data content is extracted from the JSON data based on the real determined data type and assigned to the corresponding property of the target object.
[0074] During the property assignment process, you can perform correct type conversion on basic data types (such as int, float, bool, etc.) and complex object types (such as lists and custom classes) according to the type of the property, and ensure the type safety of the data during deserialization. For complex object types such as lists and custom classes, use the "ToObject" method for deserialization.
[0075] By using the "DynamicJsonPropertyConverter" JSON parser in this embodiment, according to the rules in the CSV file, the value of the data content in the JSON data is mapped to the properties of the data object, and the reflection technology is used to automatically match the fields in the data source JSON data with the properties of the object, thereby realizing automatic property assignment, reducing the workload of manual coding and reducing the risk of errors in manual operations. In addition, reflection is used to dynamically determine the type of the target object at runtime, and assign the data to the corresponding target object. This method breaks the limitations of traditional static type languages and provides flexibility similar to dynamic type languages.
[0076] In some of the embodiments, the method further includes: converting the type name of the target object into a unified base class type.
[0077] Specifically, the JSON parser "DynamicJsonPropertyConverter" can check and convert the target object type name at runtime. Using the "SetDataType" method, according to the type name ("typeName") of the incoming target object, such as "HVData", "RVData" and other subclass type names, the subclass type name is converted to a unified base class type name (such as "HMIData"). This can be understood as parameter passing, the content remains unchanged, and the type name is unified as the base class type so that the data type of the target object can be uniformly called later, which can achieve polymorphism and extensibility.
[0078] In some of the embodiments, the method further includes: accessing a new data source by updating metadata in a CSV file.
[0079] Specifically, by simply modifying the CSV configuration file and updating the metadata in the CSV file, the data structure of the new data source can be created without modifying the code. Through the reflection mechanism, the program can understand and operate these new data structures at runtime, which is convenient for expanding system functions. For running on unsupported data types, the program records error information, which improves the robustness of the program compared to directly throwing exceptions.
[0080] The present embodiment is described and illustrated below through preferred embodiments.
[0081] Figure 3 is a flow chart of the autonomous driving data access method of this embodiment. Figure 3 As shown, the method comprises the following steps:
[0082] Step S301, pre-configure and load a CSV file; the CSV file defines metadata of the data source, and the metadata includes field name, data type, and source identifier.
[0083] Step S302, obtaining the data source to be accessed, parsing to obtain the data content, message type and data source of the data source; binding the fields of the data source with the metadata defined in the CSV file;
[0084] Step S303, traverse the data types in the CSV file, match the data types corresponding to the data source and message type; and create the corresponding target object.
[0085] Step S304, traverse the CSV array obtained by parsing the CSV file, and obtain the attributes corresponding to the target object through reflection matching.
[0086] Step S305, according to the data source, determine the corresponding data content and type value from the data source; convert the type value into the data type of the data content through the reflection mechanism; based on the data type, extract the value of the data content and assign it to the attribute of the target object.
[0087] Step S306: Access a new data source by updating the metadata in the CSV file.
[0088] By configuring the CSV file and reflection technology in this embodiment, it is possible to automatically match the fields in the data source and the properties of the target object, realize automatic target object property assignment, and thus realize the parsing and access of the data source, and adapt to the ever-changing multivariate data sources and data structures without modifying the code, while maintaining the simplicity and maintainability of the code. In addition, by separating the definition of the data source in the CSV file from the data processing logic in the reflection mechanism, a high degree of decoupling is achieved. This decoupling ensures that changes in the data source will not affect the data processing logic, thereby improving the maintainability of the system. In addition, by checking and converting types at runtime, the system ensures the type safety of the data, and by preloading and parsing the CSV configuration file, the system avoids the repeated parsing work required when processing each data message, thereby optimizing data processing performance.
[0089] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0090] In this embodiment, an autonomous driving data access device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. The terms "module", "unit", "subunit", etc. used below may implement a combination of software and / or hardware of predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0091] Figure 4 is a structural block diagram of the automatic driving data access device in this embodiment, such as Figure 4 As shown, the device comprises:
[0092] The data acquisition module 10 is used to acquire the data source to be accessed, and parse the data content, message type and data source of the data source;
[0093] The matching module 20 is used to match and determine the corresponding data type in the pre-loaded CSV file according to the data source and the message type and create a target object of the data content; the fields of the data source are bound to the metadata defined in the CSV file;
[0094] A reflection module 30 is used to convert the data type of the data content through a reflection mechanism and then assign values to the attributes of the target object;
[0095] The data updating module 40 is used to update the data source to be connected by distributing the target object after the attribute is assigned.
[0096] By configuring the CSV file and reflection technology through the device provided in this embodiment, the fields in the data source and the attributes of the target object can be automatically matched, and the automatic attribute assignment of the target object is realized, thereby realizing the parsing and access of the data source, and adapting to the ever-changing multivariate data sources and data structures without modifying the code, while maintaining the simplicity and maintainability of the code with universality. In addition, by separating the definition of the data source in the CSV file from the data processing logic in the reflection mechanism, a high degree of decoupling is achieved, and this decoupling makes it possible for changes in the data source to not affect the data processing logic, thereby improving the maintainability of the system.
[0097] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0098] In this embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0099] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0100] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0101] In addition, in combination with the autonomous driving data access method provided in the above embodiments, a storage medium may also be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by the processor, any one of the autonomous driving data access methods in the above embodiments is implemented.
[0102] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0103] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0104] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0105] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0106] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. An autonomous driving data access method, characterized in that: include: Obtain the data source to be accessed, and parse to obtain the data content, message type, and data source of the data source; According to the data source and the message type, the corresponding data type is matched in the pre-loaded CSV file and a target object of the data content is created; the fields of the data source are bound to the metadata defined in the CSV file; By means of a reflection mechanism, the data type of the data content is converted and then assigned to the attribute of the target object; The data source to be connected is updated by distributing the target object after the attribute assignment.
2. The method for accessing autonomous driving data according to claim 1, characterized in that: Also includes: Pre-configure and load said CSV file; The CSV file defines metadata of the data source, which includes field names, data types, and source identifiers.
3. The autonomous driving data access method according to any one of claims 1 or 2, characterized in that: The matching and determining the corresponding data type in the pre-loaded CSV file according to the data source and the message type and creating the target object of the data content includes: Traverse the data types in the CSV file and match the data types corresponding to the data source and the message type; According to the data type determined by matching, a corresponding target object is created.
4. The method for accessing autonomous driving data according to claim 1, characterized in that: The step of converting the data type of the data content through the reflection mechanism and assigning a value to the attribute of the target object includes: According to the data source, determining corresponding data content and type value from the data source; Convert the type value into the data type of the data content through a reflection mechanism; Based on the data type, the value of the data content is extracted and assigned to the attribute of the target object.
5. The method for accessing autonomous driving data according to claim 4, characterized in that: Also includes: Traverse the CSV array obtained by parsing the CSV file, and obtain the attributes corresponding to the target object through reflection matching; The CSV array includes all field names.
6. The method for accessing autonomous driving data according to claim 1, characterized in that: Before assigning a value to the attribute of the target object after converting the data content of the data source through the reflection mechanism, the method further includes: Convert the type name of the target object to a unified base class type.
7. The method for accessing autonomous driving data according to claim 1, characterized in that: Also includes: New data sources can be accessed by updating the metadata in the CSV file.
8. An automatic driving data access device, characterized in that: include: A data acquisition module is used to acquire the data source to be accessed, and parse the data content, message type and data source of the data source; A matching module, used to match and determine the corresponding data type in a pre-loaded CSV file according to the data source and the message type and create a target object of the data content; the fields of the data source are bound to the metadata defined in the CSV file; A reflection module, used to convert the data type of the data content through a reflection mechanism and then assign values to the attributes of the target object; The data updating module is used to update the data source to be connected by distributing the target object after the attribute assignment.
9. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the autonomous driving data access method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the autonomous driving data access method described in any one of claims 1 to 7 are implemented.