An adaptation method and device for application software and a storage medium
By identifying the target installation platform and compatibility type, and employing automated adaptation methods, the cumbersome adaptation process of traditional application software is solved, thus improving adaptation efficiency.
Patent Information
- Application Number
- CN202311041635.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-17
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-08-17
AI Technical Summary
Traditional application software adaptation processes are cumbersome and inefficient, especially when adapting to different domestic platforms, requiring manual detection of software installation and version, and the packaging process is complex.
By identifying the target installation platform and compatibility type, corresponding adaptation methods are used for automated adaptation, including source code management, compilation, packaging, and deployment, and the automated process is achieved using plugin tools and communication connections.
It enables automatic adaptation of application software, improves adaptation efficiency, and reduces manual intervention steps.
Smart Images

Figure CN117193856B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to an application software adaptation method and device and storage medium. BACKGROUND
[0002] In the traditional application software adaptation process, the adaptation process involves different domestic platform architectures, and also relies on some basic environment software such as qt, gcc, g++, gdb and cmake. Therefore, the adaptation personnel needs to manually detect whether the related software is installed and whether the version is appropriate; in the packaging process, the adaptation personnel needs to find the related template, write scripts, upload, package, test download and many other steps. In the web adaptation, the specified middleware needs to be installed on the specified domestic platform, the use method of the middleware needs to be learned, the war package needs to be uploaded and deployed for testing. Therefore, the adaptation process is complicated and the adaptation efficiency is low. SUMMARY
[0003] Therefore, the present application provides an application software adaptation method, device and storage medium, which mainly aims to solve the problem of complicated application software adaptation process and low adaptation efficiency.
[0004] To solve the above problems, the present application provides an application software adaptation method, which comprises the following steps:
[0005] determining a target installation platform on which the target application software is to be installed;
[0006] determining an adaptation type of the target application software;
[0007] based on the adaptation type, using an adaptation mode corresponding to the adaptation type to adapt the target source code of the target application software by using the target installation platform, and obtaining a target file package adapted to the target installation platform.
[0008] Optionally, the adaptation type comprises an application program adaptation type and a webpage adaptation type.
[0009] when the adaptation type is the application program adaptation type, based on the adaptation type, using an adaptation mode corresponding to the adaptation type to adapt the target source code of the target application software by using the target installation platform, and obtaining a target file package adapted to the target installation platform, comprises:
[0010] obtaining the target source code corresponding to the target application software from a source code manager, and storing the target source code to the target installation platform on which the target application software is to be installed;
[0011] establish a target communication connection with the target installation platform, and send a compiling instruction to the target installation platform, so that the target installation platform compiles the target source code based on the compiling instruction, and obtains a compiled file;
[0012] obtain a target packaging template, and store the target packaging template to the target installation platform, so that the target installation platform packages the compiled file based on the target packaging template, and obtains a target file package adapted to the target installation platform, to obtain the target file package;
[0013] when the adaptation type is a webpage adaptation type, the target installation platform is adapted to the target application software based on the adaptation type and the adaptation manner corresponding to the adaptation type, to obtain the target file package adapted to the target installation platform, including:
[0014] obtain target source code corresponding to a target web project from a source code manager, and store the target source code to a target installation platform on which the target application software is to be installed;
[0015] establish a target communication connection with the target installation platform, and send a compiling instruction and a packaging instruction to the target installation platform, so that the target installation platform compiles and packages the target source code in sequence based on the compiling instruction and the packaging instruction, to obtain a target webpage application file package, and obtain the target file package;
[0016] deploy the target webpage application file package to a middleware of the target installation platform.
[0017] Optionally, before obtaining the target source code corresponding to the target application software from the source code manager, the method further includes:
[0018] establish an initial communication connection with the target installation platform, and obtain a data channel;
[0019] send an environment detection instruction through the data channel, detect whether a basic environment of the target installation platform meets a predetermined installation condition, and obtain the target source code corresponding to the target application software from the source code manager when the installation condition is met.
[0020] Optionally, when the installation condition is not met, the method further includes:
[0021] construct a basic environment setting command based on an operation behavior of a target user on a webpage;
[0022] modify the target installation platform based on the basic environment setting command through the data channel, so that the modified basic environment meets the installation condition.
[0023] Optionally, the obtaining the target source code corresponding to the target application software from the source code manager comprises:
[0024] The source code manager is associated based on the target plug-in tool to obtain the target source code from the source code manager.
[0025] Optionally, the obtaining the target packaging template comprises:
[0026] According to the software type of the target application software and the platform category of the target installation platform, a target packaging template corresponding to the software type and the platform category is obtained.
[0027] Optionally, after the target communication connection with the target installation platform is established, the method further comprises:
[0028] The remote connection of the target communication connection is started, and a universally unique identifier used for binding the target communication connection is obtained;
[0029] In response to a binding request of a webpage end for the target communication connection, the communication interface corresponding to the webpage end is bound to the target communication connection based on the universally unique identifier in the binding request, so as to detect whether there is transmission data output in the target communication connection in real time, and in the case that there is transmission data output, the transmission data is displayed in real time based on the webpage end.
[0030] Optionally, the method further comprises: constructing each packaging template in advance, specifically comprising:
[0031] Based on the platform category of each target installation platform and the software type of each application software, the packaging process, the packaging tool and the script file of each application software on each installation platform are determined;
[0032] Based on the packaging process, the packaging tool and the script file of each application software on each installation platform, the packaging template of each application software on each installation platform is constructed.
[0033] To solve the above problems, the application provides an adaptation method and device for application software, comprising:
[0034] A first determination module is configured to determine a target installation platform on which the target application software is to be installed;
[0035] A second determination module is configured to determine an adaptation type of the target application software;
[0036] An adaptation module is configured to perform adaptation processing on a target source code of the target application software based on the adaptation type by using an adaptation mode corresponding to the adaptation type, to obtain a target file package adapted to the target installation platform.
[0037] To address the aforementioned problems, this application provides a storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above-described adaptation methods for application software.
[0038] The application software adaptation method, apparatus, and storage medium disclosed in this application automatically adapt the application software by determining the adaptation type and then using an adaptation method corresponding to the adaptation type, thereby eliminating the need for manual adaptation and improving adaptation efficiency.
[0039] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0040] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0041] Figure 1 This is a flowchart illustrating an adaptation method for application software according to an embodiment of this application;
[0042] Figure 2 This is a flowchart illustrating an adaptation method for application software, as described in another embodiment of this application.
[0043] Figure 3 This is a flowchart illustrating an adaptation method for application software, as described in another embodiment of this application.
[0044] Figure 4 This is a structural block diagram of an adaptation device for application software according to another embodiment of this application. Detailed Implementation
[0045] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0046] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.
[0047] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0048] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0049] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.
[0050] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0051] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.
[0052] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0053] This application provides an adaptation method for application software, which can be applied to electronic devices such as terminals and servers, and also to adaptation systems and platforms used for application software adaptation. Taking the adaptation platform as an example, the implementation subject is as follows: Figure 1 As shown, the method in this embodiment includes the following steps:
[0054] Step S101: Determine the target installation platform for the target application software to be installed;
[0055] In this step, the target installation platform refers to the target server, specifically the combination of the operating system and the CPU. The CPU chip can include: Phytium, Loongson, Zhaoxin, Hygon, Kunpeng, Kylin, etc.; the operating system can be: Galaxy Kylin, UnionTech, Zhongke Fangde, Euler, etc. In other words, different servers / installation platforms may have different CPUs and operating systems. Therefore, the target file packages for compatible application software will differ for different servers / installation platforms, hence the need to determine the target installation platform.
[0056] Step S102: Determine the compatibility type of the target application software;
[0057] This step involves two types of adaptation: application adaptation and web page adaptation. Application adaptation refers to compiling and packaging the software package's source code on the target installation platform to create a software installation package that can run on that platform. Web page adaptation refers to packaging the locally developed web project corresponding to the target application software, deploying it to a domestically developed middleware on the installation platform, and verifying whether the web project can run successfully.
[0058] Step S103: Based on the adaptation type, adopt the adaptation method corresponding to the adaptation type, and use the target installation platform to perform adaptation processing on the target source code of the target application software to obtain a target file package adapted to the target installation platform.
[0059] In practice, the adaptation process varies depending on the type of adaptation. Therefore, after determining the type of adaptation, an adaptation method corresponding to that type can be adopted. The target source code of the target application software is then adapted to the target installation platform to obtain a target file package adapted to the target installation platform.
[0060] This embodiment provides an application software adaptation method that determines the adaptation type and then uses the corresponding adaptation method to adapt the application software, thereby achieving automatic adaptation of the application software without the need for manual adaptation and improving adaptation efficiency.
[0061] Another embodiment of this application provides an adaptation method for application software, which specifically includes the following steps:
[0062] Step S201: Determine the target installation platform for the target application software to be installed;
[0063] Step S202: Determine the adaptation type of the target application software; if the adaptation type is an application adaptation type, proceed to step S203; if the adaptation type is a webpage adaptation type, proceed to step S206.
[0064] Step S203: Obtain the target source code corresponding to the target application software from the source code manager, and store the target source code to the target installation platform where the target application software is to be installed;
[0065] In the specific implementation of this step, when the adaptation platform obtains the target source code, it can do so by associating the source code manager with the target plugin tool, and then obtaining the target source code from the source code manager. The target plugin tool can be the jgit tool. Specifically, the adaptation platform can use the jgit tool to associate with the GitLab source code manager, then pull the target source code from the source code manager to a file server, and finally copy the target source code from the file server to the target server (i.e., the target installation platform) using SCP technology, thereby storing the target source code on the target installation platform. In this embodiment, the jgit tool is a Java code plugin for committing to Git. It can connect to a remote Git repository through code, create a version control repository locally, and perform operations such as pulling, committing, and pushing.
[0066] In this embodiment, the target installation platform is the target server, specifically the combination of operating system and CPU. That is, different servers / installation platforms may have different CPUs and different operating systems, therefore the target file packages of application software compatible with different servers / installation platforms will be different.
[0067] Step S204: Establish a target communication connection with the target installation platform and send compilation instructions to the target installation platform so that the target installation platform compiles the target source code based on the compilation instructions to obtain a compiled file;
[0068] In the specific implementation of this step, the adapter platform can establish a Secure Shell (SSH) connection with the target server / target installation platform, and then send the "cmake" compilation command to the target server / target installation platform based on this communication connection, so that the target installation platform can compile the target source code, complete the compilation process, and obtain the compiled file.
[0069] Step S205: Obtain the target packaging template and store the target packaging template in the target installation platform, so that the target installation platform packages the compiled file based on the target packaging template to obtain a target file installation package adapted to the target installation platform, thereby obtaining the target file package.
[0070] In this step, the platform adaptation can specifically obtain the target packaging template corresponding to the software type and platform category of the target application software and the target installation platform. After obtaining the target file installation package, the target file package is obtained.
[0071] Step S206: Obtain the target source code corresponding to the target web project from the source code manager, and store the target source code to the target installation platform where the target application software is to be installed;
[0072] Step S207: Establish a target communication connection with the target installation platform and send compilation instructions and packaging instructions to the target installation platform, so that the target installation platform compiles and packages the target source code sequentially based on the compilation instructions and the packaging instructions to obtain the target file package;
[0073] In this step, the target web application file package is a WAR file.
[0074] Step S208: Deploy the target web application file package to the middleware of the target installation platform.
[0075] In this step, the middleware type can include any one or more of the following: Eastcom, Kingdee, Zhongchuang, Huayu, Baolande, and Primeton. In specific implementation, the deployment path can be obtained based on the middleware type, and then the WAR file can be stored in the middleware according to the deployment path. That is, the deployment path of the middleware is loaded according to its type, and then the WAR package is copied to the middleware's deployment path using SCP technology.
[0076] In this embodiment, after deploying the WAR file package, the adapting system can establish an SSH connection with the target installation platform / target server, and then send a command to restart the middleware to the target server to complete the web deployment. During the deployment process, the middleware output logs are retrieved to determine the deployment progress and whether the deployment was successful. Finally, the access address of the refactored web project is returned to the web client for users to access.
[0077] This embodiment presents an application software adaptation method. By obtaining the target source code of the target application software from a source code manager and storing it on the target installation platform, compilation instructions for the target source code can be sent to the target installation platform to control its rapid compilation. Subsequently, by storing the obtained packaging template on the target installation platform, the platform can quickly package the compiled files based on the template, ensuring the packaged target files are compatible with the target installation platform. Alternatively, the compiled files can be directly packaged into a WAR file and deployed to the middleware of the target installation platform, thereby achieving rapid application software adaptation and improving adaptation efficiency.
[0078] Another embodiment of this application provides an adaptation method for application software. In this embodiment, before executing step S203 and obtaining the target source code corresponding to the target application software from the source code manager, it is possible to detect whether the basic environment of the target installation platform meets predetermined conditions. The specific detection process is as follows: an initial communication connection is established with the target installation platform, and a data channel is obtained. Specifically, an initial communication connection with the target installation platform can be established using SSH technology to obtain the data channel. Then, an environment detection command is sent through the data channel to detect whether the basic environment of the target installation platform meets the predetermined installation conditions. Specifically, the basic environment information of the target installation platform can be obtained through the environment detection command, including: gcc, g++, gdb, boost, cmake, installation status, and detailed version information, etc., and then the target installation platform is checked for whether it meets the predetermined installation conditions based on the basic environment information. If the detection result shows that the installation conditions are met, the target source code corresponding to the target application software can then be obtained from the source code manager. If the detection result indicates that the installation conditions are not met, a basic environment setting command can be constructed based on the target user's operation behavior on the web page. Then, the data channel is used to modify the environment of the target installation platform based on the basic environment setting command, so that the modified basic environment meets the installation conditions.
[0079] Another embodiment of this application provides an adaptation method for application software. To ensure the security of the target server and prevent users from arbitrarily operating the target server / target installation platform via SSH target communication connection, after establishing a target communication connection with the target installation platform in step S204, a remote connection of the target communication connection can be opened, and a universally unique identifier (UUID) used to bind the target communication connection can be obtained. Then, in response to the binding request for the target communication connection from the web page, the corresponding communication interface / socket of the web page is bound to the target communication connection based on the universally unique identifier (UUID) in the binding request. This allows for real-time detection of whether there is data transmission output in the target communication connection, and if there is data transmission output, the transmitted data is displayed in real-time on the web page.
[0080] In this embodiment, the backend can also discard data sent via the socket, allowing only internal service commands to be sent to the SSH connection. To ensure real-time output of data for each channel, a per-thread approach is used for each channel.
[0081] Another embodiment of this application provides an adaptation method for application software. In this embodiment, before adaptation, packaging templates can be pre-built. Specifically, this includes: determining the packaging process, packaging tools, and script files for each application software on each installation platform based on the platform category of each target installation platform and the software type of each application software; and constructing packaging templates for each application software on each installation platform based on the packaging process, packaging tools, and script files for each application software on each installation platform. That is, based on the operating system category in the application platform, software packages are mainly divided into two categories: rpm and deb. A survey is conducted on software with adaptation requirements on different installation platforms, and the packaging processes, packaging tools, and scripts for each software's rpm and deb packages are abstracted into common templates, thus constructing packaging templates for each application software on each installation platform. This lays the foundation for subsequent rapid packaging of the target application software's compiled files using the target installation platform based on the packaging templates.
[0082] Based on the above embodiments, the software adaptation process in this application will be described below in conjunction with specific application scenarios, taking the application (APP) adaptation process as an example, such as... Figure 2 As shown, the specific adaptation process is as follows:
[0083] Step 1: Pre-build packaging templates for each application software; that is, standardize the packaging process and build packaging templates for each application software.
[0084] In this step, software packages are mainly divided into two categories based on the operating system: RPM and DEB. We investigate software that requires compatibility with various installation platforms, and abstract common templates and processes for packaging RPM and DEB packages for each software. From these templates, we obtain the templates for built-in RPM and DEB packaging.
[0085] Step 2, setting up the compilation and packaging environment.
[0086] In this step, an initial communication connection can be established with the domestic platform (the target installation platform) using SSH technology to obtain a data channel. Environment detection commands are then sent through the data channel to check the basic environment information of the domestic platform. This includes checking the installation status and detailed version information of components such as gcc, g++, gdb, boost, and cmake. If the basic environment is incomplete or does not meet the user's personalized environment requirements, basic environment setup commands are generated based on the user's behavior on the web interface. These commands are then used through the channel to configure the domestic platform accordingly, ensuring the basic environment meets the installation requirements.
[0087] Step 3, automatic compilation.
[0088] In this step, you first need to connect to the GitLab source code manager using the target plugin tool jgit, and pull the target source code corresponding to the target application software from the source code manager to the file server. jgit is a Java code plugin for committing to Git, which allows you to connect to a remote Git repository through code, create a version control repository locally, and perform operations such as pulling, committing, and pushing.
[0089] Next, the target source code is copied from the file server to the domestic platform (target installation platform / target server) using SCP technology, and finally the source code temporarily stored on the file server is deleted.
[0090] Finally, establish a target SSH communication connection with the domestic platform (target installation platform / target server), and then send the compilation command "cmake" to the domestic platform (target installation platform / target server) to complete the compilation process and obtain the compiled files.
[0091] In practice, this step can utilize SCP technology to copy the compiled files to a file server for backup. Furthermore, after obtaining the compiled files, residual compilation traces on the domestic platform (target installation platform / target server) can be cleaned up, and intermediate files from the compilation process, such as source code files, can be deleted.
[0092] Step 4: Automatic packaging.
[0093] In this step, firstly, a software packaging template can be loaded based on the specified software type and the domestic platform (target installation platform / target server) information. Then, the template is copied to the domestic platform (target installation platform / target server) using SCP technology.
[0094] If there are personalized settings in the packaging process, a custom packaging script file is supported. The custom spec script file and package resource files are copied together to the domestic platform (target installation platform / target server) using SCP technology, replacing the template content.
[0095] Then, the rpmbuild and dpkg packaging commands are sent through the channel, that is, the packaging commands are sent to the domestic platform (target installation platform / target server), so that the domestic platform (target installation platform / target server) can package the compiled files based on the packaging template to obtain a target file package that is compatible with the domestic platform (target installation platform / target server).
[0096] In this embodiment, real-time output can also be displayed during implementation. The specific implementation process is as follows: First, a remote SSH connection is established, and the universally unique identifier (UUID) bound to that connection is obtained. The web client uses the UUID. Then, the current socket connection is bound to the SSH connection corresponding to the UUID. Therefore, when data is output through the SSH connection, the web client can display that data in real time. To ensure server security and prevent users from arbitrarily operating the server via SSH, the backend discards data sent via the socket, allowing only internal service commands to be sent through the SSH connection. To ensure real-time output of data for each channel, a per-thread approach is used for each channel.
[0097] To prevent SSH connections from closing due to prolonged inactivity, the idle time can be reset at predetermined intervals until the system-specified idle time expires before closing the connection. After the command execution is complete, the packaged software will be uploaded back to the file server for centralized management.
[0098] Finally, clean up any remaining packaging traces on the domestic platform (target installation platform / target server) and delete intermediate files from the packaging process, such as packaging scripts.
[0099] Based on the above embodiments, the software adaptation process in this application will be described below in conjunction with specific application scenarios, taking the web page adaptation process as an example, such as... Figure 3 As shown, the specific adaptation process is as follows:
[0100] Step 1: Pull the target source code of the web project to be packaged from the source code manager.
[0101] In the specific implementation process, this step can be carried out by using the target plugin tool jgit to associate with the GitLab source code manager, and then pulling the target source code corresponding to the web project from the source code manager to the file server.
[0102] Next, the target source code is copied from the file server to the domestic platform (target installation platform / target server) using SCP technology, and finally the target source code temporarily stored on the file server is deleted.
[0103] Step 2: Automatically compile the target source code into a WAR file.
[0104] In the specific implementation process, this step can control the domestic platform (target installation platform / target server) and rely on Maven to automatically build the target source code using the maven-invoker tool to generate a WAR package.
[0105] Step 3: Automatically deploy the middleware to the domestic platform (target installation platform / target server).
[0106] In this step, the middleware can be domestically produced, including companies such as Eastcom, Kingdee, Zhongchuang, Huayu, Baolande, and Primeton.
[0107] In the actual implementation process, the deployment path of the middleware can be loaded according to its type.
[0108] Then, using SCP technology, the WAR package obtained in step 2 is copied to the deployment path of the domestic middleware, thereby realizing the deployment of the WAR package.
[0109] After the WAR package is deployed, the adapted system can establish an SSH connection with the domestic platform (target installation platform / target server) and then send a command to restart the middleware to the domestic platform (target installation platform / target server) to complete the web deployment. During the deployment process, the middleware output logs are retrieved to determine the deployment progress and whether the deployment was successful.
[0110] Finally, the refactored web project's access address is returned to the web client for users to access.
[0111] In this embodiment, the state of the adaptation process can also be set during specific implementation.
[0112] In the specific implementation process of this application, each adaptation process can be classified according to its sensitivity, and classification tags can be set for each adaptation process. The classification tags include "public" and "non-public". The "public" adaptation processes can be searched, viewed and downloaded by all valid users. The "non-public" adaptation processes can only be searched, viewed and downloaded by users with higher privileges.
[0113] Another embodiment of this application provides an adaptation device for application software, such as... Figure 4 As shown, it includes:
[0114] The first determining module 11 is used to determine the target installation platform for the target application software to be installed.
[0115] The second determining module 12 is used to determine the compatibility type of the target application software;
[0116] The adaptation module 13 is used to adapt the target source code of the target application software to the target application software based on the adaptation type and using the adaptation method corresponding to the adaptation type, so as to obtain a target file package adapted to the target installation platform.
[0117] In this embodiment, the adaptation types include: application adaptation types and webpage adaptation types; the adaptation module includes a first adaptation unit and a second adaptation unit.
[0118] The first adaptation unit is configured to: when the adaptation type is an application adaptation type, obtain the target source code corresponding to the target application software from the source code manager, and store the target source code to the target installation platform where the target application software is to be installed;
[0119] A target communication connection is established with the target installation platform, and compilation instructions are sent to the target installation platform so that the target installation platform compiles the target source code based on the compilation instructions to obtain a compiled file;
[0120] Obtain a target packaging template and store the target packaging template in the target installation platform, so that the target installation platform packages the compiled file based on the target packaging template to obtain a target file installation package adapted to the target installation platform, thereby obtaining the target file package;
[0121] The second adaptation unit is used to: when the adaptation type is a web page adaptation type, obtain the target source code corresponding to the target web project from the source code manager, and store the target source code to the target installation platform where the target application software is to be installed;
[0122] A target communication connection is established with the target installation platform, and compilation instructions and packaging instructions are sent to the target installation platform so that the target installation platform compiles and packages the target source code sequentially based on the compilation instructions and the packaging instructions to obtain the target web application file package;
[0123] Deploy the target web application package to the middleware of the target installation platform.
[0124] In this embodiment, the first adapter unit is further configured to: establish an initial communication connection with the target installation platform and obtain a data channel before obtaining the target source code corresponding to the target application software from the source code manager; send an environment detection command through the data channel to detect whether the basic environment of the target installation platform meets the predetermined installation conditions, so as to obtain the target source code corresponding to the target application software from the source code manager if the installation conditions are met.
[0125] In this embodiment, the first adaptation unit is further configured to: construct a basic environment setting command based on the target user's operation behavior on the webpage if the installation conditions are not met; and modify the target installation platform using the data channel based on the basic environment setting command so that the modified basic environment meets the installation conditions.
[0126] In this embodiment, the first adaptation unit is specifically used to: associate the source code manager with the target plugin tool to obtain the target source code from the source code manager.
[0127] In this embodiment, the first adaptation unit is specifically used to: obtain a target packaging template corresponding to the software type and platform category of the target application software and the target installation platform.
[0128] In this embodiment, after establishing a target communication connection with the target installation platform, the first adapter unit is further configured to: enable the remote connection of the target communication connection and obtain a universally unique identifier for binding the target communication connection; respond to the binding request of the web page for the target communication connection, and bind the communication interface corresponding to the web page to the target communication connection based on the universally unique identifier in the binding request, so as to detect in real time whether there is data transmission output in the target communication connection, and if there is data transmission output, display the data transmission in real time based on the web page.
[0129] In this embodiment, the first adapter unit is further configured to: pre-build each packaging template, specifically for:
[0130] Based on the platform category of each target installation platform and the software type of each application software, the packaging process, packaging tools, and script files for each application software on each installation platform are determined; based on the packaging process, packaging tools, and script files for each application software on each installation platform, a packaging template for each application software on each installation platform is constructed.
[0131] This embodiment provides an application software adaptation device that determines the adaptation type and then uses an adaptation method corresponding to the adaptation type to adapt the application software, thereby achieving automatic adaptation of the application software without the need for manual adaptation and improving adaptation efficiency.
[0132] Another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the following method steps:
[0133] Step 1: Determine the target installation platform for the target application software to be installed;
[0134] Step 2: Determine the compatibility type of the target application software;
[0135] Step 3: Based on the adaptation type, adopt the adaptation method corresponding to the adaptation type, and use the target installation platform to adapt the target source code of the target application software to obtain a target file package adapted to the target installation platform.
[0136] The specific implementation process of the above method steps can be found in any of the above embodiments of the adaptation method for application software, and will not be repeated here.
[0137] In this application, the storage medium determines the adaptation type and then uses the adaptation method corresponding to the adaptation type to adapt the application software, thereby achieving automatic adaptation of the application software, eliminating the need for manual adaptation and improving adaptation efficiency.
[0138] Another embodiment of this application provides an electronic device, including at least a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program in the memory, performs the following method steps:
[0139] Step 1: Determine the target installation platform for the target application software to be installed;
[0140] Step 2: Determine the compatibility type of the target application software;
[0141] Step 3: Based on the adaptation type, adopt the adaptation method corresponding to the adaptation type, and use the target installation platform to adapt the target source code of the target application software to obtain a target file package adapted to the target installation platform.
[0142] The specific implementation process of the above method steps can be found in any of the above embodiments of the adaptation method for application software, and will not be repeated here.
[0143] In this application, the electronic device automatically adapts the application software by determining the adaptation type and then using the adaptation method corresponding to the adaptation type, eliminating the need for manual adaptation and improving adaptation efficiency.
[0144] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.
Claims
1. A method for adapting application software, characterized in that, Determine the target installation platform for the application software to be installed; Determine the adaptation type of the target application software; the adaptation type includes: application adaptation type and webpage adaptation type; When the adaptation type is an application adaptation type, the target source code corresponding to the target application software is obtained from the source code manager, and the target source code is stored in the target installation platform where the target application software is to be installed; A target communication connection is established with the target installation platform, and compilation instructions are sent to the target installation platform so that the target installation platform compiles the target source code based on the compilation instructions to obtain a compiled file; Obtain a target packaging template and store the target packaging template in the target installation platform, so that the target installation platform packages the compiled file based on the target packaging template to obtain a target file installation package adapted to the target installation platform, thereby obtaining a target file package; When the adaptation type is web page adaptation type, the target source code corresponding to the target web project is obtained from the source code manager, and the target source code is stored in the target installation platform where the target application software is to be installed; A target communication connection is established with the target installation platform, and compilation instructions and packaging instructions are sent to the target installation platform so that the target installation platform compiles and packages the target source code sequentially based on the compilation instructions and the packaging instructions to obtain the target web application file package. Deploy the target web application file package to the middleware of the target installation platform; The method also includes: pre-building each packaging template, specifically including: determining the packaging process, packaging tools and script files for each application software on each installation platform based on the platform category of each target installation platform and the software type of each application software; Based on the packaging process, packaging tools, and script files of each application software on each installation platform, a packaging template for each application software on each installation platform is constructed.
2. The method as described in claim 1, characterized in that, Before retrieving the target source code corresponding to the target application software from the source code manager, the method further includes: Establish an initial communication connection with the target installation platform and acquire data channels; An environment detection command is sent through the data channel to detect whether the basic environment of the target installation platform meets the predetermined installation conditions. If the installation conditions are met, the target source code corresponding to the target application software is obtained from the source code manager.
3. The method as described in claim 2, characterized in that, If the installation conditions are not met, the method further includes: Based on the target user's actions on the web page, build basic environment setup commands; Using the data channel, based on the basic environment settings command, the target installation platform is modified to make the modified basic environment meet the installation conditions.
4. The method as described in claim 1, characterized in that, The step of obtaining the target source code corresponding to the target application software from the source code manager specifically includes: The target source code is obtained from the source code manager by associating the target plugin tool with it.
5. The method as described in claim 1, characterized in that, The process of obtaining the target packaging template specifically includes: Based on the software type of the target application software and the platform category of the target installation platform, obtain the target packaging template corresponding to the software type and platform category.
6. The method as described in claim 1, characterized in that, After establishing a target communication connection with the target installation platform, the method further includes: Open a remote connection for the target communication connection and obtain a universally unique identifier for binding the target communication connection; In response to the binding request from the web page for the target communication connection, the web page's corresponding communication interface is bound to the target communication connection based on the universally unique identifier in the binding request. This allows for real-time detection of whether there is data transmission output in the target communication connection, and if there is data transmission output, the web page displays the transmitted data in real-time.
7. An adapter for application software, characterized in that, include: The first determination module is used to determine the target installation platform for the target application software to be installed. The second determining module is used to determine the compatibility type of the target application software; The adaptation types include: application adaptation types and webpage adaptation types; The adaptation module is used to obtain the target source code corresponding to the target application software from the source code manager when the adaptation type is an application adaptation type, and store the target source code to the target installation platform where the target application software is to be installed. A target communication connection is established with the target installation platform, and compilation instructions are sent to the target installation platform so that the target installation platform compiles the target source code based on the compilation instructions to obtain a compiled file; Obtain a target packaging template and store the target packaging template in the target installation platform, so that the target installation platform packages the compiled file based on the target packaging template to obtain a target file installation package adapted to the target installation platform, thereby obtaining a target file package; When the adaptation type is web page adaptation type, the target source code corresponding to the target web project is obtained from the source code manager, and the target source code is stored in the target installation platform where the target application software is to be installed; A target communication connection is established with the target installation platform, and compilation instructions and packaging instructions are sent to the target installation platform so that the target installation platform compiles and packages the target source code sequentially based on the compilation instructions and the packaging instructions to obtain the target web application file package. Deploy the target web application file package to the middleware of the target installation platform; The device is also used to: pre-build each packaging template, specifically to: determine the packaging process, packaging tools and script files for each application software on each installation platform based on the platform category of each target installation platform and the software type of each application software; Based on the packaging process, packaging tools, and script files of each application software on each installation platform, a packaging template for each application software on each installation platform is constructed.
8. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the adaptation method for application software as described in any one of claims 1-6.
Citation Information
Patent Citations
Application installation package generation method, computing device and storage medium
CN114691146A
Automatic adaptation method and device, storage medium and electronic equipment
CN115167886A