Cross-platform installation package automatic adaptation method and system

By obtaining a unified description file and operating system fingerprint, generating a dependency tree and automatically generating an installation package based on the optimal build template, the problems of low manual adaptation efficiency, high configuration error rate and high maintenance cost in cross-platform software deployment are solved, and efficient, accurate and automated adaptation of cross-platform installation packages is achieved.

CN120803480APending Publication Date: 2025-10-17BEIJING ZHONGYI ANTU TECH CO
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511012722.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing technologies in cross-platform software deployment have problems such as low manual adaptation efficiency, high configuration error rate, high maintenance cost, lack of environmental awareness and fragmented construction process, resulting in poor accuracy and efficiency.

Method used

By obtaining a unified description file and operating system fingerprint, generating a dependency tree and automatically generating an installation package based on the optimal build template, combining syntax tree parsing and semantic verification, dynamically identifying platform features, and achieving automatic adaptation of cross-platform installation packages.

Benefits of technology

It greatly reduces the time developers spend on multi-platform adaptation, significantly reduces configuration error rates, reduces maintenance costs, improves the accuracy and efficiency of cross-platform installation packages, and realizes centralized control and automated execution of cross-platform adaptation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803480A_ABST
    Figure CN120803480A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides a cross-platform installation package automatic adaptation method and system, and the method comprises the steps: obtaining a unified description file and an operating system fingerprint of each target platform; based on the operating system fingerprints of the target platforms and the installation package adaptation parameters, matching is carried out, and dependency trees of the target platforms are generated; and generating an adaptive installation package based on the dependency tree of each target platform and the installation package adaptation parameter. According to the cross-platform installation package automatic adaptation method, specific parameters and shared parameters of the platform are managed in a centralized mode through unified description files, environment intelligent perception is achieved and the dependency tree of the platform is generated in combination with dynamically obtained operating system fingerprints, and the adaptive installation package is generated through analysis of the installation package adaptation parameters of the platform and the dependency tree. The problems of low adaptation efficiency, high configuration error rate, high maintenance cost and the like are solved; in addition, a unified construction management mechanism realizes cross-platform centralized management and control, and the accuracy and efficiency of cross-platform installation package adaptation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and in particular to a cross-platform installation package automatic adaptation method and system. BACKGROUND

[0002] The current cross-platform software deployment mainly adopts the following technical solutions: 1) manually writing installation scripts for each platform; 2) compiling and configuring based on automatic build tools CMake / Makefile; 3) encapsulating multiple environments using Docker containers. The existing technology relies on developers to manually maintain the build rules of different platforms, and needs to configure installation parameters such as dependencies, file directory structure, permission settings for each platform, and then generate installation packages adapted for each platform, which involves a lot of repetitive configuration work.

[0003] Therefore, the existing technology has many defects: 1) low efficiency of manual adaptation: statistics show that nearly half of the time of developers is spent on handling multi-platform adaptation problems; 2) high error rate of configuration: differences in path formats and permission models between different platforms result in compatibility problems in some installation packages; 3) high maintenance cost: each platform upgrade needs to re-verify all configuration items; 4) lack of environment awareness: unable to dynamically identify the operating system fingerprint of the platform; 5) fragmented build process: the installation packages adapted for each platform are independent of each other, lacking a unified management mechanism. In summary, the existing technology has the problems of poor accuracy and efficiency. SUMMARY

[0004] The present application provides a cross-platform installation package automatic adaptation method and system to solve the problem of poor accuracy and efficiency of the existing technology.

[0005] In a first aspect, the present application provides a cross-platform installation package automatic adaptation method, comprising: obtaining a unified description file and operating system fingerprints of each target platform; the unified description file contains installation package adaptation parameters of each target platform; the installation package adaptation parameters of each target platform include platform-specific parameters and inter-platform shared parameters required when generating installation packages; matching based on the operating system fingerprints and installation package adaptation parameters of each target platform to generate a dependency tree for each target platform; generating installation packages adapted for each target platform based on the dependency tree and installation package adaptation parameters of each target platform.

[0006] In one embodiment, after obtaining the unified description file and before matching based on the operating system fingerprints and installation package adaptation parameters of each target platform, it further comprises: parsing the unified description file to obtain a syntax tree; The syntax tree is semantically checked to obtain a semantic checking result; A target description file is generated based on the semantic checking result.

[0007] In one embodiment, the operation system fingerprint and the installation package adaptation parameter of each target platform are matched to generate a dependency tree of each target platform, including: The system version and system architecture of each target platform are determined based on the operation system fingerprint of each target platform; The multiple dependency relationships of each target platform are determined by matching the installation package adaptation parameter of each target platform in the target description file based on the system version and system architecture of each target platform; The dependency tree of each target platform is generated based on the multiple dependency relationships of each target platform.

[0008] In one embodiment, the dependency tree of each target platform and the installation package adaptation parameter are used to generate an installation package adapted to each target platform, including: The source code package of each target platform is generated based on the dependency tree of each target platform and the installation package adaptation parameter of each target platform in the target description file; The optimal build template of each target platform is generated based on the source code package and the dependency tree of each target platform; The installation package adapted to each target platform is generated based on the optimal build template of each target platform.

[0009] In one embodiment, the optimal build template of each target platform is used to generate an installation package adapted to each target platform, including: The native build tool chain of each target platform is invoked based on the optimal build template of each target platform to compile and generate an installation package adapted to each target platform.

[0010] In one embodiment, after the dependency tree of each target platform and the installation package adaptation parameter are used to generate an installation package adapted to each target platform, the method further includes: The installation package adapted to each target platform is installed and verified in multiple preset test environments to generate a compatibility verification report of each preset test environment.

[0011] In one embodiment, the installation package adapted to each target platform is installed and verified in multiple preset test environments to generate a compatibility verification report of each preset test environment, including: The installation package adapted to each target platform supported by the preset test environment is sampled and verified in each preset test environment to generate a compatibility verification report of each preset test environment.

[0012] In one embodiment, after generating the compatibility verification report of each preset test environment, each compatibility verification report further includes: If the compatibility verification report describes any target platform adapted installation package with compatibility problems, based on the compatibility problems, determine the error analysis result of the dependency tree of the target platform; Based on the error analysis result, optimize the installation package adaptation parameters of the target platform in the target description file; Based on the optimized installation package adaptation parameters of the target platform, regenerate the installation package adapted to the target platform.

[0013] In a second aspect, the present application also provides a cross-platform installation package automatic adaptation system, which is configured with a configuration parser, an environment detector, a dependency manager and an installation package generation module; The configuration parser is used to obtain a unified description file; the unified description file contains installation package adaptation parameters of each target platform; The environment detector is used to obtain the operating system fingerprints of each target platform; The dependency manager is used to match based on the operating system fingerprints and installation package adaptation parameters of each target platform, and generate a dependency tree of each target platform; The installation package generation module is used to generate installation packages adapted to each target platform based on the dependency tree and installation package adaptation parameters of each target platform.

[0014] In one embodiment, the installation package generation module further includes an intelligent adaptation engine, a build executor, a verification module and a feedback optimization module; The configuration parser is also used to perform syntax tree parsing and semantic checking on the description file to generate a target description file; The intelligent adaptation engine is used to generate the best build template of each target platform based on the installation package adaptation parameters of each target platform in the target description file and the dependency tree of each target platform; The build executor is used to call the native build tool chain of each target platform based on the best build template of each target platform to compile and generate installation packages adapted to each target platform; The verification module is used to perform sampling installation verification testing on the target platform adapted installation package supported by each preset test environment in each preset test environment, and generate a compatibility verification report of each preset test environment; The feedback optimization module is configured to, for each compatibility verification report, if any target platform adapted installation package described in the compatibility verification report has a compatibility problem, optimize the installation package adaptation parameter of the target platform in the target description file based on the compatibility problem, and regenerate the target platform adapted installation package based on the optimized installation package adaptation parameter of the target platform.

[0015] The cross-platform installation package automatic adaptation method and system provided by the application can realize intelligent environment sensing by unified description file centralized management of platform specific parameters and shared parameters, combined with dynamically acquired operating system fingerprints, automatically generate a dependency tree of a target platform, replace the traditional manual script adaptation method, greatly reduce the time proportion of developers handling multi-platform adaptation, and generate platform adapted installation packages through automatic analysis of platform installation package adaptation parameters and dependency trees, eliminate compatibility problems caused by platform differences, and significantly reduce configuration error rates. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0017] Figure 1 is one of the process schematic diagrams of the cross-platform installation package automatic adaptation method provided by the application.

[0018] Figure 2 is the second process schematic diagram of the cross-platform installation package automatic adaptation method provided by the application.

[0019] Figure 3 is the structure schematic diagram of the cross-platform installation package automatic adaptation system provided by the application. DETAILED DESCRIPTION

[0020] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0021] The terms "first", "second", and the like in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein.

[0022] The present application will be described below with reference to the drawings. Figures 1-3 The provided cross-platform installation package automatic adaptation method and system of the present application are described below.

[0023] The cross-platform installation package automatic adaptation method provided by the embodiments of the present application is realized based on the cross-platform installation package automatic adaptation system. Therefore, the embodiments of the present application take the cross-platform installation package automatic adaptation system as the execution subject, and specifically describe the cross-platform installation package automatic adaptation method.

[0024] The cross-platform installation package automatic adaptation method provided by the embodiments of the present application is realized based on the cross-platform installation package automatic adaptation system. Therefore, the embodiments of the present application take the cross-platform installation package automatic adaptation system as the execution subject, and specifically describe the cross-platform installation package automatic adaptation method. Figures 1-2 Figure 1 is one of the flowcharts of the cross-platform installation package automatic adaptation method provided by the present application, Figure 2 is another flowchart of the cross-platform installation package automatic adaptation method provided by the present application.

[0025] As shown in Figure 1 , the cross-platform installation package automatic adaptation method comprises the following steps: Step 101, obtaining a uniform description file and an operating system fingerprint of each target platform; Step 102, matching based on the operating system fingerprint of each target platform and the installation package adaptation parameter, to generate a dependency tree of each target platform; Step 103, generating an installation package adapted for each target platform based on the dependency tree of each target platform and the installation package adaptation parameter.

[0026] ​Specifically, before implementing cross-platform deployment of a certain software, it is necessary to first implement automated generation of installation packages adapted to each target platform. In order to realize centralized management and automatic execution of cross-platform adaptation logic, a unified description file specification and unified installation package adaptation parameters for each target platform are used. The unified description file is a cross-platform configuration specification used to centrally define installation package construction parameters for software on different target platforms (such as Windows, macOS, Linux, etc.). By integrating the unique parameters of each target platform and cross-platform shared parameters (such as application version number, main program entry path, resource file hash value, installation path default rule, etc.) in a unified format, the standardization of configuration parameter construction is realized, and the goal of "one configuration, all platform deployment" is ultimately achieved.

[0027] The user submits a unified description file through an interactive page, and the system obtains the unified description file submitted by the user. Further, the unified description file is parsed and semantically verified to generate a standardized target description file, to ensure that its format is correct and its content conforms to the specification.

[0028] At the same time, the system identifies the operating system fingerprints of each target platform by analyzing the data packet characteristics generated by each target platform in network interaction. For example, based on network protocol analysis, by sending specific network protocol packets to each target platform, the differences in processing data packets by different systems will result in different response characteristics, thereby identifying the operating system fingerprints of each target platform. For local target platforms, the operating system fingerprints can be obtained preferentially through the application programming interface or command line of the system. The operating system fingerprints contain the system version and system architecture of the target platform, so the system version and system architecture of each target platform can be extracted from the operating system fingerprints of each target platform.

[0029] Further, based on the system version and system architecture of each target platform, the dependency relationship matching is performed in the installation package adaptation parameters of each target platform in the target description file, and the dependency tree of each target platform is generated. The dependency tree records in detail the dependency relationship required for the software to run on the corresponding target platform, providing accurate basis for subsequent installation package construction.

[0030] Further, based on the installation package adaptation parameters and the dependency tree of each target platform, the best construction template for each target platform is generated. The best construction template is a reusable framework that integrates standardized configurations, platform adaptation parameters, dependency management rules, and automated processes for a specific target platform and software type. Its core goal is to eliminate "environmental differences" and "configuration fragmentation" in the construction process, ensuring the construction efficiency, consistency, and compatibility of software on different target platforms.

[0031] Further, based on the best build template of each target platform, the native build tool chain of each target platform is called to compile and generate an installation package adapted to each target platform, ensuring optimal performance and compatibility on different platforms.

[0032] The cross-platform installation package automatic adaptation method provided by the application realizes intelligent environment sensing by unified description file centralized management of platform-specific parameters and shared parameters, combined with dynamically obtained operating system fingerprints, automatically generates a dependency tree of the target platform, replaces the traditional manual scripting adaptation method, and greatly reduces the time proportion of the developer in handling multi-platform adaptation. At the same time, through automatic parsing of the installation package adaptation parameters and the dependency tree of the platform, an installation package adapted to each platform is generated, eliminating compatibility problems caused by platform differences and significantly reducing configuration error rates. When the platform is upgraded, only the installation package adaptation parameters in the unified description file need to be updated to complete the global adaptation logic synchronization, avoiding the tedious process of re-verifying configuration items for each platform, and greatly reducing maintenance costs. In addition, the unified build management mechanism breaks the independence of the platform installation package generation process, realizes centralized control and automatic execution of cross-platform adaptation logic, and improves the accuracy and efficiency of cross-platform installation package adaptation.

[0033] In some embodiments, based on the steps between step 101 and step 102, that is, after obtaining the unified description file, and before matching based on the operating system fingerprint and the installation package adaptation parameter of each target platform, the following steps are further included: parsing the unified description file into a syntax tree; performing semantic verification on the syntax tree to obtain a semantic verification result; generating a target description file based on the semantic verification result.

[0034] Specifically, the unified description file is parsed into a syntax tree, and the goal of syntax tree parsing is to convert the unstructured or semi-structured unified description file (such as XML, YAML, JSON, or custom format) into a hierarchical syntax tree that can be understood by a machine. First, the content of the unified description file is split according to the preset syntax rules, and key syntax units Token are extracted, such as keyword recognition, symbol parsing, value type classification, etc. Then, based on the lexical units, an abstract syntax tree is constructed, and the logical structure of the unified description file is mapped through the node level relationship, such as the root node (corresponding to the entire unified description file), the branch node (split according to the function module), and the leaf node (store specific parameter values).

[0035] Further, the syntax tree is subjected to semantic verification to verify whether the syntax tree conforms to the business logic and platform specifications. The semantic verification process can include three dimensions, namely basic constraint verification, cross-node association verification, and platform specification verification.

[0036] If the semantic check succeeds, the generated syntax tree is taken as the target description file; if the semantic check fails, the position of the semantic error is found, and the syntax tree after correction is taken as the target description file.

[0037] The embodiment of the application can accurately identify and correct syntax errors and semantic conflicts in the description logic by syntax tree parsing and semantic checking of the unified description file, thereby effectively improving the accuracy and efficiency of cross-platform adaptation.

[0038] In some embodiments, based on step 102, the operation system fingerprint and the installation package adaptation parameter of each target platform are matched to generate a dependency tree of each target platform, including: Based on the operation system fingerprint of each target platform, the system version and the system architecture of each target platform are determined; Based on the system version and the system architecture of each target platform, the installation package adaptation parameter of each target platform in the target description file is matched to determine a plurality of dependency relationships of each target platform; Based on the plurality of dependency relationships of each target platform, a dependency tree of each target platform is generated.

[0039] Specifically, the system version and the system architecture corresponding to each target platform are extracted from the operation system fingerprint of each target platform.

[0040] Further, based on the system version and the system architecture of each target platform, the installation package adaptation parameter of each target platform in the target description file is matched, and when the system version and the system architecture of the target platform are matched, all dependency relationships of the target platform are mapped.

[0041] Further, for each target platform, based on all the matched dependency relationships, a hierarchical structure is generated, and the hierarchical structure is subjected to dependency conflict resolution to finally generate a structured dependency tree.

[0042] The embodiment of the application accurately analyzes the platform characteristics through the operation system fingerprint, extracts compliant dependency relationships based on rule matching, and generates a structured dependency tree through hierarchical construction and conflict resolution, finally providing a dependency list of "version accurate, platform adaptive, and conflict-free" for installation package construction, which is the core basis for ensuring stable operation of software across platforms.

[0043] In some embodiments, based on step 103, the dependency tree and the installation package adaptation parameter of each target platform are used to generate an installation package adapted to each target platform, including: Based on the dependency tree of each target platform and the installation package adaptation parameter of each target platform in the target description file, a source code package of each target platform is generated; Based on the source code package and the dependency tree of each target platform, a best construction template of each target platform is generated; generate installation packages adapted to each target platform based on the optimal build templates of the target platforms.

[0044] Specifically, for each target platform, a corresponding source code package is generated based on the dependency tree of the target platform and its installation package adaptation parameters in the target description file, mainly containing program codes that have not been compiled.

[0045] Further, a corresponding optimal build template is generated based on the source code package and the dependency tree of the target platform. The optimal build template is a set of standardized, platform-adapted configuration files and script collections, which defines the whole process rules from "source code compilation" to "installation package output" based on the project source code structure, dependency relationship and platform characteristics. Its essence is to solidify the construction experience (such as compilation options, dependency management, packaging logic) into reusable automation instructions, ensuring the consistency, efficiency and reliability of the cross-platform construction process.

[0046] Further, an installation package adapted to the target platform is generated based on the optimal build template of the target platform.

[0047] The embodiment of the application generates a source code package based on the dependency tree and installation package adaptation parameters of the target platform, and then generates an optimal build template in combination with the dependency relationship, and finally generates installation packages adapted to each target platform, thereby realizing the precision and efficiency of cross-platform construction, effectively reducing the cost of manual adaptation, and improving the compatibility and deployment success rate of the installation package in different environments.

[0048] Further, the generation of installation packages adapted to each target platform based on the optimal build templates of the target platforms comprises: Based on the optimal build templates of the target platforms, the native build tool chain of each target platform is called to compile and generate installation packages adapted to each target platform.

[0049] Specifically, the optimal build template defines the native tool chain path, calling parameters and output specification of the target platform to ensure the compatibility of the compilation process and the system environment. Therefore, for each target platform, based on the optimal build template of the target platform, the native build tool chain of the target platform is called to complete the whole process from source code compilation to installation package packaging, and finally generate installation packages adapted to each target platform.

[0050] The embodiment of the application generates installation packages adapted to each target platform by calling the native build tool chain of the target platform based on the optimal build template, which can fully utilize the platform underlying compilation capability and optimization mechanism to ensure that the running performance and compatibility of the installation package in the target environment are optimal.

[0051] In some embodiments, after generating installation packages adapted to each target platform based on the dependency tree and installation package adaptation parameters of the target platforms, the method further comprises: In the plurality of preset test environments, installation verification tests are performed on the installation package adapted to each target platform to generate a compatibility verification report for each preset test environment.

[0052] Specifically, after the installation package adapted to each target platform is generated, the compatibility of the installation package needs to be verified through multi-environment and full-process automatic testing to ensure that the installation package can be normally deployed and run in different hardware configurations, system versions, and runtime environments.

[0053] The embodiment precreates a plurality of preset test environments, such as a Windows environment, a macOS environment, and a Linux environment, to implement compatibility verification on the installation package of the target platform generated above. Each target platform has a preset test environment adapted thereto, and the target platform and the installation package adapted thereto for compatibility verification under each preset test environment are obtained by dividing the target platform according to the preset test environment adapted thereto.

[0054] Further, in each preset test environment, the installation package adapted to the target platform supported by the preset test environment is sampled and installation verification testing is performed to generate a compatibility verification report for each preset test environment. The compatibility verification report integrates the test report of the installation package adapted to the target platform supported by the preset test environment. In addition, installation verification testing can also be performed on a full-sample installation package, and the embodiment takes the sampling installation verification testing as an example.

[0055] Optionally, one installation package adapted to a target platform is extracted from the installation package adapted to the target platform supported by the preset test environment, and installation verification testing is performed in the preset test environment. If the testing is successful, that is, the installation is successful in the preset test environment, it is considered that the generated installation package is correct, and the installation package adapted to the target platform supported by the preset test environment is also correct. If the testing fails, that is, the installation does not react or there is a dependency conflict in the preset test environment, it is considered that the generated installation package has a problem, and the installation package adapted to the target platform needs to be regenerated according to the compatibility problem feedback.

[0056] The embodiment of the present application can discover potential adaptation problems in different environments in an efficient manner in advance by sampling and installation verification of the installation package adapted to each platform in a plurality of preset test environments and generating a compatibility report, significantly reduces the risk of installation failure caused by platform differences, provides a reliable verification basis for the cross-environment stability of the installation package, and effectively balances the test cost and verification efficiency under the premise of ensuring the effectiveness of test coverage.

[0057] In some embodiments, after the compatibility verification report for each preset test environment is generated, each compatibility verification report further includes: If the compatibility verification report describes that the installation package adapted for any target platform has a compatibility problem, an error analysis result of a dependency tree of the target platform is determined based on the compatibility problem; Based on the error analysis result, the installation package adaptation parameters of the target platform in the target description file are optimized; Based on the optimized installation package adaptation parameters of the target platform, the installation package adapted for the target platform is regenerated.

[0058] Specifically, if the compatibility verification report describes that the installation package adapted for a certain target platform has a compatibility problem, the root cause is located through error logs and dependency relationship backtracking based on the compatibility problem, and an error analysis result of a dependency tree of the target platform is determined.

[0059] Further, based on the error analysis result, the installation package adaptation parameters of the target platform in the target description file are optimized, and then based on the optimized installation package adaptation parameters, a dependency tree is generated, and based on the dependency tree and the optimized installation package adaptation parameters, a best build template is generated, and based on the best build template, a native build tool chain is called to compile to generate a newly adapted installation package.

[0060] The embodiment of the application accurately locates the error of the dependency tree of the target platform and optimizes the installation package adaptation parameters through backtracking analysis of the problems in the compatibility verification report, forms a closed-loop mechanism of "testing-feedback-repairing", supports the hot repair mechanism of the build process, effectively improves the self-correction ability of the cross-platform installation package adaptation, significantly reduces the recurrence rate of compatibility problems, and further enhances the adaptability of the unified description file to the multi-platform environment through the dynamic optimization of the adaptation parameters, and finally guarantees the high availability and stability of the software in complex deployment scenarios.

[0061] Through actual testing of the above cross-platform installation package automatic adaptation method, the actual measurement data show that: 1) the build time is reduced by 65% (from an average of 2.1 hours to 45 minutes); 2) the installation success rate is improved to 99%; 3) the dependency conflict resolution efficiency is improved by 8 times; 4) more than 10 system installation packages can be generated at the same time; 5) the configuration code amount is reduced by 90%; 6) 85% of common compatibility problems are automatically repaired. It is especially suitable for mixed operating system deployment scenarios in cloud computing environments, and has been verified in a K8s cluster management system, successfully realizing the generation of a deployment package for a 32-node heterogeneous system with a single configuration.

[0062] The structure of the cross-platform installation package automatic adaptation system provided by the application will be described below. The cross-platform installation package automatic adaptation system described below can be referred to in conjunction with the cross-platform installation package automatic adaptation method described above.

[0063] Refer to Figure 3 , Figure 3is a structural schematic view of the cross-platform installation package automatic adaptation system provided by the application.

[0064] As shown in Figure 3 The cross-platform installation package automatic adaptation system comprises a configuration parser, an environment detector, a dependency manager and an installation package generation module. The configuration parser is configured to obtain a unified description file, wherein the unified description file contains installation package adaptation parameters of each target platform. The environment detector is configured to obtain an operating system fingerprint of each target platform. The dependency manager is configured to match the operating system fingerprint of each target platform and the installation package adaptation parameters to generate a dependency tree of each target platform. The installation package generation module is configured to generate an installation package adapted to each target platform based on the dependency tree of each target platform and the installation package adaptation parameters.

[0065] Further, the installation package generation module further comprises an intelligent adaptation engine, a build executor, a verification module and a feedback optimization module. The configuration parser is further configured to perform syntax tree parsing and semantic checking on the description file to generate a target description file. The intelligent adaptation engine is configured to generate a best build template of each target platform based on the installation package adaptation parameters of each target platform in the target description file and the dependency tree of each target platform. The build executor is configured to call a native build tool chain of each target platform based on the best build template of each target platform to compile and generate an installation package adapted to each target platform. The verification module is configured to perform sampling installation verification testing on an installation package adapted to a target platform supported by each preset test environment in each preset test environment to generate a compatibility verification report of each preset test environment. The feedback optimization module is configured to, for each compatibility verification report, if the compatibility verification report describes that any installation package adapted to a target platform has a compatibility problem, optimize installation package adaptation parameters of the target platform in the target description file based on the compatibility problem, and regenerate an installation package adapted to the target platform based on the optimized installation package adaptation parameters of the target platform.

[0066] The cross-platform installation package automatic adaptation system provided by the application can realize intelligent environment sensing by unified description file centralized management platform specific parameters and shared parameters, combined with dynamically obtained operating system fingerprints, automatically generate a dependency tree of a target platform, replace the traditional manual adaptation script writing mode, greatly reduce the time proportion of the developer in processing multi-platform adaptation, and generate an installation package adapted to each platform through automatic analysis of the installation package adaptation parameters and the dependency tree, eliminate compatibility problems caused by platform differences, and significantly reduce configuration error rates.

[0067] It should be noted that the cross-platform installation package automatic adaptation system provided by the application can execute the cross-platform installation package automatic adaptation method described in any of the above embodiments during specific operation, and the present embodiment will not be described here.

[0068] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the application, and not to limit them; although the application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the application.

Claims

1. A cross-platform installation package automatic adaptation method, characterized in that: The cross-platform installation package automatic adaptation method includes: Obtaining a unified description file and operating system fingerprints of each target platform; the unified description file includes installation package adaptation parameters for each target platform; the installation package adaptation parameters for each target platform include platform-specific parameters and inter-platform shared parameters required when generating the installation package; Generate a dependency tree for each target platform based on the operating system fingerprint and installation package adaptation parameters of each target platform; Generate installation packages adapted to each target platform based on the dependency tree and installation package adaptation parameters of each target platform.

2. The cross-platform installation package automatic adaptation method according to claim 1, characterized in that: After obtaining the unified description file and before matching based on the operating system fingerprint and installation package adaptation parameters of each target platform, it also includes: Performing syntax tree parsing on the unified description file to obtain a syntax tree; Performing semantic verification on the syntax tree to obtain a semantic verification result; Based on the semantic verification result, a target description file is generated.

3. The cross-platform installation package automatic adaptation method according to claim 2, characterized in that: The matching of the operating system fingerprint and the installation package adaptation parameters of each target platform to generate a dependency tree for each target platform includes: Determine the system version and system architecture of each target platform based on the operating system fingerprint of each target platform; Based on the system version and system architecture of each target platform, matching the installation package adaptation parameters of each target platform in the target description file to determine multiple dependency relationships of each target platform; Based on multiple dependency relationships of each target platform, a dependency tree for each target platform is generated.

4. The cross-platform installation package automatic adaptation method according to claim 3, characterized in that: The step of generating an installation package adapted for each target platform based on the dependency tree and installation package adaptation parameters of each target platform includes: Generate a source code package for each target platform based on the dependency tree of each target platform and the installation package adaptation parameters of each target platform in the target description file; Generate the best build template for each target platform based on the source code package and dependency tree of each target platform; Generate installation packages adapted to each target platform based on the optimal build template for each target platform.

5. The cross-platform installation package automatic adaptation method according to claim 4, characterized in that: The generation of installation packages adapted to each target platform based on the optimal construction template for each target platform includes: Based on the optimal build template for each target platform, the native build tool chain of each target platform is called to compile and generate installation packages adapted to each target platform.

6. The cross-platform installation package automatic adaptation method according to claim 1, characterized in that: After generating the installation packages adapted to each target platform based on the dependency tree and installation package adaptation parameters of each target platform, the following steps are also included: In multiple preset test environments, installation verification tests are performed on the installation packages adapted to each target platform, and a compatibility verification report is generated for each preset test environment.

7. The cross-platform installation package automatic adaptation method according to claim 6, characterized in that: The installation verification test is performed on the installation package adapted for each target platform in multiple preset test environments, and a compatibility verification report is generated for each preset test environment, including: In each preset test environment, a sample installation verification test is performed on the installation packages adapted to the target platform supported by the preset test environment, and a compatibility verification report for each preset test environment is generated.

8. The cross-platform installation package automatic adaptation method according to claim 7, characterized in that: After generating a compatibility verification report for each preset test environment, each compatibility verification report also includes: If the compatibility verification report describes that any target platform-adapted installation package has a compatibility problem, then based on the compatibility problem, determine an error analysis result of the dependency tree of the target platform; Based on the error analysis result, optimizing the installation package adaptation parameters of the target platform in the target description file; Based on the optimized installation package adaptation parameters of the target platform, an installation package adapted to the target platform is regenerated.

9. A cross-platform installation package automatic adaptation system, characterized in that: The cross-platform installation package automatic adaptation system includes a configuration parser, an environment detector, a dependency manager and an installation package generation module; The configuration parser is used to obtain a unified description file; the unified description file contains installation package adaptation parameters for each target platform; The environment detector is used to obtain the operating system fingerprint of each target platform; The dependency manager is used to match the operating system fingerprint and installation package adaptation parameters of each target platform to generate a dependency tree for each target platform; The installation package generation module is used to generate an installation package adapted to each target platform based on the dependency tree and installation package adaptation parameters of each target platform.

10. The cross-platform installation package automatic adaptation system according to claim 9, characterized in that: The installation package generation module also includes an intelligent adaptation engine, a build executor, a verification module and a feedback optimization module; The configuration parser is further used to perform syntax tree parsing and semantic verification on the description file to generate a target description file; The intelligent adaptation engine is used to generate the optimal build template for each target platform based on the installation package adaptation parameters of each target platform in the target description file and the dependency tree of each target platform; The build executor is used to call the native build tool chain of each target platform based on the optimal build template of each target platform, and compile and generate an installation package adapted to each target platform; The verification module is used to perform a sample installation verification test on the installation packages adapted to the target platform supported by the preset test environment in each preset test environment, and generate a compatibility verification report for each preset test environment; The feedback optimization module is used to optimize the installation package adaptation parameters of the target platform in the target description file based on each compatibility verification report. If the compatibility verification report describes that there are compatibility issues with the installation package adapted for any target platform, the feedback optimization module is used to regenerate the installation package adapted for the target platform based on the optimized installation package adaptation parameters of the target platform.

Citation Information

Cited By

  • Cross-platform repairing method and system based on large language model

    CN121050770A

  • Laptop software adaptation test method and system applied to multi-platform compatibility

    CN121051029A