Search

CN-122018867-A - Installation package interface compatible control method and device, electronic equipment and storage medium

CN122018867ACN 122018867 ACN122018867 ACN 122018867ACN-122018867-A

Abstract

The application relates to the technical field of vehicle application and discloses a method and a device for controlling compatibility of an installation package interface, electronic equipment and a storage medium. The method comprises the steps of extracting an interface description language file when an interface of any Android application package APK is exposed, generating a semantic signature abstract corresponding to the interface according to the interface description language file, executing uniqueness check on the semantic signature abstract, generating an interface ID and a version number after the uniqueness check passes, executing semantic level automatic adaptation operation according to preset adaptation rules when a first APK calls the interface ID exposed by a second APK if the version numbers of the first APK and the second APK are different, and establishing a connection call relation between the first APK and the second APK at least after the semantic level automatic adaptation operation is completed. The application is beneficial to improving the safety and compatibility of the APK interface.

Inventors

  • XIE HUIYING
  • ZHANG HUIMING
  • MA GUANGMING
  • XU HONGBIN
  • HE XIANGYU
  • ZHANG XINYAN

Assignees

  • 中国第一汽车股份有限公司
  • 一汽(北京)软件科技有限公司

Dates

Publication Date
20260512
Application Date
20260121

Claims (10)

  1. 1. A method for controlling compatibility of an installation package interface, comprising at least: Extracting an interface description language file when the interface of any Android application package APK is exposed; generating a semantic signature abstract corresponding to an interface according to the interface description language file; executing the uniqueness check on the semantic signature abstract, and generating an interface ID and a version number after the uniqueness check passes; When a first APK calls an interface ID exposed by a second APK, if the version numbers of the first APK and the second APK are different, executing semantic level automatic adaptation operation according to a preset adaptation rule; and at least after the semantic level automatic adaptation operation is completed, establishing a connection calling relationship between the first APK and the second APK.
  2. 2. The method for controlling compatibility of an installation package interface according to claim 1, wherein when a first APK calls an interface ID exposed by a second APK, if there is a difference between the version numbers of the first APK and the second APK, executing a semantic level automatic adaptation operation according to a preset adaptation rule, which specifically includes: When the first APK calls the interface ID exposed by the second APK, if the version numbers of the first APK and the second APK are different, continuing to determine an adaptation operation mode; if the adaptive operation mode is the newly added parameter, filling a default value; if the adaptive operation mode is parameter type change, changing the parameter type according to the target change type; if the adapting operation mode is deleting parameters, ignoring an input field corresponding to the first APK; If the adaptation operation mode is the return value structure expansion, the mapping or the cut-off irrelevant field is automatically degraded.
  3. 3. The installation package interface compatibility control method of claim 1, further comprising, after said performing a uniqueness check on said semantic signature digest and generating an interface ID and version number after said uniqueness check passes: When the first APK calls the interface ID exposed by the second APK, if the version numbers of the first APK and the second APK are not different, a connection call relationship between the first APK and the second APK is established.
  4. 4. The installation package interface compatibility control method of claim 1, further comprising, after establishing a connection call relationship between the first APK and the second APK at least after the semantic level automatic adaptation operation is completed: Constructing an interface signature dependency graph according to all the connection calling relations, and executing consistency check on the version number of each APK interface ID based on the interface signature dependency graph; and if the verification is passed, executing the release flow on the connection calling relationship.
  5. 5. The installation package interface compatibility control method of claim 4, further comprising, after said performing a consistency check on said version number of each APK interface ID according to all said connection call relations: and if the test is not passed, stopping the connection calling relationship and generating a structured difference report.
  6. 6. The method according to claim 4, further comprising, after the execution of the release procedure for the connection call relationship if the verification passes: And if any APK exposed interface needs version updating, acquiring the minimum security release set of the APK to determine the updating mode of the APK.
  7. 7. An installation package interface compatible control device, comprising at least: the data extraction module is used for extracting an interface description language file when the interface of any Android application package APK is exposed; The abstract generating module is used for generating a semantic signature abstract corresponding to the interface according to the interface description language file; The interface checking module is used for executing the uniqueness check on the semantic signature abstract and generating an interface ID and a version number after the uniqueness check passes; the automatic adaptation module is used for executing semantic level automatic adaptation operation according to a preset adaptation rule when the first APK calls an interface ID exposed by the second APK and the version numbers of the first APK and the second APK are different; and the connection establishment module is used for establishing a connection calling relationship between the first APK and the second APK at least after the semantic-level automatic adaptation operation is completed.
  8. 8. The installation package interface compatible control device of claim 7, wherein the automatic adaptation module is specifically configured to: The method comprises the steps of calling an interface ID exposed by the second APK by the first APK, continuously determining an adaptation operation mode when the version numbers of the first APK and the second APK are different, supplementing a default value when the adaptation operation mode is a newly added parameter, changing the parameter type according to a target change type when the adaptation operation mode is a parameter type change, omitting an input field corresponding to the first APK when the adaptation operation mode is a deletion parameter, and automatically degrading mapping or cutting off irrelevant fields when the adaptation operation mode is a return value structure expansion.
  9. 9. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, wherein the processor, when executing the program, implements the steps of the installation package interface compatibility control method of any one of claims 1 to 6.
  10. 10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the steps in the installation package interface compatibility control method of any one of claims 1 to 6.

Description

Installation package interface compatible control method and device, electronic equipment and storage medium Technical Field The present invention relates to the field of vehicle application technologies, and in particular, to a method and apparatus for controlling compatibility of an installation package interface, an electronic device, and a storage medium. Background With the continuous upgrade of intelligent cabins and vehicle-mounted information entertainment systems, a vehicle software system gradually evolves from a single application mode to a complex distributed platform with multi-module and multi-process collaborative operation. In order to improve the function expansion capability and development efficiency, more and more host factories and ecological suppliers adopt modularized architecture, and functional modules such as navigation, voice assistant, vehicle control, entertainment playing and the like are developed, deployed and maintained in an independent APK form. The APKs are usually signed and managed by different development subjects, and data interaction and function multiplexing among modules are realized through a Binder/AIDL cross-process communication mechanism provided by an Android platform, so that a multi-source collaborative vehicle-mounted software ecological system is formed. However, in this multi APK parallel evolution development mode, the following prominent problems still exist in the prior art: 1. Interface signature compatibility detection granularity is insufficient The existing detection tool is mainly used for comparing the new addition or modification of the AIDL file, and lacks of accurate analysis on semantic layers such as method signature, parameter type, sequence field sequence and the like. When there is an implicit change in the interface definition (e.g., data structure adjustment or parameter type drift), the system often exposes problems at the operation stage, such as triggering BadParcelableException, UNKNOWN _transmission and other anomalies, which seriously affect the stability of the vehicle. 2. Multiple APK collaborative release risk is high Each APK is typically maintained independently by different development teams, the iteration rhythms of the versions are inconsistent, and the interface changes lack global coordination mechanisms. The existing flow is dependent on manual comparison or document synchronization, and an automatic cross-APK interface compatibility verification means is lacked, so that the problem of interface mismatch is often found in an integrated test or formal release stage, and rework and project delay are caused. 3. Lack of unified differential reporting and interface evolution traceability mechanism The current detection tools output results in a log or prompt mode, information is scattered and cannot be traced, and the evolution history and compatibility change trend of the interface cannot be systematically presented. Therefore, the development team is difficult to master the interface dependency relationship and the influence range in time, and the complexity of iterative maintenance of the vehicle-mounted software is increased. In summary, the prior art cannot effectively solve the problem of compatibility verification and collaborative release security of interface evolution in a vehicle-mounted multi-APK system, and a technical scheme capable of automatically detecting interface semantic differences, tracking interface history evolution and supporting collaborative release decisions is needed. Disclosure of Invention The invention aims to provide a method, a device, electronic equipment and a storage medium for controlling compatibility of an installation package interface, which at least solve the problems of compatibility verification and collaborative release safety of interface evolution in a vehicle-mounted multi-APK system and are beneficial to improving the safety and compatibility of an APK interface. In order to solve the above technical problems, in a first aspect, the present invention provides a method for controlling compatibility of an installation package interface, at least including: Extracting an interface description language file when the interface of any Android application package APK is exposed; generating a semantic signature abstract corresponding to an interface according to the interface description language file; executing the uniqueness check on the semantic signature abstract, and generating an interface ID and a version number after the uniqueness check passes; When a first APK calls an interface ID exposed by a second APK, if the version numbers of the first APK and the second APK are different, executing semantic level automatic adaptation operation according to a preset adaptation rule; and at least after the semantic level automatic adaptation operation is completed, establishing a connection calling relationship between the first APK and the second APK. Optionally, when the first APK