Cross-operating-system installation package adaptation method and device, equipment and medium

Through the graph neural network prediction model and hierarchical compilation strategy, the problems of artificial dependency and resource redundancy in cross-operating system adaptation are solved, the intelligent generation and dynamic optimization of installation packages are realized, and the deployment efficiency and user experience are improved.

CN120803478APending Publication Date: 2025-10-17ZHENGZHOU YUNHAI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies have problems in cross-operating system adaptation, such as high manual dependence, high resource consumption, and high development and maintenance costs. In addition, the static adaptation mode is difficult to cope with new system changes, the installation package generation efficiency is low, and there is a lack of dynamic adjustment capabilities based on environmental awareness.

Method used

A compatibility prediction model based on graph neural networks is adopted, combined with a hierarchical compilation strategy and a preset volume optimization algorithm. Through cross-compilation and conditional compilation, optimized installation packages that are adapted to different operating systems and instruction set architectures are generated. The virtualization driver layer is used to realize dynamic detection of hardware information and intelligent generation of installation packages.

Benefits of technology

Reduce manual testing costs and deployment failure risks, improve hardware recognition accuracy and compilation success rate, reduce maintenance and storage costs, and improve installation speed and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803478A_ABST
    Figure CN120803478A_ABST
Patent Text Reader

Abstract

The invention discloses a cross-operating-system installation package adaptation method and device, equipment and a medium, and relates to the technical field of computers, and the method comprises the steps: constructing a compatibility prediction model based on a graph neural network, rapidly predicting the compatibility of a driver and an operating system, and effectively solving the problem of high manual dependency; whether the hardware information hits the drive cache or not is determined according to the prediction result of the compatibility prediction model, and when a new drive or a new system needs to be adapted, the model can also give a corresponding hardware detection result, so that the maintenance cost and the development cost are reduced; the preset hierarchical compiling strategy is executed based on the hardware detection result, so that repeated compiling of bottom layer dependence can be avoided, correct operation of the component under different instruction set architectures and different operating systems is ensured, compiling errors caused by dependence conflicts are reduced, the compiling success rate is increased, and the installation package generation efficiency is further improved. The volume of the installation package is dynamically adjusted by using a volume optimization algorithm, and the technical problem of resource redundancy is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and in particular to a cross-operating system installation package adaptation method and device, equipment and medium. BACKGROUND

[0002] With the development of the operating system technology ecosystem, a variety of mature technical systems have appeared on the market (for example, some mainstream commercial systems and their open source variants). According to industry-related reports, the number of operating system versions that need to be adapted by mainstream products simultaneously exceeds 20, which significantly increases the maintenance cost of a single product installation package; the adaptation period of new systems is as long as 3-6 months; and the failure rate during on-site deployment has increased to 15%-20%.

[0003] The traditional adaptation scheme adopts a "one system, one image, one product" mode, which has significant drawbacks: large manual input, bloated installation package due to the need to include redundant drivers, and lagging updates due to dependence on vendor patches. When software needs to be compatible with multiple different systems used by customers, the maintenance and development costs increase dramatically. Industry research shows that cross-platform deployment is evolving towards containerization abstraction, intelligent driving matching, and automated packaging tools. However, the current related technologies still face challenges: the static adaptation mode has limitations, it is difficult to respond to changes in new systems, installation package generation is inefficient, and there is a lack of dynamic adjustment capabilities based on environmental perception. Therefore, how to provide a solution to the above technical problems is a problem that needs to be solved by those skilled in the art at present. SUMMARY

[0004] The present application provides a cross-operating system installation package adaptation method, device, equipment and medium to at least solve the problems of high manual dependence, high resource occupation and high development and maintenance costs in related technologies.

[0005] In a first aspect, the present application provides a cross-operating system installation package adaptation method, comprising: obtaining hardware information of a target device; outputting a compatibility prediction result corresponding to the target device using a compatibility prediction model created based on a graph neural network; the compatibility prediction model is used to predict the compatibility of the driver with the device operating system; determining whether the hardware information hits the driver cache based on the compatibility prediction result to obtain a corresponding hardware detection result; executing a preset hierarchical compilation strategy based on the hardware detection result, and optimizing the installation package generated by the hierarchical compilation using a preset volume optimization algorithm to generate an optimized installation package adapted to different operating systems and different instruction set architectures; wherein the preset hierarchical compilation strategy is used to adapt different instruction set architectures through cross-compilation and different operating systems through conditional compilation.

[0006] The application further provides a cross-operating system installation package adaptation device, comprising: a hardware information acquisition module configured to acquire hardware information of the target device; a model prediction module configured to output a compatibility prediction result corresponding to the target device by using a compatibility prediction model created based on a graph neural network; the compatibility prediction model is used to predict the compatibility between the driver and the device operating system; a hardware detection module configured to determine whether the hardware information hits the driver cache based on the compatibility prediction result, so as to obtain a corresponding hardware detection result; an adaptation module configured to execute a preset hierarchical compilation strategy based on the hardware detection result, and optimize the installation package generated by the hierarchical compilation by using a preset volume optimization algorithm, so as to generate an optimized installation package adapted to different operating systems and different instruction set architectures; wherein, the preset hierarchical compilation strategy is used to adapt to different instruction set architectures by cross-compilation and adapt to different operating systems by conditional compilation.

[0007] The application further provides an electronic device, comprising: a memory configured to store a computer program; and a processor configured to execute the computer program to implement the steps of any of the above cross-operating system installation package adaptation methods.

[0008] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any of the above cross-operating system installation package adaptation methods.

[0009] The application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the steps of any of the above cross-operating system installation package adaptation methods.

[0010] Beneficial effects: through the present application, firstly, a compatibility prediction model based on a graph neural network is constructed, which can quickly predict the compatibility of the driver and the operating system, reduce the cost of manual testing and the risk of deployment failure, and effectively solve the problem of high manual dependence; secondly, according to the prediction result of the compatibility prediction model, it can be determined whether the hardware information hits the driver cache, without repeating the complex compatibility detection and compilation process, and when there is a new driver or a new system to be adapted, the compatibility prediction model can also give the corresponding hardware detection result, improving the deployment response speed and hardware recognition accuracy, reducing the maintenance cost and development cost; finally, based on the hardware detection result, a preset hierarchical compilation strategy is executed, which can avoid repeated compilation of bottom-layer dependencies, ensure the correct operation of components under different instruction set architectures and different operating systems, reduce compilation errors caused by dependency conflicts, improve the compilation success rate compared with the traditional one-time compilation method, further improve the installation package generation efficiency, and when facing diversified instruction set architectures and operating system environments, there is no need to develop an adaptation scheme for each combination. In addition, the preset volume optimization algorithm is used to dynamically adjust the installation package volume, which reduces the installation package volume under the premise of ensuring the integrity of the function, solves the technical problem of resource redundancy, reduces the storage cost and network transmission bandwidth demand of the installation package, and also speeds up the installation speed and improves the user experience. BRIEF DESCRIPTION OF DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creating any creative labor.

[0012] Figure 1 A cross-operating system installation package adaptation method flow chart disclosed by the present application; Figure 2 A hardware detection flowchart disclosed by the present application; Figure 3 A compatibility prediction model structure diagram disclosed by the present application; Figure 4 A scheme effect comparison diagram disclosed by the present application; Figure 5 A cross-operating system installation package adaptation device structure diagram disclosed by the present application. DETAILED DESCRIPTION

[0013] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all embodiments of the present application. Based on the embodiments of the present application, any person skilled in the art can obtain all other embodiments without creative work, which shall fall into the protection scope of the present application.

[0014] It should be noted that, in the description of the present application, the terms "comprise", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0015] Currently, the adaptation scheme of product installation package for different operating system versions adopts a "one system, one image, one product" mode, which has the following defects: ①High dependence on manual work: a driver compatibility layer needs to be written separately for each system version; ②Resource redundancy: the installation package needs to include all possible driver modules, with a volume expansion of 5-8 times; ③Update lag: after the release of a new system, the manufacturer needs to provide an adaptation patch.

[0016] For example, customer A uses system A and customer B uses system B, so the product needs to be compatible with these two systems. In this case, as the number of customers increases, a product needs to continuously adapt to multiple operating systems, greatly increasing the maintenance and development costs.

[0017] According to the current industry technology evolution trend, industry research reports point out that cross-platform deployment technology presents three major development directions: ①The application rate of containerized hardware abstraction layer increases by 47% annually; ②The penetration rate of intelligent driver matching technology reaches 68%; ③The market size of automatic installation package generation tools breaks through 1.2 billion. However, under this trend, related technologies still face challenges: ①Limitations of static adaptation mode: firstly, the traditional scheme uses pre-installed driver libraries, which cannot synchronize kernel changes of newly released systems in real time, resulting in lag in updating the compatibility database; secondly, there are multiple dependency problems, for example, when there are version differences in the base library of the target system, manual intervention is needed to solve the dependency conflict; thirdly, loading multiple driver modules at the same time leads to high resource occupation, with an increase of 30% to 50% in memory occupation; Installation package generation efficiency issues: First, insufficient isolation of the compilation environment easily leads to environmental variable contamination during cross-compilation. Second, current tools have package format conversion defects when converting between RPM and DEB (two software package formats in Linux systems), resulting in the loss of more than 40% of metadata. Third, cross-system packaging leads to digital certificate verification anomalies, resulting in signature verification failures. ③ Lack of dynamic adaptation during the deployment phase: First, the traditional solution's recognition accuracy for heterogeneous computing architectures is less than 60%, resulting in a low hardware recognition rate. Second, there is a lack of real-time configuration and runtime environment awareness, making it impossible to dynamically adjust IO (Input / Output) scheduling strategies. Third, the rollback mechanism is imperfect, and a failed deployment cannot automatically recover to a safe state.

[0018] To this end, this application provides a cross-operating system installation package adaptation solution that eliminates driver compatibility issues caused by operating system differences, enables intelligent generation and dynamic optimization of installation packages, and adaptively perceives the current system's hardware and configuration environment. To help those skilled in the art better understand this application solution, the following is a further detailed description of this application in conjunction with the accompanying drawings and specific implementation methods.

[0019] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the cross-operating system installation package adaptation method depends, the specific application environment architecture or specific hardware architecture is described herein.

[0020] The embodiment of the present application provides a cross-operating system installation package adaptation method. In conjunction with the execution process of the cross-operating system installation package adaptation method, see Figure 1 As shown, the method is described in detail, and the method includes: Step S11: Obtain hardware information of the target device.

[0021] To ensure that installation packages can run across operating systems, unify configurations, and adapt middleware, it is necessary to address compatibility between different instruction set architectures within the same operating system, and between different operating systems within the same instruction set architecture. The instruction set architecture is the "interface" between the processor and software, defining the processor's executable instruction set, data types, register configuration, and other aspects. It determines how the hardware parses and executes instructions.

[0022] In an embodiment of the present application, hardware information of the target device is first obtained. The hardware information may be a target operating system of the target device under a current instruction set architecture, or a target instruction set architecture corresponding to the target device under the current operating system is determined.

[0023] Step S12: Output the compatibility prediction result corresponding to the target device by using the compatibility prediction model created based on the graph neural network.

[0024] In the embodiments of the present application, a compatibility prediction model is constructed in advance based on a graph neural network (GNN). The GNN is a deep learning model specially processing graph structure data, which is good at capturing information and dependency relationships transmitted between nodes through edges.

[0025] In the embodiments of the present application, the compatibility prediction model is a graph structure model representing the relationship between a driver, an operating system (OS) and hardware. By using the information transmission mechanism of the GNN, the deep-level interaction mode and implicit rules between the driver, the operating system and the hardware features and generated through the dependency relationship can be automatically learned, so as to predict whether a certain driver can work normally on a target operating system, thereby solving the problem of driver compatibility prediction.

[0026] After obtaining the hardware information of the target device, the compatibility prediction model created based on the graph neural network is used to output the compatibility probability of the target device under the target operating system or the target instruction set architecture, so as to obtain the corresponding compatibility prediction result.

[0027] Step S13: Determine whether the hardware information hits the driver cache based on the compatibility prediction result, to obtain the corresponding hardware detection result.

[0028] In the embodiments of the present application, by constructing an adaptive runtime virtualization driver layer, it is determined whether the hardware information hits the driver cache based on the compatibility prediction result, to obtain two hardware detection results of hit or miss. Then, according to the hardware detection result, an installation package adapted to the target operating system is adaptively generated.

[0029] It should be noted that if the hardware detection result indicates a hit, it means that based on the compatibility prediction model, an installation package corresponding to the target operating system can be generated and adapted according to the hit driver; if the hardware detection result indicates a miss, the current hardware information can also be added to the model node for learning and reasoning based on the compatibility prediction model, and then a corresponding installation package is generated to synchronize new releases in real time.

[0030] Step S14: Execute a preset hierarchical compilation strategy based on the hardware detection result, and optimize the installation package generated by the hierarchical compilation by using a preset volume optimization algorithm, to generate optimized installation packages adapted to different operating systems and different instruction set architectures; wherein the preset hierarchical compilation strategy is used to adapt to different instruction set architectures through cross-compilation and to adapt to different operating systems through conditional compilation.

[0031] In the embodiments of the present application, if the hardware detection result indicates that the hardware information hits the driver cache, a preset hierarchical compilation strategy is further executed to compile the hit driver to generate an adaptive installation package. Meanwhile, in order to realize dynamic optimization of the installation package and avoid high resource occupation, a preset volume optimization algorithm is used to optimize the volume of the installation package generated by the compilation, and finally an optimized installation package adaptive to different operating systems and different instruction set architectures is generated.

[0032] The hierarchical compilation strategy can identify the dependency relationship between dependencies, and through cross-compilation and conditional compilation, an installation package for a target environment is generated, wherein the target environment is a combination scenario covering different OS and instruction set architectures. The core purpose of the hierarchical compilation strategy is to build a hierarchical compilation architecture, systematically sort out and manage the dependency relationship in the compilation process, avoid repeated compilation and dependency conflicts, improve the compilation efficiency and stability, and thus efficiently generate a compilation product adaptive to different operating systems and architectures.

[0033] The above-mentioned compilation process is also based on the virtualized driver layer built. In the embodiments of the present application, a containerized hardware abstraction interface is designed for the virtualized driver layer. Specifically, different physical devices are mapped to different virtual interfaces and corresponding compatible modes are set to create a virtual device mapping table; the compatible mode is used to convert the native instruction set or application program interface of the physical device into the instruction set or application program interface supported by the current environment. In this way, in the process of executing the compilation to generate the installation package, the operation request of the target device is redirected to the virtual interface and the conversion of the compatible mode is executed according to the virtual device mapping table. In this way, the conversion of the physical device under different compatible modes can be realized through the virtual interface mapping, and the process of generating the installation package by the driver compilation can be realized by calling the hardware abstraction interface according to the virtual device mapping table.

[0034] Table 1 is an exemplary virtual device mapping table. For example, a physical device (such as an NVIDIA GPU) is mapped to a virtual interface (such as / dev / vgpu0), and a compatible mode (such as CUDA→OpenCL conversion) is set. The core purpose is to realize the virtualization and cross-platform compatibility of GPU (Graphics Processing Unit, graphics processor) resources. This mapping mechanism allows the shared computing power of a physical GPU to run with different programming interfaces (such as CUDA or OpenCL).

[0035] Table 1 Virtual device mapping table

[0036]

[0037] In the embodiments of the present application, cross-compilation can be based on a virtual device mapping table to solve the differences between different instruction set architectures and implement adaptation of different instruction set architectures. Multi-format parallel compilation is performed for different combinations of operating systems and instruction set architectures, environment isolation is performed using container technology through multi-dimensional technical means to avoid environmental interference. Then, an installation package for a specified operating system is generated through conditional compilation injection to implement operating system-level adaptation.

[0038] Beneficial effects: Through the present application, first, a compatibility prediction model based on a graph neural network is constructed, which can quickly predict the compatibility of drivers and operating systems, reduce the cost of manual testing and the risk of deployment failure, and effectively solve the problem of high manual dependence; second, according to the prediction result of the compatibility prediction model, it can be determined whether the hardware information hits the driver cache, without the need to repeatedly perform complex compatibility detection and compilation processes, and when new drivers or new systems need to be adapted, the compatibility prediction model can also give the corresponding hardware detection result, improving the deployment response speed and hardware recognition accuracy, reducing maintenance and development costs; finally, based on the hardware detection result, a preset hierarchical compilation strategy is executed, which can avoid repeated compilation of underlying dependencies, ensure the correct operation of components under different instruction set architectures and different operating systems, reduce compilation errors caused by dependency conflicts, improve the compilation success rate compared to the traditional one-time compilation method, further improve the installation package generation efficiency, and when facing diversified instruction set architectures and operating system environments, there is no need to develop an adaptation scheme for each combination. In addition, the preset volume optimization algorithm is used to dynamically adjust the installation package volume, which reduces the installation package volume under the premise of ensuring the integrity of the function, solves the technical problem of resource redundancy, reduces the storage cost and network transmission bandwidth demand of the installation package, and also speeds up the installation speed and improves the user experience.

[0039] Based on the above embodiments, in a feasible implementation, in order to ensure the integrity and security of the installation package, prevent it from being tampered with during transmission and use, realize intelligent generation and dynamic optimization of the installation package, and reduce maintenance costs and adaptation cycles, the present application verifies the hash value after the hardware information hits the driver cache. Specifically, the following steps can also be included: When the hardware detection result indicates that the hardware information hits the driver cache, the hit driver is determined and signature verification is performed on the hit driver; If the hit driver passes the signature verification, the hit driver is loaded and a preset hierarchical compilation strategy is executed to compile the hit driver; If the hit driver does not pass the signature verification, the hit driver is rolled back to a safe mode to automatically restore the stable working state of the driver within the target time period.

[0040] In combination with Figure 2As shown, in an embodiment of the present application, a digital signature is added to the driver in the driver cache to ensure the security and credibility of the generated installation package on each operating system. In response to the hardware detection operation, the driver cache hit status is queried. If the cache hits, the driver signature is verified. After the verification passes, the baseline module is loaded. This module has been verified and tested in the system. It is a module or component that can run stably, has high reliability and security, and is the basis for the normal operation of the system. If the signature verification fails, it rolls back to safe mode and automatically recovers to the most recent stable working driver state to prevent unauthorized drivers from posing a threat to the system and ensure system availability.

[0041] The following is an example of a dynamic loading mechanism that executes the environment monitoring process at runtime: mermaid graph TD A[Start detection program] --> B[Detect CPU architecture] B -->|x86_64| C[Load Intel optimized driver] B -->|ARMv8| D[Load Kunpeng compatibility layer] C / D --> E[Verify driver signature] E --> F[Inject container runtime].

[0042] In another feasible implementation manner, when the hardware detection result indicates that the hardware information does not hit the driver cache, the following steps may also be included: Triggering the active learning mechanism to generate a candidate drive set; Perform sandbox testing on the candidate driver set and perform grayscale release after sandbox testing.

[0043] In the embodiment of the present application, if the cache misses, it may indicate that new hardware is connected for the first time, which means that a new driver or a new system needs to be adapted, triggering the active learning mechanism to generate a candidate driver set. Specifically, the hardware information is used to generate an incremental training data set, and the incremental training data set is used to incrementally train the compatibility prediction model to generate a candidate driver set.

[0044] By retaining the original model parameter weights, incremental training is performed based on the GNN model, the message passing mechanism of the GNN model is used to update the graph node embedding, and the Top-K candidate driver set is output based on node similarity calculation.

[0045] Further, the candidate driver set is subjected to sandbox testing, which is a method of testing software or systems in an isolated environment. In the sandbox environment, various usage scenarios and conditions can be simulated to comprehensively test the software or system without affecting the actual production environment. Finally, through gray release, the new version is gradually pushed to part of the users, feedback and opinions are collected, and the new version is optimized and improved to ensure the stability and reliability of the new version.

[0046] Based on the foregoing embodiments, the present embodiment will specifically describe the construction process of the compatibility prediction model. The construction of the compatibility prediction model can include the following steps: Obtain multi-source heterogeneous data and use the multi-source heterogeneous data to construct a training data set; Use a deduplication algorithm to clean the training data set, and use a fuzzy algorithm to generate corresponding fingerprint features from the training data set after data cleaning; Take the fingerprint features as input, and construct a graph structure model representing the relationship between the driver, the operating system and the hardware; the graph structure model includes driver nodes, operating system nodes and hardware nodes, as well as edges representing compatibility between nodes and edges representing dependency between nodes; Train the graph structure model based on a graph neural network to obtain a compatibility prediction model for predicting compatibility between drivers and device operating systems.

[0047] Multi-source heterogeneous data is data from multiple different sources. In the embodiments of the present application, multi-source heterogeneous data is generated by expanding data sources to provide strong support for model prediction. For example, the related technical ecological development committee records a plurality of manufacturers' driver warehouse, adds the SDK (Software Development Kit) log of the mainstream equipment manufacturer in the market, and adds the driver project in the open source community. After data collection, a training data set is constructed using multi-source heterogeneous data.

[0048] Further, a deduplication algorithm is used to clean the training data set, which mainly aims to identify and remove duplicate records in the data. During data collection, due to the diversity of data sources and different collection methods, duplicate data is prone to occur. Therefore, using a deduplication algorithm can eliminate duplicate data, ensure the uniqueness and consistency of the data, improve the data quality, reduce redundancy, and ensure the accuracy of subsequent analysis as follows: def test(tokens): v = [0]*128 for t in tokens: h = mmh3.hash(t, seed=i) % 128 if h < 64: v[h] += 1 else: v[h] -= 1 fingerprint = sum(1 << (127 - i) for i, bit in enumerate(v) if bit >0) return fingerprint.

[0049] Then, the training data set after data cleaning is generated into corresponding fingerprint features by using the fuzzy algorithm. After processing the data by the fuzzy algorithm, a representative feature representation can be generated for subsequent identification or classification, and the robustness and adaptability of the data can also be enhanced. For example, the fuzzy algorithm is used to generate the driver fingerprint as follows: V=[ KernelVersion,GLIBCVER,DriverAPI,InstructionSet ] def generate_fingerprint(driver): ssdeep = pydeep.hash_file(driver) return ssdeep.split(':')。

[0050] In the embodiments of the present application, the compatibility prediction model can predict whether a specific driver (Driver) can work normally in a specific target operating system (OS) environment and a specific hardware (Hardware). First, the graph is constructed, and based on the graph neural network, the model defines three core entities as nodes, that is, three node types, including a Driver Node (driver node), representing a specific device driver; an OS Node (operating system node), representing a specific operating system environment; and a Hardware Node (hardware node), representing a specific physical hardware device. Secondly, the relationship between the nodes is defined by two types of edges. The Compatibility Edge (compatibility relationship edge) connects the Driver Node and the OS Node, and the information carried by this edge is the historical record or the predicted compatibility state (compatible / incompatible / conditionally compatible); the Dependency Edge (dependency relationship edge) connects the Driver Node and the OS Node (may also be connected to other Driver Nodes or Hardware Nodes), and this edge represents the dependency relationship of the driver to the operating system environment (or hardware).

[0051] For example, as shown below, a graph neural network (GNN) is used to model the driver-system relationship: CompatibilityScore=GNN(DriverNode,OSNode,EdgeFeature) def message_passing(node_features, edge_embeddings): aggregated = scatter_mean(edge_embeddings, edge_indices, dim=0) updated = F.relu(self.fc(node_features + aggregated)) return updated.

[0052] It should be pointed out that the model deployment process also includes collecting historical adaptation records during the deployment process, such as information such as the successful deployment of the driver in the actual system or compatibility issues. The historical adaptation record is a record of each incremental code when debugging the model. The full code generated after each modification is collected and added to the training dataset of the compatibility prediction model to trigger model retraining to optimize the prediction accuracy of the compatibility prediction model. As the deployment scale expands, a positive cycle is formed: more use - more accurate prediction - higher adaptation efficiency. The following is an example of expanding the dataset through adversarial sample generation technology: from cleverhans.attacks import FastGradientMethod adv_driver = fgsm_attack(original_driver, eps=0.3).

[0053] like Figure 3The illustrated shows a graph neural network (GNN) based model architecture for handling compatibility and risk assessment problems between hardware, drivers, and operating systems (OS). The model is divided into an input layer, a GNN layer, and an output layer. The input layer includes hardware feature vectors (model / architecture), driver metadata (API call chains), and OS environment fingerprints (kernel version). These input data are processed through the GNN layer, which uses heterogeneous graph convolution, with node types including Driver, OS, and Hardware. In the GNN layer, an attention mechanism is used to calculate edge weights (compatibility probabilities), allowing the model to assign different weights to different neighbor nodes during information aggregation, enhancing the model's expressive power. Aggregation functions are used for message passing, allowing the model to learn complex relationships and structural features in the graph structure through information passing and aggregation between nodes. Finally, the output layer provides compatibility probabilities (0-1 confidence) and risk labels (high / medium / low).

[0054] Based on the foregoing embodiment, the present embodiment will specifically describe step S14 in the foregoing embodiment. Among them, the hierarchical compilation strategy systematically combs the dependency relationship by constructing a three-level architecture of the basic layer, the middleware layer and the application layer, and ensures that the compilation process is orderly. The process of executing the preset hierarchical compilation strategy based on the hardware detection result can include the following steps: determining a target operating system corresponding to the target device based on the hardware detection result; generating a general binary file through basic layer compilation, and performing middleware layer compilation on the binary file based on a container to build an independent cross-compilation environment to adapt to different instruction set architectures; performing conditional compilation on the compilation product of the middleware layer compilation to package the compilation product of the middleware layer compilation into an installation package in a format recognizable by the target operating system.

[0055] In the embodiment of the present application, the basic layer compilation focuses on generating a general binary file and compiling core dependent libraries. By specifying the installation path, the script dynamically adapts the system parameters, lays a foundation for upper layer compilation, and avoids repeated compilation of bottom layer dependencies. The following example provides compilation and installation of components and middleware. The following is part of the core process: mv / usr / bin / openssl / usr / bin / openssl.old mv / usr / lib64 / libssl.so.1.1 / usr / lib64 / libssl.so.1.1.old mv / usr / lib64 / libcrypto.so.1.1 / usr / lib64 / libcrypto.so.1.1.old mv / usr / bin / openssl.old / usr / bin / openssl mv / usr / lib64 / libssl.so.1.1.old / usr / lib64 / libssl.so.1.1 mv / usr / lib64 / libcrypto.so.1.1.old / usr / lib64 / libcrypto.so.1.1 . / config --prefix= / opt / manage / lib / openssl \ --openssldir= / opt / manage / lib / openssl \ shared zlib make -j$(nproc) && make install echo " / opt / manage / lib / openssl / lib" > / etc / ld.so.conf.d / openssl-1.1.1w.conf ldconfig -v ln -sf / opt / manage / lib / openssl / bin / openssl / usr / bin / openssl ln -sf / opt / manage / lib / openssl / lib / libssl.so.1.1 / usr / lib64 / libssl.so.1.1 ln -sf / opt / manage / lib / openssl / lib / libcrypto.so.1.1 / usr / lib64 / libcrypto.so.1.1 ldd / opt / manage / lib / openssl / bin / openssl | grep "libssl\|libcrypto" . / configure --prefix= / opt / manage / lib / python \ --enable-shared \ --enable-optimizations \ CFLAGS="-fPIC" make -j $(nproc) sudo make install echo " / opt / manage / lib / python / lib" > / etc / ld.so.conf.d / python-3.8.20.conf ldconfig -v . / configure \ --prefix= / opt / manage / pgsql \ --without-icu --without-readline --without-zlib \ --host=arm-linux make -j$(nproc) make install userdel -r pgsql groupadd pgsql useradd -g pgsql pgsql echo -e "Manage1!\nManage1!\n" | passwd pgsql usermod -aG wheel pgsql export PGPORT=5432 export PGDATA= / opt / manage / pgsql / data export PGHOME= / opt / manage / pgsql export LD_LIBRARY_PATH=$PGHOME / lib:$LD_LIBRARY_PATH export PATH=$PGHOME / bin:$PATH: export PGHOST=$PGDATA export PGUSER=pgsql export PGDATABASE=postgres ###根据实际需要执行 export OPENSSL_ROOT_DIR= / opt / manage / lib / openssl export CPATH=$OPENSSL_ROOT_DIR / include:$CPATH export LIBRARY_PATH=$OPENSSL_ROOT_DIR / lib:$LIBRARY_PATH source / etc / profile mkdir -p / opt / manage / pgsql / data / chown -R pgsql:pgsql / opt / manage / pgsql su - pgsql -c ' / opt / manage / pgsql / bin / initdb -D / opt / manage / pgsql / data-U pgsql' sed -i's%^#listen_addresses =.*%listen_addresses = '\''*'\''%' / opt / manage / pgsql / data / postgresql.conf sed -i's%^#port =.*%port = 5432%' / opt / manage / pgsql / data / postgresql.conf sed -i's%^#unix_socket_directories =.*%unix_socket_directories ='\'' / opt / manage / pgsql / data'\''%' / opt / manage / pgsql / data / postgresql.conf sed -i's%^#logging_collector =.*%logging_collector = on%' / opt / manage / pgsql / data / postgresql.conf sed -i's%^#log_directory =.*%log_directory = '\''log'\''%' / opt / manage / pgsql / data / postgresql.conf sed -i's%^#log_filename =.*%log_filename = '\''postgresql.log'\''%' / opt / manage / pgsql / data / postgresql.conf sed -i's%^#log_truncate_on_rotation =.*%log_truncate_on_rotation =on%' / opt / manage / pgsql / data / postgresql.conf sed -i's%^host all all 127.*%host all all 0.0.0.0 / 0 trust%' / opt / manage / pgsql / data / pg_hba.conf ln -sf / opt / manage / pgsql / bin / psql / usr / bin / psql ln -sf / opt / manage / pgsql / bin / pg_dump / usr / bin / pg_dump ln -sf / opt / manage / pgsql / bin / pg_restore / usr / bin / pg_restore ln -sf / opt / manage / pgsql / bin / postgres / usr / bin / postgres vim / usr / lib / systemd / system / pgsql.service [Unit] Description=PostgreSQL database server Documentation=man:postgres After=network.target [Service] Type=forking User=pgsql Group=pgsql Environment=PGPORT=5432 Environment=PGDATA= / opt / manage / pgsql / data OOMScoreAdjust=-1000 ExecStart= / opt / manage / pgsql / bin / pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300 ExecStop= / opt / manage / pgsql / bin / pg_ctl stop -D ${PGDATA} -s -m fast ExecReload= / opt / manage / pgsql / bin / pg_ctl reload -D ${PGDATA} -s KillMode=mixed KillSignal=SIGINT TimeoutSec=0 [Install] WantedBy=multi-user.target systemctl daemon-reload systemctl start pgsql #创建用户 psql -h / opt / manage / pgsql / data / -c "CREATE USER inmanagedba WITHPASSWORD 'Manage1\!';" psql -h / opt / manage / pgsql / data / -c "CREATE DATABASE inmanagedb;" psql -h / opt / manage / pgsql / data / -c "GRANT ALL PRIVILEGES ON DATABASEinmanagedb to inmanagedba;" psql -h / opt / manage / pgsql / data / -c "GRANT ALL PRIVILEGES ON ALLTABLES IN SCHEMA public to inmanagedba;" psql -h / opt / manage / pgsql / data / -c "ALTER USER inmanagedbaSuperuser;" systemctl stop pgsql #编译Tesseract / Leptonica依赖库(libjpeg、libpng、libtiff、zlib、libwebp)的完整编译方案 mkdir -p / opt / manage / lib / tesseract export TESSERACT= / opt / manage / lib / tesseract export PATH=$TESSERACT / bin:$PATH export LD_LIBRARY_PATH=$TESSERACT / lib:$LD_LIBRARY_PATH export PKG_CONFIG_PATH=$TESSERACT / lib / pkgconfig:$PKG_CONFIG_PATH tar -zxvf zlib-1.3.1.tar.gz . / configure --prefix=$TESSERACT make -j$(nproc) && make install tar -zxvf jpegsrc.v9f.tar.gz . / configure --prefix=$TESSERACT --enable-shared make -j$(nproc) && make install export CPPFLAGS="-I / opt / manage / lib / tesseract / include" export LDFLAGS="-L / opt / manage / lib / tesseract / lib" tar -zxvf libpng-1.6.47.tar.gz . / configure --prefix=$TESSERACT --with-zlib-prefix=$TESSERACT make -j$(nproc) && make install tar -zxvf tiff-4.5.1.tar.gz . / configure --prefix=$TESSERACT --with-jpeg-include-dir=$TESSERACT / include --with-jpeg-lib-dir=$TESSERACT / lib make -j$(nproc) && make install yum remove cmake -y yum install -y gcc gcc-c++ make openssl-devel wget https: / / cmake.org / files / v3.7 / cmake-3.7.2.tar.gz tar -zxvf cmake-3.7.2.tar.gz && cd cmake-3.7.2 . / bootstrap # Generate Makefile. If an error occurs, check whether the dependencies are complete. make -j$(nproc) && make install ln -s / usr / local / bin / cmake / usr / bin / cmake # Create a symbolic link to overwrite the old version path hash -r # Refresh Shell cache [3](@ref) cmake --version #Verify that the version should be 3.7.2 tar -zxvf libwebp-1.3.2.tar.gz mkdir build && cd build cmake \ -DCMAKE_INSTALL_PREFIX= / opt / manage / lib / tesseract \ -DCMAKE_INSTALL_LIBDIR=lib \ -DBUILD_SHARED_LIBS=ON .. make -j$(nproc) && make install # Check if the library file is generated ls $TESSERACT / lib | grep -E 'libjpeg|libpng|libtiff|libwebp|libz' ldd $TESSERACT / lib / libpng16.so | grep 'not found' tar -zxvf leptonica-1.79.0.tar.gz . / configure --prefix=$TESSERACT --with-zlib=$TESSERACT --with-jpeg=$TESSERACT --with-libwebp=$TESSERACT --with-libtiff=$TESSERACT make -j$(nproc) && make install # Verify Leptonica version pkg-config --modversion lept tar -zxvf tesseract-4.0.0.tar.gz sh autogen.sh . / configure --prefix=$TESSERACT --with-extra-libraries=$TESSERACT / lib make -j$(nproc) && make install #fontconfig mkdir -p / opt / manage / lib / fontconfig export FONTCONFIG= / opt / manage / lib / fontconfig tar -xvf libxml2-2.11.5.tar.xz . / configure --prefix=$FONTCONFIG --without-python make && make install tar -zxvf freetype-2.10.4.tar.gz . / configure --prefix=$FONTCONFIG --with-zlib=no --with-png=no make && make install tar -zxvf fontconfig-2.14.2.tar.gz . / configure \ --prefix=$FONTCONFIG \ --enable-libxml2 \ --with-default-fonts= / usr / share / fonts \ --with-freetype-config=$FONTCONFIG / bin / freetype-config \ --with-expat=no \ PKG_CONFIG_PATH=$FONTCONFIG / lib / pkgconfig make && make install ldd $FONTCONFIG / bin / fc-scan | grep libfontconfig。

[0056] Further, based on the base layer output, the middleware layer is compiled, a separate cross-compilation environment is built based on the Docker container, a dedicated image is corresponded to each architecture / system, binary files are compiled to ensure the correct compilation and running of the middleware under each architecture, and different instruction set architectures are adapted.

[0057] Finally, the compilation product of the middleware layer compilation is conditionally compiled by using the application layer, which can integrate the business logic components and the lower layer compilation results, complete the generation of the final compilation product, and encapsulate the installation package in the format recognizable by the target operating system.

[0058] For example, the following is an example of adding cross-compilation optimization in the process of adopting the hierarchical compilation strategy. According to the requirements of the target operating system and architecture, the cross-compilation optimization selects the compilation parameters and dependencies in combination with the hierarchical products of hierarchical compilation, and generates compilation products adapted to specific combinations: ifeq ($(OS),linux) CFLAGS += -march=$(ARCH) -mtune=$(CPU) LDFLAGS += -Wl,-rpath-link=$(SYSROOT) / lib Endif。

[0059] For example, the component package or product package is encapsulated into an rpm format to realize compatibility with the operating system. The following is a core encapsulation display of the rpm installation package: rpmbuild -bb \ --define "_topdir %{getenv:HOME} / rpmbuild" \ --clean \ --rmsource \ ~ / rpmbuild / SPECS / manage.spec.

[0060] In one feasible implementation, a design monitoring module can be added during the driver compilation process using a hierarchical compilation strategy to sense the current system load, hardware status, and other factors, and dynamically adjust the behavior of the virtual layer (such as I / O scheduling) to optimize performance. Furthermore, this technical solution demonstrates significant expansion potential and foresight in multiple fields. For example, in the military industry, targeted optimization of military real-time operating systems (RTOSs) such as the Adaptable Road System (ADAS) can meet the stringent requirements of high reliability and strong security, providing technical support for cross-platform collaboration and rapid deployment of military equipment. In IoT scenarios, it can further enable lightweight adaptation of embedded operating systems such as OpenHarmony, addressing compatibility issues for resource-constrained devices and promoting the efficient construction of an IoE ecosystem. Looking ahead, with the development of quantum computing technology, this solution can explore cross-platform adaptation methods in quantum computing environments, overcome the adaptation barriers between quantum operating systems and traditional computing architectures, promote the popularization and implementation of quantum computing applications, and continue to lead the innovative development of cross-operating system adaptation technology.

[0061] In the embodiment of the present application, after a preset hierarchical compilation strategy is used to compile the driver to generate a corresponding installation package, a preset volume optimization algorithm is used to optimize the installation package generated by the hierarchical compilation to generate an optimized installation package adapted to different operating systems and different instruction set architectures. Specifically, the following steps are included: Load drivers based on hardware detection results and determine the number of drivers required by the target operating system; Determine the original installation package volume corresponding to the installation package generated by hierarchical compilation, and based on the original installation package volume and the number of drivers, use the preset installation package volume compression formula to optimize the volume of the installation package generated by hierarchical compilation to generate optimized installation packages adapted to different operating systems and different instruction set architectures.

[0062] In the embodiment of the present application, the driver is loaded according to the hardware detection result, and the number of drivers used by the target operating system to be loaded is determined; then the volume of the generated installation package is optimized using a preset installation package volume compression formula, which is: ;in: is the volume after optimization; is the original volume; The number of drivers that need to be loaded for the target operating system.

[0063] For example, Figure 4The scheme effect comparison chart realized after application of the above technical solution. Table 2 is the scheme effect comparison data realized after application of the above technical solution.

[0064] Table 2 Effect data comparison

[0065]

[0066] It should be pointed out that on the basis of generating the installation package, the optimized installation package can be punched into the dependent library to realize the packaging of ISO format, realize the system production, and finally generate the deployable system image. The following is a packaging diagram: rm -rf repodata createrepo -g comps.xml. / genisoimage -V "Kylin-Server-10" -o Kylin-Server-V10-Custom.iso -input-charset utf-8 -J -R -c isolinux / boot.cat -b isolinux / isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images / efiboot.img -no-emul-boot / ISO.

[0067] For example, as shown in Table 3, the present scheme also provides a comparison of technical indicators after application of the present scheme: Table 3 Comparison of technical indicators Further, the following two application scenarios are provided: Scenario one: mixed deployment of operating system technology ecological environment: in the heterogeneous data center of Kunpeng 920 (ARMv8) and Intel Xeon (x86_64) existing at the same time, add a secure boot process: A, TPM (Trusted Platform Module, Trusted Platform Module) chip reads hardware fingerprint, automatically identifies hardware architecture and loads corresponding driver; B, verify system integrity through SM2 algorithm, dynamically generate standard installation package; C, dynamically load standard encryption driver, deployment time is shortened from 8 hours to 22 minutes; As shown in Table 4 is the technical index comparison of scenario one: Table 4 Technical index comparison of scenario one Scenario two: emergency system migration: when the customer on-site operating system emergency switching: automatically detect kernel differences (for example, 3.10→4.19), dynamically load kernel compatibility layer, encryption uses SM4 algorithm, and generate an installation package that meets the requirements of the security protection: try: deploy_package(target_os) except KernelPanicError as e: rollback_to_snapshot(snapshot_id) send_alert_email("Deployment Failed", str(e))。

[0068] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment.

[0069] The embodiments of the present application also provide a cross-operating system installation package adaptation device, which is shown in Figure 5 The device comprises: A hardware information acquisition module 11 is configured to acquire hardware information of a target device. A model prediction module 12 is configured to output a compatibility prediction result corresponding to the target device by using a compatibility prediction model created based on a graph neural network; the compatibility prediction model is used to predict the compatibility of a driver with a device operating system. A hardware detection module 13 is configured to determine whether the hardware information hits a driver cache based on the compatibility prediction result, so as to obtain a corresponding hardware detection result. An adaptation module 14 is configured to execute a preset hierarchical compilation strategy based on the hardware detection result, and optimize an installation package generated by the hierarchical compilation by using a preset volume optimization algorithm, so as to generate an optimized installation package adapted to different operating systems and different instruction set architectures. The preset hierarchical compilation strategy is used to adapt to different instruction set architectures by cross-compiling and adapt to different operating systems by conditional compiling.

[0070] The features of the embodiments corresponding to the cross-operating system installation package adaptation device can be referred to the related descriptions of the embodiments corresponding to the cross-operating system installation package adaptation method, which will not be repeated here.

[0071] Beneficial effects: through the present application, firstly, a compatibility prediction model based on a graph neural network is constructed, which can quickly predict the compatibility of the driver and the operating system, reduce the cost of manual testing and the risk of deployment failure, and effectively solve the problem of high manual dependence; secondly, according to the prediction result of the compatibility prediction model, it can be determined whether the hardware information hits the driver cache, without repeating the complex compatibility detection and compilation process, and when there is a new driver or a new system to be adapted, the compatibility prediction model can also give the corresponding hardware detection result, improving the deployment response speed and hardware recognition accuracy, reducing the maintenance cost and development cost; finally, based on the hardware detection result, a preset hierarchical compilation strategy is executed, which can avoid repeated compilation of bottom-layer dependencies, ensure the correct operation of components under different instruction set architectures and different operating systems, reduce compilation errors caused by dependency conflicts, improve the compilation success rate compared with the traditional one-time compilation method, further improve the installation package generation efficiency, and when facing diversified instruction set architectures and operating system environments, there is no need to develop an adaptation scheme for each combination. In addition, the preset volume optimization algorithm is used to dynamically adjust the installation package volume, which reduces the installation package volume under the premise of ensuring the integrity of the function, solves the technical problem of resource redundancy, reduces the storage cost and network transmission bandwidth demand of the installation package, and also speeds up the installation speed and improves the user experience.

[0072] In a feasible implementation, the cross-operating system installation package adaptation device further comprises: The model construction module is configured to: obtain multi-source heterogeneous data, and construct a training data set using the multi-source heterogeneous data; perform data cleaning on the training data set using a deduplication algorithm, and generate corresponding fingerprint features from the training data set after data cleaning using a fuzzy algorithm; use the fingerprint features as input to construct a graph structure model representing the relationship between the driver, the operating system and the hardware; the graph structure model includes driver nodes, operating system nodes and hardware nodes, as well as edges representing compatibility between nodes and edges representing dependency between nodes; train the graph structure model based on a graph neural network to obtain a compatibility prediction model for predicting compatibility between the driver and the device operating system.

[0073] The model optimization module is configured to: collect historical adaptation records generated during deployment of the compatibility prediction model, and generate adversarial samples based on the historical adaptation records; add the adversarial samples to the training data set to obtain an expanded data set, and perform model optimization on the compatibility prediction model based on the expanded data set.

[0074] The virtual device mapping table construction module is configured to: Map different physical devices to different virtual interfaces and set corresponding compatibility modes to create a virtual device mapping table; the compatibility mode is used to convert the native instruction set or application program interface of the physical device into an instruction set or application program interface supported by the current environment.

[0075] An active learning module is configured to trigger an active learning mechanism to generate a candidate driver set when the hardware detection result indicates that the hardware information does not hit the driver cache; the candidate driver set is subjected to sandbox testing, and the sandbox testing is followed by a gray release.

[0076] In an available implementation, the hardware information acquisition module is specifically configured to: determine a target operating system of the target device under a current instruction set architecture, or determine a target instruction set architecture corresponding to the target device under a current operating system; Correspondingly, the model prediction module is specifically configured to output a compatibility probability of the target device under the target operating system or the target instruction set architecture by using a compatibility prediction model created based on a graph neural network, to obtain a corresponding compatibility prediction result.

[0077] In an available implementation, the adaptation module is specifically configured to: when the hardware detection result indicates that the hardware information hits the driver cache, determine a hit driver and perform signature verification on the hit driver; if the hit driver passes the signature verification, load the hit driver and perform a preset hierarchical compilation strategy to compile the hit driver; if the hit driver does not pass the signature verification, roll back the hit driver to a safe mode to automatically restore a stable working state of the driver within a target time period.

[0078] In an available implementation, the adaptation module includes: The hierarchical compilation module is configured to: determine a target operating system corresponding to the target device based on the hardware detection result; generate a general binary file through base layer compilation, and perform middleware layer compilation on the binary file based on a container to build an independent cross-compilation environment, to adapt to different instruction set architectures; perform conditional compilation on a compilation product of the middleware layer compilation, to package the compilation product of the middleware layer compilation into an installation package in a format recognizable by the target operating system.

[0079] The installation package optimization module is configured to: load a driver according to the hardware detection result, and determine a number of drivers to be loaded by the target operating system; The original installation package volume corresponding to the installation package generated by the hierarchical compilation is determined, and based on the original installation package volume and the number of drivers, the installation package generated by the hierarchical compilation is compressed in volume by using a preset installation package volume compression formula to generate optimized installation packages adapted to different operating systems and different instruction set architectures.

[0080] Embodiments of the present application also provide an electronic device comprising a memory and a processor, the memory storing a computer program, and the processor being configured to execute the computer program to perform the steps in any of the above cross-operating-system installation package adaptation method embodiments.

[0081] Embodiments of the present application also provide a computer readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above cross-operating-system installation package adaptation method embodiments when executed.

[0082] In one exemplary embodiment, the above computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media capable of storing computer programs.

[0083] Embodiments of the present application also provide a computer program product comprising a computer program, the computer program being executed by a processor to implement the steps in any of the above cross-operating-system installation package adaptation method embodiments.

[0084] Embodiments of the present application also provide another computer program product comprising a non-volatile computer readable storage medium storing a computer program, the computer program being executed by a processor to implement the steps in any of the above cross-operating-system installation package adaptation method embodiments.

[0085] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0086] The above describes in detail a cross-operating system installation package adaptation method, device, equipment and medium provided by the present application. The principles and implementation manners of the present application are described by applying specific examples, and the above example description is only used to help understand the method of the present application and its core idea. It should be pointed out that, for ordinary skilled persons in the technical field, some improvements and modifications can be made to the present application without departing from the principles of the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A method for adapting an installation package across operating systems, characterized in that: include: Get the hardware information of the target device; Outputting a compatibility prediction result corresponding to the target device using a compatibility prediction model created based on a graph neural network; The compatibility prediction model is used to predict the compatibility between the driver and the device operating system; Determining whether the hardware information hits the driver cache based on the compatibility prediction result to obtain a corresponding hardware detection result; Executing a preset hierarchical compilation strategy based on the hardware detection result, and optimizing the installation package generated by the hierarchical compilation using a preset volume optimization algorithm to generate an optimized installation package adapted to different operating systems and different instruction set architectures; The preset hierarchical compilation strategy is used to adapt to different instruction set architectures through cross-compilation and to adapt to different operating systems through conditional compilation.

2. The cross-operating system installation package adaptation method according to claim 1, characterized in that: The process of constructing the compatibility prediction model includes: Acquire multi-source heterogeneous data and construct a training data set using the multi-source heterogeneous data; Using a deduplication algorithm to clean the training data set, and using a fuzzy algorithm to generate corresponding fingerprint features from the cleaned training data set; Using the fingerprint feature as input, a graph structure model representing the relationship between the driver, the operating system, and the hardware is constructed; the graph structure model includes a driver node, an operating system node, and a hardware node, as well as edges representing compatibility relationships between the nodes and edges representing dependency relationships between the nodes; The graph structure model is trained based on a graph neural network to obtain a compatibility prediction model for predicting the compatibility between the driver and the device operating system.

3. The cross-operating system installation package adaptation method according to claim 2, characterized in that: Also includes: Collecting historical adaptation records generated during the deployment of the compatibility prediction model, and generating adversarial samples based on the historical adaptation records; The adversarial sample is added to the training data set to obtain an expanded data set, and the compatibility prediction model is optimized based on the expanded data set.

4. The cross-operating system installation package adaptation method according to claim 1, characterized in that: The obtaining of hardware information of the target device includes: Determining a target operating system of the target device under the current instruction set architecture, or determining a target instruction set architecture corresponding to the target device under the current operating system; Accordingly, the compatibility prediction model created based on the graph neural network is used to output the compatibility prediction result corresponding to the target device, including: Using a compatibility prediction model created based on a graph neural network, the compatibility probability of the target device under the target operating system or the target instruction set architecture is output to obtain a corresponding compatibility prediction result.

5. The cross-operating system installation package adaptation method according to claim 1, characterized in that: Also includes: Map different physical devices to different virtual interfaces and set corresponding compatibility modes to create a virtual device mapping table; The compatibility mode is used to convert the native instruction set or application programming interface of the physical device into an instruction set or application programming interface supported by the current environment.

6. The cross-operating system installation package adaptation method according to claim 5, characterized in that: The process of executing the preset hierarchical compilation strategy based on the hardware detection result also includes: According to the virtual device mapping table, the operation request of the target device is redirected to the virtual interface and the conversion of the compatible mode is performed.

7. The cross-operating system installation package adaptation method according to claim 1, characterized in that: The executing a preset hierarchical compilation strategy based on the hardware detection result includes: When the hardware detection result indicates that the hardware information hits the driver cache, determining that a driver is hit and performing signature verification on the hit driver; If the hit driver passes the signature verification, the hit driver is loaded and a preset hierarchical compilation strategy is executed to compile the hit driver.

8. The cross-operating system installation package adaptation method according to claim 7, characterized in that: After determining the hit driver and performing signature verification on the hit driver, the method further includes: If the hit driver fails the signature verification, the hit driver is rolled back to a safe mode to automatically restore the driver state to a stable working state within a target time period.

9. The cross-operating system installation package adaptation method according to claim 1, characterized in that: Also includes: When the hardware detection result indicates that the hardware information does not hit the driver cache, triggering an active learning mechanism to generate a candidate driver set; The candidate driver set is sandbox tested and then released in a grayscale manner after the sandbox test.

10. The cross-operating system installation package adaptation method according to claim 9, characterized in that: The triggering of the active learning mechanism to generate a candidate driver set includes: An incremental training data set is generated using the hardware information, and the compatibility prediction model is incrementally trained using the incremental training data set to generate a candidate driver set.

11. The cross-operating system installation package adaptation method according to any one of claims 1 to 10, characterized in that: The executing a preset hierarchical compilation strategy based on the hardware detection result includes: Determining a target operating system corresponding to the target device based on the hardware detection result; Generate a universal binary file through base layer compilation, and build an independent cross-compilation environment based on the container to compile the binary file at the middleware layer to adapt to different instruction set architectures; Conditional compilation is performed on the compiled product of the middleware layer compilation to encapsulate the compiled product of the middleware layer compilation into an installation package in a format recognizable by the target operating system.

12. The cross-operating system installation package adaptation method according to claim 11, characterized in that: Use the preset size optimization algorithm to optimize the installation package generated by hierarchical compilation to generate optimized installation packages adapted to different operating systems and different instruction set architectures, including: Loading drivers according to the hardware detection result and determining the number of drivers required to be loaded by the target operating system; Determine the original installation package volume corresponding to the installation package generated by hierarchical compilation, and based on the original installation package volume and the number of drivers, use a preset installation package volume compression formula to optimize the volume of the installation package generated by hierarchical compilation to generate an optimized installation package adapted to different operating systems and different instruction set architectures.

13. A cross-operating system installation package adapter device, characterized in that: include: Hardware information acquisition module, used to obtain hardware information of the target device; A model prediction module, configured to output a compatibility prediction result corresponding to the target device using a compatibility prediction model created based on a graph neural network; The compatibility prediction model is used to predict the compatibility between the driver and the device operating system; A hardware detection module, configured to determine whether the hardware information hits a driver cache based on the compatibility prediction result, so as to obtain a corresponding hardware detection result; An adaptation module is used to execute a preset hierarchical compilation strategy based on the hardware detection results, and to optimize the installation package generated by the hierarchical compilation using a preset volume optimization algorithm to generate an optimized installation package adapted to different operating systems and different instruction set architectures; wherein the preset hierarchical compilation strategy is used to adapt to different instruction set architectures through cross-compilation and to adapt to different operating systems through conditional compilation.

14. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the cross-operating system installation package adaptation method as claimed in any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the cross-operating system installation package adaptation method according to any one of claims 1 to 12 are implemented.