CN-121996456-A - Configuration file generation method, device, medium and program product
Abstract
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a medium, and a program product for generating a configuration file. The method comprises the steps of obtaining a degradation demand file, wherein the degradation demand file comprises M degradation records used for degrading functions of a vehicle, each degradation record comprises event information of degradation trigger events and corresponding degradation actions, obtaining pre-created configuration engineering, wherein the pre-created configuration engineering comprises event information of each failure event in a failure event set of a target vehicle, verifying compatibility of the degradation trigger events in each degradation record and the failure event set based on the respective event information of the degradation trigger events and the failure events, and generating a degradation configuration file in a preset format based on the degradation demand file under the condition that all the degradation trigger events are compatible with the failure event set, wherein the degradation configuration file is used for triggering the target vehicle to execute the corresponding degradation actions when the degradation trigger events occur to the target vehicle. In this way, an automatic conversion of the degraded demand file into a configuration file is achieved.
Inventors
- ZHANG JIANZHOU
Assignees
- 智驾大陆(上海)智能科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260113
Claims (14)
- 1. A method for generating a configuration file, applied to an electronic device, the method comprising: Obtaining a degradation requirement file, wherein the degradation requirement file comprises M degradation records for degrading vehicle functions, M is a positive integer, and each degradation record comprises event information of a degradation trigger event and degradation actions corresponding to the degradation trigger event; acquiring a pre-established configuration project, wherein the configuration project comprises event information of each fault event in a fault event set of a target vehicle; Checking compatibility of the degradation trigger event in each of the M degradation records with the failure event set based on the event information of the degradation trigger event and the event information of the failure event; And under the condition that each degradation triggering event is compatible with the fault event set, generating a degradation configuration file with a preset format based on the degradation requirement file, wherein the degradation configuration file is used for triggering the target vehicle to execute the degradation action corresponding to the degradation triggering event when the degradation triggering event occurs to the target vehicle.
- 2. The method of claim 1, wherein generating a degradation profile in a preset format based on the degradation requirement file if each of the degradation trigger events is compatible with the set of fault events comprises: Acquiring a template configuration file in the preset format, wherein the template configuration file comprises a first template sentence, and the first template sentence comprises a custom field; creating M template sentences corresponding to the M degradation records one by one in the template configuration file, wherein the sentence structure of each template sentence is the same as that of the first template sentence: filling the content of the degradation record in the custom field of the template statement in the ith item to generate the degradation configuration file, wherein i is a positive integer sequentially valued in 1 to M.
- 3. The method of claim 2, wherein the custom field comprises a first field; The filling the content of the degradation record of the ith item in the custom field of the template statement of the ith item comprises the following steps: filling the demotion action of the ith demotion record into the first field of the ith template statement.
- 4. The method of claim 3, wherein the degradation record further comprises a degradation record identification for identifying the degradation record in integer form, a degradation function mask for indicating that the degradation record is in effect if the degradation trigger event corresponding to the degradation record is in a preset state; The custom field comprises a second field, a third field and a fourth field; The filling the content of the degradation record of the ith item in the custom field of the template statement of the ith item comprises the following steps: Filling the degraded record identifier of the ith degraded record into the second field of the ith template statement; Filling path information of the fault event corresponding to the degradation triggering event of the ith degradation record into the third field of the ith template statement; filling the degraded function mask of the ith degraded record into the fourth field of the ith template statement.
- 5. The method of claim 1, wherein the event information of the degraded trigger event comprises description information of the degraded trigger event and an event code of the degraded trigger event, and the event information of the fault event comprises event information of the fault event and a time code of the fault event; the verifying, based on the event information of the degradation trigger event and the event information of the fault event, compatibility of the degradation trigger event and the fault event set in each degradation record includes: and checking compatibility of a degradation triggering event of an ith degradation record in the M degradation records and the fault event set, wherein i is a positive integer sequentially valued from 1 to M. And if the description information of the degradation trigger event of the ith degradation record is the same as the description information of one of the fault events in the fault event set, and the event code of the degradation trigger event is the same as the event code of the one of the fault events, the degradation trigger event of the ith degradation record is compatible with the fault event set, otherwise, the degradation trigger event of the ith degradation record is incompatible with the fault event set.
- 6. The method according to claim 1, wherein the method further comprises: And outputting abnormal prompt information when the degradation record incompatible with the fault event set exists in the degradation requirement file, wherein the abnormal prompt information is used for indicating the event information of the incompatible degradation trigger event.
- 7. The method of claim 1, wherein after said verifying compatibility of said degradation trigger event with said set of failure events in each of said degradation records, said method further comprises: A compatibility report is output indicating compatibility of the degradation record in the degradation requirement file with the set of fault events.
- 8. The method of claim 6, wherein the method further comprises: receiving modification operation of a user on the degradation requirement file based on the abnormality prompt information; And verifying compatibility of the degradation triggering event and the fault event set in each degradation record based on the modified degradation requirement file.
- 9. The method of claim 6, wherein the method further comprises: receiving modification operation of a user on the configuration engineering based on the abnormal prompt information; And verifying compatibility of the degradation trigger event and the fault event set in each degradation record based on the modified configuration engineering.
- 10. The method according to claim 1, wherein the method further comprises: Outputting a generation result report, wherein the generation result report comprises the generation time of the configuration file, the quantity information of the degradation records and/or the abnormal error information in the generation process of the configuration file.
- 11. The method of claim 1, wherein the predetermined format is ARXML format.
- 12. A readable storage medium, comprising one or more programs, which when executed on an electronic device, cause the electronic device to implement the method of any of claims 1-11.
- 13. A computer program product, characterized in that the computer program product, when run on an electronic device, causes the electronic device to implement the method of any one of claims 1 to 11.
- 14. An electronic device, comprising: One or more memories for storing one or more programs; one or more processors to execute the one or more programs to cause the electronic device to implement the method of any of claims 1-11.
Description
Configuration file generation method, device, medium and program product Technical Field The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a medium, and a program product for generating a configuration file. Background In the development of the vehicle-mounted embedded system based on the vehicle open system architecture (Automotive Open System Architecture, AUTOSAR), when a vehicle fails (such as sensor signal loss, communication abnormality or hardware failure of the vehicle), a preset degradation strategy (such as disabling non-critical functions of the vehicle) needs to be executed by a function inhibition management module (Function Inhibition Management, FIM) so as to meet the functional safety standard (such as ISO26262 functional safety standard) of the vehicle industry. Currently, the related configuration of FIM modules is mainly dependent on manual configuration. The engineer needs to refer to the degradation requirement document, create degradation numbers, associated trigger events, set mask bits and the like item by item for each degradation record in the degradation requirement document in the configuration tool, and manually derive a configuration file that the AUTOSAR development tool can recognize. However, the manual configuration is long in time consumption and low in efficiency, the configuration content is high in repeatability, and human errors, such as misspellings of event names, and the like, are easy to occur. Disclosure of Invention The application aims to provide a configuration file generation method, device, medium and program product. The method for generating the configuration file is applied to electronic equipment and comprises the steps of obtaining a degradation requirement file, wherein the degradation requirement file comprises M degradation records used for degrading functions of a vehicle, M is a positive integer, each degradation record comprises event information of degradation triggering events and degradation actions corresponding to the degradation triggering events, obtaining a pre-created configuration project, the configuration project comprises event information of each failure event in a failure event set of a target vehicle, verifying compatibility of the degradation triggering events and the failure event set in each degradation record in the M degradation records based on the event information of the degradation triggering events and the event information of the failure events, and generating a degradation configuration file in a preset format based on the degradation requirement file when each degradation triggering event is compatible with the failure event set, wherein the degradation configuration file is used for triggering the target vehicle to execute the degradation actions corresponding to the degradation triggering events when the degradation triggering events occur in the target vehicle. In the embodiment of the application, the degradation requirement file containing the degradation records is obtained, and the compatibility judgment is combined with the fault event set in the configuration engineering, so that the identifiable degradation configuration file is automatically generated only when all the degradation records meet the compatibility condition, namely, when all the degradation records are defined in the fault event set, and the runtime error caused by the unmatched degradation records can be avoided. The embodiment of the application realizes the automatic conversion from the degradation requirement file to the executable configuration file, reduces the mismatching risk caused by manual intervention, and improves the accuracy and efficiency of configuration file generation. Meanwhile, as the configuration file is generated based on the preset format, it can be understood that when the preset format is the format corresponding to the AUTOSAR development tool, the degradation configuration file generated by the technical scheme provided by the embodiment of the application can be directly imported and used by the AUTOSAR development tool, thereby being beneficial to rapid iteration and maintenance of a large-scale vehicle-mounted electronic system. In one possible implementation of the first aspect, when each degradation trigger event is compatible with the failure event set, generating a degradation configuration file in a preset format based on the degradation requirement file, where the degradation configuration file includes obtaining a template configuration file in the preset format, the template configuration file includes a first template sentence, the first template sentence includes a custom field, creating M template sentences in the template configuration file, the M template sentences are in one-to-one correspondence with the M degradation records, and each template sentence has a sentence structure identical to that of the first template sentence, and fi