CN109684191B - Application package construction method, device and equipment and readable storage medium - Google Patents

Application package construction method, device and equipment and readable storage medium Download PDF

Info

Publication number
CN109684191B
CN109684191B CN201810952424.6A CN201810952424A CN109684191B CN 109684191 B CN109684191 B CN 109684191B CN 201810952424 A CN201810952424 A CN 201810952424A CN 109684191 B CN109684191 B CN 109684191B
Authority
CN
China
Prior art keywords
target
resource
value
built
package
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810952424.6A
Other languages
Chinese (zh)
Other versions
CN109684191A (en
Inventor
梁承飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201810952424.6A priority Critical patent/CN109684191B/en
Publication of CN109684191A publication Critical patent/CN109684191A/en
Application granted granted Critical
Publication of CN109684191B publication Critical patent/CN109684191B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an application package construction method, an application package construction device, application package construction equipment and a readable storage medium, wherein the application package construction method comprises the following steps: when a target application package construction instruction is detected, acquiring a target H5 resource package corresponding to the construction instruction, and acquiring a target MD5 value corresponding to the target H5 resource package; taking the target MD5 value as an associated MD5 value of a target construction task corresponding to the target application package; when a built-in instruction of an H5 resource packet is detected, acquiring the built-in H5 resource packet based on the built-in instruction, and acquiring a built-in MD5 value of the built-in H5 resource packet; and judging whether the associated MD5 value is the same as a built-in MD5 value or not, and when the target MD5 value is the same as the built-in MD5 value, building the built-in H5 resource package in the target application package. The invention solves the technical problem that the application package is easy to be abnormal in the existing application package construction process in the prior art.

Description

Application package construction method, device, equipment and readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for constructing an application package.
Background
At present, an application development team needs to frequently integrate and develop obtained files, such as code resource files, link resource files, picture resource files and the like, so as to detect errors as quickly as possible, and avoid excessive bugs occurring when an application is online, wherein the construction of an application package is an important part of an integration process, and the construction of the application package comprises a process of embedding H5 resources, which are composed of the link resource files, the picture resource files and the like, in the code resources.
Jenkins instrument is an automatic periodic integrated test tool, can accomplish the code detection of application, compile, the construction of application package automatically through Jenkins instrument, processes such as operation test, and need not manual intervention, however, at present, because the time of constructing H5 resource through Jenkins instrument and corresponding H5 resource package is shorter, and the time of placing H5 resource package in code resource is long, therefore, in the parallel in-process of constructing application package of Jenkins instrument, cause the H5 resource that application package finally embeds inconsistent with the H5 resource that the essence needs to embed and lead to the unusual technical problem of application package of constructing easily.
Disclosure of Invention
The invention mainly aims to provide an application package construction method, device, equipment and readable storage medium, and aims to solve the technical problem that in the existing process of parallel construction of an application package by a Jenkins tool, the finally built-in H5 resource of the application package is easily inconsistent with the actually required built-in H5 resource, so that the constructed application package is abnormal.
In order to achieve the above object, the present invention provides an application package construction method, including:
when an execution instruction of a target application package construction task is detected, acquiring a target H5 resource and a target code resource corresponding to the execution instruction;
packing the target H5 resource to obtain a target H5 resource packet, and storing the target H5 resource packet to a preset path;
calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task;
acquiring a built-in H5 resource packet corresponding to the target application packet construction task from the preset path, and calculating a built-in MD5 value corresponding to the built-in H5 resource packet according to the preset MD5 value calculation rule; acquiring the pre-stored associated MD5 value of the target application package construction task;
judging whether the associated MD5 value is the same as the built-in MD5 value or not, and when the associated MD5 value is the same as the built-in MD5 value, embedding the built-in H5 resource package in the folder where the target code resource is located to generate an application resource folder;
and packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
Optionally, the storing the target H5 resource packet to a preset path includes:
creating a target subfile under a preset total storage folder, and storing the target H5 resource packet in the target subfile;
the obtaining of the built-in H5 resource package corresponding to the target application package construction task from the preset path includes:
and searching a built-in subfile corresponding to the target application package construction task from all subfiles in the total storage folder, and acquiring a built-in H5 resource package from the built-in subfile.
Optionally, the creating a target subfile under a preset total storage folder, and after storing the target H5 resource package in the target subfile, includes:
acquiring preset construction completion time corresponding to the target application package construction task, and acquiring preset packaging time for packaging the target H5 resource;
calculating a time difference value between the construction completion time and the packing time, and obtaining a proportional relation between the time difference value and the packing time;
obtaining the target storage number for storing the target H5 resource packet based on the proportional relation; and counting the current storage number of the H5 resource packets in the total storage folder, when the current storage number of the H5 resource packets is greater than the target storage number, calculating a difference value between the storage number and the target storage, and deleting or covering the H5 resource packets with the difference value.
Optionally, when the storage number of the H5 resource packets is greater than the target storage number, the step of deleting or covering the H5 resource packets corresponding to the difference number includes:
and when the current storage number of the H5 resource packets is larger than the target storage number, deleting or covering the H5 resource packets corresponding to the difference number stored earlier based on the storage sequence of the corresponding H5 resource packets.
Optionally, the step of determining whether the associated MD5 value is the same as the built-in MD5 value includes:
and when the target MD5 value is different from a built-in MD5 value, generating a first prompt message for pausing the built-in H5 resource package, wherein the first prompt message comprises the name, the version number, the pause time and the associated MD5 value of the built-in H5 resource package.
Optionally, after the step of embedding the built-in H5 resource package in the folder where the target code resource is located to generate the application resource folder, when the target MD5 value is the same as the built-in MD5 value, the method further includes:
and when the built-in H5 resource packet is detected to be built in, generating second prompt information for completing the built-in.
The present invention also provides an application package constructing apparatus, including:
the first acquisition module is used for acquiring a target H5 resource and a target code resource corresponding to an execution instruction when the execution instruction of a target application package construction task is detected;
the first packing module is used for packing the target H5 resource to obtain a target H5 resource package, and storing the target H5 resource package to a preset path;
the first calculation module is used for calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task;
a second obtaining module, configured to obtain, from the preset path, a built-in H5 resource package corresponding to the target application package construction task, and calculate, according to the preset MD5 value calculation rule, a built-in MD5 value corresponding to the built-in H5 resource package; acquiring the pre-stored associated MD5 value of the target application package construction task;
the judging module is used for judging whether the associated MD5 value is the same as the built-in MD5 value or not, and when the associated MD5 value is the same as the built-in MD5 value, the built-in H5 resource package is built in a folder where the target code resource is located so as to generate an application resource folder;
and the second packaging module is used for packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
Optionally, the application package constructing apparatus further includes:
the creating module is used for creating a target subfile under a preset total storage folder and storing the target H5 resource package in the target subfile;
wherein the second obtaining module comprises:
and the searching unit is used for searching a built-in subfile corresponding to the target application package constructing task from each subfile in the total storage folder, and acquiring a built-in H5 resource package from the built-in subfile.
Optionally, the application package constructing apparatus further includes:
a third obtaining module, configured to obtain a preset construction completion time corresponding to the target application package construction task, and obtain a preset packaging time for packaging the target H5 resource;
the second calculation module is used for calculating a time difference value between the construction completion time and the packing time and obtaining a proportional relation between the time difference value and the packing time;
a fourth obtaining module, configured to obtain, based on the proportional relationship, a target storage number for storing the target H5 resource packet;
and the processing module is used for counting the current storage number of the H5 resource packets in the total storage folder, calculating the difference value between the storage number and the target storage when the current storage number of the H5 resource packets is greater than the target storage number, and deleting or covering the H5 resource packets with the difference value number.
Optionally, the processing module includes:
and the processing unit is used for deleting or covering the H5 resource packets corresponding to the number of the previously stored difference values based on the storage sequence of the corresponding H5 resource packets when the current storage number of the H5 resource packets is greater than the target storage number.
Optionally, the determining module includes:
a generating unit, configured to generate a first prompt message for pausing the built-in H5 resource package when the target MD5 value is different from the built-in MD5 value, where the first prompt message includes a name, a version number, a pause time, and the associated MD5 value of the built-in H5 resource package.
Optionally, the application package constructing apparatus further includes:
and the generating module is used for generating second prompt information for completing the built-in when the built-in H5 resource packet is detected to be completely built-in.
Further, to achieve the above object, the present invention also provides an application package constructing apparatus including: a memory, a processor, a communication bus, and an application package builder stored on the memory,
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute the application package building program to implement the steps of:
when an execution instruction of a target application package construction task is detected, acquiring a target H5 resource and a target code resource corresponding to the execution instruction;
packing the target H5 resource to obtain a target H5 resource packet, and storing the target H5 resource packet to a preset path;
calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task;
acquiring a built-in H5 resource packet corresponding to the target application packet construction task from the preset path, and calculating a built-in MD5 value corresponding to the built-in H5 resource packet according to the preset MD5 value calculation rule; acquiring the pre-stored associated MD5 value of the target application package construction task;
judging whether the associated MD5 value is the same as the built-in MD5 value or not, and when the associated MD5 value is the same as the built-in MD5 value, embedding the built-in H5 resource package in the folder where the target code resource is located to generate an application resource folder;
and packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
Further, to achieve the above object, the present invention also provides a readable storage medium storing one or more programs, the one or more programs being executable by one or more processors for:
when an execution instruction of a target application package construction task is detected, acquiring a target H5 resource and a target code resource corresponding to the execution instruction;
packing the target H5 resource to obtain a target H5 resource packet, and storing the target H5 resource packet to a preset path;
calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task;
acquiring a built-in H5 resource packet corresponding to the target application packet construction task from the preset path, and calculating a built-in MD5 value corresponding to the built-in H5 resource packet according to the preset MD5 value calculation rule; acquiring the pre-stored associated MD5 value of the target application package construction task;
judging whether the associated MD5 value is the same as the built-in MD5 value or not, and when the associated MD5 value is the same as the built-in MD5 value, embedding the built-in H5 resource package in the folder where the target code resource is located to generate an application resource folder;
and packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
When an execution instruction of a target application package construction task is detected, a target H5 resource and a target code resource corresponding to the execution instruction are obtained; packing the target H5 resource to obtain a target H5 resource packet, and storing the target H5 resource packet to a preset path; calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task; acquiring a built-in H5 resource packet corresponding to the target application packet construction task from the preset path, and calculating a built-in MD5 value corresponding to the built-in H5 resource packet according to the preset MD5 value calculation rule; acquiring the pre-stored associated MD5 value of the target application package construction task; judging whether the associated MD5 value is the same as the built-in MD5 value or not, and when the associated MD5 value is the same as the built-in MD5 value, embedding the built-in H5 resource package in the folder where the target code resource is located to generate an application resource folder; and packaging the application resource folder to obtain a target application package corresponding to the target application package construction task. In the process of parallelly constructing the application package by the Jenkins tool, although a plurality of H5 resource packages exist, or the H5 resource package generated later can replace the H5 resource package generated before, due to the unique certainty of the target MD5 value, whether the H5 resource finally built in the application package is consistent with the H5 resource which needs to be built in substantially can be judged through the target MD5 value, the abnormal construction of the application is avoided, and the technical problem that the constructed application package is abnormal due to the fact that the H5 resource finally built in the application package is inconsistent with the H5 resource which needs to be built in substantially in the prior art is solved.
Drawings
FIG. 1 is a schematic flow chart diagram of a first class of embodiments of an application package construction method according to the present invention;
fig. 2 is a schematic diagram of a detailed flow after a target subfile is created under a preset total storage folder and the target H5 resource package is stored in the target subfile in the application package construction method of the present invention;
fig. 3 is a schematic device structure diagram of a hardware operating environment related to the method according to the embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides an application package construction method, in a first class of embodiments of the application package construction method of the invention, the application package construction method comprises:
when an execution instruction of a target application package construction task is detected, acquiring a target H5 resource and a target code resource corresponding to the execution instruction; packing the target H5 resource to obtain a target H5 resource packet, and storing the target H5 resource packet to a preset path; calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task; acquiring a built-in H5 resource packet corresponding to the target application packet construction task from the preset path, and calculating a built-in MD5 value corresponding to the built-in H5 resource packet according to the preset MD5 value calculation rule; acquiring the pre-stored associated MD5 value of the target application package construction task; judging whether the associated MD5 value is the same as the built-in MD5 value or not, and when the associated MD5 value is the same as the built-in MD5 value, embedding the built-in H5 resource package in the folder where the target code resource is located to generate an application resource folder; and packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
Referring to fig. 1, the specific steps are as follows:
step S10, when an execution instruction of a target application package construction task is detected, a target H5 resource and a target code resource corresponding to the execution instruction are obtained;
in the embodiment, files such as link resources and picture resources developed by developers are stored in a determined storage address, and required files can be selectively captured from the determined storage address to construct the application package, namely in the construction process of the application package, an application resource folder needs to be packaged, and the application resource folder is obtained by embedding a built-in H5 resource package in a corresponding code resource.
It should be noted that, in this embodiment, the H5 resource refers to a picture resource, a link resource, and the like, and selective capture processing is performed on a plurality of picture resources, link resources, and the like stored in a certain storage address to obtain different H5 resources, so as to meet requirements of H5 resources built in different applications, at present, when an application package is built by a Jenkins tool, a required H5 resource package, that is, a target H5 resource package, is first built, and after the target H5 resource package, that is, a packing target H5 resource package, is built, the target H5 resource package is then built in a code resource, where a plurality of H5 resource packages are generally built in the code resource.
In the process of constructing an application package by a Jenkins tool, a plurality of tasks are often constructed in a short time, namely, a phenomenon that a plurality of constructed tasks are parallel exists, in the process of constructing the application package by the Jenkins tool, because an H5 resource package task is constructed firstly, and the storage space occupied by the corresponding file resources of the H5 resource package is generally small, the time for constructing the H5 resource package is shorter, and the storage space occupied by other corresponding file resources except the H5 resource package is larger, therefore, the time for constructing the whole complete application package is much longer than that for constructing the H5 resource package, because the time sequence type requirement of the application construction is that after other code resources of the application are constructed, the H5 resource package embedding process can be realized, namely, after a plurality of H5 resource packages are constructed and then the plurality of H5 resource packages are stored, or after the H5 resource package formed later replaces the H5 resource package formed earlier, the H5 resource package is embedded in the corresponding code resources, to complete the construction of an application package, because multiple H5 resource packages are constructed and then stored, or after the H5 resource package formed later replaces the H5 resource package formed earlier, the H5 resource package is just started to be embedded in the corresponding code resource, thereby causing the situation that the H5 resource package embedded in the code resource is wrongly embedded, which is described in the specific embodiment, if Jenkins tool synchronously and parallelly constructs a first application package of a first application and a second application package of a second application, when Jenkins parallelly constructs a task of the first application package and the second application package, the H5 resource package and the second H5 resource package are firstly constructed, wherein the first H5 resource package and the second H5 resource package respectively correspond to the first code resource embedded in the first application package and the second code resource embedded in the second application package, since the H5 resource packet is constructed at a high speed, in the construction process, a second H5 resource packet may be embedded in the first code resource, which may cause an abnormal condition of the first application packet of the first application.
In this embodiment, when an execution instruction of a target application package construction task is detected, a target H5 resource and a target code resource corresponding to the execution instruction are obtained, it should be noted that the execution instruction of the construction task carries configuration information, where the configuration information includes information, such as an initial version number of the H5 resource, a packaging environment, and a capture address of the H5 resource, that are required to be filled in a construction taskbar during construction, and after the target application package construction instruction is detected, the target H5 resource can be obtained by capturing from the capture address of the H5 resource.
Step S20, packing the target H5 resource to obtain a target H5 resource packet, and storing the target H5 resource packet to a preset path;
after the target H5 resource is obtained, packing the target H5 resource to obtain a target H5 resource package, wherein the target H5 resource may include one or more file resources, and after the target H5 resource package is obtained, storing the target H5 resource package to a preset path.
Step S30, calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task;
in this embodiment, according to a preset MD5 value calculation rule, a target MD5 value corresponding to the target H5 resource package is calculated, and the target MD5 value is used as an associated MD5 value of the target application package construction task and is stored, specifically, according to the preset MD5 value calculation rule, a process of calculating the target MD5 value corresponding to the target H5 resource package may be: calling a pre-stored MD5 value acquisition program segment, wherein the program segment comprises a preset MD5 value calculation rule, and acquiring a target digital fingerprint (target MD5 value) corresponding to the target H5 resource packet based on the preset MD5 value calculation rule, wherein the MD5 value acquisition program segment needs to be set in a built-in processor in advance after the target H5 resource packet is acquired, the MD5 value acquisition program segment represents processing logic for acquiring the MD5 value, and the processing logic is used for acquiring the target digital fingerprint (target MD5 value) corresponding to the target H5 resource packet after the target H5 resource packet is acquired.
It should be noted that the target MD5 value refers to a "digital fingerprint" of the target H5 resource packet. The MD5 value of each H5 resource packet is different, and if the H5 resource packet is modified, the MD5 value thereof, i.e. the corresponding "digital fingerprint" will be changed, for the specific embodiment, the H5 resource packet includes two picture files, the MD5 value of the H5 resource packet is t1, where t1 is formed by a series of alphanumeric numbers, and if the H5 resource packet is changed to include only one picture file, the MD5 value of the H5 resource packet is changed to t2.
And after obtaining the target MD5 value, taking the target MD5 value as the associated MD5 value of the target application package construction task and storing the associated MD5 value, namely taking the target MD5 value as the identifier of the corresponding construction task.
Step S40, acquiring a built-in H5 resource package corresponding to the target application package construction task from the preset path, and calculating a built-in MD5 value corresponding to the built-in H5 resource package according to the preset MD5 value calculation rule;
when a built-in instruction of the H5 resource package is detected, the built-in H5 resource package corresponding to the target application package construction task is obtained from the preset path, and the built-in MD5 value corresponding to the built-in H5 resource package is calculated according to the preset MD5 value calculation rule, it should be noted that the built-in H5 resource package is generally the latest generated H5 resource package selected from many generated H5 resource packages.
Step S40, obtaining the pre-stored associated MD5 value of the target application package construction task;
in this embodiment, the associated MD5 value of the target application package constructing task stored in advance is obtained, so as to compare the associated MD5 value with the built-in MD5 value.
Step S50, judging whether the associated MD5 value is the same as the built-in MD5 value, and when the associated MD5 value is the same as the built-in MD5 value, embedding the built-in H5 resource package into the folder where the target code resource is located to generate an application resource folder;
and after the associated MD5 value and the built-in MD5 value are obtained, judging whether the associated MD5 value is the same as the built-in MD5 value, and if the target MD5 value is the same as the built-in MD5 value, the selected built-in H5 resource package is a required resource package, so that the built-in H5 resource package is built in a folder where the target code resource is located to generate an application resource folder.
And S60, packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
After the built-in H5 resource package is built in the folder where the target code resource is located to generate an application resource folder, packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
When an execution instruction of a target application package construction task is detected, a target H5 resource and a target code resource corresponding to the execution instruction are obtained; packing the target H5 resource to obtain a target H5 resource packet, and storing the target H5 resource packet to a preset path; calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task; acquiring a built-in H5 resource packet corresponding to the target application packet construction task from the preset path, and calculating a built-in MD5 value corresponding to the built-in H5 resource packet according to the preset MD5 value calculation rule; acquiring the pre-stored associated MD5 value of the target application package construction task; judging whether the associated MD5 value is the same as the built-in MD5 value or not, and when the associated MD5 value is the same as the built-in MD5 value, embedding the built-in H5 resource package in the folder where the target code resource is located to generate an application resource folder; and packaging the application resource folder to obtain a target application package corresponding to the target application package construction task. In the process of parallelly constructing the application package by the Jenkins tool, although a plurality of H5 resource packages exist, or the H5 resource package generated later can replace the H5 resource package generated before, due to the unique certainty of the target MD5 value, whether the H5 resource finally built in the application package is consistent with the H5 resource which needs to be built in substantially can be judged through the target MD5 value, the abnormal construction of the application is avoided, and the technical problem that the constructed application package is abnormal due to the fact that the H5 resource finally built in the application package is inconsistent with the H5 resource which needs to be built in substantially in the prior art is solved.
Further, the present invention provides another embodiment of the application package constructing method, in the embodiment, the storing the target H5 resource package to a preset path includes:
a1, creating a target subfile under a preset total storage folder, and storing the target H5 resource package in the target subfile;
in this embodiment, in the process of building an application package by a Jenkins tool in parallel, in order to avoid that an H5 resource package packed in the latest way replaces another H5 resource package packed in the previous way, after the H5 resource package is packed, a target subfile is created under a preset total storage folder, where each target subfile is created based on an MD5 value of each H5 resource package, that is, the target H5 resource package is stored in the target subfile, it needs to be noted that each target subfile name is associated with an MD5 value of a corresponding stored target H5 resource package.
Further, after the creating a target subfile under a preset total storage folder and storing the target H5 resource package in the target subfile, the method includes:
step B1, acquiring preset construction completion time corresponding to the target application package construction task, and acquiring preset packaging time for packaging the target H5 resource;
in order to avoid that the speed of task construction is slowed down due to the fact that too many H5 resource packages are stored, in this embodiment, preset construction completion time corresponding to the target application package construction task is obtained, and preset packaging time for packaging the target H5 resource is obtained.
B2, calculating a time difference value between the construction completion time and the packing time, and obtaining a proportional relation between the time difference value and the packing time;
b3, obtaining the target storage number for storing the target H5 resource packet based on the proportional relation;
in this embodiment, a time difference between the construction completion time and the packing time is calculated, and a proportional relationship between the time difference and the packing time is obtained, where the proportional relationship may be: the time difference is 3 times the packing time. And calculating the target storage number of the target H5 resource packets through the obtained proportional relation between the time difference and the packing time. Specifically, in this embodiment, if the time difference is 3 times the packing time, the target storage number of the target H5 resource packets is 3, and it should be noted that, if the packing time with the time difference being more than 3 times is less than 4 times the packing time, the target storage number of the target H5 resource packets is 4.
And B4, counting the current storage number of the H5 resource packets in the total storage folder, calculating the difference between the storage number and the target storage when the current storage number of the H5 resource packets is greater than the target storage number, and deleting or covering the H5 resource packets with the difference number.
Counting the current storage number of the H5 resource packets in the total storage folder, and deleting or covering the H5 resource packets with the corresponding difference number when the storage number of the H5 resource packets is greater than the target storage number, wherein if the target storage number is 5 and the storage number of the H5 resource packets is 6, 1H 5 resource packet is correspondingly deleted.
Specifically, when the storage number of the H5 resource packets is greater than the target storage number, the step of deleting or covering the H5 resource packets corresponding to the difference number includes:
and step C1, when the current storage number of the H5 resource packets is larger than the target storage number, deleting or covering the H5 resource packets corresponding to the difference number stored firstly based on the storage sequence of the corresponding H5 resource packets.
When the current storage number of the H5 resource packets is greater than the target storage number, deleting or covering the H5 resource packets corresponding to the number of the previously stored difference values based on the storage sequence of the corresponding H5 resource packets, that is, in this embodiment, when the target storage number is reached, deleting the previously stored H5 resource packets first to store the newly generated H5 resource packets. The phenomenon that the construction of the corresponding application package fails because the later stored H5 resource package is not built-in when the later stored H5 resource package is deleted first is avoided.
In this embodiment, a target subfile is created in a preset total storage folder, the target H5 resource package is stored in the target subfile, a built-in subfile corresponding to the target application package construction task is searched for from each subfile in the total storage folder, and the built-in H5 resource package is obtained in the built-in subfile. The embodiment avoids the phenomenon that the matched H5 resource packet cannot be found due to the fact that the H5 resource packet is replaced when the application packet is constructed.
Further, the present invention provides another embodiment of the application package constructing method, in the embodiment, after the step of determining whether the associated MD5 value is the same as the built-in MD5 value, the step of:
step S61, when the target MD5 value is different from the built-in MD5 value, generating a first prompt message for pausing the built-in H5 resource package, where the first prompt message includes a name, a version number, a pause time, and the associated MD5 value of the built-in H5 resource package.
And when the target MD5 value is different from the built-in MD5 value, generating a pause instruction for pausing the built-in H5 resource package to pause the built-in H5 resource package, acquiring the name, the version number, the pause time, the associated MD5 value and other related information of the built-in H5 resource package, and recording the related information for subsequent query.
In this embodiment, when the target MD5 value is different from the built-in MD5 value, a first prompt message for pausing the built-in H5 resource package is generated, where the first prompt message includes a name, a version number, a pause time, and the associated MD5 value of the built-in H5 resource package. Therefore, the resource waste caused by the continuous built-in operation when the built-in H5 resource packet is not suitable for the needed H5 resource packet can be avoided.
Further, in another embodiment of the application package building method provided by the present invention, after the step of embedding the built-in H5 resource package in the folder where the object code resource is located to generate the application resource folder, when the target MD5 value is the same as the built-in MD5 value, the method further includes:
and D1, generating second prompt information for completing the built-in process when the built-in H5 resource packet is detected to be completely built-in.
In this embodiment, when it is detected that the built-in H5 resource package is completely built, the second prompt information for completing the built-in is generated. And constructing other tasks of the application package based on the second prompt message, such as constructing other picture resources or file resources.
In this embodiment, when it is detected that the H5 resource package is completely embedded, the second prompt message for completing embedding is generated. Therefore, the construction of other tasks of the application package can be triggered, and the construction process of the application package is prevented from being delayed.
Referring to fig. 3, fig. 3 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The application package constructing device in the embodiment of the invention can be a PC, and can also be a terminal device such as a smart phone, a tablet computer, an electronic book reader, an MP3 (Moving Picture Experts Group Audio Layer III, dynamic video Experts compress standard Audio Layer 3) player, an MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video Experts compress standard Audio Layer 3) player, a portable computer and the like.
As shown in fig. 3, the application package constructing apparatus may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used for realizing connection communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.
Optionally, the application package constructing device may further include a user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. The user interface may comprise a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may also comprise a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
Those skilled in the art will appreciate that the application package building apparatus configuration shown in fig. 3 does not constitute a limitation of the application package building apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 3, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, and an application package constructing program. The operating system is a program that manages and controls the hardware and software resources of the application package building apparatus, supporting the operation of the application package building program as well as other software and/or programs. The network communication module is used to implement communication between the components within the memory 1005 and with other hardware and software in the application package building apparatus.
In the application package construction device shown in fig. 3, the processor 1001 is configured to execute the application package construction program stored in the memory 1005, and implements the steps of:
when an execution instruction of a target application package construction task is detected, acquiring a target H5 resource and a target code resource corresponding to the execution instruction;
packing the target H5 resource to obtain a target H5 resource packet, and storing the target H5 resource packet to a preset path;
calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task;
acquiring a built-in H5 resource packet corresponding to the target application packet construction task from the preset path, and calculating a built-in MD5 value corresponding to the built-in H5 resource packet according to the preset MD5 value calculation rule; acquiring the pre-stored associated MD5 value of the target application package construction task;
judging whether the associated MD5 value is the same as the built-in MD5 value or not, and when the associated MD5 value is the same as the built-in MD5 value, embedding the built-in H5 resource package in the folder where the target code resource is located to generate an application resource folder;
and packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
The specific implementation of the application package constructing apparatus of the present invention is substantially the same as the embodiments of the application package constructing method described above, and details are not described herein again.
The present invention also provides an application package constructing apparatus, including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a target H5 resource and a target code resource corresponding to an execution instruction when the execution instruction of a target application package construction task is detected;
the first packing module is used for packing the target H5 resource to obtain a target H5 resource package, and storing the target H5 resource package to a preset path;
the first calculation module is used for calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task;
a second obtaining module, configured to obtain, from the preset path, a built-in H5 resource package corresponding to the target application package construction task, and calculate, according to the preset MD5 value calculation rule, a built-in MD5 value corresponding to the built-in H5 resource package; acquiring the pre-stored associated MD5 value of the target application package construction task;
a judging module, configured to judge whether the associated MD5 value is the same as the built-in MD5 value, and when the associated MD5 value is the same as the built-in MD5 value, embed the built-in H5 resource package in the folder where the object code resource is located to generate an application resource folder;
and the second packaging module is used for packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
Further, the application package constructing apparatus includes:
the creating module is used for creating a target subfile under a preset total storage folder and storing the target H5 resource package in the target subfile;
wherein the second obtaining module comprises:
and the searching unit is used for searching a built-in subfile corresponding to the target application package constructing task from each subfile in the total storage folder, and acquiring a built-in H5 resource package from the built-in subfile.
The specific implementation of the readable storage medium of the present invention is substantially the same as the embodiments of the application package construction method, and is not described herein again.
The present invention provides a readable storage medium storing one or more programs, the one or more programs being further executable by one or more processors for implementing the steps of the application package construction method of any one of the above.
The specific implementation of the readable storage medium of the present invention is substantially the same as the embodiments of the application package construction method, and is not described herein again.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An application package construction method, characterized in that the application package construction method comprises:
when an execution instruction of a target application package construction task is detected, acquiring a target H5 resource and a target code resource corresponding to the execution instruction;
packing the target H5 resource to obtain a target H5 resource packet, and storing the target H5 resource packet to a preset path;
calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task;
acquiring a built-in H5 resource packet corresponding to the target application packet construction task from the preset path, and calculating a built-in MD5 value corresponding to the built-in H5 resource packet according to the preset MD5 value calculation rule; acquiring the pre-stored associated MD5 value of the target application package construction task;
judging whether the associated MD5 value is the same as the built-in MD5 value or not, and when the associated MD5 value is the same as the built-in MD5 value, embedding the built-in H5 resource package in the folder where the target code resource is located to generate an application resource folder;
and packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
2. The application package construction method of claim 1, wherein the storing the target H5 resource package to a preset path comprises:
creating a target subfile under a preset total storage folder, and storing the target H5 resource packet in the target subfile;
the obtaining of the built-in H5 resource package corresponding to the target application package construction task from the preset path comprises:
and searching a built-in subfile corresponding to the target application package construction task from all subfiles in the total storage folder, and acquiring a built-in H5 resource package from the built-in subfile.
3. The method of claim 2, wherein the creating a target subfile under a preset total storage folder and storing the target H5 resource package in the target subfile comprises:
acquiring preset construction completion time corresponding to the target application package construction task, and acquiring preset packaging time for packaging the target H5 resource;
calculating a time difference value between the construction completion time and the packing time, and obtaining a proportional relation between the time difference value and the packing time;
obtaining the target storage number for storing the target H5 resource packet based on the proportional relation;
and counting the current storage number of the H5 resource packets in the total storage folder, when the current storage number of the H5 resource packets is greater than the target storage number, calculating a difference value between the storage number and the target storage, and deleting or covering the H5 resource packets with the difference value.
4. The method for constructing an application package according to claim 3, wherein the step of deleting or covering the H5 resource packages corresponding to the difference number when the storage number of the H5 resource packages is greater than the target storage number comprises:
and when the current storage number of the H5 resource packets is larger than the target storage number, deleting or covering the H5 resource packets corresponding to the number of the previously stored difference values based on the storage sequence of the corresponding H5 resource packets.
5. The application package construction method according to claim 1, wherein the step of determining whether the associated MD5 value is the same as the built-in MD5 value comprises:
and when the target MD5 value is different from the built-in MD5 value, generating a first prompt message for pausing the built-in H5 resource package, wherein the first prompt message comprises the name, the version number, the pause time and the associated MD5 value of the built-in H5 resource package.
6. The application package construction method of any one of claims 1-5, wherein when the target MD5 value is the same as a built-in MD5 value, after the step of building the built-in H5 resource package in the folder where the target code resource is located to generate an application resource folder, further comprises:
and when the built-in H5 resource packet is detected to be built in, generating second prompt information for completing the built-in.
7. An application package constructing apparatus, characterized by comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a target H5 resource and a target code resource corresponding to an execution instruction when the execution instruction of a target application package construction task is detected;
the first packing module is used for packing the target H5 resource to obtain a target H5 resource package, and storing the target H5 resource package to a preset path;
the first calculation module is used for calculating a target MD5 value corresponding to the target H5 resource package according to a preset MD5 value calculation rule, and storing the target MD5 value as an associated MD5 value of the target application package construction task;
a second obtaining module, configured to obtain, from the preset path, a built-in H5 resource package corresponding to the target application package construction task, and calculate, according to the preset MD5 value calculation rule, a built-in MD5 value corresponding to the built-in H5 resource package; acquiring the pre-stored associated MD5 value of the target application package construction task;
a judging module, configured to judge whether the associated MD5 value is the same as the built-in MD5 value, and when the associated MD5 value is the same as the built-in MD5 value, embed the built-in H5 resource package in the folder where the object code resource is located to generate an application resource folder;
and the second packaging module is used for packaging the application resource folder to obtain a target application package corresponding to the target application package construction task.
8. The application package building apparatus according to claim 7, wherein the application package building apparatus further comprises:
the creating module is used for creating a target subfile under a preset total storage folder and storing the target H5 resource package in the target subfile;
wherein the second obtaining module comprises:
and the searching unit is used for searching a built-in subfile corresponding to the target application package construction task from all subfiles in the total storage folder, and acquiring a built-in H5 resource package from the built-in subfile.
9. An application package construction apparatus characterized by comprising: a memory, a processor, a communication bus, and an application package builder stored on the memory,
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute the application package construction program to implement the steps of the application package construction method according to any one of claims 1 to 6.
10. A readable storage medium, characterized in that an application package construction program is stored thereon, which when executed by a processor implements the steps of the application package construction method according to any one of claims 1 to 6.
CN201810952424.6A 2018-08-21 2018-08-21 Application package construction method, device and equipment and readable storage medium Active CN109684191B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810952424.6A CN109684191B (en) 2018-08-21 2018-08-21 Application package construction method, device and equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810952424.6A CN109684191B (en) 2018-08-21 2018-08-21 Application package construction method, device and equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN109684191A CN109684191A (en) 2019-04-26
CN109684191B true CN109684191B (en) 2023-03-24

Family

ID=66185622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810952424.6A Active CN109684191B (en) 2018-08-21 2018-08-21 Application package construction method, device and equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN109684191B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955450B (en) * 2019-12-16 2023-09-29 北京智游网安科技有限公司 Attribution statistical method, system and storage medium of application package file

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402788A (en) * 2017-07-25 2017-11-28 网易(杭州)网络有限公司 Resource packing management method and device
CN108345632A (en) * 2017-12-29 2018-07-31 中国平安财产保险股份有限公司 Call method, device, equipment and the computer readable storage medium of the H5 pages

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170163816A1 (en) * 2015-12-08 2017-06-08 Le Holdings (Beijing) Co., Ltd. Mobile terminal and controlling method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402788A (en) * 2017-07-25 2017-11-28 网易(杭州)网络有限公司 Resource packing management method and device
CN108345632A (en) * 2017-12-29 2018-07-31 中国平安财产保险股份有限公司 Call method, device, equipment and the computer readable storage medium of the H5 pages

Also Published As

Publication number Publication date
CN109684191A (en) 2019-04-26

Similar Documents

Publication Publication Date Title
CN109240924B (en) Application program testing method and device
CN107193750B (en) Script recording method and device
US9990209B2 (en) Digital assistance device for facilitating multi-stage setup
CN111045952A (en) Software testing method, flow playback device, terminal equipment and readable storage medium
CN109933350B (en) Method and device for embedding codes in application and electronic equipment
CN107357726A (en) A kind of application compatibility method of testing and device
CN107957837B (en) Method and device for generating shortcut of webpage application program and terminal equipment
CN110113391B (en) Client online method and device and client operation method and device
CN107203465A (en) System interface method of testing and device
CN110716848A (en) Data collection method and device, electronic equipment and storage medium
CN110750415B (en) Interface service configuration method, device, medium and computer equipment
CN111124544A (en) Interface display method and device, electronic equipment and storage medium
CN113885935A (en) Resource packaging method and device, electronic equipment and computer readable storage medium
CN113254033A (en) Master disk file generation method and device, electronic equipment and storage medium
CN113656107A (en) Mobile application loading method and device and electronic equipment
CN112527459A (en) Log analysis method and device based on Kubernetes cluster
CN108255509A (en) Using dispositions method, device, equipment and readable storage medium storing program for executing
CN111309622A (en) Application program testing method and device, terminal equipment and storage medium
CN109684191B (en) Application package construction method, device and equipment and readable storage medium
CN107102937B (en) User interface testing method and device
CN110806913A (en) Webpage screenshot method, device and equipment
CN110543429A (en) Test case debugging method and device and storage medium
CN108509228B (en) Page loading method, terminal equipment and computer readable storage medium
CN107864038B (en) Certificate management method, device, equipment and computer readable storage medium
CN112241373A (en) Automatic test method, test device, processor and test system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant