Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind
State Software package method, apparatus, computer storage medium and the equipment of problem.
One aspect of the present invention provides a kind of Software package method, comprising:
Pre-set Software package strategy is obtained, includes packaging operation set in the Software package strategy and beats
The corresponding operating parameter of each packaging operation in package operation set;
Software packaging object, which is treated, according to the corresponding operating parameter of each packaging operation successively executes the packaging operation collection
Packaging operation in conjunction realizes Software package.
Optionally, described to be treated described in software packaging object successively executes according to the corresponding operating parameter of each packaging operation
Packaging operation in packaging operation set, comprising:
Read the packaging operation in the packaging operation set;
The packaging operation currently read is executed to software packaging object to described according to corresponding operating parameter;
Judge whether the packaging operation currently read is the last item packaging operation in packaging operation set;
If it is not, then reading next packaging operation in the packaging operation set, and according to corresponding operating parameter
The next packaging operation currently read is executed to software packaging object to described.
Optionally, described that the packing currently read behaviour is executed to software packaging object to described according to corresponding operating parameter
Make, comprising:
Obtain the operation mark of the packaging operation currently read;
Corresponding executable shell script is obtained according to the operation mark;
The executable shell script is called, is beaten to software packaging object according to the realization of corresponding operating parameter described
Packet processing.
Optionally, the method also includes:
According to custom-configuring for user, the Software package strategy is generated using preset expression templates.
Optionally, the packaging operation includes squeeze operation, decompression operations, the operation of modification filename, alternate file content
Operation, encryption file operation, decryption file in it is one or more.
Another aspect of the present invention provides a kind of Software package device, comprising:
Module is obtained, includes to be packaged for obtaining pre-set Software package strategy, in the Software package strategy
The corresponding operating parameter of each packaging operation in operational set and packaging operation set;
Execution module successively executes institute for treating software packaging object according to the corresponding operating parameter of each packaging operation
The packaging operation in packaging operation set is stated, realizes Software package.
Optionally, the execution module, comprising:
Extraction unit, for reading the packaging operation in the packaging operation set;
Execution unit, for executing the packing currently read to software packaging object to described according to corresponding operating parameter
Operation;
Judging unit, for judging whether the packaging operation currently read is that the last item is packaged behaviour in packaging operation set
Make;
The extraction unit is also used to when judging unit judgement result is the packaging operation currently read not be packaging operation
In set when the last item packaging operation, next packaging operation in the packaging operation set is read;
The execution unit is also used to execute current read to software packaging object to described according to corresponding operating parameter
Next packaging operation.
Optionally, the execution unit, specifically for obtaining the operation mark of the packaging operation currently read;According to described
Operation mark obtains corresponding executable shell script;The executable shell script is called, it is real according to corresponding operating parameter
Now the packing to software packaging object is handled.
In addition, it is stored thereon with computer program the present invention also provides a kind of computer readable storage medium, the program
The step of method as described above is realized when being executed by processor.
In addition, the present invention also provides a kind of equipment, including memory, processor and storage on a memory and can located
The step of computer program run on reason device, the processor realizes method as described above when executing described program.
Software package method, apparatus, computer storage medium and equipment provided in an embodiment of the present invention, by configuring difference
Software package strategy, customized packaging operation and the corresponding operating parameter of each packaging operation in Software package strategy,
The Software package for not having to type is realized based on different Software package strategies, effectively improves the accuracy and effect of Software package
Rate, and the packing of various types of softwares is adapted to, it is versatile.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art
Language and scientific term), there is meaning identical with the general understanding of those of ordinary skill in fields of the present invention.Should also
Understand, those terms such as defined in the general dictionary, it should be understood that have in the context of the prior art
The consistent meaning of meaning, and unless otherwise will not be explained in an idealized or overly formal meaning by specific definitions.
Fig. 1 is the flow chart of the Software package method of one embodiment of the invention.Referring to Fig.1, the embodiment of the present invention is soft
Part packaging method specifically includes the following steps:
S11, obtain pre-set Software package strategy, include packaging operation set in the Software package strategy with
And the corresponding operating parameter of each packaging operation in packaging operation set.
Wherein, packaging operation includes squeeze operation, decompression operations, modification filename operation, alternate file content operation, adds
It is one or more in close file operation, decryption file.
Packaging operation in the embodiment of the present invention, the i.e. basic operation of Software package, including but not limited to squeeze operation, solution
Press operation, modification filename operation, alternate file content operation, encryption file operation, decryption file operation etc..What is be packaged is basic
Operation is responsible for realization by the executable shell script being packaged.
Wherein, each packaging operation can be attached to several parameters, and the meaning of each parameter is determined by the packaging operation.
Software package strategy in the embodiment of the present invention includes in order a plurality of packaging operation, while specifying each packing
Operate specific operating parameter.For example the filename of squeeze operation, the filename of decompression operations modify the source filename of filename
With file destination name etc..
In the present embodiment, can custom-configuring according to user, generate the software using preset expression templates and beat
Packet strategy.Packing strategy in the embodiment of the present invention can carry out customized preparation by user, to adapt to different type software
It is packaged.
S12, software packaging object is treated according to the corresponding operating parameter of each packaging operation successively execute packing behaviour
Make the packaging operation in gathering, realizes Software package.
Software package method provided in an embodiment of the present invention, by configuring different Software package strategies, in Software package
Customized packaging operation and the corresponding operating parameter of each packaging operation in strategy are realized based on different Software package strategies
Without the Software package of type, the accuracy and efficiency of Software package is effectively improved, and it is soft to adapt to various types
The packing of part, it is versatile.
Fig. 2 is the flow chart of the Software package method of another embodiment of the present invention.Reference Fig. 2, the embodiment of the present invention
Software package method specifically includes the following steps:
S21, obtain pre-set Software package strategy, include packaging operation set in the Software package strategy with
And the corresponding operating parameter of each packaging operation in packaging operation set.
Packaging operation in S22, the reading packaging operation set;
S23, the packaging operation currently read is executed to software packaging object to described according to corresponding operating parameter;
Whether the packaging operation that S24, judgement are currently read is the last item packaging operation in packaging operation set;If no
It is, then return step S22 to read next packaging operation in the packaging operation set, and to execute step S23 with basis
Corresponding operating parameter executes the next packaging operation currently read to software packaging object to described;Otherwise it is packaged process knot
Beam.
It is described to be beaten to what the execution of software packaging object was currently read according to corresponding operating parameter described in the present embodiment
Package operation specifically includes following implemented step: obtaining the operation mark of the packaging operation currently read;According to the operation mark
Obtain corresponding executable shell script;The executable shell script is called, is realized according to corresponding operating parameter to described
Packing to software packaging object is handled.
The embodiment of the present invention can configure different packing strategies by a set of Software package shell script, each to adapt to
The packing of the software of kind, improves the efficiency and accuracy of Software package.And the program is versatile.
The process flow of the Software package method of the technology of the present invention proposition is described below by a specific embodiment
It is described, specific implementation flow is as follows:
Process 1: setting Software package strategy;
Name are as follows: Software package demonstration, as follows comprising packaging operation:
Order [1] action name [decryption oprerations] parameter 1 [upgrade.zip]
1 [upgrade.zip] parameter 2 [version.txt] of order [2] action name [decompression operations] parameter
2 [1] parameter 3 [2] of order [3] action name [alternate file content] parameter 1 [version.txt] parameter
1 [upgrade.zip] parameter 2 [A.app] parameter 3 [B.app] of order [4] action name [squeeze operation] parameter ginseng
Number 4 [version.txt]
Order [5] action name [cryptographic operation] parameter 1 [upgrade.zip]
Process 2: above-mentioned packing strategy is read, packaging operation list is got;
Process 3: first packaging operation: order [1] action name [decryption oprerations] parameter 1 [upgrade.zip] is taken out;
Process 4: according to action name [decryption oprerations], decrypting object is [upgrade.zip], then script can be
Upgrade.zip (ready in advance, and encrypted) is decrypted into non-encrypted upgrade.zip;
Process 5: judge the non-the last item operation of the packaging operation, continue to obtain next;
Process 6: next packaging operation: order [2] action name [decompression operations] parameter 1 [upgrade.zip] is taken out
Parameter 2 [version.txt], then script presses out the version.txt solution inside upgrade.zip compressed package;
Process 7: judge the non-the last item operation of the packaging operation, continue to obtain next;
Process 8: next packaging operation: order [3] action name [alternate file content] parameter 1 is taken out
2 [1] parameter 3 [2] of [version.txt] parameter, then 1 inside version.txt is changed to 2 by script;
Process 9: judge the non-the last item operation of the packaging operation, continue to obtain next;
Process 10: next packaging operation: order [4] action name [squeeze operation] parameter 1 [upgrade.zip] is taken out
3 [B.app] parameter 4 [version.txt] of parameter 2 [A.app] parameter, then script is A.app, B.app, version.txt,
It is compressed in upgrade.zip;
Process 11: judge the non-the last item operation of the packaging operation, continue to obtain next;
Process 12: next packaging operation: order [5] action name [cryptographic operation] parameter 1 is taken out
[upgrade.zip], then script encrypts upgrade.zip;
Process 13: judge that the packaging operation is the last item operation, being packaged process terminates.
Software package method provided in an embodiment of the present invention at least has the advantages that
(1) by a set of general Software package script, software automatic packaging is carried out.
(2) by configuring different packing strategies, it is suitable for different types of Software package.
(3) personalization of packaging operation is realized by being passed to the parameter of different operation.
For embodiment of the method, for simple description, therefore, it is stated as a series of action combinations, but this field
Technical staff should be aware of, and embodiment of that present invention are not limited by the describe sequence of actions, because implementing according to the present invention
Example, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know that, specification
Described in embodiment belong to preferred embodiment, the actions involved are not necessarily necessary for embodiments of the present invention.
Fig. 3 diagrammatically illustrates the structural schematic diagram of the Software package device of one embodiment of the invention.Referring to Fig. 3, originally
The Software package device of inventive embodiments, which specifically includes, obtains module 301 and execution module 302, in which:
Module 301 is obtained, includes to beat for obtaining pre-set Software package strategy, in the Software package strategy
The corresponding operating parameter of each packaging operation in package operation set and packaging operation set.The packaging operation includes compression behaviour
Work, decompression operations, modification filename operation, alternate file content operation, encryption file operation, decrypt file in one or more
?.
Execution module 302 is successively held for treating software packaging object according to the corresponding operating parameter of each packaging operation
Packaging operation in the row packaging operation set, realizes Software package.
In the embodiment of the present invention, the execution module 302 specifically includes extraction unit, execution unit and judging unit,
In:
Extraction unit, for reading the packaging operation in the packaging operation set;
Execution unit, for executing the packing currently read to software packaging object to described according to corresponding operating parameter
Operation;
Judging unit, for judging whether the packaging operation currently read is that the last item is packaged behaviour in packaging operation set
Make;
The extraction unit is also used to when judging unit judgement result is the packaging operation currently read not be packaging operation
In set when the last item packaging operation, next packaging operation in the packaging operation set is read;
The execution unit is also used to execute current read to software packaging object to described according to corresponding operating parameter
Next packaging operation.
Further, the execution unit, specifically for obtaining the operation mark of the packaging operation currently read;According to institute
It states operation mark and obtains corresponding executable shell script;The executable shell script is called, according to corresponding operating parameter
It realizes and the packing to software packaging object is handled.
In the embodiment of the present invention, described device further includes attached configuration module not shown in the figure, which is used for root
According to custom-configuring for user, the Software package strategy is generated using preset expression templates.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness
Labour in the case where, it can understand and implement.
Software package method, apparatus provided in an embodiment of the present invention, by configuring different Software package strategies, in software
It is packaged customized packaging operation and the corresponding operating parameter of each packaging operation in strategy, based on different Software package strategies
It realizes the Software package for not having to type, effectively improves the accuracy and efficiency of Software package, and adapt to various inhomogeneities
The packing of type software, it is versatile.
In addition, it is stored thereon with computer program the embodiment of the invention also provides a kind of computer readable storage medium,
The step of program realizes method as described above when being executed by processor.
In the present embodiment, if module/unit that the Software package device integrates is real in the form of SFU software functional unit
Now and when sold or used as an independent product, it can store in a computer readable storage medium.Based in this way
Understanding, the present invention realize above-described embodiment method in all or part of the process, can also be instructed by computer program
Relevant hardware is completed, and the computer program can be stored in a computer readable storage medium, the computer program
When being executed by processor, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer
Program code, the computer program code can be source code form, object identification code form, executable file or certain centres
Form etc..The computer-readable medium may include: can carry the computer program code any entity or device,
Recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software
Distribution medium etc..It should be noted that the content that the computer-readable medium includes can be according to making laws in jurisdiction
Requirement with patent practice carries out increase and decrease appropriate, such as in certain jurisdictions, according to legislation and patent practice, computer
Readable medium does not include electric carrier signal and telecommunication signal.
Fig. 4 is the schematic diagram of equipment provided in an embodiment of the present invention.Equipment provided in an embodiment of the present invention, including memory
401, processor 402 and the computer program that can be run on memory 401 and on the processor 402, the processor are stored in
The step in above-mentioned each Software package embodiment of the method is realized when the 402 execution computer program, such as shown in FIG. 1
S11, pre-set Software package strategy is obtained, includes packaging operation set and packing behaviour in the Software package strategy
Work gather in the corresponding operating parameter of each packaging operation.S12, packing is treated according to the corresponding operating parameter of each packaging operation
Software object successively executes the packaging operation in the packaging operation set, realizes Software package.Alternatively, the processor 402
The function of each module/unit in above-mentioned each Software package Installation practice, such as Fig. 3 institute are realized when executing the computer program
The acquisition module 301 and execution module 302 shown.
Illustratively, the computer program can be divided into one or more module/units, one or more
A module/unit is stored in the memory, and is executed by the processor, to complete the present invention.It is one or more
A module/unit can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing institute
State implementation procedure of the computer program in the Software package device.It is obtained for example, the computer program can be divided into
Modulus block 301 and execution module 302.
The equipment can be desktop PC, notebook, palm PC and cloud server etc. and calculate equipment.It is described
Equipment may include, but be not limited only to, processor, memory.It will be understood by those skilled in the art that the schematic diagram 4 is only
The example of the equipment does not constitute the restriction to equipment, may include components more more or fewer than diagram, or combine certain
A little components or different components, such as the equipment can also include input-output equipment, network access equipment, bus etc..
The processor can be central processing unit (Central Processing Unit, CPU), can also be it
His general processor, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng the processor is the control centre of the equipment, utilizes the various pieces of various interfaces and connection whole equipment.
The memory can be used for storing the computer program and/or module, and the processor is by operation or executes
Computer program in the memory and/or module are stored, and calls the data being stored in memory, described in realization
The various functions of equipment.The memory can mainly include storing program area and storage data area, wherein storing program area can deposit
Application program (such as sound-playing function, image player function etc.) needed for storing up operating system, at least one function etc.;Storage
Data field, which can be stored, uses created data (such as audio data, phone directory etc.) etc. according to mobile phone.In addition, memory can
It can also include nonvolatile memory, such as hard disk, memory, plug-in type hard disk, intelligence to include high-speed random access memory
Energy storage card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash
Card), at least one disk memory, flush memory device or other volatile solid-state parts.
In embodiments of the present invention, it should be understood that disclosed device and method, it can be real by another way
It is existing.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit or unit, only
A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or
Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of equipment or unit
It connects, can be electrical or other forms.
It will be appreciated by those of skill in the art that although some embodiments in this include included in other embodiments
Certain features rather than other feature, but the combination of the feature of different embodiments means to be within the scope of the present invention simultaneously
And form different embodiments.For example, in the following claims, the one of any of embodiment claimed all may be used
Come in a manner of in any combination using.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.