CN111596935A - Script packing method and device, electronic equipment and storage medium - Google Patents

Script packing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111596935A
CN111596935A CN202010342217.6A CN202010342217A CN111596935A CN 111596935 A CN111596935 A CN 111596935A CN 202010342217 A CN202010342217 A CN 202010342217A CN 111596935 A CN111596935 A CN 111596935A
Authority
CN
China
Prior art keywords
script
demand
lower layer
updated
basic
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.)
Pending
Application number
CN202010342217.6A
Other languages
Chinese (zh)
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.)
Wuba Co Ltd
Original Assignee
Wuba 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 Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN202010342217.6A priority Critical patent/CN111596935A/en
Publication of CN111596935A publication Critical patent/CN111596935A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application provides a script packing method, a script packing device, electronic equipment and a storage medium, wherein a packing instruction is received at first, and the packing instruction comprises an entry file of a basic script in an application program to be updated. And detecting whether the basic script has a lower-layer script to be loaded according to requirements or not by traversing each entry information in the entry file, and if so, sequentially packaging each lower-layer script to be loaded according to requirements to obtain an updated unique identifier corresponding to each lower-layer script to be loaded according to requirements. And then, updating the unique identifier corresponding to each lower layer of the base script according to the needs to obtain the updated base script. And finally, packaging the updated basic script to obtain the unique identifier of the updated basic script so as to complete the updating of the application program to be updated.

Description

Script packing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of application development, and in particular, to a script packing method and apparatus, an electronic device, and a storage medium.
Background
In order to meet the requirements of cross-platform running and dynamic updating of an application, a developer may generally develop the application in a cross-platform mobile application development framework (RN), and the application developed in this way is an RN application. Typically, a RN application has multiple code repositories, each corresponding to a different script, which includes a base script for implementing the basic functions of the RN application and an on-demand script for implementing different requirements of the user.
With the changing user demands and the optimization of various performances of the application programs, developers need to update the application programs continuously. In the process of updating an application, each script in the application is generally required to be updated. In order to update the scripts, developers need to sequentially find the code warehouses corresponding to each script on the development platform, package the updated codes in each code warehouse, finally obtain the updated scripts corresponding to each script, and place the updated scripts into a Content Delivery Network (CDN) for users to use.
If the application program contains a large number of scripts, errors and omissions are easy to occur no matter in the stage of determining the code warehouse corresponding to each script or in the stage of packaging operation of the updated codes by adopting the manual packaging updating mode.
Disclosure of Invention
The application provides a script packing method and device, electronic equipment and a storage medium, so as to improve the updating quality of an application program.
In a first aspect, the present application provides a script packing method, including:
receiving a packaging instruction, wherein the packaging instruction comprises an entry file of a basic script in an application program to be updated, the basic script is a script for realizing basic functions of the application program to be updated, the entry file is a first accessed file in all files of the basic script, and the entry file comprises entry information of each file in the basic script;
traversing each entry information in the entry file, and detecting whether a lower layer on-demand script exists or not, wherein the lower layer on-demand script is an on-demand script having a dependency relationship with the basic script, and the on-demand script is a script for realizing a function corresponding to a user requirement;
if the lower layer on-demand scripts exist, packaging each lower layer on-demand script to obtain an updated unique identifier corresponding to each lower layer on-demand script;
updating the unique identifier corresponding to each lower layer on-demand script in the basic script to generate an updated basic script;
and packaging the updated basic script to obtain the unique identifier of the updated basic script.
In a possible implementation manner of the first aspect of the embodiment of the present invention, the packaging each lower layer on-demand script includes:
detecting whether the lower layer on-demand script exists in a next lower layer on-demand script, wherein the next lower layer on-demand script is an on-demand script which has a dependency relationship with the lower layer on-demand script;
if the sub-lower layer on-demand script exists, packaging each sub-lower layer on-demand script to obtain a unique identifier corresponding to each sub-lower layer on-demand script;
updating the unique identifier corresponding to each lower layer on-demand script in the lower layer on-demand script to obtain an updated lower layer on-demand script;
and packaging the updated lower layer on-demand script to obtain the unique identifier of the updated lower layer on-demand script.
In a possible implementation manner of the first aspect of the embodiment of the present invention, the detecting whether the lower layer on-demand script has a next lower layer on-demand script further includes:
and if the next lower layer on-demand script does not exist, directly packaging the lower layer on-demand script to obtain the updated unique identifier corresponding to the lower layer on-demand script.
In a possible implementation manner of the first aspect of the embodiment of the present invention, the packing instruction further includes a warehouse address and a code branch corresponding to the lower layer on-demand script of the base script, and the packing each lower layer on-demand script includes:
obtaining a warehouse address and a code branch corresponding to each lower layer on-demand script from the packaging instruction, wherein the warehouse address is a storage position of a corresponding code warehouse of the lower layer on-demand script in a corresponding database of the application program to be updated, and the code branch is used for representing a code version of the lower layer on-demand script;
acquiring a code warehouse of the lower layer loading script as required from a database corresponding to the application program to be updated according to the warehouse address; acquiring updated codes of the lower layer on-demand loading scripts from the code warehouse according to the code branches;
and packaging the updated codes of each lower layer on-demand script to obtain an updated unique identifier corresponding to each lower layer on-demand script.
In a possible implementation manner of the first aspect of the embodiment of the present invention, the packing instruction further includes a warehouse address and a code branch corresponding to the base script, and the packing the updated base script to obtain the unique identifier of the updated base script includes:
acquiring a warehouse address and a code branch corresponding to the basic script from the packaging instruction, wherein the warehouse address corresponding to the basic script is a storage position of a corresponding code warehouse of the basic script in a database corresponding to the application program to be updated, and the code branch of the basic script is used for representing a code version of the basic script;
acquiring a code warehouse of the basic script from a database corresponding to the application program to be updated according to the warehouse address of the basic script;
acquiring updated codes of the basic script from a code warehouse of the basic script according to the code branches of the basic script;
and packaging the updated code of the basic script and the unique identifier corresponding to each lower-layer on-demand loading script to obtain the unique identifier of the updated basic script.
In a second aspect, the present application provides a script packing apparatus, the apparatus comprising:
the system comprises a packaging instruction receiving module, a packaging instruction receiving module and a packaging instruction transmitting module, wherein the packaging instruction comprises an entry file of a basic script in an application program to be updated, the basic script is a script for realizing basic functions of the application program to be updated, the entry file is a first accessed file in all files of the basic script, and the entry file comprises entry information of each file in the basic script;
the information traversing module is used for traversing each entry information in the entry file and detecting whether a lower layer on-demand script exists or not, wherein the lower layer on-demand script is an on-demand script which has a dependency relationship with the basic script, and the on-demand script is a script for realizing a function corresponding to a user requirement;
the lower layer on-demand script packing module is used for packing each lower layer on-demand script if the lower layer on-demand script exists to obtain an updated unique identifier corresponding to each lower layer on-demand script;
the basic script updating module is used for updating the unique identifier corresponding to each lower layer loading script in the basic script as required to generate an updated basic script;
and the script packing module is used for packing the updated basic script to obtain the unique identifier of the updated basic script.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the lower layer on-demand script packing module includes:
the detection module is used for detecting whether the lower layer on-demand script exists in the lower layer on-demand script, and the lower layer on-demand script is an on-demand script which has a dependency relationship with the lower layer on-demand script;
the first packing module is used for packing each sub-lower layer on-demand script if the sub-lower layer on-demand script exists to obtain a unique identifier corresponding to each sub-lower layer on-demand script;
the updating module is used for updating the unique identifier corresponding to each next lower layer on-demand script in the lower layer on-demand scripts to obtain updated lower layer on-demand scripts;
and the second packing module is used for packing the updated lower layer on-demand script to obtain the unique identifier of the updated lower layer on-demand script.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the lower layer on-demand script packing module further includes:
and the third packing module is used for directly packing the lower layer on-demand script if the lower layer on-demand script does not exist, and obtaining the updated unique identifier corresponding to the lower layer on-demand script.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the lower layer on-demand script packing module includes:
a first information obtaining module, configured to obtain, from the packing instruction, a warehouse address and a code branch corresponding to each lower layer on-demand script, where the warehouse address is a storage location of a corresponding code warehouse of the lower layer on-demand script in a database corresponding to the application to be updated, and the code branch is used to represent a code version of the lower layer on-demand script;
the first code warehouse acquisition module is used for acquiring a code warehouse of the lower layer loading script as required from the database corresponding to the application program to be updated according to the warehouse address;
the first updated code acquisition module is used for acquiring updated codes of the lower layer on-demand loading script from the code warehouse according to the code branches;
and the first sub-packaging module is used for packaging the updated codes of each lower layer on-demand loading script to obtain an updated unique identifier corresponding to each lower layer on-demand loading script.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the lower layer on-demand script packing module includes:
a second information obtaining module, configured to obtain, from the packing instruction, a warehouse address and a code branch corresponding to the basic script, where the warehouse address corresponding to the basic script is a storage location of a code warehouse corresponding to the basic script in a database corresponding to the application program to be updated, and the code branch of the basic script is used to represent a code version of the basic script;
the second code warehouse acquisition module is used for acquiring a code warehouse of the basic script from the database corresponding to the application program to be updated according to the warehouse address of the basic script;
the second updated code acquisition module is used for acquiring the updated codes of the basic script from the code warehouse of the basic script according to the code branches of the basic script;
and the second sub-packaging module is used for packaging the updated code of the basic script and the unique identifier corresponding to each lower-layer loading script as required to obtain the unique identifier of the updated basic script.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
a processor, and
a memory for storing executable instructions of the processor;
wherein the processor is configured to execute the script packing method via execution of the executable instructions.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the script packing method.
The application provides a script packing method, a script packing device, electronic equipment and a storage medium, wherein a packing instruction sent by a developer is received at first, and the packing instruction comprises an entry file of a basic script in an application program to be updated. And detecting whether the basic script has a lower-layer script to be loaded according to requirements or not by traversing each entry information in the entry file, and if so, sequentially packaging each lower-layer script to be loaded according to requirements to obtain an updated unique identifier corresponding to each lower-layer script to be loaded according to requirements. And then, updating the unique identifier corresponding to each lower layer of the base script according to the needs to obtain the updated base script. And finally, packaging the updated basic script to obtain the unique identifier of the updated basic script so as to complete the updating of the application program to be updated. Therefore, according to the technical scheme provided by the application, the dependency relationship among the scripts in the application program to be updated can be automatically judged through the entry file, so that the application program to be updated is updated by packaging the scripts step by step to obtain the unique identifier of the updated basic script, and the updated application program comprises the unique identifier of the scripts of each level, so that the application program is convenient for a user to use.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a flowchart of a script packing method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a script packing process provided in an embodiment of the present application;
FIG. 3 is a flowchart of a method for packaging a lower layer on-demand script according to an embodiment of the present application;
FIG. 4 is a flowchart of a method for packaging a lower layer on-demand script according to an embodiment of the present application;
FIG. 5 is a flowchart of a method for packaging updated base scripts according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a first script packaging apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a second script packaging apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a third script packaging apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a fourth script packaging apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a fifth script packing apparatus according to an embodiment of the present invention;
fig. 11 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a script packing method provided in an embodiment of the present application, and as shown in fig. 1, the method includes:
s1, receiving a packaging instruction, wherein the packaging instruction comprises an entry file of a basic script in the application program to be updated, the basic script is a script for realizing the basic function of the application program to be updated, the entry file is a first accessed file in all files of the basic script, and the entry file comprises entry information of each file entering the basic script.
The application program to be updated is an RN application program, and the application program to be updated at this time is a stage of waiting for uploading to the CDN and being disclosed after a developer updates a corresponding code. Developers place the application program to be updated on a packaging platform, wherein the packaging platform is equipment, a manager, a server and the like with a code packaging function. The method comprises the steps that a developer sends a packaging instruction to a packaging platform, the packaging instruction at least comprises an entry file of a basic script, all subfiles corresponding to the basic script can be accessed through the entry file, the subfiles can contain on-demand loading scripts which have dependency relations with the basic script, and therefore the lower-layer on-demand loading scripts of the basic script can be accurately found through the entry file.
And S2, traversing each entry information in the entry file, and detecting whether a lower layer on-demand script exists, wherein the lower layer on-demand script is an on-demand script having a dependency relationship with the basic script, and the on-demand script is a script for realizing a function corresponding to a user requirement.
By browsing all entry information in the entry file, it can be determined whether the underlying script has an on-demand script.
Specifically, an embodiment of the present application provides a method for determining whether a lower layer script is loaded on demand, which includes:
s201, acquiring entry information from the entry file;
s202, judging whether lower-layer entry information exists in the entry information, wherein the lower-layer entry information is entry information of a packed file corresponding to the lower-layer on-demand script, and the packed file is a file stored with codes of the lower-layer on-demand script;
if the basic script exists, the basic script has a lower layer script loaded according to the requirement; if not, the underlying on-demand script does not exist for the base script.
The entry file is equivalent to the display first page of all the files, and if the entry file is desired to enter other subfiles, the entry file needs to be entered first, and then each corresponding subfile is entered through the entry information contained in the entry file. In the embodiment of the present application, entry information that affects the packaging result of the basic script is mainly provided, that is, the entry information corresponds to a packaging file of the lower layer on-demand script, and such entry information is defined as lower layer entry information in this embodiment.
If the entry file has lower entry information, the basic script can enter the lower script to be loaded as required, namely the basic script has the lower script to be loaded as required; on the contrary, if the lower layer entry information does not exist in the entry file, it indicates that the base script does not have the lower layer on-demand script that can be entered, that is, the base script does not have the lower layer on-demand script.
S3, if the lower layer on-demand script exists, packaging each lower layer on-demand script to obtain an updated unique identifier corresponding to each lower layer on-demand script;
further, when the user updates the application program used by the user, each script is gradually updated according to the own requirement, as shown in fig. 2, which is a schematic diagram of a script packing process provided in the embodiment of the present application, when the user opens the application program, the application program first needs to display a home page, at this time, the corresponding script is a basic script, and along with the actual requirement of the user, if the user finally needs to display a first page, the user needs to enter the first page from the home page, the first page corresponds to the on-demand script 1, and in order to smoothly display the first page, the on-demand script 1 matched with the first page needs to be downloaded. From the above process, if the user needs to browse the first page and needs to download the script 1 on demand, the user needs to clearly know which script the first page corresponds to, and which script the current version of the script is, and the information is obtained from the basic script. Therefore, the basic script needs to include an identifier representing the lower layer script loaded as required, so that the user can download corresponding script data through the identifier.
As can be seen from the above process, the packing process of the basic script is associated with the updated unique identifier of the lower layer on-demand script, and therefore, before packing the basic script, the lower layer on-demand script corresponding to the basic script needs to be packed to obtain the updated unique identifiers corresponding to the lower layer on-demand scripts.
It should be noted that, when the update script is packaged, each packaging process is performed only for one script in the same level, as shown in fig. 2, when it is determined that the on-demand script 1 exists through the entry file, the on-demand script 2 is not continuously searched in the packaging process, but the next lower-level on-demand script is searched from the on-demand script 1. After the secondary packaging process is finished, whether a lower layer script loaded according to requirements exists is searched again from the basic script, and a new packaging process is started again.
Specifically, as shown in fig. 3, a flowchart of a method for packaging a lower layer on-demand script provided in an embodiment of the present application is provided, where the method includes:
s301, detecting whether the lower layer on-demand script exists in a next lower layer on-demand script, wherein the next lower layer on-demand script is an on-demand script which has a dependency relationship with the lower layer on-demand script;
s302, if the sub-lower layer on-demand script exists, packaging each sub-lower layer on-demand script to obtain a unique identifier corresponding to each sub-lower layer on-demand script;
s303, updating the unique identifier corresponding to each next lower layer on-demand script in the lower layer on-demand scripts to obtain updated lower layer on-demand scripts;
s304, packaging the updated lower layer on-demand script to obtain the unique identifier of the updated lower layer on-demand script.
In this case, according to the above concept, the packaging process of the lower layer on-demand script is necessarily associated with the unique identifier of the lower layer on-demand script located at the lower layer, i.e., having a dependency relationship with the lower layer on-demand script. Therefore, if the lower layer on-demand script has a next lower layer on-demand script, the updated unique identifiers of all the next lower layer on-demand scripts associated with the lower layer on-demand script need to be obtained and then packaged. As shown in fig. 2, the on-demand script 1 is a lower-layer on-demand script of the basic script, and the on-demand script 1 has lower-layer on- demand scripts 3, 4, and 5, so that updated unique identifiers of the lower-layer on- demand scripts 3, 4, and 5 need to be obtained as packing bases of the on-demand script 1.
Further, fig. 2 only shows an exemplary application to be updated with a three-layer script structure, in the actual development of the application, the application may have different numbers of script hierarchies, wherein when a certain script on each hierarchy is packaged, the packaging basis of the script is associated with the updated unique identifier of the script on the lower layer, therefore, the script on the next hierarchy may be searched layer by layer until the script on the lowest layer is found, and the script on the lowest layer no longer has the script on demand on the lower layer, so that the script on the lowest layer is only associated with the update code of itself when packaged, and is not affected by other descendant scripts. At the moment, the scripts from the bottommost layer are packed layer by layer to the upper layer, so that updated unique identifiers can be provided for the scripts waiting to be packed in the upper layer.
Taking the script hierarchy shown in fig. 2 as an example, if the lower layer on-demand script has a next lower layer on-demand script, in the packaging process, in addition to the updated unique identifier of each next lower layer on-demand script, an updated code of the on-demand script is also required to be loaded, so that the packaged script has the updated code and is the script of the latest version.
Specifically, as shown in fig. 4, a flowchart of a method for packaging a lower layer on-demand script provided in an embodiment of the present application is provided, where the method includes:
s3021, obtaining a warehouse address and a code branch corresponding to each lower layer on-demand script from the packing instruction, where the warehouse address is a storage location of a corresponding code warehouse of the lower layer on-demand script in a corresponding database of the application program to be updated, and the code branch is used to represent a code version of the lower layer on-demand script;
s3022, acquiring a code warehouse of the lower layer script loaded as required from the database corresponding to the application program to be updated according to the warehouse address;
s3023, acquiring updated codes of the lower layer on-demand script from the code warehouse according to the code branches;
and S3024, packaging the updated codes of each lower layer on-demand script to obtain an updated unique identifier corresponding to each lower layer on-demand script.
The packing instruction issued by the developer usually has a warehouse address of each script in the application program to be updated and a code branch corresponding to the updated code, and obviously, the warehouse address and the code branch corresponding to the lower layer on-demand script are also included in the packing instruction, so that the packing platform can obtain a code warehouse corresponding to the lower layer on-demand script according to the warehouse address, and the code warehouse at the moment includes all used code versions and updated code versions of the lower layer on-demand script. Then, the packaging platform can determine an updated code version from the code warehouse according to the code branch, so as to acquire the updated code. At this time, the updated lower layer on-demand script can be obtained by packing the updated unique identifier of the lower layer on-demand script and the updated code of the lower layer on-demand script of each time of the lower layer on-demand script, so as to facilitate the acquisition of the user, a unique identifier can be given to the updated lower layer on-demand script, and the user can obtain corresponding script data through the unique identifier. The unique identifier can adopt numbers, codes, special symbols and the like.
It should be noted that, for the next lower layer on-demand script and all on-demand scripts, if there is an on-demand script having a dependency relationship with it, the above steps can be adopted for packaging.
In another embodiment, if the next lower layer on-demand script does not exist, directly packaging the lower layer on-demand script to obtain an updated unique identifier corresponding to the lower layer on-demand script.
As shown in fig. 2, the on-demand script 2 is a lower layer on-demand script of the basic script, and there is no lower layer on-demand script, so its packaging process is not affected by other on-demand scripts and is only associated with its updated code, therefore, as long as its updated code is packaged, the updated lower layer on-demand script can be obtained, and for the convenience of user acquisition, a unique identifier can be assigned to the updated lower layer on-demand script, and the user can obtain corresponding script data through the unique identifier. The unique identifier can adopt numbers, codes, special symbols and the like.
It should be noted that, for the next lower layer on-demand script and all on-demand scripts, if there is no on-demand script having a dependency relationship with it, the above steps can be adopted for packaging.
And S4, updating the unique identifier corresponding to each lower layer loading script in the basic script as required, and generating the updated basic script.
According to the process, after the unique identifier corresponding to each lower layer on-demand script is obtained, the unique identifier is the latest unique identifier corresponding to the lower layer on-demand script, and the basic script and each lower layer on-demand script have a dependency relationship, so that the basic script can be updated by updating the unique identifier corresponding to each lower layer on-demand script in the basic script, and the updated basic script is obtained to serve as the basis for updating the application program to be updated.
And S5, packaging the updated basic script to obtain the unique identifier of the updated basic script.
After the updated base script is obtained, the updated base script may be packaged.
Specifically, as shown in fig. 5, a flowchart of a method for packaging an updated base script provided in an embodiment of the present application is provided, where the method includes:
s501, a warehouse address and a code branch corresponding to the basic script are obtained from the packaging instruction, the warehouse address corresponding to the basic script is the storage position of a code warehouse corresponding to the basic script in a database corresponding to the application program to be updated, and the code branch of the basic script is used for representing the code version of the basic script;
s502, acquiring a code warehouse of the basic script from a database corresponding to the application program to be updated according to the warehouse address of the basic script;
s503, acquiring updated codes of the basic script from a code warehouse of the basic script according to the code branches of the basic script;
s504, packing the updated code of the basic script and the unique identifier corresponding to each lower layer loading script according to the needs to obtain the unique identifier of the updated basic script.
The packing instruction issued by the developer usually has a warehouse address of the basic script in the application program to be updated and a code branch corresponding to the updated code, so that the packing platform can obtain a code warehouse corresponding to the basic script according to the warehouse address, and the code warehouse at the moment contains all used code versions and updated code versions of the basic script. Then, the packaging platform can determine an updated code version from the code warehouse according to the code branch, so as to acquire the updated code. At this time, the updated basic script can be obtained by packing the updated unique identifier of the basic script and the updated code of the basic script on demand of each lower layer of the basic script, so that a unique identifier can be given to the updated basic script for the convenience of acquisition of a user, and the user can obtain corresponding script data through the unique identifier. The unique identifier can adopt numbers, codes, special symbols and the like.
According to the technical scheme, the dependency relationship among the scripts in the application program to be updated can be automatically judged through the entry file, so that the updated codes corresponding to the scripts can be automatically packed layer by layer, the unique identifier of the lower-layer script is added in the packing process, the unique identifier of the lower-layer script can be contained in the packed updated script, and when a user generates specific requirements, the updated script of the lower-layer script can be obtained through the unique identifier.
Fig. 6 is a schematic structural diagram of a first script packaging apparatus provided in an embodiment of the present invention, where the apparatus includes: the system comprises a packaging instruction receiving module 1, a packaging instruction receiving module, a packaging instruction processing module and a packaging module, wherein the packaging instruction comprises an entry file of a basic script in an application program to be updated, the basic script is a script for realizing basic functions of the application program to be updated, the entry file is a first accessed file in all files of the basic script, and the entry file comprises entry information of each file in the basic script; the information traversing module 2 is configured to traverse each entry information in the entry file, and detect whether a lower layer on-demand script exists, where the lower layer on-demand script is an on-demand script that has a dependency relationship with the basic script, and the on-demand script is a script for implementing a function corresponding to a user requirement; a lower layer on-demand script packing module 3, configured to pack each lower layer on-demand script if the lower layer on-demand script exists, to obtain an updated unique identifier corresponding to each lower layer on-demand script; the basic script updating module 4 is configured to update the unique identifier corresponding to each lower layer on-demand script in the basic script, and generate an updated basic script; and the script packing module 5 is used for packing the updated basic script to obtain the unique identifier of the updated basic script.
Fig. 7 is a schematic structural diagram of a second script packing apparatus according to an embodiment of the present invention, where the lower layer on-demand script packing module 3 includes: the detection module 31 is configured to detect whether a next lower layer on-demand script exists in the lower layer on-demand script, where the next lower layer on-demand script is an on-demand script that has a dependency relationship with the lower layer on-demand script; the first packing module 32 is configured to pack each sub-lower layer on-demand script if the sub-lower layer on-demand script exists, so as to obtain a unique identifier corresponding to each sub-lower layer on-demand script; the updating module 33 is configured to update the unique identifier corresponding to each of the next lower layer on-demand scripts in the lower layer on-demand scripts, so as to obtain an updated lower layer on-demand script; and a second packing module 34, configured to pack the updated lower layer on-demand script to obtain a unique identifier of the updated lower layer on-demand script.
Fig. 8 is a schematic structural diagram of a third script packing apparatus according to an embodiment of the present invention, where the lower layer on-demand script packing module 3 further includes: and a third packing module 35, configured to, if the next lower layer on-demand script does not exist, directly pack the lower layer on-demand script to obtain an updated unique identifier corresponding to the lower layer on-demand script.
Fig. 9 is a schematic structural diagram of a fourth embodiment of the script packaging apparatus according to the embodiment of the present invention, where the lower layer on-demand script packaging module 3 further includes: a first information obtaining module 301, configured to obtain, from the packing instruction, a warehouse address and a code branch corresponding to each lower layer on-demand script, where the warehouse address is a storage location of a corresponding code warehouse of the lower layer on-demand script in a database corresponding to the application program to be updated, and the code branch is used to represent a code version of the lower layer on-demand script; a first code repository obtaining module 302, configured to obtain, according to the repository address, a code repository of the lower layer on-demand script from the database corresponding to the application to be updated; a first updated code obtaining module 303, configured to obtain, from the code repository, an updated code of the lower layer on-demand script according to the code branch; the first sub-packaging module 304 is configured to package the updated code of each lower layer on-demand script, and obtain an updated unique identifier corresponding to each lower layer on-demand script.
Fig. 10 is a schematic structural diagram of a fifth embodiment of a script packaging apparatus according to an embodiment of the present invention, where the script packaging module 4 includes: a second information obtaining module 41, configured to obtain, from the packed instruction, a warehouse address and a code branch corresponding to the basic script, where the warehouse address corresponding to the basic script is a storage location of a code warehouse corresponding to the basic script in a database corresponding to the application to be updated, and the code branch of the basic script is used to represent a code version of the basic script; a second code repository obtaining module 42, configured to obtain a code repository of the basic script from the database corresponding to the application to be updated according to the repository address of the basic script; a second updated code obtaining module 43, configured to obtain, according to the code branch of the basic script, the updated code of the basic script from the code repository of the basic script; and the second sub-packaging module 44 is configured to package the updated basic script code and the unique identifier corresponding to each lower layer on-demand script, so as to obtain the unique identifier of the updated basic script.
Fig. 11 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. The electronic device includes: a memory 101 and a processor 102;
a memory 101 for storing a computer program;
the processor 102 is configured to execute the computer program stored in the memory to implement the script packing method in the above embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 101 may be separate or integrated with the processor 102.
When the memory 101 is a device independent of the processor 102, the electronic apparatus may further include:
a bus 103 for connecting the memory 101 and the processor 102.
The electronic device provided in the embodiment of the present invention may be configured to execute any one of the script packing methods shown in the above embodiments, and the implementation manner and the technical effect are similar, and details of the embodiment of the present invention are not described here.
An embodiment of the present invention further provides a readable storage medium, where a computer program is stored in the readable storage medium, and when at least one processor of a message sending apparatus executes the computer program, the message sending apparatus executes the script packing method according to any of the foregoing embodiments.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program described above may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention.

Claims (12)

1. A method for packaging scripts, the method comprising:
receiving a packaging instruction, wherein the packaging instruction comprises an entry file of a basic script in an application program to be updated, the basic script is a script for realizing basic functions of the application program to be updated, the entry file is a first accessed file in all files of the basic script, and the entry file comprises entry information of each file in the basic script;
traversing each entry information in the entry file, and detecting whether a lower layer on-demand script exists or not, wherein the lower layer on-demand script is an on-demand script having a dependency relationship with the basic script, and the on-demand script is a script for realizing a function corresponding to a user requirement;
if the lower layer on-demand scripts exist, packaging each lower layer on-demand script to obtain an updated unique identifier corresponding to each lower layer on-demand script;
updating the unique identifier corresponding to each lower layer on-demand script in the basic script to generate an updated basic script;
and packaging the updated basic script to obtain the unique identifier of the updated basic script.
2. The method of claim 1, wherein said packaging each of said lower level on-demand scripts comprises:
detecting whether the lower layer on-demand script exists in a next lower layer on-demand script, wherein the next lower layer on-demand script is an on-demand script which has a dependency relationship with the lower layer on-demand script;
if the sub-lower layer on-demand script exists, packaging each sub-lower layer on-demand script to obtain a unique identifier corresponding to each sub-lower layer on-demand script;
updating the unique identifier corresponding to each lower layer on-demand script in the lower layer on-demand script to obtain an updated lower layer on-demand script;
and packaging the updated lower layer on-demand script to obtain the unique identifier of the updated lower layer on-demand script.
3. The method of claim 2, wherein detecting whether a next lower level on-demand script exists in the lower level on-demand script further comprises:
and if the next lower layer on-demand script does not exist, directly packaging the lower layer on-demand script to obtain the updated unique identifier corresponding to the lower layer on-demand script.
4. The method of claim 1, wherein the packing instructions further include a warehouse address and a code branch corresponding to the lower level on-demand scripts of the base script, and wherein packing each of the lower level on-demand scripts comprises:
obtaining a warehouse address and a code branch corresponding to each lower layer on-demand script from the packaging instruction, wherein the warehouse address is a storage position of a corresponding code warehouse of the lower layer on-demand script in a corresponding database of the application program to be updated, and the code branch is used for representing a code version of the lower layer on-demand script;
acquiring a code warehouse of the lower layer loading script as required from a database corresponding to the application program to be updated according to the warehouse address; acquiring updated codes of the lower layer on-demand loading scripts from the code warehouse according to the code branches;
and packaging the updated codes of each lower layer on-demand script to obtain an updated unique identifier corresponding to each lower layer on-demand script.
5. The method of claim 1, wherein the packing instructions further include a warehouse address and a code branch corresponding to the base script, and wherein packing the updated base script to obtain the unique identifier of the updated base script comprises:
acquiring a warehouse address and a code branch corresponding to the basic script from the packaging instruction, wherein the warehouse address corresponding to the basic script is a storage position of a corresponding code warehouse of the basic script in a database corresponding to the application program to be updated, and the code branch of the basic script is used for representing a code version of the basic script;
acquiring a code warehouse of the basic script from a database corresponding to the application program to be updated according to the warehouse address of the basic script;
acquiring updated codes of the basic script from a code warehouse of the basic script according to the code branches of the basic script;
and packaging the updated code of the basic script and the unique identifier corresponding to each lower-layer on-demand loading script to obtain the unique identifier of the updated basic script.
6. A script packaging apparatus, characterized in that the apparatus comprises:
the system comprises a packaging instruction receiving module, a packaging instruction receiving module and a packaging instruction transmitting module, wherein the packaging instruction comprises an entry file of a basic script in an application program to be updated, the basic script is a script for realizing basic functions of the application program to be updated, the entry file is a first accessed file in all files of the basic script, and the entry file comprises entry information of each file in the basic script;
the information traversing module is used for traversing each entry information in the entry file and detecting whether a lower layer on-demand script exists or not, wherein the lower layer on-demand script is an on-demand script which has a dependency relationship with the basic script, and the on-demand script is a script for realizing a function corresponding to a user requirement;
the lower layer on-demand script packing module is used for packing each lower layer on-demand script if the lower layer on-demand script exists to obtain an updated unique identifier corresponding to each lower layer on-demand script;
the basic script updating module is used for updating the unique identifier corresponding to each lower layer loading script in the basic script as required to generate an updated basic script;
and the script packing module is used for packing the updated basic script to obtain the unique identifier of the updated basic script.
7. The apparatus of claim 6, wherein the lower on-demand script packing module comprises:
the detection module is used for detecting whether the lower layer on-demand script exists in the lower layer on-demand script, and the lower layer on-demand script is an on-demand script which has a dependency relationship with the lower layer on-demand script;
the first packing module is used for packing each sub-lower layer on-demand script if the sub-lower layer on-demand script exists to obtain a unique identifier corresponding to each sub-lower layer on-demand script;
the updating module is used for updating the unique identifier corresponding to each next lower layer on-demand script in the lower layer on-demand scripts to obtain updated lower layer on-demand scripts;
and the second packing module is used for packing the updated lower layer on-demand script to obtain the unique identifier of the updated lower layer on-demand script.
8. The apparatus of claim 7, wherein the lower on-demand script packing module further comprises:
and the third packing module is used for directly packing the lower layer on-demand script if the lower layer on-demand script does not exist, and obtaining the updated unique identifier corresponding to the lower layer on-demand script.
9. The apparatus of claim 6, wherein the lower on-demand script packing module comprises:
a first information obtaining module, configured to obtain, from the packing instruction, a warehouse address and a code branch corresponding to each lower layer on-demand script, where the warehouse address is a storage location of a corresponding code warehouse of the lower layer on-demand script in a database corresponding to the application to be updated, and the code branch is used to represent a code version of the lower layer on-demand script;
the first code warehouse acquisition module is used for acquiring a code warehouse of the lower layer loading script as required from the database corresponding to the application program to be updated according to the warehouse address;
the first updated code acquisition module is used for acquiring updated codes of the lower layer on-demand loading script from the code warehouse according to the code branches;
and the first sub-packaging module is used for packaging the updated codes of each lower layer on-demand loading script to obtain an updated unique identifier corresponding to each lower layer on-demand loading script.
10. The apparatus of claim 6, wherein the lower on-demand script packing module comprises:
a second information obtaining module, configured to obtain, from the packing instruction, a warehouse address and a code branch corresponding to the basic script, where the warehouse address corresponding to the basic script is a storage location of a code warehouse corresponding to the basic script in a database corresponding to the application program to be updated, and the code branch of the basic script is used to represent a code version of the basic script;
the second code warehouse acquisition module is used for acquiring a code warehouse of the basic script from the database corresponding to the application program to be updated according to the warehouse address of the basic script;
the second updated code acquisition module is used for acquiring the updated codes of the basic script from the code warehouse of the basic script according to the code branches of the basic script;
and the second sub-packaging module is used for packaging the updated code of the basic script and the unique identifier corresponding to each lower-layer loading script as required to obtain the unique identifier of the updated basic script.
11. An electronic device, characterized in that the electronic device comprises:
a processor, and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the script packing method of any of claims 1-5 via execution of the executable instructions.
12. A computer-readable storage medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing the script packing method of any one of claims 1 to 5.
CN202010342217.6A 2020-04-27 2020-04-27 Script packing method and device, electronic equipment and storage medium Pending CN111596935A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010342217.6A CN111596935A (en) 2020-04-27 2020-04-27 Script packing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010342217.6A CN111596935A (en) 2020-04-27 2020-04-27 Script packing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111596935A true CN111596935A (en) 2020-08-28

Family

ID=72182339

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010342217.6A Pending CN111596935A (en) 2020-04-27 2020-04-27 Script packing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111596935A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711539A (en) * 2021-01-08 2021-04-27 北京三快在线科技有限公司 Data processing method and device and data detection system
CN113360178A (en) * 2021-05-31 2021-09-07 东风商用车有限公司 Software unique identification code generation method, device, equipment and readable storage medium

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106138A (en) * 2011-11-15 2013-05-15 阿里巴巴集团控股有限公司 Method and device for synchronization of test case and test script
CN103135979A (en) * 2011-12-05 2013-06-05 中国移动通信集团广东有限公司 Method, device and system for generating terminal applications
CN104407856A (en) * 2014-11-10 2015-03-11 北京国双科技有限公司 SDK (Software Development Kit) file packaging method and SDK file packaging device
US20150286739A1 (en) * 2012-11-06 2015-10-08 Layabox Inc. Html5-protocol-based webpage presentation method and device
CN105512324A (en) * 2015-12-21 2016-04-20 用友网络科技股份有限公司 Front end module loader for partial renewal of package file
CN105872778A (en) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 Upgrading control method and device
CN106095455A (en) * 2016-06-17 2016-11-09 北京小米移动软件有限公司 A kind of application update method and device
CN106202083A (en) * 2015-04-30 2016-12-07 阿里巴巴集团控股有限公司 Resource packaging system, method and device for web page
CN106933890A (en) * 2015-12-31 2017-07-07 华为技术有限公司 A kind of processing method and processing device of static page
CN107436787A (en) * 2017-07-31 2017-12-05 腾讯科技(深圳)有限公司 Method for processing resource, device, storage medium and electronic installation
CN107577469A (en) * 2017-08-21 2018-01-12 厦门悦讯教育科技有限公司 A kind of Software package method for release management
CN107748662A (en) * 2017-11-17 2018-03-02 深圳市泉眼网络科技有限公司 Application development method, terminal and computer-readable recording medium
CN108334360A (en) * 2017-07-12 2018-07-27 深圳市小牛在线互联网信息咨询有限公司 Method, apparatus, storage medium and the computer equipment of application program dynamic load
CN109491695A (en) * 2018-10-19 2019-03-19 华南理工大学 A kind of increment updating method of integrated Android application
CN110162332A (en) * 2019-05-20 2019-08-23 深圳前海微众银行股份有限公司 A kind of construction method and system of RN project
CN110989992A (en) * 2019-10-30 2020-04-10 无线生活(北京)信息技术有限公司 Resource processing method and device

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106138A (en) * 2011-11-15 2013-05-15 阿里巴巴集团控股有限公司 Method and device for synchronization of test case and test script
CN103135979A (en) * 2011-12-05 2013-06-05 中国移动通信集团广东有限公司 Method, device and system for generating terminal applications
US20150286739A1 (en) * 2012-11-06 2015-10-08 Layabox Inc. Html5-protocol-based webpage presentation method and device
CN104407856A (en) * 2014-11-10 2015-03-11 北京国双科技有限公司 SDK (Software Development Kit) file packaging method and SDK file packaging device
CN106202083A (en) * 2015-04-30 2016-12-07 阿里巴巴集团控股有限公司 Resource packaging system, method and device for web page
CN105512324A (en) * 2015-12-21 2016-04-20 用友网络科技股份有限公司 Front end module loader for partial renewal of package file
CN106933890A (en) * 2015-12-31 2017-07-07 华为技术有限公司 A kind of processing method and processing device of static page
CN105872778A (en) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 Upgrading control method and device
CN106095455A (en) * 2016-06-17 2016-11-09 北京小米移动软件有限公司 A kind of application update method and device
CN108334360A (en) * 2017-07-12 2018-07-27 深圳市小牛在线互联网信息咨询有限公司 Method, apparatus, storage medium and the computer equipment of application program dynamic load
CN107436787A (en) * 2017-07-31 2017-12-05 腾讯科技(深圳)有限公司 Method for processing resource, device, storage medium and electronic installation
CN107577469A (en) * 2017-08-21 2018-01-12 厦门悦讯教育科技有限公司 A kind of Software package method for release management
CN107748662A (en) * 2017-11-17 2018-03-02 深圳市泉眼网络科技有限公司 Application development method, terminal and computer-readable recording medium
CN109491695A (en) * 2018-10-19 2019-03-19 华南理工大学 A kind of increment updating method of integrated Android application
CN110162332A (en) * 2019-05-20 2019-08-23 深圳前海微众银行股份有限公司 A kind of construction method and system of RN project
CN110989992A (en) * 2019-10-30 2020-04-10 无线生活(北京)信息技术有限公司 Resource processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘迎春等: "《网站系统维护》", 中国铁道出版社, pages: 192 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711539A (en) * 2021-01-08 2021-04-27 北京三快在线科技有限公司 Data processing method and device and data detection system
CN113360178A (en) * 2021-05-31 2021-09-07 东风商用车有限公司 Software unique identification code generation method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN110058873B (en) Application page updating method, device, equipment and storage medium
US10635728B2 (en) Manifest-driven loader for web pages
CN104572114A (en) Binding device, application updating device and method and application
TWI506555B (en) A method of disseminating updated drivers to mobile computing devices and a dissemination system therefor
CN107885540A (en) A kind of method, apparatus and terminal of loading application programs static resource
CN110321131B (en) Service component packaging method, system and server
CN106873952B (en) Data processing system and method for mobile terminal webpage development and application device
CN110162964B (en) Method, device and system for checking file tampering
CN111596935A (en) Script packing method and device, electronic equipment and storage medium
CN110362338B (en) Game resource packaging and resource quick access method under mobile platform
CN109298900A (en) A kind of application fractionation and on-demand loading method, apparatus
CN110716786B (en) Page display method, system and storage medium
CN112882746B (en) Application program updating method and device, storage medium and computer equipment
US8719812B1 (en) Methods, systems, and computer readable media for dynamically modifying and utilizing a software package description for software installation
CN111930455A (en) Page updating method, device, terminal and storage medium
CN115794214B (en) Application module metadata management method, device, storage medium and apparatus
CN116069366A (en) Client application program updating method and device, storage medium and electronic equipment
CN116302054A (en) Development method and device of software project, storage medium and electronic equipment
CN114253441B (en) Method and device for enabling target function, storage medium and electronic device
CN115794220A (en) Software source migration method, device and system, computing device and readable storage medium
CN110515905B (en) Method, device and server for configuring route
CN114816816A (en) Collapse stack information processing method, device, equipment and storage medium
CN114676372B (en) Data processing method and device for web game, electronic equipment and storage medium
CN108664259B (en) Method and terminal for installing application
CN116186050A (en) Data updating method and device based on hash algorithm

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200828

RJ01 Rejection of invention patent application after publication