Software version adaptation method, device, electronic device and storage medium
By loading the software adapter, the high maintenance cost and compatibility problems caused by the underlying software version upgrade or API changes are solved, and compatibility with different versions is achieved, maintenance costs are reduced and development flexibility is improved.
Patent Information
- Application Number
- CN202210638495.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-07
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-06-07
AI Technical Summary
During the software development process, the existing technology faces high maintenance costs and compatibility problems caused by the upgrade of the underlying software version or API changes.
By loading the software adapter, smoothing the differences in APIs between the versions of the underlying software, achieving compatibility with different versions, and avoiding additional costs caused by version upgrades or API changes.
It effectively reduces the additional costs caused by the update of the underlying software version, reduces the complexity of software maintenance and the consumption of human resources, and improves the flexibility and compatibility of software development.
Smart Images

Figure CN114995871B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology, and in particular to a software version adaptation method, device, electronic device and storage medium. Background Art
[0002] At present, developers rely on other software (hereinafter referred to as underlying software) for development during the daily software development process (referred to as software 1); and the underlying software often has periodic iterative updates, and each update will generate a corresponding version number. Among them, the version number consists of a major version, a minor version number, and a revision number (for example, 1.1.1); and the update of the major version number often contains destructive content. For the developers of software A, this destructive software version update will bring high software maintenance costs and also be accompanied by the consumption of manpower, resources, energy and time. If software 1 is open sourced to the community, then the software developed based on software 1 (referred to as software 2) will also face the problems faced by software 1.
[0003] Currently, for developers, there are several options for developing software 1, software 2, ..., software N:
[0004] 1. Use a fixed version (main stable version) of the dependent software for project development;
[0005] 2. If you rely on the main version number of the software for upgrading, then the related projects will be reconstructed to support the higher version of the underlying software.
[0006] However, such a technical solution has the following defects:
[0007] 1. For Solution 1, the version of the dependent software is fixed, so some technical updates brought by the new update cannot be used. Often, the version update is accompanied by the performance optimization of the project, etc., which will lead to some requirements cannot be realized or some performance optimization cannot be realized; similarly, due to the fixed version, if the software 1 developed by the dependent software is open sourced and used by others, then others will also be unable to use the higher version of the underlying software;
[0008] 2. For Option 2, project reconstruction will be accompanied by the consumption of manpower, resources, energy and time; higher versions may often be accompanied by more demanding software operating environments, and compatibility issues may exist; at the same time, the main version update of the underlying software often changes the API (Application Programming Interface), etc., which has a higher learning and usage cost. Summary of the invention
[0009] In order to solve at least one of the problems mentioned in the above background technology, the present application provides a software version adaptation method, device, electronic device and storage medium, which can be compatible with various versions that the software depends on, avoiding additional costs caused by underlying software version upgrades or API changes.
[0010] The specific technical solutions provided by the embodiments of this application are as follows:
[0011] In a first aspect, a software version adaptation method is provided, comprising:
[0012] In response to the software project performing software dependency installation, reading software dependency information of the software project in the configuration file, the software dependency including one or more underlying software;
[0013] According to the software dependency information, install each software dependency package and install a software adapter;
[0014] The software adapter is loaded to make the software adapter compatible with the application program interface that the software depends on and adapt the software version that the software depends on.
[0015] Further, the software adapter includes at least one of a process manager module, an analyzer module, a memory manager module, an executor module and a parser module, and the steps of installing each software dependency package and installing the software adapter according to the software dependency information include:
[0016] Reading an adapter package of a software adapter, initializing each module by installing the process manager module integrated with the entry file of the adapter package, calling the analyzer module to perform environment analysis and dependency analysis, obtaining analysis data, and writing the analysis data into the memory manager module;
[0017] The executor module queries the version information of the software project and the underlying software according to the analysis data, and copies the compatible package of the corresponding version to the root directory of the software adapter according to the version information;
[0018] Each compatible package includes the same entry file for calling.
[0019] Furthermore, before copying the compatible package of the corresponding version to the root directory of the software adapter according to the version information, the method further includes:
[0020] Parsing the application program interface of the underlying software through the parser module to determine whether the application program interface has been registered with a custom implementation inside the parser, thereby obtaining a first determination result;
[0021] If the first judgment result is that the application program interface has registered a custom implementation inside the parser, the custom implementation is executed.
[0022] Furthermore, if the first judgment result is that the application program interface has not registered a custom implementation in the parser, the method further includes:
[0023] Returning a patch package for each version of the underlying software through the parser module according to the software project and the version information of the underlying software;
[0024] The patch packages of each version are packaged to generate a compatible package corresponding to each version of the underlying software and containing the same entry file.
[0025] Furthermore, the parsing of the application program interface of the underlying software by the parser module further includes:
[0026] The parser module provides a use function for the software project to call the use function to register an unrecognized application program interface and execute logic processing of unreturned patch packages.
[0027] Furthermore, the analysis data includes at least one of the operating environment of the software project, the publishing environment of the software project, and the name of the software dependency and the version of the software dependency.
[0028] In a second aspect, a software version adaptation device is provided, the device comprising:
[0029] A dependency reading module, configured to perform software dependency installation in response to a software project, and read software dependency information of the software project in a configuration file, wherein the software dependency includes one or more underlying software;
[0030] A dependency installation module, used to install various software dependency packages and software adapters according to the software dependency information;
[0031] The loading module is used to load the software adapter so as to make the software adapter compatible with the application program interface that the software depends on and adapt the software version that the software depends on.
[0032] Further, the software adapter includes at least one of a process manager module, an analyzer module, a memory manager module, an executor module, and a parser module;
[0033] The dependency installation module is also used to read the adapter package of the software adapter, initialize each module by installing the process manager module integrated with the entry file of the adapter package, call the analyzer module to perform environment analysis and dependency analysis, obtain analysis data, and write the analysis data into the memory manager module;
[0034] The executor module queries the version information of the software project and the underlying software according to the analysis data, and copies the compatible package of the corresponding version to the root directory of the software adapter according to the version information;
[0035] Each compatible package includes the same entry file for calling.
[0036] According to a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the software version adaptation method when executing the computer program.
[0037] In a fourth aspect, a computer-readable storage medium is provided, storing computer-executable instructions, wherein the computer-executable instructions are used to execute the software version adaptation method.
[0038] The embodiments of the present application have the following beneficial effects:
[0039] The embodiments of the present application provide a software version adaptation method, device, electronic device and storage medium, which can smooth out the API differences between the underlying software versions by loading a software adapter, and can be compatible with the various versions that the software depends on, thereby avoiding additional costs caused by upgrading the underlying software version or changing the API. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 The overall flow chart of the software version adaptation method provided in the embodiment of the present application is shown;
[0042] Figure 2 A specific flow chart of a software version adaptation method according to an embodiment of the present application is shown;
[0043] Figure 3 A schematic diagram showing the structure of a software version adaptation device provided in an embodiment of the present application is shown;
[0044] Figure 4An exemplary system is shown that can be used to implement the various embodiments described in this application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like in the entire specification and claims should be interpreted as inclusive rather than exclusive or exhaustive; that is, the meaning of "including but not limited to".
[0047] It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.
[0048] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps, and do not specifically refer to the order or sequence, nor are they used to limit the present application. They are only for the convenience of describing the method of the present application, and cannot be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.
[0049] Embodiment 1
[0050] This application provides a software version adaptation method, referring to Figure 1 ,include:
[0051] S1, in response to the software project performing software dependency installation, reading software dependency information of the software project in the configuration file, where the software dependency includes one or more underlying software;
[0052] S2. Install each software dependency package and the software adapter according to the software dependency information;
[0053] S3. Load the software adapter to adapt the software version to which the software depends by using the software adapter to be compatible with the application program interface to which the software depends.
[0054] Specifically, first of all, the operation of a software project does not necessarily require all functions to be carried out from 0 to 1. During the software development process, if a certain function is needed during the operation of the software project, and there happens to be a corresponding underlying software, then the underlying software can be used directly, and the underlying software becomes the software dependency of the software project. There may often be many software dependencies in a software project. During the installation of software dependencies, the software project will first run the script command (npm install). During the runtime, the package management tool (npm) will read all the software dependency information of the software project configured in the configuration file package.json, download all software dependency packages from the npm warehouse, and install each dependency package. When all dependencies are installed, the software adapter package installation begins. During the installation of software dependencies, the current software development operating environment will be automatically determined, so as to perform environment analysis and dependency analysis (version analysis); after that, the software adapter will be automatically installed and loaded through scripts, file copying, downloading and other operations. The adapter will smooth out the API differences between the various versions of the underlying software, so that even if the underlying software that depends on it is updated and upgraded to the main version, the software project does not need to pay attention to compatibility and inconsistency in the software operating environment. Similarly, if the developed software project is used as the underlying software of other software to be developed, the various versions of each software project are also adapted through the software adapter.
[0055] The following example uses the software project version 2.0.0 and needs to support the underlying software A version 1.0.0, 2.0.0, and 3.0.0. Figure 2 For further explanation:
[0056] In some implementations, the software adapter includes at least one of a process manager module, an analyzer module, a memory manager module, an executor module, and a parser module. Based on this, S2 includes:
[0057] S21, read the adapter package of the software adapter, initialize each module by installing the process manager module integrated with the entry file according to the adapter package, call the analyzer module to perform environment analysis and dependency analysis, obtain analysis data, and write the analysis data into the memory manager module;
[0058] S22, the executor module queries the version information of the software project and the underlying software according to the analysis data, and copies the compatible package of the corresponding version to the root directory of the software adapter according to the version information;
[0059] Each compatible package includes the same entry file for calling.
[0060] Specifically, the software adapter itself is a software project dependency package and a software package, which will be placed in the npm public repository for installation and use by various projects. The software adapter mainly includes modules such as process controller module, analyzer module, memory manager module, executor module, parser module and script configuration file. Among them, the executor module is divided into two cases, one is when the software adapter is installed, and the other is when the software adapter is running. First, the entry file of the executor module will determine whether the software adapter is in the installation state based on the passed parameters. If the software adapter is in the installation state, the executor module will call the script for installation; if the software adapter is in the running state, the executor module will call the parser to parse the relevant APIs and related functions.
[0061] Specifically, since the software adapter itself is also a software project dependency, the software adapter is installed through npminstall <adapter package name>. During the installation process, the adapter package information, such as the adapter package address, package version and other information, will be read for installation. Since the postinstall event is registered and the corresponding script is configured in the adapter package script configuration, the corresponding configured script file will be executed, and entering the script file will also enter the installation entry file of the package, and the entry file integrates the process manager module. Among them, the process manager module mainly intercepts each node during the installation / operation process of the software adapter, and uses appropriate modules for processing and scheduling. First, the process manager module initializes each module and obtains the reference information of each module to facilitate subsequent calls. The analyzer module is called to perform environmental analysis and dependency analysis. The script file of the analyzer module reads the package configuration file of the software project through the fs module of Node itself, extracts and reads all dependencies of the software project, the running environment of the software project, and the release environment, etc., obtains the analysis data, and returns the analysis data to the process manager module; the process manager module obtains the analysis data returned by the analyzer module and calls the memory manager module for memory writing. After writing is completed, the executor module is called, and the memory manager module is shared with the executor module, and marked as the installed adapter state. The executor module queries the version information of the software project and the underlying software according to the analysis data. The analysis data includes at least one of the running environment of the software project, the release environment of the software project, and the name of the software dependency and the version of the software dependency.
[0062] For example, if the software project version is 2.0.0, the current underlying software A version is also 2.0.0, and the executor module detects that the current state is to install the adapter, the script method is called to copy the v2.0.0 version of the compatibility package packaged during the development of the software adapter to the root directory of the software adapter. Each compatible package contains an index.js file as an entry file for external calls. The main field in the configuration file package.json has been configured as index.js. At this time, the defined main: index.js has a specific pointer, and the corresponding v2.0.0 version of the compatible package can be called. At this point, the installation of the software adapter corresponding to the underlying software version is completed.
[0063] In some implementations, before copying the compatible package of the corresponding version to the root directory of the software adapter according to the version information, the method further includes:
[0064] Parsing the application program interface of the underlying software through the parser module to determine whether the application program interface has been registered with a custom implementation inside the parser, and obtaining a first determination result;
[0065] If the first judgment result is that the application interface has registered a custom implementation inside the parser, the custom implementation is executed.
[0066] Specifically, when using the module files exposed by the software adapter in a software project, the introduced APIs are parsed by the parser module. When it comes to a specific API, the parser will determine whether the current API has been customized by the user. If the user has customized the configuration, it will return the user-defined configuration. If not, it will call the API of the relevant module and return.
[0067] In some implementations, if the first determination result is that the application program interface has not registered a custom implementation in the parser, the method further includes:
[0068] 101. Return the patch package of each version of the underlying software according to the version information of the software project and the underlying software through the parser module;
[0069] 102. Packaging is performed according to the patch package of each version, and a compatible package containing the same entry file corresponding to each version of the underlying software is constructed and generated.
[0070] Specifically, the parser module will execute the judgment rules according to the version information of the software project and the underlying software. Exemplarily, if the version of the software project is 2.0.0, if the version of the underlying software A is 1.0.0, then the low version patch package of software A is returned; if the version of the underlying software A is 2.0.0, then the software package of the underlying software A is returned; if the version of the underlying software A is 3.0.0, then the high version patch package of the underlying software A is returned. At this point, after the software adapter for the underlying software A is developed, the software adapter needs to be packaged and built, and three folders v1.0.0, v2.0.0 and v3.0.0 are packaged, corresponding to the compatible packages of the underlying software A1.0.0, 2.0.0 and 3.0.0 versions, that is, the compatible packages copied by the above-mentioned executor module. Each compatible package has an index.js file as an entry file for external calls. The software project that actually uses the software adapter can execute the logic of the software adapter through index.js. For example, before the software adapter is introduced, the underlying software is used in the software project in the following way: import{api1, api2, api3}from "underlying software A". After the software adapter is introduced, the underlying software is used in the following way: import{api1, api2, api3}from "software adapter XX". When the software adapter XX is introduced, the main: index.js entry file configured in the software adapter is read, and the entry file comes from the compatible package of version v2.0.0, so it can be perfectly compatible in this environment.
[0071] In some implementations, parsing the application program interface of the underlying software by the parser module further includes:
[0072] The parser module provides a use function for the software project to call the use function to register unrecognized application program interfaces and perform logical processing of unreturned patch packages.
[0073] For example, if api3 is not recognized or the current version of the underlying software A (2.0.0) has no patch, you can use import{use}from"software adapter XX" to customize the behavior of api3 by using use(api3,fn1). At this time, fn1 is registered in the software adapter, and fn1 is used when api3 is actually used, so perfect compatibility can be achieved. You don't need to pay too much attention to the differences in the api between the underlying software A1.0.0, 2.0.0 and 3.0.0 versions of the underlying software A.
[0074] Specifically, when switching the version of the underlying software A, if the underlying software A in the software project is updated and upgraded to version 3.0.0, then when installing the software adapter, there will be a software package compatible with version 3.0.0 based on the above root directory file. For the software project, the way of using API and functions has not changed, but other versions of the underlying software A can be run in the software project, which has almost no cost for the software project.
[0075] In this embodiment, the current software project development environment is automatically determined during the dependency installation process, so that environmental analysis and dependency analysis can be performed without human intervention. The API differences between the underlying software versions can be smoothed by loading software adapters, thereby reducing the additional costs caused by the underlying software version updates.
[0076] Embodiment 2
[0077] Corresponding to the above embodiment, the present application also provides a software version adaptation device, referring to Figure 3 The device includes: a dependency reading module, a dependency installation module and a loading module.
[0078] Among them, the dependency reading module is used to perform software dependency installation in response to the software project, and read the software dependency information of the software project in the configuration file, wherein the software dependency includes one or more underlying software; the dependency installation module is used to install each software dependency package and install the software adapter according to the software dependency information; the loading module is used to load the software adapter so as to adapt the software version of the software dependency to the application program interface of the software dependency through the software adapter.
[0079] Further, the software adapter includes at least one of a process manager module, an analyzer module, a memory manager module, an executor module and a parser module; the dependency installation module is also used to read the adapter package of the software adapter, initialize each module by installing the process manager module integrated with the entry file of the adapter package, call the analyzer module to perform environment analysis and dependency analysis, obtain analysis data, and write the analysis data into the memory manager module; the executor module queries the version information of the software project and the underlying software according to the analysis data, and copies the compatible package of the corresponding version to the root directory of the software adapter according to the version information;
[0080] Each compatible package includes the same entry file for calling.
[0081] Furthermore, the parser module is also used to parse the application program interface of the underlying software to determine whether the application program interface has been registered as a custom implementation within the parser, and obtain a first judgment result; if the first judgment result is that the application program interface has been registered as a custom implementation within the parser, the parser module is also used to execute the custom implementation.
[0082] Furthermore, if the first judgment result is that the application interface has not registered a custom implementation within the parser, the parser module is also used to return the patch package of each version of the underlying software based on the version information of the software project and the underlying software; the device also includes a packaging construction module, which is used to package the patch package of each version and construct a compatible package corresponding to each version of the underlying software that contains the same entry file.
[0083] Furthermore, the parser module is also used to provide a use function, so that the software project can call the use function to register an unrecognized application program interface and perform logical processing of unreturned patch packages.
[0084] Furthermore, the analysis data includes at least one of the operating environment of the software project, the publishing environment of the software project, and the name of the software dependency and the version of the software dependency.
[0085] For the specific limitations of the software version adaptation device, please refer to the relevant limitations of the software version adaptation method above, so it will not be repeated here. Each module in the above-mentioned software version adaptation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0086] Embodiment 3
[0087] Corresponding to the above embodiments, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the above software version adaptation method can be implemented.
[0088] like Figure 4As shown, in some embodiments, the system can be used as any of the above-mentioned electronic devices for the software version adaptation method in each of the embodiments. In some embodiments, the system may include one or more computer-readable media (e.g., system memory or NVM / storage device) having instructions and one or more processors (e.g., (one or more) processors) coupled to the one or more computer-readable media and configured to execute instructions to implement the module to perform the actions described in this application.
[0089] For one embodiment, the system control module may include any suitable interface controller to provide any suitable interface to at least one of the processor(s) and / or any suitable device or component in communication with the system control module.
[0090] The system control module may include a memory controller module to provide an interface to the system memory. The memory controller module may be a hardware module, a software module, and / or a firmware module.
[0091] The system memory may be used, for example, to load and store data and / or instructions for the system. For one embodiment, the system memory may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the system memory may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
[0092] For one embodiment, the system control module may include one or more input / output (I / O) controllers to provide interfaces to the NVM / storage devices and communication interface(s).
[0093] For example, the NVM / storage device may be used to store data and / or instructions. The NVM / storage device may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).
[0094] The NVM / storage device may include storage resources that are physically part of the device on which the system is installed, or it may be accessible to the device without being part of the device. For example, the NVM / storage device may be accessed over a network via (one or more) communication interfaces.
[0095] The communication interface(s) may provide an interface for the system to communicate over one or more networks and / or with any other suitable device. The system may wirelessly communicate with one or more components of a wireless network in accordance with any of one or more wireless network standards and / or protocols.
[0096] For one embodiment, at least one of the processor(s) may be packaged together with the logic of one or more controllers of a system control module (e.g., a memory controller module). For one embodiment, at least one of the processor(s) may be packaged together with the logic of one or more controllers of a system control module to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) may be integrated on the same die with the logic of one or more controllers of a system control module. For one embodiment, at least one of the processor(s) may be integrated on the same die with the logic of one or more controllers of a system control module to form a system on chip (SoC).
[0097] In various embodiments, the system may be, but is not limited to: a server, a workstation, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the system may have more or fewer components and / or a different architecture. For example, in some embodiments, the system includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application specific integrated circuit (ASIC), and a speaker.
[0098] It should be noted that the present application can be implemented in software and / or a combination of software and hardware, for example, can be implemented using an application specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented using hardware, for example, as a circuit that cooperates with a processor to perform each step or function.
[0099] In addition, a part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0100] Communication media include media by which communication signals containing, for example, computer readable instructions, data structures, program modules, or other data are transmitted from one system to another. Communication media may include guided transmission media such as cables and wires (e.g., fiber optic, coaxial, etc.) and wireless (unguided transmission) media that can propagate energy waves, such as acoustic, electromagnetic, RF, microwave, and infrared. Computer readable instructions, data structures, program modules, or other data may be embodied as a modulated data signal in, for example, a wireless medium such as a carrier wave or similar mechanism such as embodied as part of spread spectrum technology. The term "modulated data signal" refers to a signal whose one or more characteristics are changed or set in such a manner as to encode information in the signal. Modulation may be analog, digital, or a hybrid modulation technique.
[0101] Here, according to an embodiment of the present application, a device is included, which includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein, when the computer program instructions are executed by the processor, the device is triggered to run the methods and / or technical solutions based on the aforementioned multiple embodiments of the present application.
[0102] Embodiment 4
[0103] Corresponding to the above embodiment, the present application also provides a computer-readable storage medium storing computer-executable instructions, and the computer-executable instructions are used to execute the software version adaptation method.
[0104] In this embodiment, the computer-readable storage medium may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. For example, computer-readable storage media include, but are not limited to, volatile memory, such as random access memory (RAM, DRAM, SRAM); and non-volatile memory, such as flash memory, various read-only memories (ROM, PROM, EPROM, EEPROM), magnetic and ferromagnetic / ferroelectric memories (MRAM, FeRAM); and magnetic and optical storage devices (hard disks, magnetic tapes, CDs, DVDs); or other media now known or developed in the future that can store computer-readable information / data for use by computer systems.
[0105] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.
[0106] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A software version adaptation method, characterized in that: include: In response to the software project performing software dependency installation, reading software dependency information of the software project in the configuration file, the software dependency including one or more underlying software; According to the software dependency information, install each software dependency package and install a software adapter; Loading the software adapter to make the software compatible with the application program interface that the software depends on through the software adapter and adapting the software version that the software depends on; The software adapter includes at least one of a process manager module, an analyzer module, a memory manager module, an executor module, and a parser module. The installing of each software dependency package and the installing of the software adapter according to the software dependency information includes: Reading an adapter package of a software adapter, initializing each module by installing the process manager module integrated with the entry file of the adapter package, calling the analyzer module to perform environment analysis and dependency analysis, obtaining analysis data, and writing the analysis data into the memory manager module; The executor module queries the version information of the software project and the underlying software according to the analysis data, and copies the compatible package of the corresponding version to the root directory of the software adapter according to the version information; Each compatible package includes the same entry file for calling.
2. The software version adaptation method according to claim 1, characterized in that: Before copying the compatible package of the corresponding version to the root directory of the software adapter according to the version information, the method further includes: Parsing the application program interface of the underlying software through the parser module to determine whether the application program interface has been registered with a custom implementation inside the parser, thereby obtaining a first determination result; If the first judgment result is that the application program interface has registered a custom implementation inside the parser, the custom implementation is executed.
3. The software version adaptation method according to claim 2, characterized in that: If the first judgment result is that the application program interface has not registered a custom implementation in the parser, the method further includes: Returning a patch package for each version of the underlying software through the parser module according to the software project and the version information of the underlying software; The patch packages of each version are packaged to generate a compatible package corresponding to each version of the underlying software and containing the same entry file.
4. The software version adaptation method according to claim 3, characterized in that: The parsing of the application program interface of the underlying software by the parser module further includes: The parser module provides a use function for the software project to call the use function to register an unrecognized application program interface and execute logic processing of unreturned patch packages.
5. The software version adaptation method according to claim 1, characterized in that: The analysis data includes at least one of the operating environment of the software project, the publishing environment of the software project, and the name of the software dependency and the version of the software dependency.
6. A software version adaptation device for implementing the software version adaptation method as claimed in claim 1, characterized in that: The device comprises: A dependency reading module, configured to perform software dependency installation in response to a software project, and read software dependency information of the software project in a configuration file, wherein the software dependency includes one or more underlying software; A dependency installation module, used to install various software dependency packages and software adapters according to the software dependency information; The loading module is used to load the software adapter so as to make the software adapter compatible with the application program interface that the software depends on and adapt the software version that the software depends on.
7. The software version adaptation device according to claim 6, characterized in that: The software adapter includes at least one of a process manager module, an analyzer module, a memory manager module, an executor module, and a parser module; The dependency installation module is also used to read the adapter package of the software adapter, initialize each module by installing the process manager module integrated with the entry file of the adapter package, call the analyzer module to perform environment analysis and dependency analysis, obtain analysis data, and write the analysis data into the memory manager module; The executor module queries the version information of the software project and the underlying software according to the analysis data, and copies the compatible package of the corresponding version to the root directory of the software adapter according to the version information; Each compatible package includes the same entry file for calling.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the software version adaptation method as described in any one of claims 1 to 5 is implemented.
9. A computer-readable storage medium storing computer-executable instructions, characterized in that: The computer executable instructions are used to execute the software version adaptation method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-software package management method and device
CN112558980A
Distributed heterogeneous software cluster configuration management framework
CN113010229A