Data processing method and device, electronic equipment, vehicle and storage medium

By segmenting and parsing text samples, combined with a data type parser and conflict checking, the problems of low efficiency and accuracy in data type design are solved, achieving more efficient and accurate data processing.

CN121832889APending Publication Date: 2026-04-10GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies have low efficiency and accuracy in data type design, especially in cases of complex nested relationships, where they are prone to errors and have high maintenance complexity.

Method used

By segmenting text samples and using parsers corresponding to the data types, the individual storage type is determined, and conflict checking is performed to ensure accuracy and efficiency, including data cleaning, parsing, and storage operations.

Benefits of technology

It improves the accuracy and efficiency of data type design, reduces the probability of errors, and simplifies the maintenance process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121832889A_ABST
    Figure CN121832889A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, electronic equipment, a vehicle and a storage medium, and the method comprises the steps: segmenting a text sample, determining a plurality of target sub-samples corresponding to the text sample, and determining a data type corresponding to each target sub-sample; adopting a parser corresponding to the data type to parse a target sub-sample corresponding to the data type, and determining a single storage type corresponding to each target sub-sample; analyzing the single storage types corresponding to the plurality of target sub-samples, and determining a plurality of user data types corresponding to the text sample; and performing conflict verification on the plurality of user data types corresponding to the text sample and a pre-stored storage data type, determining a conflict verification result, and executing a corresponding storage operation based on the conflict verification result. According to the method, the text sample can be quickly converted into the data type, so that the efficiency and accuracy of data type development are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of software development, and particularly relate to a data processing method and device, an electronic device, a vehicle, and a storage medium. BACKGROUND

[0002] In the process of software development (for example, automobile software development), for the design and development scheme involving data types, it is usually necessary to develop an interface data type (Interface DataType, hereinafter referred to as "IDT") of different data types in a graphical interface, and then generate code conforming to the software development specification based on the IDT. Due to the complexity of the definition of data types in actual application scenarios, and the nesting relationship between different data types, the efficiency and accuracy of the developed and designed data types are low. SUMMARY

[0003] Embodiments of the present application provide a data processing method and device, an electronic device, a vehicle, and a storage medium, aiming to solve the problem of low efficiency and accuracy in the existing data type design process.

[0004] A data processing method comprises: splitting a text sample to determine a plurality of target sub-samples corresponding to the text sample, and determining a data type corresponding to each target sub-sample; using a parser corresponding to the data type to parse the target sub-sample corresponding to the data type to determine a single storage type corresponding to each target sub-sample; parsing the single storage types corresponding to the plurality of target sub-samples to determine a plurality of user data types corresponding to the text sample; performing conflict checking on the plurality of user data types corresponding to the text sample and a pre-stored storage data type to determine a conflict checking result, and performing a corresponding storage operation based on the conflict checking result.

[0005] In this embodiment, the text sample is split into a plurality of target sub-samples, and a parser corresponding to a certain data type is used to parse the target sub-sample corresponding to the data type, so that the parsing process is targeted, and the accuracy of the determined single storage type is guaranteed. The single storage type is converted into a user data type, and then the user data type and the storage data type are subjected to conflict checking, which helps to guarantee the accuracy of the conflict checking. Finally, based on the conflict checking result, a corresponding storage operation is performed on the plurality of user data types corresponding to the text sample, so as to guarantee the execution efficiency of the storage operation.

[0006] In an embodiment, the splitting the text sample, determining a plurality of target sub-samples corresponding to the text sample, comprises: performing data cleaning on the text sample to obtain a cleaned text sample; splitting the cleaned text sample based on a target keyword to determine a plurality of initial sub-samples corresponding to the text sample; performing data cleaning on the plurality of initial sub-samples to determine a plurality of target sub-samples corresponding to the text sample.

[0007] In this example, data cleaning is performed before splitting the text sample to avoid interference from irrelevant data, ensure the executability of the splitting logic, and avoid large differences between the initial sub-samples after splitting. Data cleaning is performed after splitting the text sample to optimize the data density of the cleaned target sub-samples, avoid interference from irrelevant data that was not removed during the first data cleaning, and help ensure the accuracy of the target sub-samples.

[0008] In an embodiment, the using the parser corresponding to the data type to parse the target sub-sample corresponding to the data type to determine a single storage type corresponding to each target sub-sample, comprises: using the parser corresponding to the data type to parse the target sub-sample corresponding to the data type to determine initial text content corresponding to the target sub-sample; verifying the initial text content corresponding to the target sub-sample to determine target text content that conforms to a code specification; based on the code conversion rule corresponding to the data type, converting the target text content to determine the single storage type corresponding to the target sub-sample.

[0009] In an embodiment, the parsing the single storage types corresponding to the plurality of target sub-samples to determine a plurality of user data types corresponding to the text sample, comprises: based on the single storage types corresponding to the plurality of target sub-samples, determining a name corresponding to a last single storage type, and creating a user data type corresponding to the name; traversing and parsing the plurality of single storage types to determine a plurality of sub-data types corresponding to each single storage type; performing ring definition verification on all sub-data types to determine sub-data types that pass the ring definition verification, and determining the sub-data types that pass the ring definition verification as sub-data types of the user data type corresponding to the name.

[0010] In an embodiment, the sub-data types that pass the ring definition verification simultaneously satisfy the following conditions: The name of the sub-data type is different from the name of the user data type; The name of the sub-data type is different from the names of all the sub-data types recorded in the sub-data type mapping. The sub-data type mapping is a mapping of the user data type and its sub-data types. The name of the sub-data type is different from the names of the multiple ancestor data types recorded in the ancestor data type mapping. The ancestor data type mapping is a mapping of the user data type and its ancestor data types.

[0011] In one embodiment, conflict checking is performed on multiple user data types corresponding to the text sample and pre-stored storage data types to determine the conflict checking result, including: Determine whether the name of the user data type is the same as the name of the storage data type; When the two names are different, the conflict check result is determined to be that there is no conflict; If the names of the two are the same, determine whether the instance of the user data type is the same as the instance of the storage data type; When the instances of the two are different, the conflict check result is determined to be that there is no conflict; When two instances are identical, determine whether the descendant data type of the user data type is the same as the descendant data type of the storage data type; When the descendant data types of the two are different, the conflict check result is determined to be that there is no conflict; If the descendant data types of both are the same, the conflict check result is determined to be a conflict.

[0012] A data processing apparatus, comprising: The text sample segmentation module is used to segment the text sample, determine multiple target sub-samples corresponding to the text sample, and determine the data type corresponding to each target sub-sample; The single-unit storage type determination module is used to use the parser corresponding to the data type to parse the target sub-samples corresponding to the data type and determine the single-unit storage type corresponding to each target sub-sample; The user storage type determination module is used to parse the individual storage types corresponding to multiple target sub-samples and determine multiple user data types corresponding to the text sample. The storage operation execution module is used to perform conflict verification on multiple user data types corresponding to the text sample and pre-stored storage data types, determine the conflict verification result, and execute the corresponding storage operation based on the conflict verification result.

[0013] An electronic device includes a processor and a memory, wherein, Memory, used to store computer programs; The processor is used to execute the program stored in the memory to implement the above data processing method.

[0014] A vehicle including the aforementioned electronic equipment.

[0015] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described data processing method. Attached Figure Description

[0016] Figure 1 This is a flowchart of a data processing method provided in an embodiment of this application; Figure 2 yes Figure 1 A flowchart of step S101; Figure 3 yes Figure 1 A flowchart of step S102; Figure 4 yes Figure 1 A flowchart of step S103; Figure 5 yes Figure 1 A flowchart of step S104; Figure 6 This is a structural diagram of the data processing apparatus provided in an embodiment of this application; Figure 7 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0017] To make the technical problems, technical solutions, and beneficial effects solved by this application clearer, the following detailed description is provided in conjunction with embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0018] This application provides a data processing method applicable to electronic devices with data processing capabilities. This method can quickly and accurately convert user-inputted text samples into standard data types, thereby reducing data type access time and improving processing efficiency.

[0019] In the field of AUTOSAR CP and AP development processes, the mainstream approach is to use third-party commercial software, such as AUTOSAR Builder (foreign) and Neusoft Neusar (domestic). These tools provide a complete set of data type design and development solutions, allowing users to design various types of IDTs (Integrated Data Types) through a graphical interface and then generate corresponding ARXML and code files conforming to the AUTOSAR specification. However, in specific scenarios, data type definitions are often very complex, and the definition of data types for structures often involves nested data types. Following the commercial software approach requires manually filling in the content of each data type, which leads to two problems: First, if the data types involved are too complex and nested, it is easy to miss errors; second, if you want to modify a structure definition with multiple nested data types, you need to traverse and check all descendant data types of the nested structure's data type members to see if they need to be modified synchronously, resulting in high complexity, high cost, and a high risk of errors in maintaining data types. To overcome these problems, this example provides a data processing method to ensure the efficiency and accuracy of the identified and accessed data types.

[0020] For ease of understanding, some terms in the embodiments of this application are explained and clarified, please refer to the following description.

[0021] Interface Data Type (IDT) is a core concept in AUTOSAR used to define data structures for interaction between modules; specifically, it is an abstract definition of data types.

[0022] ARXML is a standard data exchange format defined in the AUTOSAR specification. Based on XML (Extensible Markup Language) syntax, it is used to describe all design information of an AUTOSAR system. ARXML files are files formed based on ARXML.

[0023] The Data type (Date) is a data type stored in persistent storage. In this example, the Data type (Date) includes four core data types: name, category, base_type, and type_define. `name` represents the name of the Data, specifically a unique identifier for the data type, used to uniquely identify the data type in the system for easy reference and differentiation. `category` represents the category / classification of the Data, used to distinguish the abstraction level or purpose of the data type, helping tools and developers understand the essence of the type. Currently, five data types are supported: ARRAY (array type), ENUM (enumeration type), STRUCTURE (struct type), TYPEREF (type reference), and BASE (basic data type). `base_type` represents the base type of the Data, specifically the underlying dependent type under the category, indicating which more basic type it is based on. `type_define` is the type definition of the Data, specifically a description of the specific structure or constraints of the type, i.e., the detailed definition rules of the type (such as member composition, value range, format, etc.). Since any Data type definition can ultimately be resolved into basic data types, the following basic data types also need to be built-in: Data(name='uint8',base_type='uint8'); Data(name='uint16',base_type='uint16'); Data(name='uint32',base_type='uint32'); Data(name='uint64',base_type='uint64'); Data(name='sint8',base_type='sint8'); Data(name='sint16',base_type='sint16'); Data(name='sint32',base_type='sint32'); Data(name='sint64',base_type='sint64'); Data(name='float32',base_type='float32'); Data(name='float64',base_type='float64'); Data(name='bool',base_type='bool').

[0024] For example, if a user-input text sample contains the following structure type, its representation in the text sample is as follows: typedef struct { uint16 mid_log_gwMessageArgumentCountType; MID_LOG_gLogLevelType_en mid_log_genLog_Level; }MID_POWM_PartitionStatusTbl_Type.

[0025] When the above structure type is stored in persistent memory, it needs to be converted to the following storage data type (Date): category=STRUCTURE, type_define={'content': [ {'type_name': 'uint8', 'var_name': 'PartitionCnt'}, {'type_name': 'MID_POWM_Type', 'var_name': 'PartitionList'},]}, name=MID_POWM_PartitionStatusTbl_Type.

[0026] A single-unit storage type (SwcStruct) is a data type that is cached in memory after text samples are segmented. Based on different data types, the single-unit storage type (SwcStruct) can be divided into five types, and their corresponding pseudocode representations are as follows: SwcArray(name, is_base, type_name, length) represents a single-unit storage type of array; SwcEnum(name, content) represents a single-unit storage type of enumeration type; SwcStruct(name, content) represents a single-unit storage type of structure type; SwcTypeRef(name, type_name) represents a single-unit storage type for a type reference; SwcBase(name, base_type) represents a monolithic storage type for basic data types.

[0027] In this example, methods are provided for mutual conversion between the single-type memory storage type (SwcStruct) and the persistent storage data type (Date), namely a first type conversion method and a second type conversion method. The first type conversion method refers to the method of converting from the single-type memory storage type (SwcStruct) to the storage data type (Date), which can be represented by the to_model_dat data processing method of SwcData. The second type conversion method refers to the method of converting from the storage data type (Date) to the single-type memory storage type (SwcStruct), which can be represented by the to_swc_dat data processing method of Data.

[0028] User data types (DataType) are the data types returned to the end-user interface. These data types provide methods for converting themselves into corresponding ARXML and code files for users to download and use. User data types can also be divided into five types, and their corresponding pseudocode representations are as follows: ArrayDataType(data: SwcArray) represents a user data type of array. EnumDataType(data: SwcEnum) represents the user data type of the enumeration type; STRUCTUREDataType(data: SwcStruct) represents a user data type of structure type; RefDataType(data: SwcTypeRef) represents a user-defined data type referenced by a type. BaseDataType(data: SwcBase) represents a user data type that represents the basic data type.

[0029] This application provides a data processing method, which will be described using an electronic device as an example. Figure 1 As shown, the data processing methods include: S101: Segment the text sample, determine multiple target sub-samples corresponding to the text sample, and determine the data type corresponding to each target sub-sample; S102: Use a parser corresponding to the data type to parse the target sub-samples corresponding to the data type and determine the single-unit storage type corresponding to each target sub-sample; S103: Analyze the individual storage types corresponding to multiple target sub-samples to determine the multiple user data types corresponding to the text samples; S104: Perform conflict checks on multiple user data types corresponding to the text sample and pre-stored storage data types, determine the conflict check results, and perform the corresponding storage operations based on the conflict check results.

[0030] The text sample is a text sample that requires data type conversion; specifically, it is a sample designed by the user in text form based on data type development requirements. The target subsample is a subsample obtained by segmenting the text sample and requiring parsing.

[0031] As an example, in step S101, the electronic device can use a pre-set segmenter to segment the text sample. Specifically, it can segment the text sample based on target keywords as segmentation labels to determine multiple target sub-samples corresponding to the text sample. Here, the target keywords are the keywords used to segment different sub-samples. Then, for each target sub-sample, type keyword identification is performed to determine the data type corresponding to the target sub-sample. Here, type keywords are keywords related to the data type, such as ARRAY, ENUM, STRUCTURE, TYPEREF, and BASE.

[0032] As an example, in step S102, the electronic device can use a parser corresponding to each data type to parse the target sub-sample corresponding to that data type to determine the monolithic storage type (SwcStruct) corresponding to the target sub-sample. In this example, the electronic device parses the target sub-sample by calling parsers for different data types. The parsers corresponding to the different data types are: ArrayParser, used to parse sub-samples of array type; EnumParser, used to parse sub-samples of enumeration type; StructParser, used to parse sub-samples of structure type; TypeRefParser, used to parse sub-samples of type reference; and BaseParser, used to parse sub-samples of basic data types. Understandably, using a parser corresponding to the data type to parse the target sub-sample corresponding to that data type makes the parsing process targeted, ensuring that the parsed monolithic storage type conforms to the code specifications of that data type, thereby ensuring the accuracy of the determination of the monolithic storage type.

[0033] As an example, in step S103, after determining the single-unit storage type (SwcStruct) corresponding to multiple target sub-samples, the electronic device can parse the content list corresponding to each single-unit storage type (SwcStruct) to determine one or more sub-data types corresponding to each single-unit storage type (SwcStruct); then, based on the conversion rules of user data type (DataType), it processes all sub-data types to determine the user data type (DataType) corresponding to the text sample.

[0034] As an example, in step S104, after determining the user data type corresponding to the text sample, the electronic device needs to perform a conflict check between the user data type and the storage data type pre-stored in persistent memory, determine the conflict check result, and then perform the corresponding storage operation based on the conflict check result. In this example, the conflict check result includes two possibilities: conflict exists and no conflict exists. If the conflict check result is that a conflict exists, a waiting storage operation is performed, specifically outputting a prompt message to wait for the user's response to the prompt signal feedback control command within a preset time period. If a control command is received within the preset time period, the storage operation is performed; if no control command is received within the preset time period, the storage operation is not performed; if the conflict check result is that no conflict exists, a direct storage operation is performed. In this example, performing the storage operation specifically includes: converting the user data type into a storage data type and storing the converted storage data type in persistent memory to complete the fast storage of the text sample. In this example, the `to_model_dat` data processing method of `SwcData` can be used to convert the user data type (`DataType`) corresponding to the text sample into a storage data type (`Date`), update the content of `Date`, and then save it in persistent memory to complete the update.

[0035] Generally, a single-unit storage type (SwcStruct) typically corresponds to a local, specific sub-sample structure within a text sample (such as the storage format of a single field, short sentence, or code snippet), with fine granularity and potentially containing numerous details. A user-defined data type (DataType), on the other hand, is an abstract integration of multiple related SwcStructs, reflecting the complete data type definition from the user's perspective. Pre-stored storage data types (Data) are typically system-level standard types (such as database table structures, interface protocol definitions, etc.), operating at the same level of abstraction as DataType. In this example, integrating SwcStructs into DataType first ensures that the object to be validated matches the standard type in terms of dimension, avoiding validation confusion caused by directly comparing fine-grained local structures with coarse-grained standard types. Furthermore, it avoids redundant and repetitive validation between the single-unit storage type (SwcStruct) and the storage data type (Date), ensuring the accuracy of conflict checking.

[0036] In this embodiment, the text sample is segmented into multiple target sub-samples. A parser corresponding to a specific data type is used to parse the target sub-samples corresponding to that data type, making the parsing process targeted and ensuring that the parsed single-unit storage type conforms to the code specification of that data type, thereby ensuring the accuracy of the single-unit storage type determination. The single-unit storage type is then converted into a user data type, and conflict checking is performed based on the user data type and the storage data type, which helps ensure the accuracy of conflict checking. Finally, based on the conflict checking results, corresponding storage operations are performed on the multiple user data types corresponding to the text sample to ensure the execution efficiency of the storage operations.

[0037] In one embodiment, such as Figure 2 As shown, step S101 involves segmenting the text sample to determine multiple target sub-samples corresponding to the text sample, including: S201: Perform data cleaning on the text sample to obtain the cleaned text sample; S202: Segment the cleaned text samples based on the target keywords to determine multiple initial sub-samples corresponding to the text samples; S203: Perform data cleaning on multiple initial subsamples to determine multiple target subsamples corresponding to the text sample.

[0038] As an example, in step S201, the electronic device may use a pre-set first data cleaning rule to clean the text sample, removing data irrelevant to the data type, and obtaining the cleaned text sample. Here, the first data cleaning rule refers to the data cleaning rules before the text sample is segmented, and may include, but is not limited to, removing leading and trailing spaces, tabs, and indentation formatting.

[0039] As an example, in step S202, the electronic device can segment the cleaned text sample based on predetermined target keywords to divide the text sample into multiple initial sub-samples.

[0040] As an example, in step S203, the electronic device may also use a pre-set second data cleaning rule to clean the data of the multiple initial sub-samples obtained from the segmentation, removing data unrelated to the data type to obtain the cleaned target sub-samples; then, type keyword identification is performed on each target sub-sample to determine the data type corresponding to the target sub-sample. Here, the second data cleaning rule refers to the data cleaning rule after the text sample is segmented. It can be the same as or different from the first data cleaning rule, and can be determined independently according to the actual situation.

[0041] For example, the cleaned text sample is shown below: typedef struct{ uint8 Time_Hour; uint8 Time_Min; uint8 Time_Sec; vRCTime; typedef struct{ vRCTime StartTime; vRCTime EndTime. uint8 RCRepeatState; vRCAutoChargeConfig; The electronic device calls a pre-set segmenter to segment and clean the above text sample based on the target keyword "typedef". This will result in two target sub-samples as follows: typedef struct{uint8 Time_Hour;uint8 Time_Min;uint8 Time_Sec;}vRCTime and typedef struct{vRCTime StartTime;vRCTimeEndTime;uint8 RCRepeatState;}vRCAutoChargeConfig.

[0042] In this example, data cleaning is performed before segmenting the text samples to avoid interference from irrelevant data, ensure the feasibility of the segmentation logic, and prevent large differences in the initial sub-samples after segmentation. Data cleaning is performed after segmenting the text samples to optimize the data density of the cleaned target sub-samples, avoid interference from irrelevant data not removed in the first data cleaning, and help ensure the accuracy of the target sub-samples.

[0043] In one embodiment, such as Figure 3 As shown, step S102 involves using a parser corresponding to the data type to parse the target sub-samples corresponding to the data type, determining the individual storage type corresponding to each target sub-sample, including: S301: Use the parser corresponding to the data type to parse the target sub-sample corresponding to the data type and determine the initial text content corresponding to the target sub-sample; S302: Verify the initial text content corresponding to the target subsample to determine the target text content that conforms to the code specifications; S303: Based on the code conversion rules corresponding to the data type, convert the target text content and determine the single-unit storage type corresponding to the target sub-sample.

[0044] As an example, in step S301, the electronic device may use a parser corresponding to a certain data type to parse and transform all target sub-samples corresponding to that data type, so as to convert them into the initial text content corresponding to that target sub-sample. Here, the initial text content is the text content obtained by the parser after the target sub-samples have been transformed.

[0045] For example, a parser for struct types uses string substitution to remove characters like "{", "}", and ";", and then uses "\n" to convert the content into a list to determine its corresponding initial text content. Taking the above typedef struct{uint8 Time_Hour;uint8 Time_Min;uint8 Time_Sec;} as an example, the converted initial text content is as follows: [ {"type_name": "unit8", "var_name": "Time_Hour"}, {"type_name": "uint8", "var_name": "Time_Min"}, {"type_name": "uint8", "var_name": "Time_Sec"}, ] As an example, in step S302, the electronic device can validate the variable names (type_name) or other parameters in the initial text content corresponding to the target subsample based on pre-defined code specifications to determine whether they conform to the code specifications. If they conform, the initial text content is identified as the target text content; if they do not conform, a prompt message is output to remind the user to correct the initial text content and determine the corrected target text content. In this example, the initial text content is validated to ensure that the validated target text content conforms to the code specifications, avoiding compilation errors and other problems during later code generation or integration.

[0046] As an example, in step S303, after acquiring the target text content corresponding to the target subsample, the electronic device can use the code conversion rules corresponding to that data type to convert the target text content into a single-unit storage type corresponding to the target subsample, specifically converting the target text content into an instance of a single-unit storage type (SwcStruct). The code conversion rules here are rules used to convert text content into data types.

[0047] For example, after transformation, the two target sub-samples, typedef struct{uint8 Time_Hour;uint8 Time_Min;uint8 Time_Sec;}vRCTime and typedef struct{vRCTime StartTime;vRCTime EndTime;uint8RCRepeatState;}vRCAutoChargeConfig, result in the following two monolithic storage types: SwcStruct(name="vRCTime", content=[{"type_name": "unit8", "var_name":"Time_Hour"}, {"type_name": "unit8", "var_name": "Time_Min"}, {"type_name": "unit8", "var_name": "Time_Sec"}]) SwcStruct(name=" vRCAutoChargeConfig", content=[{"type_name": "vRCTime", "var_name": "StartTime"}, {"type_name": "vRCTime", "var_name": "EndTime"}, {"type_name": "unit8", "var_name": "RCRepeatState"}]) In this embodiment, a parser corresponding to the same data type is used to parse the target subsample of the data type to ensure the accuracy of the initial text content determined by the parser; then the initial text content is verified to ensure that the target text content obtained by the verification conforms to the code specification, so as to ensure the feasibility of subsequent code transformation; finally, the target text content is transformed to determine the single-unit storage type corresponding to the target subsample, so as to transform the unstructured or semi-structured text content into a structured storage type, which helps to ensure the efficiency of subsequent storage.

[0048] In one embodiment, such as Figure 4 As shown, step S103 involves parsing the individual storage types corresponding to multiple target sub-samples to determine the multiple user data types corresponding to the text sample, including: S401: Based on the single-unit storage type corresponding to multiple target sub-samples, determine the name corresponding to the last single-unit storage type and create the user data type corresponding to the name; S402: Traverse and parse multiple single-unit storage types to determine multiple sub-data types corresponding to each single-unit storage type; S403: Perform a ring definition check on all sub-data types, determine the sub-data types that pass the ring definition check, and identify the sub-data types that pass the ring definition check as the sub-data types of the user data types corresponding to the names.

[0049] As an example, in step S401, after the electronic device switches the text sample into multiple target sub-samples and determines the corresponding single-unit storage type for each target sub-sample, it needs to determine the name `last_block_name` corresponding to the last single-unit storage type from among the single-unit storage types corresponding to the multiple target sub-samples, and create the user data type corresponding to the name `last_block_name`. In this example, determining the name corresponding to the last single-unit storage type and creating its corresponding user data type ensures that parsing processing starts from the last single-unit storage type, making the processing process conform to code standards and guaranteeing the feasibility of subsequent operations.

[0050] As an example, in step S402, the electronic device sequentially traverses and parses multiple single-unit storage types in reverse order to determine the multiple sub-data types corresponding to each single-unit storage type. Specifically, the electronic device checks the target mapping from name to single-unit storage type to determine if there exists a single-unit storage type (SwcStruct) corresponding to the name of the last single-unit storage type. If a single-unit storage type (SwcStruct) corresponding to that name exists, it parses the content list in the single-unit storage type (SwcStruct) to determine the multiple sub-data types corresponding to the single-unit storage type (SwcStruct). In this example, the sub-data types parsed from the single-unit storage type can be basic data types or non-basic data types. When the sub-data type is a basic data type, it can be directly output. When the sub-data type is a non-basic data type, it is necessary to continue traversing the target mapping and parsing the non-basic data types until its content list is entirely composed of basic data types.

[0051] The following analysis, using specific examples, illustrates the process of converting a monolithic storage type into a user data type: (A) From the single-block storage types corresponding to multiple target sub-samples, determine the name last_block_name corresponding to the last single-block storage type as vRCAutoChargeConfig, and create a user data type Datatype_A named vRCAutoChargeConfig.

[0052] (B) In the target mapping blocks (Dict[str, SwcData]) from name to monolithic storage type, determine whether there is a monolithic storage type corresponding to the name last_block_name of the last monolithic storage type. For example, determine whether there is a monolithic storage type (SwcStruct) with the name vRCAutoChargeConfig.

[0053] (C) If a single-unit storage type (SwcStruct) named vRCAutoChargeConfig is included, parse the content list within the single-unit storage type (SwcStruct) to determine the sub-data type corresponding to the single-unit storage type (SwcStruct) named vRCAutoChargeConfig. Here, the sub-data type is a basic data type, or it can be a composite data type formed by combining multiple basic data types. Specific examples are as follows: (C1) Traverse the content list of SwcStruct and find that "type_name" contains two sub-data types: vRCTime and uint8. [ {"type_name": "vRCTime", "var_name": "StartTime"}, {"type_name": "vRCTime", "var_name": "EndTime"}, {"type_name": "uint8", "var_name": "RCRepeatState"}, ] (C2) Since vRCTime is not a basic data type, the search continues in the target mapping blocks. vRCTime is found to be a single-unit storage type (SwcStruct) of structure type. Then, the content is parsed. At this point, the content looks like this: [ {"type_name": "unit8", "var_name": "Time_Hour"}, {"type_name": "uint8", "var_name": "Time_Min"}, {"type_name": "uint8", "var_name": "Time_Sec"}, ] During the parsing of the content, it was found that all type_names were uint8, which is a basic data type. Therefore, the parsing was stopped. The vRCTime SwcStruct was stored as a sub-data_types of the user storage type Datatype_A. Alternatively, it could be validated before being stored as a sub-data_types of the user storage type Datatype_A.

[0054] As an example, in step S403, the electronic device needs to perform a ring definition check on multiple sub-data types parsed from the single-entity storage type corresponding to the name. This check verifies whether there are any ring definition conflicts between the multiple sub-data types and the user data type. If a ring definition conflict exists, an error alert is issued; otherwise, the sub-data types that pass the ring definition check are used as the sub-data types of the user data type corresponding to the name. In this example, the multiple sub-data types that pass the ring definition conflict check are determined as the sub-data types of the user data type to achieve text self-checking, avoid ring definition dependency errors and content missing errors, and ensure the accuracy and validity of the user data type.

[0055] In this embodiment, the name corresponding to the last single-unit storage type is determined and its corresponding user data type is created so that the parsing process starts from the last single-unit storage type, making the processing process conform to the code style and ensuring the feasibility of subsequent operations; the single-unit storage types are traversed and parsed to determine their corresponding multiple sub-data types, and then the sub-data types that pass the ring definition verification are determined as the sub-data types of the user data types corresponding to the names, so as to ensure the accuracy and validity of the user data types.

[0056] In one embodiment, the sub-data type that passes the ring definition validation simultaneously satisfies the following conditions: The name of the subdata type is different from the name of the user data type; The name of the subdata type is different from the names of all the subdata types recorded in the subdata type mapping. The subdata type mapping is a mapping of the user data type and its subdata types. The name of the sub-data type is different from the names of the multiple ancestor data types recorded in the ancestor data type mapping. The ancestor data type mapping is a mapping of the user data type and its ancestor data types.

[0057] As an example, the electronic device needs to compare the name of each sub-data type parsed by the single storage type with the name of the user data type. If the name of the sub-data type is the same as the name of the user data type (such as Datatype_A), it is determined that there is a circular definition conflict and a prompt message needs to be output; otherwise, if the name of the sub-data type is different from the name of the user data type (such as Datatype_A), it is determined that there is no circular definition conflict between the name of the sub-data type and the name of the user data type (such as Datatype_A).

[0058] Among them, the descendant data type mapping is the mapping between user data type and its descendant data type. For example, for user data type Datatype_A, a descendant data type mapping subcssors from name to DataType is defined, which can be represented as successors: Dict[str, DataType].

[0059] As an example, an electronic device needs to query the descendant data type mappings (succssors) based on the name of each sub-data type resolved by the single storage type. It then determines whether the name of the sub-data type is the same as the name of the descendant data type in the descendant data type mappings (succssors). If the name of the sub-data type is the same as the name of at least one descendant data type, a circular definition conflict is determined, and a prompt message needs to be output. Conversely, if the name of the sub-data type is different from the names of all descendant data types, it is determined that there is no circular definition conflict between the sub-data type and all descendant data types. In this case, the sub-data type (name and instance) can be added to the descendant data type mappings (succssors) of the user data type.

[0060] Among them, the ancestor data type mapping is the mapping between the user data type and its ancestor data type. For example, for the user data type Datatype_A, an ancestor data type mapping ancestors from name to DataType is defined as: ancestors: Dict[str, DataType].

[0061] As an example, an electronic device needs to query the ancestor data type mapping ancestors based on the name of each sub-data type parsed by the single storage type, and determine whether the name of the sub-data type is the same as the name of the ancestor data type in the ancestor data type mapping ancestors. If the name of the sub-data type is the same as the name of at least one ancestor data type, it is determined that there is a circular definition conflict, and a prompt message needs to be output; otherwise, if the name of the sub-data type is different from the names of all ancestor data types, it is determined that there is no circular definition conflict between the sub-data type and all ancestor data types. At this time, the sub-data type (name and instance) can be added to the ancestor data type mapping ancestors of the user data type.

[0062] In this embodiment, a sub-data type is considered not to have a circular definition check with other data types only when the name of the sub-data type is different from the name of the user data type, the names of all descendant data types, and the name of the ancestor data type. This ensures the uniqueness of the name of the sub-data type that passes the circular definition check, avoids circular definition dependency errors and content missing errors, and ensures the accuracy and validity of the user data type.

[0063] In one embodiment, such as Figure 5 As shown, step S104 involves performing conflict checks on multiple user data types corresponding to the text sample and pre-stored data types, and determining the conflict check results, including: S501: Determine whether the name of the user data type is the same as the name of the stored data type; S502: When the names of the two are different, the conflict check result is determined to be no conflict; S503: When the names of the two are the same, determine whether the instance of the user data type is the same as the instance of the storage data type; S504: When the instances of the two are different, determine that there is no conflict; S505: When two instances are identical, determine whether the descendant data type of the user data type is the same as the descendant data type of the storage data type; S506: When the descendant data types of the two are different, the conflict check result is determined to be that there is no conflict; S507: When the descendant data types of both are the same, the conflict check result is determined to be a conflict.

[0064] As an example, in step S501, for the user data type Datatype_A named vRCAutoChargeConfig, it is necessary to query all storage data types (Date) in the persistent storage to determine whether there is a storage data type (Date) with the same name.

[0065] As an example, in step S502, if there is no storage data type (Date) with the same name as the user data type Datatype_A, then the conflict check result is determined to be no conflict. At this time, the user data type can be converted into a storage data type and the converted storage data type can be stored in persistent storage to complete the fast storage of the text sample.

[0066] As an example, in step S503, if there exists a storage data type (Date) with the same name as the user data type Datatype_A, then it is necessary to read the instance of the user data type Datatype_A and the instance of the storage data type (Date) to determine whether the instances of the two data types are the same.

[0067] In this example, the electronic device can use the Data instance returned by the storage data type. Data provides a to_swc_data method to convert itself into SwcData of the same type, converting the storage data type (Date) into a single storage type (SwcStruct). Next, the name and instance of SwcData are stored in the target mapping of another block. Then, the content attribute of SwcData is traversed to continue retrieving Data with the same name from the storage data type until the traversal is complete. Finally, the last_block_name and the mapping in the blocks are combined to retrieve the corresponding instance DataType_B from the storage data type, and it is compared with the instance DataType_A of the user data type to determine whether the two instances are the same.

[0068] As an example, in step S504, if the instance of the user data type Datatype_A and the instance of the storage data type (Date) are different, it is determined that there is no conflict. At this time, the user data type can be converted into the storage data type and the converted storage data type can be stored in the persistent storage to complete the fast storage of the text sample.

[0069] As an example, in step S505, if an instance of the user data type Datatype_A and an instance of the storage data type (Date) are the same, it is necessary to further determine whether the descendant data types of the user data type and the descendant data types of the storage data type are the same. This determination of whether the descendant data types are the same can be made from two dimensions: the number of descendant data types and their corresponding data types. If both the number and data types are the same, then it is determined that the two descendant data types are the same; if at least one of the number or data type is different, then it is determined that the two descendant data types are different.

[0070] As an example, in step S506, if the descendant data types of the two are different, it is determined that there is no conflict. At this time, the user data type can be converted into a storage data type and the converted storage data type can be stored in persistent storage to complete the fast storage of the text sample.

[0071] As an example, in step S507, if the descendant data types of the two are the same, it is determined that there is a conflict. At this time, a prompt message needs to be output so that the user can determine whether to perform a replacement operation based on the prompt message, and then perform subsequent operations based on the control instruction.

[0072] In this embodiment, when the name, instance, and descendant data types of the user data type and the storage data type are all the same, it is determined that there is a conflict between them; when at least one of the name, instance, and descendant data types is different, it is determined that there is no conflict between them. This allows for a comprehensive evaluation of whether there is a conflict between the two data types from multiple dimensions, which helps to ensure the accuracy of the conflict verification results.

[0073] The data processing method provided in this embodiment has the following beneficial effects: Firstly, this solution supports inputting multiple text samples at once. A segmenter then divides the input text samples into multiple target sub-samples. Different parsers are used to parse these target sub-samples, ultimately converting them into a single-unit storage type (SwcData). Due to the parsing rules of the parser, sub-samples that do not meet the requirements are incorrectly identified, ensuring the accuracy of the resulting SwcData single-unit storage type. During the parsing and conversion of the single-unit storage type to determine its corresponding user data type, a circular definition check is also performed to avoid circular definition dependency errors and content missing errors, thus ensuring the validity of the determined user data type.

[0074] Secondly, this solution supports data type updates, especially for nested and complex data types. When multiple user data types and stored data types corresponding to the input text sample conflict, the conflicting descendant data types are recorded. The user data type corresponding to the text sample can be converted into the corresponding stored data type, and then the converted stored data type can replace the conflicting stored data type. Compared with the original method of manual confirmation and manual modification of conflicts, this greatly improves the update efficiency and accuracy, realizing a highly efficient data type generation solution.

[0075] In other words, this solution supports batch text sample input during the development of AUTOSAR CP and AP, enabling rapid and accurate conversion of these samples into their corresponding interface data types (IDTs). It also effectively performs circular definition verification on the input text samples and performs conflict detection and updates for data types with the same name, providing a self-verifying, user-friendly, and highly scalable method for generating AUTOSAR application data type IDTs. This reduces the time required to integrate data type IDTs and improves development efficiency. Furthermore, this solution avoids communication errors caused by data format mismatches between different modules through a unified data type definition, simplifying software reuse and integration.

[0076] This application embodiment also provides a data processing device 600, such as... Figure 6 As shown, it includes: The text sample segmentation module 601 is used to segment the text sample, determine multiple target sub-samples corresponding to the text sample, and determine the data type corresponding to each target sub-sample. The single-unit storage type determination module 602 is used to use a parser corresponding to the data type to parse the target sub-samples corresponding to the data type and determine the single-unit storage type corresponding to each target sub-sample. User storage type determination module 603 is used to parse the individual storage types corresponding to multiple target sub-samples and determine the multiple user data types corresponding to the text sample. The storage operation execution module 604 is used to perform conflict verification on multiple user data types corresponding to the text sample and pre-stored storage data types, determine the conflict verification result, and perform the corresponding storage operation based on the conflict verification result.

[0077] This application also provides an electronic device 700, such as... Figure 7 As shown, it includes a memory 701 and a processor 702, wherein the memory 701 is used to store computer programs; the processor 702 is used to execute the programs stored in the memory 701 to implement the data processing method described in any embodiment of this application.

[0078] This application also provides a vehicle including the electronic device 700 described in the above embodiments.

[0079] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the data processing method described in any embodiment of this application.

[0080] In this application, "multiple" refers to two or more.

[0081] In this application, unless otherwise expressly defined, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0082] The terms “first,” “second,” “third,” “fourth,” etc., in this application (if any) are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0083] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, in this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0084] Unless otherwise specified, all steps in this application may be performed sequentially or randomly. For example, if the method includes steps A and B, it means that the method may include steps A and B performed sequentially, or it may include steps B and A performed sequentially. For example, if the method may also include step C, it means that step C may be added to the method in any order. For example, the method may include steps A, B, and C, or it may include steps A, C, and B, or it may include steps C, A, and B, etc.

[0085] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A data processing method, characterized in that, include: The text sample is segmented to determine multiple target sub-samples corresponding to the text sample, and the data type corresponding to each target sub-sample is determined. Using the parser corresponding to the data type, the target sub-samples corresponding to the data type are parsed to determine the single-unit storage type corresponding to each target sub-sample; The individual storage types corresponding to multiple target sub-samples are parsed to determine multiple user data types corresponding to the text sample; Conflict checks are performed on multiple user data types corresponding to the text sample and pre-stored storage data types to determine the conflict check results, and the corresponding storage operations are performed based on the conflict check results.

2. The method according to claim 1, characterized in that, The process of segmenting the text sample to determine multiple target sub-samples corresponding to the text sample includes: The text sample is cleaned to obtain the cleaned text sample; The cleaned text sample is segmented based on the target keywords to determine multiple initial sub-samples corresponding to the text sample; Data cleaning is performed on multiple initial sub-samples to determine multiple target sub-samples corresponding to the text sample.

3. The method according to claim 1, characterized in that, The step of using the parser corresponding to the data type to parse the target sub-samples corresponding to the data type and determining the single-unit storage type corresponding to each target sub-sample includes: Using the parser corresponding to the data type, the target sub-sample corresponding to the data type is parsed to determine the initial text content corresponding to the target sub-sample; The initial text content corresponding to the target subsample is validated to determine the target text content that conforms to the code specification. Based on the code conversion rules corresponding to the data type, the target text content is converted to determine the single-unit storage type corresponding to the target subsample.

4. The method according to claim 1, characterized in that, The step of parsing the individual storage types corresponding to multiple target sub-samples to determine multiple user data types corresponding to the text sample includes: Based on the individual storage types corresponding to multiple target sub-samples, determine the name corresponding to the last individual storage type, and create the user data type corresponding to the name; The process involves traversing and parsing multiple single-unit storage types to determine multiple sub-data types corresponding to each single-unit storage type. Perform a ring definition check on all the sub-data types, determine the sub-data types that pass the ring definition check, and identify the sub-data types that pass the ring definition check as the sub-data types of the user data type corresponding to the name.

5. The method according to claim 4, characterized in that, The sub-data types that pass the ring definition validation simultaneously satisfy the following conditions: The name of the sub-data type is different from the name of the user data type; The name of the sub-data type is different from the names of all the sub-data types recorded in the sub-data type mapping. The sub-data type mapping is a mapping of the user data type and its sub-data types. The name of the sub-data type is different from the names of the multiple ancestor data types recorded in the ancestor data type mapping. The ancestor data type mapping is a mapping of the user data type and its ancestor data types.

6. The method according to claim 1, characterized in that, The step of performing conflict verification on multiple user data types corresponding to the text sample and pre-stored data types, and determining the conflict verification result, includes: Determine whether the name of the user data type is the same as the name of the storage data type; When the two names are different, the conflict check result is determined to be that there is no conflict; If the names of the two are the same, determine whether the instance of the user data type is the same as the instance of the storage data type; When the instances of the two are different, the conflict check result is determined to be that there is no conflict; When two instances are identical, determine whether the descendant data type of the user data type is the same as the descendant data type of the storage data type; When the descendant data types of the two are different, the conflict check result is determined to be that there is no conflict; If the descendant data types of both are the same, the conflict check result is determined to be a conflict.

7. A data processing apparatus, characterized in that, include: The text sample segmentation module is used to segment the text sample, determine multiple target sub-samples corresponding to the text sample, and determine the data type corresponding to each target sub-sample; The single-unit storage type determination module is used to use the parser corresponding to the data type to parse the target sub-samples corresponding to the data type and determine the single-unit storage type corresponding to each target sub-sample; The user storage type determination module is used to parse the individual storage types corresponding to multiple target sub-samples and determine multiple user data types corresponding to the text sample. The storage operation execution module is used to perform conflict verification on multiple user data types corresponding to the text sample and pre-stored storage data types, determine the conflict verification result, and execute the corresponding storage operation based on the conflict verification result.

8. An electronic device, characterized in that, Including processor and memory, among which, Memory, used to store computer programs; A processor for executing a program stored in memory to implement the data processing method according to any one of claims 1-6.

9. A vehicle, characterized in that, Includes the electronic device as described in claim 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the data processing method according to any one of claims 1-6.