A method and apparatus for modifying protocol stack attributes

By obtaining the target's identifiable attributes from the vehicle communication protocol stack, establishing an address mapping table, and changing the constant type to a variable type, the attribute adjustment process is simplified, solving the problem of high workload for engineers in existing technologies and improving modification efficiency.

CN119676326BActive Publication Date: 2025-12-02BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411929921.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-12-02
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

The existing technology for adjusting the attributes of the vehicle communication protocol stack is cumbersome, resulting in a large workload for engineers, high labor costs, and a long modification time.

Method used

By obtaining the target's calibrable attributes, searching the preset attribute calibration list, determining the protocol stack attribute array, changing the constant type to the variable type, establishing an address mapping table, and using the mapping table to modify the protocol stack attributes.

Benefits of technology

It simplifies the process of modifying protocol stack attributes, reduces the workload of engineers, and improves modification efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676326B_ABST
    Figure CN119676326B_ABST
Patent Text Reader

Abstract

This application discloses a method and apparatus for modifying protocol stack attributes. The method includes: obtaining a target calibrable attribute and searching for a target preset attribute calibration list corresponding to the target calibrable attribute from all preset attribute calibration lists; determining an attribute array in the protocol stack based on the target calibrable attribute; changing the constant type of the attribute array to a variable type to obtain the target attribute array, and storing the target attribute array in RAM; establishing an address mapping table for the target attribute array according to the target preset attribute calibration list; and modifying multiple protocol stack attributes in the target attribute array according to the address mapping table and the target preset attribute calibration list. This effectively completes the modification of calibration data and solves the problem of heavy workload for engineers by performing position mapping through the calibrable attribute, the attribute calibration list, and the established mapping table, thereby overwriting the protocol stack attributes in the attribute array with the values ​​obtained from the position mapping.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automotive electronics technology, and in particular to a method and apparatus for modifying protocol stack attributes. Background Technology

[0002] The in-vehicle communication protocol stack is a set of protocols used for communication between vehicles. It defines the protocols and specifications required for data exchange and communication within and between vehicles. Therefore, in the actual vehicle development process, it is inevitable that some signal and message attributes of the communication protocol stack will be adjusted.

[0003] Most existing automotive ECUs typically adopt the Automotive Open System Architecture (AUTOSAR) software architecture. However, in the AUTOSAR software architecture, all attributes are statically configured. Furthermore, according to the existing automotive communication protocol stack development process, any adjustment to communication attributes requires corresponding modifications based on communication requirements. Moreover, updating the communication description file also requires reconfiguration of the underlying software, as well as re-integration and debugging of the code. This results in a large number of engineers involved in the entire development process, high labor costs, and a cumbersome and time-consuming attribute adjustment process, undoubtedly causing a significant workload for engineers. Summary of the Invention

[0004] In view of the shortcomings of the prior art, this application provides a method and apparatus for modifying protocol stack attributes to solve the problem of large workload for engineers caused by the prior art.

[0005] To achieve the above objectives, this application provides the following technical solution:

[0006] The first aspect of this application provides a method for modifying protocol stack attributes, including:

[0007] Obtain the target calibrable attributes, and search for the target preset attribute calibration list corresponding to the target calibrable attributes from all preset attribute calibration lists;

[0008] Based on the target identifiable attributes, an attribute array in the protocol stack is determined; wherein, the attribute array consists of multiple protocol stack attributes;

[0009] The constant type of the attribute array is changed to the variable type to obtain the target attribute array, and the target attribute array is stored in RAM;

[0010] Based on the target preset attribute labeling list, an address mapping table for the target attribute array is established; wherein, the address mapping table contains the mapping relationship between the target preset attribute labeling list and the target attribute array, and the number of index numbers in the address mapping table is the same as the number of labelable attributes in the target preset attribute labeling list, and one index number in the address mapping table corresponds to one labelable attribute in the target preset attribute labeling list;

[0011] Based on the address mapping table and the target preset attribute labeling list, modify multiple protocol stack attributes in the target attribute array.

[0012] Optionally, in the above method for modifying protocol stack attributes, modifying multiple protocol stack attributes in the target attribute array according to the address mapping table and the target preset attribute labeling list includes:

[0013] Obtain the first calibrable attribute from the target preset attribute calibration list;

[0014] Obtain the index number corresponding to the first identifiable attribute from the address mapping table, and search for the protocol stack attribute corresponding to the first identifiable attribute and the index number from the target attribute array;

[0015] Assign the value corresponding to the first identifiable attribute to the protocol stack attribute;

[0016] Detect whether the first identifiable attribute is the last identifiable attribute in the attribute identification list;

[0017] If the first identifiable attribute is not the last identifiable attribute in the attribute identification list, then the next identifiable attribute of the first identifiable attribute is obtained from the target preset attribute identification list;

[0018] The next calibrable attribute is determined as the first calibrable attribute, and the process returns to retrieve the index number corresponding to the first calibrable attribute from the address mapping table, and search for the protocol stack attribute corresponding to the first calibrable attribute and the index number from the target attribute array, until the first calibrable attribute is the last calibrable attribute in the attribute calibration list.

[0019] Optionally, in the above method for modifying protocol stack attributes, the step of establishing an address mapping table for the target attribute array based on the target preset attribute labeling list includes:

[0020] Retrieve all calibrable attributes from the target preset attribute calibration list;

[0021] Create index numbers for all the identifiable attributes;

[0022] Based on all the index numbers, an address mapping table is established, and the address mapping table is determined as the address mapping table of the target attribute array.

[0023] Optionally, in the above-described method for modifying protocol stack attributes, the method for establishing the preset attribute labeling list includes:

[0024] Obtain all identifiable attributes corresponding to all communication messages;

[0025] According to the data type of all identifiable attributes corresponding to all the communication messages, all identifiable attributes corresponding to the communication messages are classified to obtain the set of identifiable attributes corresponding to each data type;

[0026] Based on all the calibrable attribute sets, generate a plurality of corresponding preset attribute calibration lists; wherein, one calibrable attribute set corresponds to one preset attribute calibration list.

[0027] Optionally, in the above method for modifying protocol stack attributes, determining the attribute array in the protocol stack based on the target identifiable attribute includes:

[0028] Obtain the configuration file corresponding to the target's identifiable attributes from the protocol stack;

[0029] Locate the attribute array corresponding to the target's identifiable attributes from the configuration file;

[0030] The target identifiable attributes are indexed using preset code to obtain an index array corresponding to the target identifiable attributes;

[0031] Determine whether the attribute array is consistent with the index array;

[0032] If the attribute array is consistent with the index array, then the attribute array corresponding to the target identifiable attribute is determined as the attribute array in the protocol stack;

[0033] If the attribute array is inconsistent with the index array, then the index array is determined to be the attribute array in the protocol stack.

[0034] A second aspect of this application provides a device for modifying protocol stack attributes, comprising:

[0035] The attribute acquisition unit is used to acquire the target calibrable attribute and search for the target preset attribute calibration list corresponding to the target calibrable attribute from all preset attribute calibration lists;

[0036] An array determination unit is used to determine an attribute array in the protocol stack based on the target identifiable attributes; wherein the attribute array consists of multiple protocol stack attributes;

[0037] The type modification unit is used to modify the constant type of the attribute array to the variable type to obtain the target attribute array, and store the target attribute array in RAM;

[0038] The address establishment unit is used to establish an address mapping table of the target attribute array according to the target preset attribute labeling list; wherein, the address mapping table contains the mapping relationship between the target preset attribute labeling list and the target attribute array, and the number of index numbers in the address mapping table is the same as the number of labelable attributes in the target preset attribute labeling list, and one index number in the address mapping table corresponds to one labelable attribute in the target preset attribute labeling list;

[0039] The attribute modification unit is used to modify multiple protocol stack attributes in the target attribute array according to the address mapping table and the target preset attribute labeling list.

[0040] Optionally, in the above-described protocol stack attribute modification device, the attribute modification unit includes:

[0041] The first acquisition unit is used to acquire the first calibrable attribute from the target preset attribute calibration list;

[0042] The first lookup unit is used to obtain the index number corresponding to the first identifiable attribute from the address mapping table, and to look up the protocol stack attribute corresponding to the first identifiable attribute and the index number from the target attribute array;

[0043] The assignment unit is used to assign the value corresponding to the first identifiable attribute to the protocol stack attribute.

[0044] The detection unit is used to detect whether the first identifiable attribute is the last identifiable attribute in the attribute labeling list;

[0045] The second acquisition unit is used to acquire the next identifiable attribute from the target preset attribute identification list if the first identifiable attribute is not the last identifiable attribute in the attribute identification list.

[0046] The attribute determination unit is used to determine the next calibrable attribute as the first calibrable attribute, and return to execute the process of obtaining the index number corresponding to the first calibrable attribute from the address mapping table, and searching for the protocol stack attribute corresponding to the first calibrable attribute and the index number from the target attribute array, until the first calibrable attribute is the last calibrable attribute in the attribute calibration list.

[0047] Optionally, in the above-described protocol stack attribute modification device, the address establishment unit includes:

[0048] The third acquisition unit is used to acquire all calibrable attributes from the target preset attribute calibration list;

[0049] Create a unit to create index numbers for all the identifiable attributes;

[0050] The first determining unit is used to establish an address mapping table based on all the index numbers, and to determine the address mapping table as the address mapping table of the target attribute array.

[0051] Optionally, the above-mentioned protocol stack attribute modification device further includes:

[0052] The fourth acquisition unit is used to acquire all identifiable attributes corresponding to all communication messages;

[0053] The classification unit is used to classify all identifiable attributes corresponding to the communication messages according to the data type of all identifiable attributes corresponding to all the communication messages, and obtain a set of identifiable attributes corresponding to each data type;

[0054] The generation unit is used to generate multiple preset attribute calibration lists corresponding to all the calibrable attribute sets; wherein, one calibrable attribute set corresponds to one preset attribute calibration list.

[0055] Optionally, in the above-described protocol stack attribute modification device, the array determination unit includes:

[0056] The fifth acquisition unit is used to acquire the configuration file corresponding to the target identifiable attribute from the protocol stack;

[0057] The second search unit is used to search for the attribute array corresponding to the target identifiable attribute from the configuration file;

[0058] An indexing unit is used to index the target identifiable attributes using a preset code to obtain an index array corresponding to the target identifiable attributes;

[0059] A judgment unit is used to determine whether the attribute array is consistent with the index array;

[0060] The second determining unit is used to determine the attribute array corresponding to the target identifiable attribute as the attribute array in the protocol stack if the attribute array is consistent with the index array;

[0061] The third determining unit is used to determine the index array as the attribute array in the protocol stack if the attribute array is inconsistent with the index array.

[0062] This application provides a method for modifying protocol stack attributes. The method involves obtaining a target calibrable attribute and searching for a target preset attribute calibration list corresponding to the target calibrable attribute from all preset attribute calibration lists. Then, based on the target calibrable attribute, an attribute array in the protocol stack is determined. This attribute array consists of multiple protocol stack attributes. Next, the constant type of the attribute array is changed to a variable type to obtain the target attribute array, which is then stored in RAM. Then, an address mapping table for the target attribute array is established according to the target preset attribute calibration list. This address mapping table contains the mapping relationship between the target preset attribute calibration list and the target attribute array. The number of indexes in the address mapping table is the same as the number of calibrable attributes in the target preset attribute calibration list, and one index in the address mapping table corresponds to one calibrable attribute in the target preset attribute calibration list. Finally, multiple protocol stack attributes in the target attribute array are modified according to the address mapping table and the target preset attribute calibration list. By finding the corresponding attribute calibration list and attribute array through the pre-defined target calibrable attributes, and then performing position mapping based on the attribute calibration list and the established mapping table, the position mapping value is then overwritten into the protocol stack attribute in the attribute array. This effectively completes the modification of calibration data and simplifies the entire process of attribute modification, effectively solving the problem of heavy workload for engineers. Attached Figure Description

[0063] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0064] Figure 1 A flowchart illustrating a method for modifying protocol stack attributes provided in an embodiment of this application;

[0065] Figure 2 A flowchart illustrating the creation of a preset attribute labeling list provided in an embodiment of this application;

[0066] Figure 3A flowchart illustrating a method for determining an attribute array provided in an embodiment of this application;

[0067] Figure 4 This is a schematic diagram illustrating a modified data type structure provided in an embodiment of this application;

[0068] Figure 5 This is a schematic diagram of the structure of an address mapping list provided in an embodiment of this application;

[0069] Figure 6 A flowchart illustrating a method for establishing an address mapping table provided in an embodiment of this application;

[0070] Figure 7 A flowchart illustrating another method for modifying protocol stack attributes provided in an embodiment of this application;

[0071] Figure 8 This application provides a schematic diagram of the structure of an address mapping process.

[0072] Figure 9 This is a schematic diagram of a protocol stack attribute modification device provided in another embodiment of this application. Detailed Implementation

[0073] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0074] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0075] This application provides a method for modifying protocol stack attributes, such as... Figure 1 As shown, the specific steps include:

[0076] S101. Obtain the target calibrable attributes and search for the target preset attribute calibration list corresponding to the target calibrable attributes from all preset attribute calibration lists.

[0077] It should be noted that the specific selection of calibrable attributes can be divided into two parts: First, it can be based on actual needs, with calibration personnel or system engineers calibrating the attributes that need to be modified according to the vehicle model or operating conditions during the actual calibration process. Second, it needs to be clarified whether these calibration attributes can realize calibrable functions on the protocol stack. Only by clarifying the calibrable attributes can the development target of the calibrable functions be identified, and subsequent automotive development can proceed.

[0078] For example, calibration attributes can include COM communication ID, data length, CAN / CANfd attributes; CAN channel baud rate and sampling points; J1939 long message communication PGN, destination address, and source address; diagnostic DID ID number, data length, read / write attributes; fault DTC DTC DTC code, fault acknowledgment recovery count, and loop type; and network management ID range, node address, time parameters, etc., all of which can be achieved through calibration.

[0079] Therefore, the target calibrable attribute in step S101 refers to the attribute that the calibration personnel or system engineer is currently modifying based on the vehicle model or operating condition.

[0080] It should also be noted that the preset attribute list is established to clearly define the identifiable attributes, as well as the development objects of these identifiable attributes and their sorting order. For example, the identifiable attribute of the CAN message ID is specified in the preset attribute list as needing modification. The ID is an attribute of the CAN message. The development project has two CAN channels, each with 100 CAN message transmissions. The preset attribute list is then obtained by arranging the transmitted messages in order, as shown in Table 1, which lists the CANID attribute.

[0081] Table 1

[0082] CAN1MSG1 ID CAN1MSG2 ID CAN1MSG3 ID … CAN1MSG100 ID CAN2MSG1 ID CAN2MSG2 ID CAN2MSG3 ID … CAN2MSG100 ID

[0083] It should also be noted that in the embodiments of this application, a type of identifiable attribute corresponds to a preset attribute list. For example, if the identifiable attribute is data length, then the preset attribute list only contains data length and will not contain ID. Therefore, when you want to modify an attribute, the list will not contain other irrelevant attributes of other types. The attribute to be identified can be located quickly and flexibly, effectively, and thus the modification of the protocol stack attribute can be realized.

[0084] Optionally, embodiments of this application provide a method for establishing a preset attribute labeling list, such as... Figure 2 As shown, it includes the following steps:

[0085] S201. Obtain all identifiable attributes corresponding to all communication messages.

[0086] Specifically, obtaining all identifiable attributes corresponding to a communication message typically requires parsing and analyzing the protocol stack. The protocol stack defines the structure and fields of the communication message, and each field may have some identifiable attributes. First, the protocol stack needs to be parsed to understand the structure and meaning of the fields in the communication message. Second, the fields in each communication message need to be identified, and the meaning and purpose of each field determined. These fields may include headers, data fields, checksum fields, etc. For each field, calibration personnel or system engineers determine its identifiable attributes. These attributes may include data type, value range, unit, sampling rate, parsing method, etc. Next, for each field, its identifiable attribute information is extracted. Then, all attributes are associated with their corresponding fields to obtain all identifiable attributes.

[0087] S202. According to the data type of all identifiable attributes corresponding to all communication messages, classify all identifiable attributes corresponding to the communication messages to obtain the set of identifiable attributes corresponding to each data type.

[0088] It should be noted that, in order to better organize and manage these identifiable attributes and facilitate subsequent data processing, all identifiable attributes need to be categorized according to data type.

[0089] S203. Generate multiple preset attribute calibration lists based on all calibrable attribute sets.

[0090] One identifiable attribute set corresponds to one preset attribute specification list.

[0091] Understandably, by generating a list of preset attribute calibrations, calibration personnel or system engineers can more easily select the attributes they want to modify for calibration based on the data type, thereby effectively speeding up the efficiency of attribute calibration.

[0092] S102. Based on the target's identifiable attributes, determine the attribute array in the protocol stack.

[0093] The attribute array consists of multiple protocol stack attributes.

[0094] It should be noted that this application uses the AUTOSAR software architecture as the application scenario. Therefore, if we want to modify the attributes in the AUTOSAR protocol stack according to the vehicle model or working condition, i.e. the target identifiable attributes, we need to clarify which protocol stack attributes in the AUTOSAR protocol stack are affected by the target identifiable attributes in order to complete the development of the vehicle communication protocol stack. Therefore, it is necessary to determine the attribute array in the AUTOSAR protocol stack based on the target identifiable attributes, i.e., the array composed of which protocol stack attributes are affected in the AUTOSAR protocol stack.

[0095] Optionally, in another embodiment of this application, one specific implementation of step S102 is as follows: Figure 3 As shown, it includes the following steps:

[0096] S301. Obtain the configuration file corresponding to the target's identifiable attributes from the protocol stack.

[0097] Specifically, to determine which attribute array in the AUTOSAR protocol stack is affected by the target's identifiable attributes, we need to start from the source, that is, find out which configuration file in the protocol stack is configured based on the target's identifiable attributes. Then, we can find the attribute array in the AUTOSAR protocol stack related to the target's attributes from the configuration file.

[0098] S302. Locate the attribute array corresponding to the target identifiable attribute from the configuration file.

[0099] It should be noted that the configuration file corresponding to the target calibrable attribute records all data related to the target calibrable attribute, including relevant data in the AUTOSAR protocol stack. Therefore, based on the configuration file obtained in step S301, the attribute array in the AUTOSAR protocol stack corresponding to the target calibrable attribute can be found in the configuration file.

[0100] S303. Use preset codes to index the target identifiable attributes to obtain the index array corresponding to the target identifiable attributes.

[0101] Specifically, in order to further determine whether the attribute array corresponding to the target identifiable attributes found in the configuration file is accurate, it is also necessary to read the code of the AUTOSAR protocol stack. This is because there are statements in the code of each layer of the protocol stack that verify or index the target identifiable attributes. By using the verification or indexing statements, the array composed of multiple protocol stack attributes in the AUTOSAR protocol stack that the accurate target identifiable attributes affect can be found, i.e., the attribute array.

[0102] S304. Determine whether the attribute array is consistent with the index array.

[0103] Understandably, to verify the accuracy of the attribute array retrieved from the configuration file, it is necessary to further determine whether the attribute array matches the index array. If the attribute array matches the index array, it means that the attribute array retrieved from the configuration file is accurate, so step S305 is executed. If the attribute array does not match the index array, it means that the attribute array retrieved from the configuration file is inaccurate, so step S306 is executed.

[0104] S305. Determine the attribute array corresponding to the target's identifiable attributes as the attribute array in the protocol stack.

[0105] It is understandable that when the attribute array and the index array are the same, it means that the protocol stack attribute in the attribute array found in the configuration file is the attribute that needs to be modified later, so step S305 needs to be executed.

[0106] S306. Determine the index array as the attribute array in the protocol stack.

[0107] Specifically, when the attribute array and the index array are inconsistent, it means that the protocol stack attribute in the attribute array found in the configuration file is not the attribute that needs to be modified later. The index array is the array composed of multiple protocol stack attributes in the AUTOSAR protocol stack that are affected by the target identifiable attribute. Therefore, the index array needs to be determined as the attribute array in the protocol stack for subsequent modification.

[0108] S103. Change the constant type of the attribute array to the variable type to obtain the target attribute array, and store the target attribute array in RAM.

[0109] It is important to emphasize that, because attribute arrays in the AUTOSAR software architecture are stored as constants in the FLASH space, they cannot be modified in the FLASH space. Therefore, in this embodiment, the constant type of the attribute array is changed to a variable type and stored in RAM, thereby enabling modification of the attribute array in RAM. Here, "variable type" refers to a runtime variable type.

[0110] For example, see Figure 4 As shown, in the FLASH space, AUTOSAR attribute array 1, AUTOSAR attribute array 2, and AUTOSAR attribute array 3 are arrays related to calibrable attributes, while AUTOSAR attribute array A, AUTOSAR attribute array B, and AUTOSAR attribute array C are arrays unrelated to calibrable attributes. After modifying the data type, AUTOSAR attribute array 1, AUTOSAR attribute array 2, and AUTOSAR attribute array 3 are stored in RAM.

[0111] S104. Based on the target preset attribute calibration list, establish an address mapping table for the target attribute array.

[0112] It should be noted that since the target identifiable attribute usually has multiple different entities, each entity has its own identifiable attribute of the same type as the target identifiable attribute, which is stored in the target preset attribute identification list. Moreover, each entity corresponds to a protocol stack attribute in the attribute array. Therefore, the target preset attribute identification list contains the target identifiable attribute and the identifiable attribute of the same type corresponding to each entity. For example, if the target identifiable attribute is CANID, the identifiable attributes of the same type corresponding to multiple different entities are the ID of the first CAN1 message, the ID of the second CAN1 message, and the ID of the third CAN1 message, etc. Therefore, the target preset attribute identification list stores the ID of the first CAN1 message, the ID of the second CAN1 message, and the ID of the third CAN1 message, etc.

[0113] Therefore, it is necessary to map all calibrable attributes in the target preset attribute calibration list to the protocol stack attributes in the attribute array one by one in order to complete the replacement of calibration data and thus complete the development of the communication protocol stack. Therefore, in this embodiment, a position mapping method is used to map all calibrable attributes in the target preset attribute calibration list to the protocol stack attributes in the attribute array one by one. Therefore, it is necessary to establish an address mapping table for the target attribute array based on all the data in the target preset attribute calibration list.

[0114] The address mapping table contains the mapping relationship between the target preset attribute calibration list and the target attribute array. The number of index numbers in the address mapping table is the same as the number of calibrable attributes in the target preset attribute calibration list, and one index number in the address mapping table corresponds to one calibrable attribute in the target preset attribute calibration list.

[0115] For example, you can refer to Figure 5 The contents shown show that the number of elements in the address mapping table is the same as that in the user attribute calibration list (i.e., the target preset attribute calibration list), and they correspond one-to-one. In addition, the address mapping table also stores the subscript index number of the attribute array (i.e., the AUTOSAR attribute array). The mapping relationship between the user attribute calibration list and the AUTOSAR attribute array is established through this address mapping table.

[0116] Optionally, in another embodiment of this application, one specific implementation of step S104 is as follows: Figure 6 As shown, it includes the following steps:

[0117] S601. Retrieve all calibrable attributes from the target preset attribute calibration list.

[0118] S602. Create index numbers for all identifiable attributes.

[0119] Specifically, in order for all calibrable attributes in the target preset attribute calibration list to be mapped one by one to the protocol stack attributes in the attribute array, it is necessary to create index numbers for all calibrable attributes based on the index numbers of all protocol stack attributes in the attribute array.

[0120] S603. Based on all the index numbers, establish an address mapping table and determine the address mapping table as the address mapping table of the target attribute array.

[0121] Optionally, the `buildAddressMap` function can be used to build an address mapping table based on the index number. Of course, other methods can also be used; this embodiment is not limited to using a function.

[0122] S105. Based on the address mapping table and the target preset attribute calibration list, modify multiple protocol stack attributes in the target attribute array.

[0123] Specifically, based on the values ​​of all calibrable attributes in the target preset attribute calibration list and the index numbers of all calibrable attributes in the address mapping table, multiple protocol stack attributes in the target attribute array are modified one by one.

[0124] Optionally, in another embodiment of this application, one specific implementation of step S105 is as follows: Figure 7 As shown, it includes the following steps:

[0125] S701. Obtain the first calibrable attribute from the target preset attribute calibration list.

[0126] It should be noted that for a identifiable attribute, there may be multiple different entities, and each entity corresponds to a protocol stack attribute in the attribute array. Therefore, it is necessary to loop through these entities from the first to the last to ensure that the attributes of each entity from the first to the last are replaced.

[0127] For example, the attribute can be identified as the ID of COM communication, and multiple different entities can be identified as the ID of COM communication 1, the ID of COM communication 2, and the ID of COM communication 3, etc.

[0128] S702. Obtain the index number corresponding to the first identifiable attribute from the address mapping table, and search for the protocol stack attribute corresponding to the first identifiable attribute and its index number from the target attribute array.

[0129] It is understood that, in the embodiments of this application, the protocol stack attribute in the AUTOSAR protocol stack corresponding to the calibrable attribute can be accurately found through location mapping. Therefore, it is necessary to find the corresponding subscript index number from the target attribute array based on the first calibrable attribute and its corresponding index number. At this time, the protocol stack attribute corresponding to the subscript index number is the protocol stack attribute in the AUTOSAR protocol stack that needs to be modified accordingly by the first calibrable attribute.

[0130] For example, you can refer to Figure 8 The content shown is that the user attribute list is the target preset attribute calibration list. Therefore, based on the first user attribute 1 in the user attribute list, which is also the first calibrable attribute, and the index number 1 in the corresponding array 1 address mapping table, the corresponding third AUTOSAR attribute array 1 element, which is the protocol stack attribute, can be found in the AUTOSAR attribute array 1.

[0131] S703. Assign the value corresponding to the first identifiable attribute to the protocol stack attribute.

[0132] S704. Check whether the first identifiable attribute is the last identifiable attribute in the attribute labeling list.

[0133] It should be noted that, since it is necessary to ensure that all attributes from the first to the last in the target preset attribute labeling list are replaced in order to complete the data replacement of the attribute array, it is necessary to further check whether the first attribute is the last attribute in the attribute labeling list. If the first attribute is not the last attribute in the attribute labeling list, it means that the last attribute has not been replaced yet, so step S705 needs to be executed at this time.

[0134] Optionally, if the first identifiable attribute is the last identifiable attribute in the attribute identification list, it means that all identifiable attributes from the first to the last in the target preset attribute identification list have been replaced, and the process ends at this point.

[0135] S705. Obtain the next calibrable attribute from the target preset attribute calibration list.

[0136] It is understandable that when the first identifiable attribute is not the last identifiable attribute in the attribute identification list, the replacement operation needs to continue. Therefore, it is necessary to obtain the next identifiable attribute of the first identifiable attribute from the target preset attribute identification list, i.e., to execute step S706.

[0137] S706. Determine the next identifiable attribute as the first identifiable attribute.

[0138] Specifically, when the next calibrable attribute is determined to be the first calibrable attribute, it is necessary to return to step S702 until the first calibrable attribute is the last calibrable attribute in the attribute calibration list. Only then is the replacement of calibration data considered complete. Therefore, compared with the calibration function of AUTOSAR, the calibrable attributes and the target preset attribute calibration list in this embodiment are more centralized. Calibration personnel do not need to know the structure and function of the AUTOSAR array, and can also complete the attribute calibration well without any understanding of the AUTOSAR core code.

[0139] This application provides a method for modifying protocol stack attributes. The method involves obtaining a target calibrable attribute and searching for a target preset attribute calibration list corresponding to the target calibrable attribute from all preset attribute calibration lists. Then, based on the target calibrable attribute, an attribute array in the protocol stack is determined. This attribute array consists of multiple protocol stack attributes. Next, the constant type of the attribute array is changed to a variable type to obtain the target attribute array, which is then stored in RAM. Then, an address mapping table for the target attribute array is established according to the target preset attribute calibration list. This address mapping table contains the mapping relationship between the target preset attribute calibration list and the target attribute array. The number of indexes in the address mapping table is the same as the number of calibrable attributes in the target preset attribute calibration list, and one index in the address mapping table corresponds to one calibrable attribute in the target preset attribute calibration list. Finally, multiple protocol stack attributes in the target attribute array are modified according to the address mapping table and the target preset attribute calibration list. By finding the corresponding attribute calibration list and attribute array through the pre-defined target calibrable attributes, and then performing position mapping based on the attribute calibration list and the established mapping table, the position mapping value is then overwritten into the protocol stack attribute in the attribute array. This effectively completes the modification of calibration data and simplifies the entire process of attribute modification, effectively solving the problem of a huge workload for engineers.

[0140] Another embodiment of this application provides a device for modifying protocol stack attributes, such as... Figure 9 As shown, it includes the following units:

[0141] The attribute acquisition unit 901 is used to acquire the target calibrable attributes and search for the target preset attribute calibration list corresponding to the target calibrable attributes from all preset attribute calibration lists.

[0142] The array determination unit 902 is used to determine the attribute array in the protocol stack based on the target identifiable attributes. The attribute array consists of multiple protocol stack attributes.

[0143] The type modification unit 903 is used to modify the constant type of the attribute array to the variable type to obtain the target attribute array, and store the target attribute array in RAM.

[0144] Address establishment unit 904 is used to establish an address mapping table for a target attribute array based on a target preset attribute calibration list. The address mapping table contains the mapping relationship between the target preset attribute calibration list and the target attribute array, and the number of index numbers in the address mapping table is the same as the number of calibrable attributes in the target preset attribute calibration list. Furthermore, one index number in the address mapping table corresponds to one calibrable attribute in the target preset attribute calibration list.

[0145] The attribute modification unit 905 is used to modify multiple protocol stack attributes in the target attribute array according to the address mapping table and the target preset attribute labeling list.

[0146] It should be noted that the specific working process of the above-mentioned units in the embodiments of this application can be referred to steps S101 to S105 in the above method embodiments, and will not be repeated here.

[0147] Optionally, in another embodiment of this application, a protocol stack attribute modification device includes an attribute modification unit 905 comprising:

[0148] The first acquisition unit is used to acquire the first calibrable attribute from the target preset attribute calibration list.

[0149] The first lookup unit is used to obtain the index number corresponding to the first identifiable attribute from the address mapping table, and to look up the protocol stack attribute corresponding to the first identifiable attribute and the index number from the target attribute array.

[0150] The assignment unit is used to assign the value corresponding to the first identifiable attribute to the protocol stack attribute.

[0151] The detection unit is used to detect whether the first identifiable attribute is the last identifiable attribute in the attribute labeling list.

[0152] The second acquisition unit is used to acquire the next identifiable attribute from the target preset attribute identification list if the first identifiable attribute is not the last identifiable attribute in the attribute identification list.

[0153] The attribute determination unit is used to determine the next calibrable attribute as the first calibrable attribute, and return to execute the process of obtaining the index number corresponding to the first calibrable attribute from the address mapping table, and searching for the protocol stack attribute corresponding to the first calibrable attribute and its index number from the target attribute array, until the first calibrable attribute is the last calibrable attribute in the attribute calibration list.

[0154] Optionally, in another embodiment of this application, a protocol stack attribute modification device includes an address establishment unit 904, comprising:

[0155] The third acquisition unit is used to acquire all calibrable attributes from the target preset attribute calibration list.

[0156] Create a cell to generate index numbers for all identifiable attributes.

[0157] The first determining unit is used to establish an address mapping table based on all the index numbers, and to determine the address mapping table as the address mapping table of the target attribute array.

[0158] Optionally, another embodiment of this application provides a protocol stack attribute modification device, which further includes:

[0159] The fourth acquisition unit is used to acquire all identifiable attributes corresponding to all communication messages.

[0160] The classification unit is used to classify all identifiable attributes corresponding to all communication messages according to the data type of all identifiable attributes corresponding to all communication messages, and obtain the set of identifiable attributes corresponding to each data type.

[0161] The generation unit is used to generate multiple preset attribute calibration lists for each of the sets of calibrable attributes. Each set of calibrable attributes corresponds to one preset attribute calibration list.

[0162] Optionally, in another embodiment of this application, a protocol stack attribute modification device includes an array determination unit 902, comprising:

[0163] The fifth acquisition unit is used to obtain the configuration file corresponding to the target's identifiable attributes from the protocol stack.

[0164] The second lookup unit is used to find the attribute array corresponding to the target identifiable attribute from the configuration file.

[0165] The index unit is used to index the target identifiable attributes using preset codes to obtain the index array corresponding to the target identifiable attributes.

[0166] The judgment unit is used to determine whether the attribute array is consistent with the index array.

[0167] The second determining unit is used to determine the attribute array corresponding to the target identifiable attribute as the attribute array in the protocol stack if the attribute array is consistent with the index array.

[0168] The third determining unit is used to determine the index array as the attribute array in the protocol stack if the attribute array and the index array are inconsistent.

[0169] It should be noted that the specific working process of each unit provided in the above embodiments of this application can be referred to the corresponding steps in the above method embodiments, and will not be repeated here.

[0170] In summary, the protocol stack attribute modification device provided in this application obtains a target calibrable attribute and searches for a target preset attribute calibration list corresponding to the target calibrable attribute from all preset attribute calibration lists. Then, based on the target calibrable attribute, it determines an attribute array in the protocol stack. The attribute array consists of multiple protocol stack attributes. Next, the constant type of the attribute array is modified to a variable type to obtain the target attribute array, which is then stored in RAM. Then, based on the target preset attribute calibration list, an address mapping table for the target attribute array is established. The address mapping table contains the mapping relationship between the target preset attribute calibration list and the target attribute array. The number of indexes in the address mapping table is the same as the number of calibrable attributes in the target preset attribute calibration list, and one index in the address mapping table corresponds to one calibrable attribute in the target preset attribute calibration list. Finally, based on the address mapping table and the target preset attribute calibration list, multiple protocol stack attributes in the target attribute array are modified. By finding the corresponding attribute calibration list and attribute array through the pre-defined target calibrable attributes, and then performing position mapping based on the attribute calibration list and the established mapping table, the position mapping value is then overwritten into the protocol stack attribute in the attribute array. This effectively completes the modification of calibration data and simplifies the entire process of attribute modification, effectively solving the problem of a huge workload for engineers.

[0171] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0172] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for modifying protocol stack attributes, characterized in that, include: Obtain the target calibrable attributes, and search for the target preset attribute calibration list corresponding to the target calibrable attributes from all preset attribute calibration lists; Based on the target identifiable attributes, an attribute array in the protocol stack is determined; wherein, the attribute array consists of multiple protocol stack attributes; The constant type of the attribute array is changed to the variable type to obtain the target attribute array, and the target attribute array is stored in RAM; Based on the target preset attribute labeling list, an address mapping table for the target attribute array is established; wherein, the address mapping table contains the mapping relationship between the target preset attribute labeling list and the target attribute array, and the number of index numbers in the address mapping table is the same as the number of labelable attributes in the target preset attribute labeling list, and one index number in the address mapping table corresponds to one labelable attribute in the target preset attribute labeling list; Based on the address mapping table and the target preset attribute labeling list, modify multiple protocol stack attributes in the target attribute array.

2. The method according to claim 1, characterized in that, The step of modifying multiple protocol stack attributes in the target attribute array according to the address mapping table and the target preset attribute labeling list includes: Obtain the first calibrable attribute from the target preset attribute calibration list; Obtain the index number corresponding to the first identifiable attribute from the address mapping table, and search for the protocol stack attribute corresponding to the first identifiable attribute and the index number from the target attribute array; Assign the value corresponding to the first identifiable attribute to the protocol stack attribute; Detect whether the first identifiable attribute is the last identifiable attribute in the attribute identification list; If the first identifiable attribute is not the last identifiable attribute in the attribute identification list, then the next identifiable attribute of the first identifiable attribute is obtained from the target preset attribute identification list; The next calibrable attribute is determined as the first calibrable attribute, and the process returns to retrieve the index number corresponding to the first calibrable attribute from the address mapping table, and search for the protocol stack attribute corresponding to the first calibrable attribute and the index number from the target attribute array, until the first calibrable attribute is the last calibrable attribute in the attribute calibration list.

3. The method according to claim 1, characterized in that, The step of establishing an address mapping table for the target attribute array based on the target preset attribute labeling list includes: Retrieve all calibrable attributes from the target preset attribute calibration list; Create index numbers for all the identifiable attributes; Based on all the index numbers, an address mapping table is established, and the address mapping table is determined as the address mapping table of the target attribute array.

4. The method according to claim 1, characterized in that, The method for establishing the preset attribute labeling list includes: Obtain all identifiable attributes corresponding to all communication messages; According to the data type of all identifiable attributes corresponding to all the communication messages, all identifiable attributes corresponding to the communication messages are classified to obtain the set of identifiable attributes corresponding to each data type; Based on all the calibrable attribute sets, generate a plurality of corresponding preset attribute calibration lists; wherein, one calibrable attribute set corresponds to one preset attribute calibration list.

5. The method according to claim 1, characterized in that, The step of determining the attribute array in the protocol stack based on the target identifiable attributes includes: Obtain the configuration file corresponding to the target's identifiable attributes from the protocol stack; Locate the attribute array corresponding to the target's identifiable attributes from the configuration file; The target identifiable attributes are indexed using preset code to obtain an index array corresponding to the target identifiable attributes; Determine whether the attribute array is consistent with the index array; If the attribute array is consistent with the index array, then the attribute array corresponding to the target identifiable attribute is determined as the attribute array in the protocol stack; If the attribute array is inconsistent with the index array, then the index array is determined to be the attribute array in the protocol stack.

6. A device for modifying protocol stack attributes, characterized in that, include: The attribute acquisition unit is used to acquire the target calibrable attribute and search for the target preset attribute calibration list corresponding to the target calibrable attribute from all preset attribute calibration lists; An array determination unit is used to determine an attribute array in the protocol stack based on the target identifiable attributes; wherein the attribute array consists of multiple protocol stack attributes; The type modification unit is used to modify the constant type of the attribute array to the variable type to obtain the target attribute array, and store the target attribute array in RAM; The address establishment unit is used to establish an address mapping table of the target attribute array according to the target preset attribute labeling list; wherein, the address mapping table contains the mapping relationship between the target preset attribute labeling list and the target attribute array, and the number of index numbers in the address mapping table is the same as the number of labelable attributes in the target preset attribute labeling list, and one index number in the address mapping table corresponds to one labelable attribute in the target preset attribute labeling list; The attribute modification unit is used to modify multiple protocol stack attributes in the target attribute array according to the address mapping table and the target preset attribute labeling list.

7. The apparatus according to claim 6, characterized in that, The attribute modification unit includes: The first acquisition unit is used to acquire the first calibrable attribute from the target preset attribute calibration list; The first lookup unit is used to obtain the index number corresponding to the first identifiable attribute from the address mapping table, and to look up the protocol stack attribute corresponding to the first identifiable attribute and the index number from the target attribute array; The assignment unit is used to assign the value corresponding to the first identifiable attribute to the protocol stack attribute. The detection unit is used to detect whether the first identifiable attribute is the last identifiable attribute in the attribute labeling list; The second acquisition unit is used to acquire the next identifiable attribute from the target preset attribute identification list if the first identifiable attribute is not the last identifiable attribute in the attribute identification list. The attribute determination unit is used to determine the next calibrable attribute as the first calibrable attribute, and return to execute the process of obtaining the index number corresponding to the first calibrable attribute from the address mapping table, and searching for the protocol stack attribute corresponding to the first calibrable attribute and the index number from the target attribute array, until the first calibrable attribute is the last calibrable attribute in the attribute calibration list.

8. The apparatus according to claim 6, characterized in that, The address establishment unit includes: The third acquisition unit is used to acquire all calibrable attributes from the target preset attribute calibration list; Create a unit to create index numbers for all the identifiable attributes; The first determining unit is used to establish an address mapping table based on all the index numbers, and to determine the address mapping table as the address mapping table of the target attribute array.

9. The apparatus according to claim 6, characterized in that, Also includes: The fourth acquisition unit is used to acquire all identifiable attributes corresponding to all communication messages; The classification unit is used to classify all identifiable attributes corresponding to the communication messages according to the data type of all identifiable attributes corresponding to all the communication messages, and obtain a set of identifiable attributes corresponding to each data type; The generation unit is used to generate multiple preset attribute calibration lists corresponding to all the calibrable attribute sets; wherein, one calibrable attribute set corresponds to one preset attribute calibration list.

10. The apparatus according to claim 6, characterized in that, The array determination unit includes: The fifth acquisition unit is used to acquire the configuration file corresponding to the target identifiable attribute from the protocol stack; The second search unit is used to search for the attribute array corresponding to the target identifiable attribute from the configuration file; An indexing unit is used to index the target identifiable attributes using a preset code to obtain an index array corresponding to the target identifiable attributes; A judgment unit is used to determine whether the attribute array is consistent with the index array; The second determining unit is used to determine the attribute array corresponding to the target identifiable attribute as the attribute array in the protocol stack if the attribute array is consistent with the index array; The third determining unit is used to determine the index array as the attribute array in the protocol stack if the attribute array is inconsistent with the index array.

Citation Information

Patent Citations

  • Network access method, computing device and computing device cluster

    CN118900289A

  • Method for implementing protocol stack to support multiple product shapes

    CN1652541A