Rapid configuration of software

In a field of software configuration, a technology of migrating and configuring software rapidly by determining a correspondence between device specific information and a specific configuration file location recording such information. According to one aspect of the present invention, a method for software fast configuration is provided comprising: obtaining and analyzing a software configuration program to identify a method related to the device specific information in the software configuration program; adding an identification to the device specific information obtained by the method related to the specific device information; and determining a correspondence between the device specific information and its record location in a software configuration file based on the added identification. According to the technical solution of the present invention, the correspondence between the record location in the configuration file and the device specific information may be automatically recorded and/or may be used for rapid configuration of software.

CROSS REFERENCE TO RELATED APPLICATION

This Application claims the benefit of priority to China Patent Application Serial No. 201210428865.9, filed on Oct. 31, 2012, the contents of which are hereby incorporated by reference.

BACKGROUND

The present invention relates to the field of software configuration. More specifically, to a technology of migrating and configuring software rapidly through determining a correspondence between device-specific information and a specific configuration file location recording the information.

At present, with the expedite development of virtualization and cloud computing technology, rapid configuration of software becomes more and more significant. Software configuration becomes particularly significant in the scenario of software migration. The software migration refers to migrating software from one machine to another machine; generally, the “machine” here refers to a virtual machine. For example, in a cloud platform, the software is migrated from one virtual machine to another virtual machine. During the running process, the software needs to rely on the software configuration file as generated upon installation. The software configuration file records much significant parameter information which is also called “device specific information”. The specific device parameter information on which the same software relies when running on different virtual machines or physical machines, which also cause a major problem in software migration process: how to improve the software migration speed and efficiency as far as possible while guaranteeing the correctness of software migration configuration file.

The prior art has proposed a plurality of technical solutions of resolving software configuration during a software migration process. First, specific scripts are written for the software and the migration of the software is performed between different virtual machines using the written scripts. The drawbacks of this solution lie in that compilation of the script program needs a more in-depth understanding on the software, which has to consume a considerable amount of manpower. Moreover, each script is merely suitable for a particular piece of software and thus is not universal.

Second, when it is required to newly start a virtual machine, the software has to be re-installed and configured. A significant drawback of this solution is much time-consuming. For lots of large business software, it would consume couples of hours to re-install and configure.

Third, the software deployment environment is limited, i.e., migration is limited merely in a running environment having the same device specific information. This limitation actually goes against the technical development trend of the open platform of cloud computing, which does not realize a true software migration.

To sum up, a main problem in the prior art is that the record location of the device specific information in software configuration cannot be obtained, and therefore it is impossible to reuse the existing software configuration file during the software migration process, which causes low efficiency of software configuration.

SUMMARY

In view of the above problems, one of the objectives of the present invention lies in providing a technical solution for rapid configuration of software or providing a technical solution of rapidly and correctly perform software configuration during software migration. Another objective of the present invention is providing a technical solution for automatically recording the correspondence between a record location in a configuration file and device specific information. The above inventive objectives may stand independently, and it is unnecessary to satisfy all mentioned inventive objectives simultaneously.

According to one aspect of the present invention, a method for rapid configuration of software is provided. The method comprises obtaining and analyzing a software configuration program to identify a method related to the device specific information in the software configuration program; adding an identification to a string value of the device specific information obtained by the method related to the specific device information; and determining a correspondence between the device specific information and its record location in a software configuration file based on the added identification.

According to a further aspect of the present invention, a system for rapid configuration of software is provided. The system comprises an identifying module configured to obtain and analyze a software configuration program to identify a method related to the device specific information in the software configuration program; an identification adding module configured to add an identification to a string value of the device specific information obtained by the method related to the specific device information; and a correspondence determining module configured to determine a correspondence between the device specific information and its record location in a software configuration file.

According to the method or system provided by the present invention, the correspondence between the record location in the configuration file and the device specific information may be automatically recorded and/or may be used for rapid configuration of software.

DETAILED DESCRIPTION

Hereinafter, a method and system for rapid configuration of software according to the present invention will be described in detail through preferred embodiments with reference to the drawings.

Now, refer toFIG. 1.FIG. 1shows an exemplary computer system100which is applicable to implement the embodiments of the present invention. As illustrated inFIG. 1, the computer system100may comprise: a CPU (Central Processing Unit)101, a RAM (Random Access Memory)102, a ROM (Read Only Memory)103, a system bus104, a hard disk controller105, a keyboard controller106, a serial interface controller107, a parallel interface controller108, a monitor controller109, a hard disk110, a keyboard111, a serial peripheral device112, a parallel peripheral device113and a monitor114. Among these components, connected to the system bus104are the CPU101, the RAM102, the ROM103, the hard disk controller105, the keyboard controller106, the serial interface controller107, the parallel interface controller108and the monitor controller109. The hard disk110is coupled to the hard disk controller105; the keyboard111is coupled to the keyboard controller106; the serial peripheral device112is coupled to the serial interface controller107; the parallel peripheral device113is coupled to the parallel interface controller108; and the monitor114is coupled to the monitor controller109. It should be understood that the structural block diagram inFIG. 1is shown only for illustration purpose, and is not intended to limit the scope of the present invention. In some cases, some devices may be added or reduced as required.

Next,FIG. 2will be introduced.FIG. 2shows a flow chart of a method for rapid configuration of software according to one embodiment of the present invention. The method as shown inFIG. 2starts from step201. At step201, a software configuration program is obtained and analyzed to identify a method related to device specific information in the software configuration process. The “method” here may be considered as a certain function in a program. The “software program function” is different from the software program itself and refers to a program which is needed to execute during the installation process, for example, an installer program, etc. According to one embodiment of the present invention, the device specific information comprises at least one of the following: a host name, an IP address, a MAC address, and a file path. Correspondingly, the method related to the device specific information may be getHostName( ) (“host name”), getHostAddress( ) (“IP address”), getWindowsMACAddress( ) (“MAC address”), and getAbsolutePath( ) (“file path”). Such methods related to the device specific information may obtain corresponding string value, for example, the value of the HostName is “apple.” During the running of the configuration program, these obtained string values will be written into the configuration file of the software. Those skilled in the art should understand that the device specific information may further comprise a plurality of other kinds, and accordingly, the methods related to the device specific information in the software configuration program might also be plural. It should be further noted that the program code may be analyzed using the existing technical means to identify a particular type of method, which will not be detailed here.

Next, the method ofFIG. 2proceeds to step202to add an identification to specific device information obtained by the method related the device specific information. The objective of adding an identification is to track string values of the device specific information as read/obtained by these methods related to the device specific information, in order to locate the file location for writing in the subsequent process of writing these strings into the configuration file. Therefore, the added identification may also be understood as an “ID for tracking device specific information string value”. According to one embodiment of the present invention, adding an identification to the identified method related to the device specific information comprises: replacing the identified method related to the device specific information with a new method with the identification, the identification being used to distinguish different device specific information. Those skilled in the art should understand that the code injection technology is an existing technology, which may modify the target code of the program by injecting the code of byte-code without obtaining the source code of the program. The program languages that may employ the code injection on the level of target code comprise, for example, Java, Ruby, PHY, C#, etc. The implementation details of code injection will not be detailed here. According to these embodiments, although the object of adding an identification is a specific value of the device specific information, it may perform the code injection operation in the method of the configuration program before the configuration program reads the specific value for the device specific information, such that once the value of the device specific information is read by executing the configuration program, an identification may be automatically added thereto.FIGS. 4A and 4Billustrate a method related to the device specific information before code injection and a new method after the code injection. It can be seen fromFIG. 4Athat the original method related to the device specific information in the software configuration program is getHostName( ) After the code injection, as shown inFIG. 4B, the original getHostName( ) is renamed and set as a private method; in this example, the getHostName( ) is modified as getHostNamelmpl( ); while the new gctHostnamc( ) getHostName( ) method first calls the getHostNamelmpl to obtain a real hostname, and an identification (tracking ID) is assigned to the method related to the device specific information, i.e., generating a specific identification by ConfigurationAnalyzer.getTrackID. In the meantime, a tracking list is created to track the device specific information. The tracking list takes the IDs for tracking the string value of the device specific information as the keywords, and takes the original values as the values. Those skilled in the art should understand that an identification may be constructed in a plurality of manners. For example, the added identification may be defined as “data type+DSC+original value”; then, suppose the HostName value obtained by the original method is “apple,” then adding the identification to the value “apple” read by the original method results in “Hostname-DSC-apple.” This is only a specific manner of generating an identification, and those skilled in the art may of course employ a plurality of other manners to define the generation rule for the identification. Suppose the string value of the HostName obtained by the software configuration program without code injection as inFIG. 4Ain execution is “Apple,” then the string value of the HostName obtained by the software configuration program after injection as shown inFIG. 4Bin execution is automatically changed into “Hostname-DSC-apple.”

Next, at step203, a correspondence between the device specific information and its record location in a software configuration file is determined based on the added identification. First, it should be noted that the execution of the software configuration program may be generally divided into two phases. In the first phase, the configuration program executes the method related to the device specific information in order to obtain the value (string value) of the device specific information adapted to a specific running environment. Then in the second phase, these obtained string values of the device specific information will be written into the configuration file of the software. The step203may be understood as being executed during the second phase of writing into the configuration file. Since an identification has been added to the read string value of the device specific information at step202, it is possible at step203to track and record the path as well as the row and column of the configuration file where the specific string is written with the added identification, such that the correspondence between the device specific information and its record location in the software configuration file may be determined.

As above mentioned, once the correspondence between the device specific information and its record location in the software configuration file is established, in the subsequent process of software re-configuration or in the subsequent configuration process after software migration, it is only necessary to use such correspondence to acquire the string value of the device specific information under the new environment such that the software configuration can be accomplished by directly replacing the new string value into the old string at the corresponding location in the corresponding configuration file. It is unnecessary to re-perform the time-consuming software re-installation and manual configuration work, or to write a particular configuration script for each piece of software. Moreover, it has a strong versatility.

FIG. 3shows a flowchart of a method for rapid configuration of software according to another embodiment of the present invention. At step301, a software configuration program is obtained and analyzed to identify a method related to the device specific information in the software configuration program. At step302, the identified method related to the device specific information is replaced, by code injection, with the new method having an identification, the identification being used to distinguish different device specific information. The step301may be understood as corresponding to step201inFIG. 2, and step302has been described in detail inFIG. 2as a specific embodiment, which will not be detailed here.

At step303, the string writing method in the software configuration program is replaced, by code injection, with a method for detecting whether the string to be written into the software configuration has the added identification. The software configuration program generates a configuration file by executing a writing operation, but not all the written strings are device specific information. For those strings which are not device specific information, it is unnecessary to make any modifications during the software migration or reconfiguration process.FIGS. 4C and 4Dshow a writing method before and after code injection according to one embodiment of the present invention. The writing method write ( ) inFIG. 4Cis renamed and set as a private method. In this example, write( ) is modified as writeImpl( ), and the new write( ) method is for detecting whether a string to be written into the software configuration file has the added identification. From the injected code of the new method as shown inFIG. 4D, it is also be seen that the end of the code segment is restored to the original string value, i.e., the string value of the device specific information finally written into the configuration file is still “apple” instead of “Hostname-DSC-apple” with the identification being added. This ensures the correctness of the current configuration file information.

Next, at step304, it is decided whether the string to be written into the software configuration file has the added identification. Because the previously added identification has been recorded and its correspondence with the original string has been recorded in the tracking list, when the software configuration program is to execute the writing method, if it is decided that the string to be written into the software configuration file has the previously added identification, then the process proceeds to step305to obtain the information on the specific location in the software configuration file where the string is to be written. If it is decided that the string that to be written into the software configuration file has no the previously added identification, it means that this string is not the device specific information and therefore it is unnecessary to track its writing location in the configuration file. As a result, no information on the specific location in the software configuration file where the string is written is obtained.

At step305, according to one embodiment of the present invention, in response to a positive result of the decision, obtaining the information on the specific location in the software configuration file where the string is written comprises: in response to a positive result of the decision, obtaining a software configuration file path where the string to be written is written; and obtaining row and column information of the string to be written in a destination software configuration file. Because the software configuration information of the software may be recorded into a plurality of configuration files having different file paths, it is necessary to obtain information on the specific file path where the specific string is written. Besides, according to one embodiment of the present invention, in order to locate the written string of the device specific information in the configuration file more accurately, the row and column information in the destination software configuration file may be further obtained. Those skilled in the art should understand that it belongs to the prior art how to obtain the row and column in the file where the string is written. For example, it is possible to calculate an initial location of the string based on the number of the line breaks and then analyze the length of the string to obtain the specific row and column information, which will not be detailed here.

It should be noted that the decision at step304is repeated for each and every writing method in the configuration program until all the writing methods are completely executed. For the sake of brevity, the diagram of cyclic execution is not shown inFIG. 3.

Next, the method shown inFIG. 3proceeds to step306where the correspondence between the device specific information and the specific location information is recorded. Those skilled in the art should understand that the correspondence may be recorded by means of a file or any other data storage. As an example,FIG. 5illustrates a record of the correspondence between the device specific information and the specific location information according to one embodiment of the present invention. As shown inFIG. 5, for the device specific information “HostName,” its value “apple” under the current running environment is written into four different locations (different row, column values) in three different configuration files during the software configuration process.

Given such correspondence record, once the software needs to be deployed on another running environment (for example, a virtual machine), step307may be performed to obtain the new device specific information of the software in the new running environment, and then step308may be performed to use the correspondence to replace the original device specific information in the software configuration with new device specific information, thereby achieving rapid configuration of software. For example, it is determined at step307that the value HostName of the software in the new running environment is “pear,” then at step308, according to the record of the correspondence shown inFIG. 5, the string “pear” is used to replace the character “apple” at the corresponding location in the original configuration file, so as to rapidly implement the software configuration without re-installing the software.

It should be further noted that steps307and308are shown in a frame inFIG. 3for the purpose of emphasizing that the two steps are not essential steps or required means of implementing the inventive objective. As long as the correspondence record as shown inFIG. 5is obtained, the objective of the present invention is implemented, because such correspondence is sufficient to rapidly implement the software configuration. As to how to specifically utilize this correspondence record to actually implement the configuration task of the software, it will not affect the realization of the objective of the present invention. For example, even if the string in the corresponding configuration file is manually amended based on the correspondence relationship, the speed and efficiency of software configuration may be improved greatly.

Those skilled in the art should understand that the schematic example regarding code injection as provided above in the form of source code is only for making the example more comprehensible. During the actual code injection operation process, modification and replacement of the code may be directly performed in the target code layer, without the need of obtaining the source code of the configuration program.

FIG. 6shows a block diagram of a system for rapid configuration of software according to one embodiment of the present invention. The system as shown inFIG. 6is generally indicated as system600. Specifically, the system600comprises an identifying module601configured to obtain and analyze a software configuration program to identify a method related to the device specific information in the software configuration program; an identification adding module602configured to add an identification to a string value of the device specific information obtained by the method related to the specific device information; and a correspondence determining module603configured to determine a correspondence between the device specific information and its record location in a software configuration file based on the added identification. The modules601-603in the system600correspond to steps201-203in the method as shown inFIG. 2, which will not be detailed here.

The flowcharts and block in the figures illustrate the system, methods, as well as architecture, functions and operations executable by a computer program product according to the embodiments of the present invention. In this regard, each block in the flowcharts or block diagrams may represent a module, a program segment, or a part of code, which contains one or more executable instructions for performing specified logic functions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown consecutively may be performed in parallel substantially or in an inverse order. This depends on relevant functions. It should also be noted that each block in the block diagrams and/or flowcharts and a combination of blocks in the block diagrams and/or flowcharts may be implemented by a dedicated hardware-based system for performing specified functions or operations or by a combination of dedicated hardware and computer instructions.

Though the system and method for processing a local document with remote application has been described in detail with reference to preferred embodiments, the present invention is not limited to this. A person of normal skill in the art can make various changes, alterations and modifications to the present invention under the teaching of the description without departing from the spirit and scope of the present invention It should be understood that all such changes, alterations, and modifications still fall into the protection scope of the present invention. The protection scope of the present invention is defined by the appending claims.