Parameter processing method and device, computer readable storage medium and processor

By parsing and converting files to build a database, direct parameter conversion from one programming language to another is achieved, solving the problem of low efficiency in parameter adjustment in programming languages ​​and improving the work efficiency of staff.

CN116561205BActive Publication Date: 2026-06-26FOSS (HANGZHOU) INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FOSS (HANGZHOU) INTELLIGENT TECH CO LTD
Filing Date
2023-03-17
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing technologies, programming languages ​​cannot directly use JSON data format to modify parameters, resulting in low efficiency for staff when adjusting program code parameters.

Method used

By parsing the first file, a conversion database is built, and the file is converted from one programming language to another using this database. This allows for direct modification within the target file, enabling rapid parameter adjustment.

Benefits of technology

This allows staff to modify parameters directly in the target file without having to search for them multiple times in the original file, improving the efficiency of parameter adjustment and reducing the workload for staff.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116561205B_ABST
    Figure CN116561205B_ABST
Patent Text Reader

Abstract

The application discloses a parameter processing method and device, a computer readable storage medium and a processor. The method comprises the following steps: analyzing a first file to obtain a description parameter, wherein the programming language of the first file is a first preset language; recombining the description parameter based on a preset format to construct a conversion database; processing the first file based on the conversion database to obtain a second file, wherein the programming language of the second file is a second preset language; and in response to a change in the second file, processing the first file based on the changed second file and the conversion database to obtain a target file, wherein the programming language of the target file is the first preset language. The application solves the technical problem of low work efficiency of a staff member in adjusting parameters in a program language.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and more specifically, to a parameter processing method, apparatus, computer-readable storage medium, and processor. Background Technology

[0002] Programming languages ​​are one of the fundamental tools for designing applications. To facilitate the modification of application code, developers created the JSON (JavaScript Object Notation) data format, which allows for direct parameter modification.

[0003] However, some programming languages ​​cannot directly use the JSON data mentioned above. When staff need to modify the program they have written, they cannot directly use the JSON data to modify the parameters in the program code. Instead, querying the program code that needs to be modified line by line will cause too much pressure on the staff when modifying the parameters, resulting in low modification efficiency.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This invention provides a parameter processing method, apparatus, computer-readable storage medium, and processor to at least solve the technical problem of low work efficiency when operators adjust parameters in programming languages ​​in related technologies.

[0006] According to one aspect of the present invention, a parameter processing method is provided, comprising: parsing a first file to obtain description parameters, wherein the programming language of the first file is a first preset language; reorganizing the description parameters based on a preset format to construct a conversion database; processing the first file based on the conversion database to obtain a second file, wherein the programming language of the second file is a second preset language; and, in response to a change in the second file, processing the first file based on the changed second file and the conversion database to obtain a target file, wherein the programming language of the target file is the first preset language.

[0007] Optionally, in response to a change in the second file, the first file is processed based on the changed second file and a conversion database to obtain a target file, including: obtaining the changed member names, member sizes, and member types in the second file; processing the member names, member types, and member sizes using the conversion database to obtain a conversion data file, wherein the programming language of the conversion data file is a first preset language; and adjusting the first file based on the conversion data file to obtain the target file.

[0008] Optionally, the first file is parsed to obtain description parameters, including: using a first parsing tool to parse the header file of the first file to obtain multiple structure members of the header file, as well as the member names and member types of the structure members; and using a second parsing tool to parse the first file according to the member names and member types to obtain description parameters.

[0009] Optionally, the description parameters include: member name, member type, member size, and member nesting value of the structure members in the header file, wherein the member nesting value is used to characterize the nesting relationship between different structure members.

[0010] Optionally, the description parameters are reorganized based on a preset format to construct a conversion database, including: processing the member name and member size using a preset JSTM library based on the member type to obtain a first mapping file; and reorganizing the member name, member nesting value, and the first mapping file of each structure member according to a preset format to construct a conversion database.

[0011] Optionally, based on the member type, the preset JSTM library is used to process the member name and member size to obtain a first mapping file, including: in response to the member type being an array type, the preset JSTM library is used to process the member name and member size corresponding to the array type, and a first identifier is added to the processing result to obtain a first mapping file; in response to the member type being a non-array type, the preset JSTM library is used to process the member name and member size corresponding to the non-array type, and a second identifier is added to the processing result to obtain a first mapping file.

[0012] Optionally, in response to a member type being an array type, the method further includes: obtaining the name, size, and type of the sub-members of the array corresponding to the array type; in response to a sub-member type being a non-array type, processing the sub-member name and size using a preset JSTM library, and adding a second identifier to the processing result to obtain a second mapping file, wherein the member nesting value corresponding to the second mapping file is greater than the member nesting value corresponding to the first mapping file.

[0013] According to another aspect of the present invention, a parameter processing apparatus is also provided, comprising: a parsing module for parsing a first file to obtain description parameters, wherein the programming language of the first file is a first preset language; a construction module for recombining the description parameters based on a preset format to construct a conversion database; a first processing module for processing the first file based on the conversion database to obtain a second file, wherein the programming language of the second file is a second preset language; and a second processing module for processing the first file based on the changed second file and the conversion database in response to a change in the second file to obtain a target file, wherein the programming language of the target file is the first preset language.

[0014] Optionally, the second processing module includes: a member acquisition unit, used to acquire the member names, member sizes and member types that have changed in the second file; a conversion unit, used to process the member names, member types and member sizes using a conversion database to obtain a conversion data file, wherein the programming language of the conversion data file is a first preset language; and an adjustment unit, used to adjust the first file based on the conversion data file to obtain a target file.

[0015] Optionally, the parsing module includes: a first parsing unit, used to parse the header file of the first file using a first parsing tool to obtain multiple structure members of the header file, as well as the member names and member types of the structure members; and a second parsing unit, used to parse the first file according to the member names and member types using a second parsing tool to obtain description parameters.

[0016] Optionally, the description parameters include: member name, member type, member size, and member nesting value of the structure members in the header file, wherein the member nesting value is used to characterize the nesting relationship between different structure members.

[0017] Optionally, the building module includes: a mapping unit, used to process member names and member sizes based on member type using a preset JSTM library to obtain a first mapping file; and a building unit, used to reorganize the member names, member nesting values, and the first mapping file of each structure member according to a preset format to build a conversion database.

[0018] Optionally, the mapping unit is further configured to: in response to a member type being an array type, process the member name and member size corresponding to the array type using a preset JSTM library, and add a first identifier to the processing result to obtain a first mapping file; in response to a member type being a non-array type, process the member name and member size corresponding to the non-array type using a preset JSTM library, and add a second identifier to the processing result to obtain a first mapping file.

[0019] Optionally, the mapping unit is also used to: obtain the name, size and type of the sub-members of the array corresponding to the array type; in response to the sub-member type being a non-array type, process the sub-member name and size using the preset JSTM library, and add a second identifier to the processing result to obtain a second mapping file, wherein the member nesting value corresponding to the second mapping file is greater than the member nesting value corresponding to the first mapping file.

[0020] According to another aspect of the present invention, a computer-readable storage medium is also provided, characterized in that the computer-readable storage medium includes a stored program, wherein the program controls the device where the computer-readable storage medium is located to execute the above-described parameter processing method when it is running.

[0021] According to another aspect of the present invention, a processor is also provided for running a program, wherein the parameter processing method described above is executed during program execution.

[0022] In this embodiment of the invention, the method involves parsing a first file to obtain description parameters; reorganizing the description parameters based on a preset format to construct a conversion database; processing the first file based on the conversion database to obtain a second file; and processing the first file based on the changed second file and the conversion database to obtain a target file in response to changes in the second file. By constructing a conversion database that can be used for parameter conversion in real time based on the description parameters of the first file, direct parameter conversion between the first and second files is achieved. This eliminates the need for staff to repeatedly determine the parameters to be changed from the first file; they can directly modify the second file to modify the first file, achieving the goal of quickly modifying the first file. This reduces the workload of staff when modifying parameters and solves the technical problem of low work efficiency when adjusting parameters in programming languages ​​in related technologies. Attached Figure Description

[0023] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0024] Figure 1 This is a flowchart illustrating a parameter processing method according to an embodiment of the present invention;

[0025] Figure 2 This is a schematic diagram illustrating the conversion of a first file into a second file according to an embodiment of the present invention;

[0026] Figure 3 This is a schematic diagram illustrating the conversion of a second file into a first file according to an embodiment of the present invention;

[0027] Figure 4 This is a structural block diagram illustrating parameter processing according to an embodiment of the present invention. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] Example 1

[0031] According to an embodiment of the present invention, a method embodiment for parameter processing is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0032] Figure 1 This is a flowchart illustrating a parameter processing method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0033] Step S102: Parse the first file to obtain the description parameters.

[0034] The programming language of the first file is the first preset language.

[0035] The first file mentioned above may refer to a program code file designed using a preset programming language.

[0036] The parameters described above can refer to the member parameters of the binary structure members in the first file, and may include, but are not limited to: member name, member type, etc.

[0037] For ease of description and understanding, the following explanation uses C language as the programming language for the first file mentioned above.

[0038] In one optional embodiment, in order to improve the work efficiency of the staff, a preset parsing tool can be used to parse the C language file, namely the first file mentioned above, to obtain the member parameters of the structure members in the C language file, namely the description parameters mentioned above.

[0039] Step S104: Reorganize the description parameters based on a preset format to construct a conversion database.

[0040] The aforementioned conversion database can refer to a database used to convert a first file in C language format into a second file in other language format, or to convert a second file in other language format into a first file in C language format.

[0041] In one optional embodiment, after obtaining the aforementioned description parameters, the description parameters can be reorganized according to a preset assembly format to obtain a conversion database that can be used to perform parameter conversion processing on a first file in C language format.

[0042] For example, the preset assembly format can be "member name-member type" or "member type-member name", etc. The specific assembly format can be set according to the actual situation and is not limited here.

[0043] Step S106: Process the first file based on the conversion database to obtain the second file.

[0044] The programming language of the second file is the second preset language.

[0045] The aforementioned second document may refer to a document composed of the aforementioned descriptive parameters, and staff can directly modify the descriptive parameters in the second document.

[0046] The second preset language mentioned above differs from the first preset language mentioned above. In addition to being a programming language, it can also be a specified data format, such as JSON data format.

[0047] For ease of description and understanding, the following explanation will continue using JSON data format as the programming language for the second file mentioned above.

[0048] After constructing the conversion database described above, the parameters of the first file can be converted using the conversion database to obtain a second file that staff can directly edit.

[0049] For example, a conversion database can be used to convert the structure member parameters in a C language format file to obtain a second file in JSON data format corresponding to the structure members.

[0050] After the second file is in JSON data format, staff can directly operate on the second file without having to repeatedly determine the location of the parameters to be changed and the corresponding modification methods from the first file, thereby improving staff efficiency.

[0051] In step S108, in response to the change in the second file, the first file is processed based on the changed second file and the transformation database to obtain the target file.

[0052] The programming language of the target file is the first preset language.

[0053] The aforementioned target document may refer to the document that the staff expects to obtain.

[0054] In one optional embodiment, since JSON data format files can be directly modified, after the staff modifies the second file, the parameter processing system can convert the modified content from JSON data format to C language format according to the aforementioned conversion database. Then, based on the tags of the modified content, such as the member names corresponding to the modified content, the first file is modified and adjusted to obtain the file expected by the staff, i.e., the target file mentioned above. This achieves the effect of the staff directly adjusting the C language structure members using JSON data by utilizing the conversion database, thereby improving the staff's work efficiency.

[0055] For example, if staff design a first file to test a vehicle's driving capabilities under different environmental parameters, the parameter processing system can directly convert the first file into a second file in JSON data format. Staff can then modify the parameters that need to be changed in the second file, such as ambient temperature and vehicle tilt angle. The parameter processing system can then adjust the first file based on these modified parameters to obtain the target file. Staff can also adjust the vehicle's performance based on the test offset after each modification.

[0056] In this embodiment of the invention, the method involves parsing a first file to obtain description parameters; reorganizing the description parameters based on a preset format to construct a conversion database; processing the first file based on the conversion database to obtain a second file; and processing the first file based on the changed second file and the conversion database to obtain a target file in response to changes in the second file. By constructing a conversion database that can be used for parameter conversion in real time based on the description parameters of the first file, direct parameter conversion between the first and second files is achieved. This eliminates the need for staff to repeatedly determine the parameters to be changed from the first file; they can directly modify the second file to modify the first file, achieving the goal of quickly modifying the first file. This reduces the workload of staff when modifying parameters and solves the technical problem of low work efficiency when adjusting parameters in programming languages ​​in related technologies.

[0057] Figure 2This is a schematic diagram illustrating the conversion of a first file into a second file according to an embodiment of the present invention, such as... Figure 2 As shown, the parameter processing system can first use a preset parsing tool to parse the first file to obtain multiple description parameters. Then, after generating a conversion database using these description parameters, the system can use the conversion database to convert the first file into a second file.

[0058] Figure 3 This is a schematic diagram illustrating the conversion of a second file into a first file according to an embodiment of the present invention, such as... Figure 3 As shown, users can modify the parameters in the second file according to their own needs. Then, the parameter processing system can use the conversion database to convert the modified second file. Finally, the conversion result is applied to the program design of the first file to obtain the target file expected by the staff.

[0059] Optionally, in response to a change in the second file, the first file is processed based on the changed second file and a conversion database to obtain a target file, including: obtaining the changed member names, member sizes, and member types in the second file; processing the member names, member types, and member sizes using the conversion database to obtain a conversion data file, wherein the programming language of the conversion data file is a first preset language; and adjusting the first file based on the conversion data file to obtain the target file.

[0060] In one optional solution of this embodiment, since the conversion database is designed directly based on the structure member parameters of the first file, when the staff completes the modification of the content of the second file in JSON data format, the parameter processing system can first compare the modified second file with the original second file to determine the member parameters such as the member name, member size, and member type that have changed.

[0061] Then, using the aforementioned conversion database, only the changed member parameters are converted to obtain the aforementioned conversion data file. The programming language of this conversion data file is the first preset language, that is, the modified JSON data format parameters can be directly converted into C language format parameters using the aforementioned conversion database.

[0062] Finally, the parameter processing system can apply the converted data file to the first file, adjust the parameters of the corresponding structure members in the first file, and thus obtain the target file expected by the staff.

[0063] Optionally, the first file is parsed to obtain description parameters, including: using a first parsing tool to parse the header file of the first file to obtain multiple structure members of the header file, as well as the member names and member types of the structure members; and using a second parsing tool to parse the first file according to the member names and member types to obtain description parameters.

[0064] The first parsing tool mentioned above can refer to a third-party tool used for parsing header files, such as the cppheaderparser tool in the Python library or the luaJIT tool in the Lua library.

[0065] The aforementioned second parsing tool may refer to the file parsing tool that comes with the first preset language, such as the builtin_types_compatible_p extended macro in the C language.

[0066] In one optional solution of this embodiment, since some first preset languages ​​cannot directly parse and obtain the structure members of their own program code, such as C language, which cannot directly obtain the information of its own structure members, and the process of using third-party tools to parse the entire first file to obtain detailed information of the structure members is too complicated and inefficient, a third-party tool, namely the first parsing tool mentioned above, can be used first to parse the header file of the first file to obtain the names and types of all structure members in the first file.

[0067] Then, after obtaining the names and types of all structure members, the second parsing tool mentioned above, such as extended macros in the C language, can be used to obtain detailed information about all structure members from the entire first file, namely the description parameters mentioned above, thereby improving the efficiency of the entire parsing process.

[0068] Optionally, the description parameters include: member name, member type, member size, and member nesting value of the structure members in the header file, wherein the member nesting value is used to characterize the nesting relationship between different structure members.

[0069] To facilitate staff in identifying the content that needs to be modified and to improve the accuracy of the generated conversion database, the above description parameters should include at least: member name, member type, member size of the structure member, and member nesting value used to represent the nesting relationship between different structure members.

[0070] In one optional embodiment, in order to improve the accuracy of converting the content modified by the staff using the conversion database, parameters such as the offset of the structure members can be further obtained. The specific descriptive parameters obtained can be set according to the actual situation and are not limited here.

[0071] Optionally, the description parameters are reorganized based on a preset format to construct a conversion database, including: processing the member name and member size using a preset JSTM library (a Java database) based on the member type to obtain a first mapping file; and reorganizing the member name, member nesting value, and the first mapping file of each structure member according to a preset format to construct a conversion database.

[0072] In one optional scheme of this embodiment, when the description parameters are reorganized according to a preset reorganization format to construct a conversion database, in order to ensure the accuracy of the conversion database and avoid errors when converting JSON data format, the JSTM library can be used first to map the aforementioned member names and member sizes to obtain a first mapping file.

[0073] It should be noted that when using the JSTM library to map parameters such as member names and member sizes of struct members, it is necessary to consider the member type of the struct members to avoid mapping parameters of different member types to the same file, which could lead to conversion errors when the final conversion database is built.

[0074] Then, the first mapping file, member names, member nesting values, and other description parameters are reorganized according to a preset reorganization format to build a transformation database.

[0075] It should be noted that, since some primary languages ​​do not support certain data formats, such as C language which does not support boolean data, the JSTM library mentioned above does not have data type casting functionality, unlike traditional JSTM libraries.

[0076] It should be noted that the above example of using the JSTM library to map parameters such as member name and member size is only an example. The specific parameters that need to be mapped can be set according to the actual situation, and are not limited here.

[0077] Optionally, based on the member type, the preset JSTM library is used to process the member name and member size to obtain a first mapping file, including: in response to the member type being an array type, the preset JSTM library is used to process the member name and member size corresponding to the array type, and a first identifier is added to the processing result to obtain a first mapping file; in response to the member type being a non-array type, the preset JSTM library is used to process the member name and member size corresponding to the non-array type, and a second identifier is added to the processing result to obtain a first mapping file.

[0078] Since array-type struct members have hierarchical relationships, meaning that there are sub-struct members corresponding to the array members within the struct members, and the nested values ​​of the sub-struct members are different from the nested values ​​of the struct members, if they are classified into the same category for mapping, subsequent staff may not be able to accurately modify the parameters of array-type struct members. Therefore, in an optional solution of this embodiment, before using the JSTM library to map the member parameters of the struct members, it can first be determined whether the member type of the struct member is an array type.

[0079] If the member type is an array, a first mapping identifier can be added to the mapping result when using the JSTM library to map array-type structure members. For example, the JMARR() function identifier can be added to the mapping result.

[0080] If the member type is not an array type, a second mapping identifier can be added to the mapping result when using the JSTM library to map non-array type structure members. For example, the JMNOR() function identifier can be added to the mapping result.

[0081] Optionally, in response to a member type being an array type, the method further includes: obtaining the name, size, and type of the sub-members of the array corresponding to the array type; in response to a sub-member type being a non-array type, processing the sub-member name and size using a preset JSTM library, and adding a second identifier to the processing result to obtain a second mapping file, wherein the member nesting value corresponding to the second mapping file is greater than the member nesting value corresponding to the first mapping file.

[0082] The aforementioned substructure members can refer to sub-parameters in the array.

[0083] In one optional embodiment, while mapping the array-type structure members, in order to ensure that staff can quickly and accurately modify the sub-structure members in the array, the parameters of the sub-structure members can also be mapped.

[0084] Specifically, you can first obtain the names, sizes, and types of the sub-members of multiple sub-structure members in the array.

[0085] Then, based on the sub-member type, following the aforementioned mapping process, the JSTM library is used to map the sub-member name and sub-member size to obtain the mapping result. If the sub-member type is an array, a first mapping identifier is added to the mapping result; if the sub-member type is not an array, a second mapping identifier is added to the mapping result.

[0086] For example, if the structure in the first file constructed by the staff is:

[0087]

[0088]

[0089] The code format of the data conversion library built through the aforementioned steps can then be:

[0090]

[0091]

[0092] Wherein, JSTM(FT_ParamsCamIntrin,) can refer to the aforementioned mapping result, JMNOR() can refer to the aforementioned first mapping identifier, and JMARR() can refer to the aforementioned second mapping identifier.

[0093] {"reserved",3,JMNOR(JSTM(FT_ParamsCamIntrin,reserved[0]))} represents the mapped transformation data result corresponding to array member 0.

[0094] The second file, obtained by processing the first file in C language format using a conversion database, can be in JSON format:

[0095]

[0096]

[0097] Example 2

[0098] According to another aspect of the embodiments of the present invention, corresponding to the embodiments of the parameter processing method described above, this specification also provides a parameter processing apparatus, please refer to... Figure 4 , Figure 4 This is a structural block diagram of parameter processing according to an embodiment of the present invention. The device includes: a parsing module 402, used to parse a first file to obtain description parameters, wherein the programming language of the first file is a first preset language; a construction module 404, used to reorganize the description parameters based on a preset format to construct a conversion database; a first processing module 406, used to process the first file based on the conversion database to obtain a second file, wherein the programming language of the second file is a second preset language; and a second processing module 408, used to process the first file based on the changed second file and the conversion database in response to a change in the second file to obtain a target file, wherein the programming language of the target file is the first preset language.

[0099] Optionally, the second processing module includes 408: a member acquisition unit, used to acquire the member names, member sizes and member types that have changed in the second file; a conversion unit, used to process the member names, member types and member sizes using a conversion database to obtain a conversion data file, wherein the programming language of the conversion data file is a first preset language; and an adjustment unit, used to adjust the first file based on the conversion data file to obtain a target file.

[0100] Optionally, the parsing module 402 includes: a first parsing unit, used to parse the header file of the first file using a first parsing tool to obtain multiple structure members of the header file, as well as the member names and member types of the structure members; and a second parsing unit, used to parse the first file according to the member names and member types using a second parsing tool to obtain description parameters.

[0101] Optionally, the description parameters include: member name, member type, member size, and member nesting value of the structure members in the header file, wherein the member nesting value is used to characterize the nesting relationship between different structure members.

[0102] Optionally, the construction module 404 includes: a mapping unit, used to process member names and member sizes based on member types using a preset JSTM library to obtain a first mapping file; and a construction unit, used to reorganize the member names, member nesting values, and the first mapping file of each structure member according to a preset format to construct a conversion database.

[0103] Optionally, the mapping unit is further configured to: in response to a member type being an array type, process the member name and member size corresponding to the array type using a preset JSTM library, and add a first identifier to the processing result to obtain a first mapping file; in response to a member type being a non-array type, process the member name and member size corresponding to the non-array type using a preset JSTM library, and add a second identifier to the processing result to obtain a first mapping file.

[0104] Optionally, the mapping unit is also used to: obtain the name, size and type of the sub-members of the array corresponding to the array type; in response to the sub-member type being a non-array type, process the sub-member name and size using the preset JSTM library, and add a second identifier to the processing result to obtain a second mapping file, wherein the member nesting value corresponding to the second mapping file is greater than the member nesting value corresponding to the first mapping file.

[0105] Example 3

[0106] According to another aspect of the present invention, a computer-readable storage medium is also provided, characterized in that the computer-readable storage medium includes a stored program, wherein the program controls the device where the computer-readable storage medium is located to execute the above-described parameter processing method when it is running.

[0107] Example 4

[0108] According to another aspect of the present invention, a processor is also provided for running a program, wherein the parameter processing method described above is executed during program execution.

[0109] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0110] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0111] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0112] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0113] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0114] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0115] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A parameter processing method, characterized in that, The method includes: The first file is parsed to obtain description parameters, wherein the programming language of the first file is a first preset language, and the description parameters include: member name, member type, member size and member nesting value of the structure members in the header file, wherein the member nesting value is used to represent the nesting relationship between different structure members, and the first preset language is C language; The description parameters are reorganized based on a preset format to construct a conversion database; The first file is processed based on the conversion database to obtain a second file, wherein the programming language of the second file is a second preset language; In response to a change in the second file, the first file is processed based on the changed second file and the conversion database to obtain a target file, wherein the programming language of the target file is a first preset language; The conversion database is constructed by reorganizing the description parameters based on a preset format, including: processing the member name and member size using a preset JSTM library based on the member type to obtain a first mapping file, wherein the preset JSTM library is a Java database without data type casting functionality; and reorganizing the member name, member nesting value, and the first mapping file of each structure member according to the preset format to construct the conversion database. In response to a change in the second file, the first file is processed based on the changed second file and the conversion database to obtain a target file, including: obtaining the changed member names, member sizes, and member types in the second file; processing the member names, member types, and member sizes using the conversion database to obtain a conversion data file, wherein the programming language of the conversion data file is a first preset language; and adjusting the first file based on the conversion data file to obtain the target file.

2. The method according to claim 1, characterized in that, The first file is parsed to obtain the description parameters, including: The header file of the first file is parsed using a first parsing tool to obtain multiple structure members of the header file, as well as the member names and member types of the structure members; The first file is parsed using a second parsing tool based on the member name and the member type to obtain the description parameters.

3. The method according to claim 1, characterized in that, Based on the member type, the pre-defined JSTM library processes the member name and member size to obtain a first mapping file, including: In response to the member type being an array type, the preset JSTM library is used to process the member name and member size corresponding to the array type, and a first identifier is added to the processing result to obtain the first mapping file; In response to the member type being a non-array type, the preset JSTM library is used to process the member name and member size corresponding to the non-array type, and a second identifier is added to the processing result to obtain the first mapping file.

4. The method according to claim 3, characterized in that, In response to the member type being an array type, the method further includes: Obtain the name, size, and type of each sub-member of the array corresponding to the array type. In response to the fact that the sub-member type is not an array type, the sub-member name and the sub-member size are processed using the preset JSTM library, and the second identifier is added to the processing result to obtain a second mapping file, wherein the member nesting value corresponding to the second mapping file is greater than the member nesting value corresponding to the first mapping file.

5. A parameter processing device, characterized in that, The device includes: The parsing module is used to parse the first file to obtain description parameters. The programming language of the first file is a first preset language. The description parameters include: member name, member type, member size and member nesting value of the structure members in the header file. The member nesting value is used to represent the nesting relationship between different structure members. The first preset language is C language. The construction module is used to reorganize the description parameters based on a preset format to construct a conversion database; The first processing module is used to process the first file based on the conversion database to obtain a second file, wherein the programming language of the second file is a second preset language; The second processing module is used to respond to a change in the second file, process the first file based on the changed second file and the conversion database to obtain a target file, wherein the programming language of the target file is a first preset language; The construction module is further configured to process the member name and the member size using a preset JSTM library based on the member type to obtain a first mapping file, wherein the preset JSTM library is a Java database without data type casting functionality; and to reorganize the member name, the member nesting value, and the first mapping file of each structure member according to the preset format to construct the conversion database; The second processing module is further configured to, in response to a change in the second file, process the first file based on the changed second file and the conversion database to obtain a target file, including: obtaining the changed member names, member sizes, and member types in the second file; processing the member names, member types, and member sizes using the conversion database to obtain a conversion data file, wherein the programming language of the conversion data file is a first preset language; and adjusting the first file based on the conversion data file to obtain the target file.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the parameter processing method according to any one of claims 1 to 4.

7. A processor, characterized in that, The processor is used to run a program, wherein the program executes the parameter processing method according to any one of claims 1 to 4 when it runs.