CN116467871A - File parameter modification method, device, equipment and storage medium - Google Patents

File parameter modification method, device, equipment and storage medium Download PDF

Info

Publication number
CN116467871A
CN116467871A CN202310391544.4A CN202310391544A CN116467871A CN 116467871 A CN116467871 A CN 116467871A CN 202310391544 A CN202310391544 A CN 202310391544A CN 116467871 A CN116467871 A CN 116467871A
Authority
CN
China
Prior art keywords
target
parameters
parameter
file
reading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310391544.4A
Other languages
Chinese (zh)
Inventor
邓嘉庆
袁登木
朱文静
魏骅
傅淘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202310391544.4A priority Critical patent/CN116467871A/en
Publication of CN116467871A publication Critical patent/CN116467871A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/15Vehicle, aircraft or watercraft design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2119/00Details relating to the type or aim of the analysis or the optimisation
    • G06F2119/14Force analysis or force optimisation, e.g. static or dynamic forces

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Automation & Control Theory (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a file parameter modification method, device, equipment and storage medium, and relates to the technical field of computers. The method comprises the following steps: determining a plurality of target parameters corresponding to the target item in the simulation process, and constructing a target table based on the plurality of target parameters; calling a table reading function in a Python language based on the target statement, reading a plurality of target parameters included in the target table, and converting the plurality of target parameters into a floating point number format; and replacing the plurality of parameters to be adjusted in the attribute file corresponding to the target subsystem with a plurality of target parameters, and simulating the target item through the ADAMS model based on the plurality of target parameters. Therefore, corresponding parameters in the attribute file corresponding to the target subsystem can be automatically modified aiming at the target item, so that the efficiency and accuracy of modifying the file parameters are improved, and the problems that time and labor are wasted and the error rate is high when the corresponding parameters in the subsystem file are manually modified are solved.

Description

File parameter modification method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for modifying file parameters.
Background
With the development of automatic simulation analysis of automobiles, mechanical system dynamics automatic analysis (automatic dynamic analysis of mechanical systems, ADAMS) software is mainly adopted to simulate automobile dynamics, corresponding parameter items in subsystem files of an ADAMS simulation model (i.e. ADAMS software and ADAMS model) need to be modified according to different simulation projects, and parameters in an adjustment menu (such as hard points and Gears) can be manually modified according to parameter requirements of different simulation projects by opening the parameter items in a Standard mode of the ADAMS software.
However, because the number of simulation items currently existing is large, corresponding parameters (i.e., file parameters) in the subsystem file are frequently modified manually, which is time-consuming and labor-consuming and has high error rate, so that the efficiency and accuracy of modifying the file parameters are poor.
Disclosure of Invention
The invention aims to provide a file parameter modification method, device, equipment and storage medium, which are used for solving the technical problems of low efficiency and low accuracy of modifying file parameters caused by high time and labor waste and high error rate when corresponding parameters in a subsystem file are modified manually. The technical scheme of the application is as follows:
According to a first aspect of the present application, there is provided a file parameter modification method, including: determining a plurality of target parameters corresponding to the target item in the simulation process, and constructing a target table based on the plurality of target parameters; calling a table reading function in a Python language based on a target statement, reading a plurality of target parameters included in a target table, and converting the plurality of target parameters into a floating point format, wherein the floating point format is a format which can be identified by a mechanical system dynamics automatic analysis ADAMS model; and replacing a plurality of parameters to be adjusted in the attribute files corresponding to the target subsystems with a plurality of target parameters, simulating the target items through the ADAMS model based on the plurality of target parameters, wherein one parameter to be adjusted corresponds to one target parameter, and the attribute files corresponding to the target subsystems are files used for storing corresponding parameters in the ADAMS model.
According to the technical means, the target parameters corresponding to the project can be automatically read through the target statement of the Python language, and the original parameters to be adjusted in the attribute file corresponding to the target subsystem of the ADAMS model are replaced by the target parameters required by the project, so that the corresponding parameters in the attribute file corresponding to the target subsystem of the ADAMS model can be automatically modified for the project, the problems that time and labor are wasted and the error rate is high when the corresponding parameters in the attribute file corresponding to the target subsystem are manually modified are solved, and the efficiency and the accuracy of modifying the file parameters are improved.
In one possible implementation, constructing the target table based on the plurality of target parameters includes: and constructing a target table based on the target parameters and a preset format, wherein the preset format is used for indicating the corresponding position of each target parameter in the target table.
According to the technical means, the method and the device can quickly and efficiently acquire and modify the corresponding file parameters in the ADAMS model based on the positions of the target parameters in the target table when the simulation of the items is required, and improve the efficiency and accuracy of simulating the items.
In one possible embodiment, each of the plurality of target parameters included in the target table corresponds to a plurality of parameter values, each of the plurality of target parameters and the corresponding plurality of parameter values being in a same row in the target table; invoking a table reading function in a Python language based on the target statement, reading a plurality of target parameters included in the target table, including: and calling a table reading function in the Python language based on the target sentence, and sequentially reading each row of parameters in the target table in a traversal and loop mode so as to sequentially read a plurality of parameter values corresponding to each target parameter in the plurality of target parameters.
According to the technical means, the method and the device can sequentially and automatically read a plurality of parameter values corresponding to each target parameter on each row in the target table in a traversal and circulation mode based on the table reading function of the Python language, so that the speed and the accuracy of reading the parameter values corresponding to the target parameters are improved.
In one possible implementation, the plurality of parameter values corresponding to each of the plurality of target parameters includes: a horizontal coordinate value, a vertical coordinate value and a vertical coordinate value; invoking a table reading function in a Python language based on the target statement, reading a plurality of target parameters included in the target table, and converting the plurality of target parameters into a floating point number format, including: invoking a table reading function in a Python language based on the target statement, reading an abscissa value corresponding to any target parameter aiming at any target parameter in a plurality of target parameters included in the target table, and converting the abscissa value corresponding to any target parameter into a floating point number format; reading the ordinate value corresponding to any target parameter, and converting the ordinate value corresponding to any target parameter into a floating point number format; and reading the vertical coordinate value corresponding to any target parameter, and converting the vertical coordinate value corresponding to any target parameter into a floating point number format.
According to the technical means, the method and the device can sequentially and automatically replace the horizontal coordinate value, the vertical coordinate value and the vertical coordinate value corresponding to each row of target parameters in the target table into the floating point number format which can be identified by the ADAMS based on the Python language function, and solve the problem that the ADAMS cannot identify the horizontal coordinate value, the vertical coordinate value and the vertical coordinate value corresponding to the target parameters, so that the project cannot be simulated.
In one possible implementation manner, replacing the plurality of parameters to be adjusted in the attribute file corresponding to the target subsystem with a plurality of target parameters, and simulating the target item through the ADAMS model based on the plurality of target parameters includes: acquiring an attribute file corresponding to a target subsystem and a backup file of the attribute file; replacing a plurality of parameters to be adjusted in the backup file of the attribute file with a plurality of target parameters; and adjusting parameters in the attribute files corresponding to the target subsystem based on the backup files of the attribute files after parameter replacement, and simulating the target item through an ADAMS model based on a plurality of target parameters.
According to the technical means, the parameters to be adjusted can be modified through the backup file, so that the content included in the modified backup file is directly copied to the attribute file to be stored, and the problem that the project cannot be simulated based on the attribute file due to the fact that writing errors of parameters in the file are caused when the parameters are directly modified and stored repeatedly is avoided.
According to a second aspect provided by the present application, there is provided a file parameter modification device, including a determining module and a processing module; the determining module is used for determining a plurality of target parameters corresponding to the target item in the simulation process; the processing module is used for constructing a target table based on a plurality of target parameters; the processing module is also used for calling a table reading function in the Python language based on the target statement, reading a plurality of target parameters included in the target table, and converting the plurality of target parameters into a floating point format which is a format capable of being identified by the mechanical system dynamics automatic analysis ADAMS model; the processing module is further configured to replace a plurality of parameters to be adjusted in an attribute file corresponding to the target subsystem with a plurality of target parameters, simulate the target item through the ADAMS model based on the plurality of target parameters, wherein one parameter to be adjusted corresponds to one target parameter, and the attribute file corresponding to the target subsystem is a file in the ADAMS model for storing the corresponding parameter.
In a possible implementation manner, the processing module is further configured to construct a target table based on the multiple target parameters and a preset format, where the preset format is used to indicate a corresponding position of each target parameter in the target table.
In one possible embodiment, each of the plurality of target parameters included in the target table corresponds to a plurality of parameter values, each of the plurality of target parameters and the corresponding plurality of parameter values being in a same row in the target table; the processing module is further used for calling a table reading function in the Python language based on the target statement, and sequentially reading each row of parameters in the target table in a traversal and loop mode so as to sequentially read a plurality of parameter values corresponding to each target parameter in the plurality of target parameters.
In one possible implementation, the plurality of parameter values corresponding to each of the plurality of target parameters includes: a horizontal coordinate value, a vertical coordinate value and a vertical coordinate value; the processing module is also used for calling a table reading function in the Python language based on the target statement, reading an abscissa value corresponding to any target parameter aiming at any target parameter in a plurality of target parameters included in the target table, and converting the abscissa value corresponding to any target parameter into a floating point number format; the processing module is also used for reading the ordinate value corresponding to any target parameter and converting the ordinate value corresponding to any target parameter into a floating point number format; the processing module is also used for reading the vertical coordinate value corresponding to any target parameter and converting the vertical coordinate value corresponding to any target parameter into a floating point number format.
In one possible implementation manner, the file parameter modification device further comprises an acquisition module; the acquisition module is used for acquiring the attribute files corresponding to the target subsystem and the backup files of the attribute files; the processing module is also used for replacing a plurality of parameters to be adjusted in the backup file of the attribute file with a plurality of target parameters; and the processing module is also used for adjusting parameters in the attribute files corresponding to the target subsystem based on the backup files of the attribute files after parameter replacement and simulating the target items through the ADAMS model based on a plurality of target parameters.
According to a third aspect provided by the present application, there is provided an electronic device comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the method of the first aspect and any of its possible embodiments described above.
According to a fourth aspect provided herein, there is provided a computer readable storage medium, which when executed by a processor of an electronic device, enables the electronic device to perform the method of any one of the above-mentioned first aspects and any one of its possible embodiments.
According to a fifth aspect provided by the present application, there is provided a vehicle comprising: file parameter modifying means for implementing the method of the first aspect and any possible implementation thereof.
According to a sixth aspect provided herein, there is provided a computer program product comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of the first aspect and any one of its possible embodiments.
Therefore, the technical characteristics of the application have the following beneficial effects:
(1) The method can automatically read target parameters corresponding to the project through target sentences of the Python language, and replace original parameters to be adjusted in the attribute files corresponding to the target subsystems of the ADAMS model with target parameters required by the project, so that corresponding parameters in the attribute files corresponding to the target subsystems of the ADAMS model are automatically modified for the project, the problems of time and labor waste and higher error rate when the corresponding parameters in the attribute files corresponding to the target subsystems are manually modified are solved, and the efficiency and the accuracy of modifying the file parameters are improved.
(2) The method can quickly and efficiently acquire and modify the corresponding file parameters in the ADAMS model based on the positions of the target parameters in the target table when the simulation of the items is required, and improves the efficiency and accuracy of simulating the items.
(3) The method can sequentially and automatically read a plurality of parameter values corresponding to each target parameter on each row in the target table by traversing and cycling based on the table reading function of the Python language so as to improve the speed and accuracy of reading the parameter values corresponding to the target parameters.
(4) The method can sequentially and automatically replace the horizontal coordinate value, the vertical coordinate value and the vertical coordinate value corresponding to each row of target parameters in the target table into a floating point number format which can be identified by an ADAMS model based on the Python language function, and solves the problem that the ADAMS model cannot identify the horizontal coordinate value, the vertical coordinate value and the vertical coordinate value corresponding to the target parameters, so that the project cannot be simulated.
(5) The parameters to be adjusted can be modified through the backup file, so that the content included in the modified backup file is directly copied into the attribute file to be stored, and the problem that the project cannot be simulated based on the attribute file due to the fact that writing errors of the parameters in the file are caused when the parameters are directly modified and stored repeatedly is avoided.
It should be noted that, the technical effects caused by any implementation manner of the second aspect to the sixth aspect may refer to the technical effects caused by the corresponding implementation manner in the first aspect, which is not described herein.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application and do not constitute an undue limitation on the application.
FIG. 1 is a schematic diagram of a file parameter modification system, according to an exemplary embodiment;
FIG. 2 is a flow chart illustrating a method of modifying file parameters according to an exemplary embodiment;
FIG. 3 is a flowchart illustrating yet another file parameter modification method according to an exemplary embodiment;
FIG. 4 is a flowchart illustrating yet another file parameter modification method according to an example embodiment;
FIG. 5 is a flowchart illustrating yet another file parameter modification method according to an example embodiment;
FIG. 6 is a flowchart illustrating yet another file parameter modification method in accordance with an exemplary embodiment;
FIG. 7 is a schematic diagram of sub file content, according to one exemplary embodiment;
FIG. 8 is a block diagram illustrating a file parameter modification apparatus according to an example embodiment;
Fig. 9 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
Further advantages and effects of the present invention will become readily apparent to those skilled in the art from the disclosure herein, by referring to the accompanying drawings and the preferred embodiments. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention. It should be understood that the preferred embodiments are presented by way of illustration only and not by way of limitation.
It should be noted that the illustrations provided in the following embodiments merely illustrate the basic concept of the present invention by way of illustration, and only the components related to the present invention are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complicated.
As the automotive industry becomes increasingly competitive, automotive manufacturers are increasingly demanding shorter periods of vehicle development. Under the premise, the host factories of automobile manufacturers have an increasing demand for quick and accurate simulation analysis before the verification of the actual automobile, so that the efficiency of the simulation analysis needs to be improved by using an automatic simulation program. Several automatic simulation programs are currently available in China for simulation analysis, such as automatic simulation of ADAMS suspension systems based on vc++ (microsoft visual C ++) and simulation analysis based on full-automatic dynamic suspension kinematics and elastic kinematics (Kinematics and Compliance t, K & C) analysis software of the suspension.
Currently, in the domestic industry, dynamic simulation is mainly performed by adopting ADAMS software, before dynamic simulation is performed based on the ADAMS software, model parameters (i.e. file parameters) of an ADAMS simulation model need to be modified according to different projects, specifically, taking an ADAMS/automobile module (Car) as an example, the model parameters of the ADAMS simulation model can be manually modified by opening parameter items in an Adjust menu under a Standard mode of the ADAMS software.
In the existing automation program for simulation by ADAMS, automatic adjustment of model parameters is not involved. However, according to the requirements of the current project development situation, the model parameters are required to be frequently adjusted for different projects to carry out simulation calculation, and the traditional method for manually modifying the model parameters is time-consuming and labor-consuming and has higher error rate, so that the efficiency and the accuracy of modifying the file parameters are poor.
For easy understanding, the file parameter modification method provided in the present application is specifically described below with reference to the accompanying drawings.
The file parameter modification method provided by the embodiment of the application can be applied to a file parameter modification system. Fig. 1 is a schematic diagram illustrating a configuration of a file parameter modification system according to an exemplary embodiment. As shown in fig. 1, the file parameter modification system 10 includes: a table construction module 11, a parameter acquisition module 12, a parameter processing module 13 and a parameter modification module 14.
The table construction module 11 is used for determining a plurality of target parameters corresponding to the target item in the simulation process and constructing a target table based on the plurality of target parameters; the parameter obtaining module 12 is used for calling a table reading function in a Python language based on the target sentence, and reading a plurality of target parameters from the table constructing module 11; the parameter processing module 13 is used for converting a plurality of target parameters into a floating point number format; the parameter modification module 14 is configured to replace a plurality of parameters to be adjusted in the attribute file corresponding to the target subsystem with a plurality of target parameters, so as to simulate the target item through the ADAMS model based on the plurality of target parameters in the attribute file corresponding to the target subsystem.
FIG. 2 is a flowchart illustrating a method of modifying file parameters, as shown in FIG. 2, according to an exemplary embodiment, comprising the steps of:
s201, determining a plurality of target parameters corresponding to the target item in the simulation process.
S202, constructing a target table based on a plurality of target parameters.
Optionally, a plurality of target parameters corresponding to each target item in the plurality of different target items and a plurality of target parameters corresponding to each item scheme in the plurality of different item schemes of the same target item may be determined, and an Excel parameter input table (i.e., a target table) may be constructed based on the plurality of target parameters and a preset format.
The target parameters are parameters that need to be adjusted in the ADAMS simulation model before the ADAMS simulation model simulates different target projects or different project schemes. The types and the number of the target parameters included in the target table can be set according to the requirements of different target projects or different project schemes, and the target table can be reserved as project information.
S203, calling a table reading function in the Python language based on the target statement, and reading a plurality of target parameters included in the target table.
S204, converting the plurality of target parameters into a floating point number format.
The floating point number format is a format which can be identified by the mechanical system dynamics automatic analysis ADAMS model.
Optionally, a table (Excel) reading function in the Python language may be called based on the target statement, then the target table corresponding to the target item is opened through the table opening statement, the target page number of the target parameters corresponding to the item scheme of the target item is called through the page number specification statement, then the target parameters included in the target page number of the target table are sequentially read through a traversal and addition circulation mode, and the target parameters are converted into a floating point number format.
Illustratively, the target item may be a chassis item, the target table may be an item chassis parameter table, the target page number may be a first page, the target statement may be < from openpyxl import load _work book >, the table open statement may be < file=load_work book ('xxx\item chassis parameter table. Xlsx') >, and the page number designation statement may be < sheet=file [ 'sheet1' ].
It should be noted that the Python language is a computer programming language.
S205, replacing a plurality of parameters to be adjusted in the attribute file corresponding to the target subsystem with a plurality of target parameters, and simulating the target item through the ADAMS model based on the plurality of target parameters.
Wherein, a parameter to be adjusted corresponds to a target parameter, and the attribute file corresponding to the target subsystem is a file for storing the corresponding parameter in the ADAMS model.
Optionally, the attribute file (i.e. the sub file) corresponding to the target subsystem in the ADAMS simulation model and the backup file (i.e. the suq file) of the attribute file may be obtained simultaneously, multiple target parameters converted into the floating point number format are written into corresponding positions (i.e. positions corresponding to multiple parameters to be adjusted) in the suq file for editing, and then the content included in the edited suq file is copied into the sub file (i.e. multiple parameters to be adjusted in the attribute file corresponding to the target subsystem are replaced by multiple target parameters) for saving, and the target item is simulated through the ADAMS model based on the multiple target parameters.
The target subsystem may be, for example, a steering system.
Note that the content included in the sub file is identical to the content included in the suq file.
Fig. 3 is a flowchart illustrating yet another method for modifying file parameters according to an exemplary embodiment, as shown in fig. 3, the method in step S202 described above specifically includes the following steps:
s301, constructing a target table based on a plurality of target parameters and a preset format.
The preset format is used for indicating the corresponding position of each target parameter in the target table.
It should be noted that, the corresponding position of each target parameter in the plurality of target parameters included in the target table is fixed in the target table, and after the target table is constructed, the corresponding position of each target parameter in the target table cannot be adjusted independently, otherwise, the corresponding target parameter is misplaced when being read by the Python program.
Fig. 4 is a flowchart illustrating a further file parameter modification method according to an exemplary embodiment, each of a plurality of target parameters included in a target table corresponds to a plurality of parameter values, each of the plurality of target parameters and the corresponding plurality of parameter values are in the same row in the target table, and as shown in fig. 4, the method in step S203 described above specifically includes the following steps:
S401, calling a table reading function in a Python language based on a target sentence, and sequentially reading each row of parameters in a target table in a traversal and loop mode so as to sequentially read a plurality of parameter values corresponding to each target parameter in a plurality of target parameters.
For example, the target table may be a steering system hard point coordinate table, the steering system hard point coordinate table may include eight target parameters, which are respectively a steering column lower hinge point C point, a steering column upper hinge point B point, a pinion center point (D point) pin_pivot, a steering wheel center point (a point), a steering wheel bushing mounting point (left front) fixed_front, a steering wheel bushing mounting point (left rear) fixed_rear, rack_house_mount, and a steering tie rod inner point (tie rod_inner), each of the eight target parameters may correspond to three parameter fingers, which may be an abscissa value (i.e., X-coordinate), an ordinate value (i.e., Y-coordinate), and an ordinate value (i.e., Z-coordinate), a starting line number corresponding to the target parameter in the steering system hard point coordinate table may be 7, an ending line number may be 14, and the steering system hard point coordinate table is shown in table one.
Optionally, when a table reading function in the Python language is called based on the target sentence and each row of parameters in the target table are sequentially read by traversing and cycling, a starting row number of the reading table may be set based on the starting row number sentence, an ending condition of cycling reading may be set based on the cycling sentence, and a cycling reading function may be set based on the cycling adding sentence, so as to sequentially read an abscissa value, an ordinate value, and an ordinate value corresponding to each target parameter in the plurality of target parameters.
Illustratively, the starting line number statement may be < count=7 >, the loop statement may be < while 9 (count < 15): >, and the loop increment statement may be < count+=1 >.
FIG. 5 is a flowchart illustrating yet another method of modifying file parameters according to an exemplary embodiment, the plurality of parameter values corresponding to each of the plurality of target parameters including: the method in the above steps S203 and S204, as shown in fig. 5, specifically includes the following steps:
s501, invoking a table reading function in a Python language based on a target sentence, reading an abscissa value corresponding to any target parameter aiming at any target parameter in a plurality of target parameters included in a target table, and converting the abscissa value corresponding to any target parameter into a floating point number format.
Hard point coordinate table of table steering system
Optionally, for any one of the target parameters included in the target table, reading an abscissa value corresponding to the any one target parameter based on an abscissa value reading statement, and converting an abscissa value corresponding to the any one target parameter into a floating point format based on a floating point conversion statement corresponding to the abscissa value.
For example, the abscissa value read statement may be < top_x=shaet3.cell (row=count, column=3). Value >, and the abscissa value corresponding floating point number conversion statement may be < top_x=count (top_x, 3) >.
S502, reading an ordinate value corresponding to any target parameter, and converting the ordinate value corresponding to any target parameter into a floating point number format.
Alternatively, the ordinate value corresponding to any target parameter may be read based on the ordinate value reading statement, and the ordinate value corresponding to any target parameter may be converted into the floating point format based on the floating point conversion statement corresponding to the ordinate value.
For example, the ordinate value read statement may be < top_y=shaet3.cell (row=count, column=4). Value >, and the ordinate value corresponding floating point number conversion statement may be < top_y=round (top_y, 3) >.
S503, reading the vertical coordinate value corresponding to any target parameter, and converting the vertical coordinate value corresponding to any target parameter into a floating point number format.
Alternatively, the vertical coordinate value corresponding to any target parameter may be read based on the vertical coordinate value reading statement, and the vertical coordinate value corresponding to any target parameter may be converted into the floating point format based on the floating point conversion statement corresponding to the vertical coordinate value.
For example, the vertical value read statement may be < topjz=shaet3.cell (row=count, column=5). Value >, and the vertical value corresponding floating point number conversion statement may be < topjz=round (topjz, 3) >.
Fig. 6 is a flowchart illustrating yet another method for modifying file parameters according to an exemplary embodiment, as shown in fig. 6, the method in step S205 described above specifically includes the following steps:
s601, obtaining an attribute file corresponding to the target subsystem and a backup file of the attribute file.
Alternatively, the attribute file corresponding to the target subsystem may be obtained based on the first read-write statement, and the backup file of the attribute file may be obtained based on the second read-write statement.
For example, the first read-write statement may be < file1=open (' xxx\\xx cdb\subsystems.
S602, replacing a plurality of parameters to be adjusted in the backup file of the attribute file with a plurality of target parameters.
Alternatively, the backup file of the attribute file may be set to a file requiring modification of the content based on the content modification statement, and then the parameter values corresponding to each of the target parameters are written into the corresponding number of rows in the backup file of the attribute file (i.e., the parameters to be adjusted in the backup file of the attribute file are replaced by the target parameters) according to the number of rows corresponding to each of the target parameters in the target table.
For example, the content modification statement may be < lines=file2.readlines () >. FIG. 7 is a schematic diagram of the contents of a sub file according to one exemplary embodiment, if the parameter to be adjusted is the "tie rod inner point (i.e., tie_inner)" of line 14 in Table one, as shown in FIG. 7, where tie_inner is located at line 28 of the sub file, then tie_inner is also located at line 28 of the suq file, and the X, Y and Z coordinates corresponding to the "tie rod inner point (i.e., tie_inner)" of line 14 in Table one may be written to line 28 of the suq file based on the parameter writing statement. The parameter write statement may be < if count= 14: > < lines [28] = ("'tier od_inner" left/right'%s%s\n "% (topup_x, topup_y, topup_z)) >.
S603, adjusting parameters in the attribute files corresponding to the target subsystem based on the backup files of the attribute files after parameter replacement, and simulating the target item through an ADAMS model based on a plurality of target parameters.
Optionally, firstly, a truncated file can be set in a property file corresponding to the target subsystem based on a truncated file statement, then a cursor is set in the property file corresponding to the target subsystem based on a cursor zeroing statement, then a statement is written based on file content, edited content in a backup file of the property file after parameter replacement is copied into the property file corresponding to the target subsystem (namely, parameters in the property file corresponding to the target subsystem are adjusted based on the backup file of the property file after parameter replacement) and stored, and based on the property files corresponding to a plurality of target parameters, the target project is simulated through an ADAMS model.
Illustratively, the truncated file statement may be < file1.Truncate () >, the cursor zeroing statement may be < file1.Seek (0) >, and the file content writing statement may be < file1.Writelines (lines >).
It should be noted that, the truncated file is used to change the length of the file to 0 while keeping the file attribute unchanged. Cursor zeroing is used to place the cursor at the beginning of the file content.
The embodiment of the application provides a file parameter modification method, which can be used for establishing a fixed-format table, extracting modeling parameters of various different projects or different schemes in the same project through a Python program, extracting specific parameter information from a position determined in the table, then carrying out assignment and editing in a suq file based on the specific parameter information, and finally copying the edited file content to the sub file to finish modification of parameters of a simulation model. The parameters are modified through the suq file, and the parameters are not directly modified and stored in the sub file, so that writing errors caused by repeated editing and covering in the same sub file can be avoided. The parameters of the ADAMS simulation model can be modified rapidly, efficiently and with zero error rate through the Python language, so that the requirements of simulation on parameters of different projects or different schemes of rapid switching models of the same project are met. Meanwhile, the automatic modification of parameters of the ADAMS simulation model according to different projects is an important standard for reflecting the degree of automation of the dynamic simulation analysis, and the method and the device open up important links of the full-automatic dynamic simulation analysis by realizing the automatic modification of model parameters.
The foregoing description of the solution provided in the embodiments of the present application has been mainly presented in terms of a method. In order to implement the above functions, the file parameter modifying apparatus or the electronic device includes a hardware structure and/or a software module that perform respective functions. Those of skill in the art will readily appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, according to the above method, the file parameter modification device or the electronic device may be exemplarily divided into functional modules, for example, the file parameter modification device or the electronic device may include each functional module corresponding to each functional division, or two or more functions may be integrated into one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
Fig. 8 is a block diagram illustrating a file parameter modification apparatus according to an exemplary embodiment. Referring to fig. 8, the file parameter modification apparatus 70 includes: a determination module 701 and a processing module 702;
a determining module 701, configured to determine a plurality of target parameters corresponding to the target item in the simulation process; a processing module 702 for constructing a target table based on a plurality of target parameters;
the processing module 702 is further configured to invoke a table reading function in a Python language based on the target statement, read a plurality of target parameters included in the target table, and convert the plurality of target parameters into a floating point format, where the floating point format is a format that can be identified by the mechanical system dynamics automatic analysis ADAMS model;
the processing module 702 is further configured to replace a plurality of parameters to be adjusted in an attribute file corresponding to the target subsystem with a plurality of target parameters, simulate the target item through the ADAMS model based on the plurality of target parameters, where one parameter to be adjusted corresponds to one target parameter, and the attribute file corresponding to the target subsystem is a file in the ADAMS model for storing the corresponding parameter.
In a possible implementation, the processing module 702 is further configured to construct a target table based on the plurality of target parameters and a preset format, where the preset format is used to indicate a corresponding location of each target parameter in the target table.
In one possible embodiment, each of the plurality of target parameters included in the target table corresponds to a plurality of parameter values, each of the plurality of target parameters and the corresponding plurality of parameter values being in a same row in the target table; the processing module 702 is further configured to invoke a table reading function in the Python language based on the target sentence, and sequentially read each row of parameters in the target table by traversing and looping, so as to sequentially read a plurality of parameter values corresponding to each of the plurality of target parameters.
In one possible implementation, the plurality of parameter values corresponding to each of the plurality of target parameters includes: a horizontal coordinate value, a vertical coordinate value and a vertical coordinate value; the processing module 702 is further configured to invoke a table reading function in a Python language based on the target statement, read an abscissa value corresponding to any one target parameter from a plurality of target parameters included in the target table, and convert the abscissa value corresponding to any one target parameter into a floating point number format; the processing module 702 is further configured to read a ordinate value corresponding to any target parameter, and convert the ordinate value corresponding to any target parameter into a floating point number format; the processing module 702 is further configured to read a vertical coordinate value corresponding to any target parameter, and convert the vertical coordinate value corresponding to any target parameter into a floating point number format.
In a possible implementation manner, the file parameter modification device 70 further includes an acquisition module 703; an obtaining module 703, configured to obtain a property file corresponding to the target subsystem and a backup file of the property file; the processing module 702 is further configured to replace a plurality of parameters to be adjusted in the backup file of the attribute file with a plurality of target parameters; the processing module 702 is further configured to adjust parameters in the attribute file corresponding to the target subsystem based on the backup file of the attribute file after parameter replacement, and simulate the target item through the ADAMS model based on the multiple target parameters.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 9 is a block diagram of an electronic device, according to an example embodiment. As shown in fig. 9, the electronic device 80 includes, but is not limited to: a processor 801 and a memory 802.
The memory 802 is used for storing executable instructions of the processor 801. It will be appreciated that the processor 801 described above is configured to execute instructions to implement the file parameter modification method in the above embodiments.
It should be noted that the electronic device structure shown in fig. 9 is not limited to the electronic device, and the electronic device may include more or less components than those shown in fig. 9, or may combine some components, or may have different arrangements of components, as will be appreciated by those skilled in the art.
The processor 801 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 802, and calling data stored in the memory 802, thereby performing overall monitoring of the electronic device. The processor 801 may include one or more processing modules. Alternatively, the processor 801 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 801.
Memory 802 may be used to store software programs as well as various data. The memory 802 may mainly include a storage program area that may store an operating system, application programs (such as a determination unit, a processing unit, an acquisition unit, etc.) required for at least one functional module, and a storage data area. In addition, memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
In an exemplary embodiment, a computer readable storage medium is also provided, e.g., a memory 802, comprising instructions executable by the processor 801 of the electronic device 800 to implement the file parameter modification method of the above embodiments.
In actual implementation, the functions of the determining module 701, the processing module 702, and the acquiring module 703 in fig. 8 may be implemented by the processor 801 in fig. 9 calling a computer program stored in the memory 802. For specific execution, reference may be made to the description of the file parameter modification method in the above embodiment, and details are not repeated here.
Alternatively, the computer readable storage medium may be a non-transitory computer readable storage medium, for example, a read-only memory (ROM), a random access memory (random access memory, RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided a vehicle including a file parameter modification device, which can complete the file parameter modification method in the above-described embodiments by the file parameter modification device.
In an exemplary embodiment, the present application also provides a computer program product comprising one or more instructions executable by the processor 801 of an electronic device to perform the file parameter modification method of the above-described embodiments.
It should be noted that, when the instructions in the computer readable storage medium or one or more instructions in the computer program product are executed by the processor of the electronic device, the respective processes of the embodiment of the file parameter modification method are implemented, and the technical effects same as those of the file parameter modification method can be achieved, so that repetition is avoided, and further description is omitted here.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules, so as to perform all the classification parts or part of the functions described above.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts shown as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. The purpose of the embodiment scheme can be achieved by selecting part or all of the classification part units according to actual needs.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or partly contributing to the prior art or the whole classification part or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform the whole classification part or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A method for modifying file parameters, comprising:
determining a plurality of target parameters corresponding to a target item in the simulation process, and constructing a target table based on the plurality of target parameters;
calling a table reading function in a Python language based on a target statement, reading a plurality of target parameters included in the target table, and converting the plurality of target parameters into a floating point format, wherein the floating point format is a format which can be identified by a mechanical system dynamics automatic analysis ADAMS model;
and replacing a plurality of parameters to be adjusted in an attribute file corresponding to a target subsystem with the target parameters, simulating the target item through the ADAMS model based on the target parameters, wherein one parameter to be adjusted corresponds to one target parameter, and the attribute file corresponding to the target subsystem is a file used for storing the corresponding parameters in the ADAMS model.
2. The method of claim 1, wherein the constructing a target table based on the plurality of target parameters comprises:
and constructing the target table based on the target parameters and a preset format, wherein the preset format is used for indicating the corresponding position of each target parameter in the target table.
3. The method according to claim 1 or 2, wherein each of the plurality of target parameters included in the target table corresponds to a plurality of parameter values, each of the plurality of target parameters and the corresponding plurality of parameter values being in a same row in the target table;
the calling a table reading function in a Python language based on a target sentence, and reading the target parameters included in the target table, including:
and calling a table reading function in a Python language based on the target statement, and sequentially reading each row of parameters in the target table in a traversal and loop mode so as to sequentially read a plurality of parameter values corresponding to each target parameter in the plurality of target parameters.
4. A method according to claim 3, wherein the plurality of parameter values corresponding to each of the plurality of target parameters comprises: a horizontal coordinate value, a vertical coordinate value and a vertical coordinate value;
The calling a table reading function in a Python language based on a target statement, reading the target parameters included in the target table, and converting the target parameters into a floating point number format, including:
invoking a table reading function in a Python language based on the target statement, reading an abscissa value corresponding to any target parameter of the plurality of target parameters included in the target table, and converting the abscissa value corresponding to any target parameter into a floating point number format;
reading the ordinate value corresponding to any target parameter, and converting the ordinate value corresponding to any target parameter into a floating point number format;
and reading the vertical coordinate value corresponding to any target parameter, and converting the vertical coordinate value corresponding to any target parameter into a floating point number format.
5. The method according to claim 1 or 2, wherein replacing the plurality of parameters to be adjusted in the attribute file corresponding to the target subsystem with the plurality of target parameters, and simulating the target item through the ADAMS model based on the plurality of target parameters, comprises:
Acquiring the attribute file and the backup file of the attribute file corresponding to the target subsystem;
replacing the plurality of parameters to be adjusted in the backup file of the attribute file with the plurality of target parameters;
and adjusting parameters in the attribute files corresponding to the target subsystem based on the backup files of the attribute files after parameter replacement, and simulating the target item through the ADAMS based on the target parameters.
6. The file parameter modification device is characterized by comprising a determination module and a processing module;
the determining module is used for determining a plurality of target parameters corresponding to the target item in the simulation process;
the processing module is used for constructing a target table based on the plurality of target parameters;
the processing module is further used for calling a table reading function in a Python language based on a target statement, reading the target parameters included in the target table, and converting the target parameters into a floating point number format, wherein the floating point number format is a format which can be identified by an automatic analysis ADAMS model of mechanical system dynamics;
the processing module is further configured to replace a plurality of parameters to be adjusted in an attribute file corresponding to a target subsystem with the plurality of target parameters, simulate the target item through the ADAMS model based on the plurality of target parameters, wherein one parameter to be adjusted corresponds to one target parameter, and the attribute file corresponding to the target subsystem is a file used for storing the corresponding parameter in the ADAMS model.
7. An electronic device, comprising: a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 5.
8. A computer readable storage medium, characterized in that, when computer-executable instructions stored in the computer readable storage medium are executed by a processor of an electronic device, the electronic device is capable of performing the method of any one of claims 1 to 5.
9. A vehicle comprising a file parameter modification device according to claim 6, the vehicle being adapted to implement the method according to any one of claims 1 to 5.
CN202310391544.4A 2023-04-12 2023-04-12 File parameter modification method, device, equipment and storage medium Pending CN116467871A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310391544.4A CN116467871A (en) 2023-04-12 2023-04-12 File parameter modification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310391544.4A CN116467871A (en) 2023-04-12 2023-04-12 File parameter modification method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116467871A true CN116467871A (en) 2023-07-21

Family

ID=87172973

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310391544.4A Pending CN116467871A (en) 2023-04-12 2023-04-12 File parameter modification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116467871A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117574867A (en) * 2023-12-08 2024-02-20 北京天圣华信息技术有限责任公司 Statistical table generation method, device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117574867A (en) * 2023-12-08 2024-02-20 北京天圣华信息技术有限责任公司 Statistical table generation method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US7971175B2 (en) Method and system for implementing cached parameterized cells
US7990375B2 (en) Virtual view schematic editor
CN109448100B (en) Three-dimensional model format conversion method, system, computer device and storage medium
US8037450B2 (en) System and methods for tracing code generation in template engines
CN109669917B (en) Waveform storage method based on priority grouping
CN104268073A (en) Method for generating test cases in batch mode
CN116467871A (en) File parameter modification method, device, equipment and storage medium
CN112579679B (en) Method and device for designing heterogeneous data model mapping strategy and automatic conversion
CN114912391A (en) Automatic generation method, device, equipment and medium of register design and verification model
CN102841837A (en) Software and hardware co-verification method based on simulator and system thereof
CN105045948B (en) A kind of transmitter guard box configuration diagram automatic batch generation method
CN113705136A (en) Integrated circuit automation logic synthesis system, method, device and medium
CN111814376A (en) Method for extracting rigidity result of vehicle body attachment point and electronic equipment
CN111581871A (en) Modeling method, device, equipment and storage medium
CN114281538A (en) Memory parameter adjusting method, device, equipment and medium
CN110502735B (en) Method and system for quickly manufacturing universal process file of electronic equipment
EP1530130A3 (en) Simulator and simulation method
CN103186365B (en) A kind of method and system generating steering order according to character contour change
CN115562989A (en) Automatic test sequence conversion method, system, equipment and medium
CN110826185A (en) Method for establishing bearing part library based on CAD secondary development
CN116186948A (en) Space engine pipe network parameterized modeling method based on Abaqus secondary development technology
CN108228314A (en) A kind of Virtual prototype error-detecting method based on equipment stipulations
CN113283009A (en) Adams-based suspension part working condition load preparation system, method and medium
CN111626024A (en) Method and system for batch processing of SWCC model parameter data based on RETC software
CN116644703B (en) Bitmap file generation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination