CN111538926A - Automatic offline package publishing method and device, electronic equipment and storage medium - Google Patents

Automatic offline package publishing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111538926A
CN111538926A CN202010313719.6A CN202010313719A CN111538926A CN 111538926 A CN111538926 A CN 111538926A CN 202010313719 A CN202010313719 A CN 202010313719A CN 111538926 A CN111538926 A CN 111538926A
Authority
CN
China
Prior art keywords
page
offline package
offline
package
issuing
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
CN202010313719.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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010313719.6A priority Critical patent/CN111538926A/en
Publication of CN111538926A publication Critical patent/CN111538926A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The method stores offline package configuration strategies corresponding to different page applications one to one in a page construction platform in advance, and automatically sends an offline package issuing notification containing the offline package configuration strategies to an offline management platform after the page applications are issued. Determining a page code corresponding to the page application according to the offline package configuration strategy, traversing the page code to determine a static resource set loaded by the page application, downloading the static resource set, generating an offline package, and uploading the offline package to a specified server for issuing. According to the method and the device, the off-line package is automatically manufactured and issued immediately after the page item is on line according to the predefined strategy, the issuing period is short, the manual operation process is reduced, and the manual operation risk is reduced.

Description

Automatic offline package publishing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of internet, and in particular, to an offline package automatic issuing method and apparatus, an electronic device, and a storage medium.
Background
With the development of H5(HyperText Markup Language 5, fifth version of HyperText Markup Language) technology, the development range of H5 page applications is more and more extensive, such as developing web pages, making small programs, small games, marketing, etc. using H5.
When an H5 page application is opened in a mobile terminal APP, the application is influenced by various factors such as the file size of resources, the network environment, the mobile phone performance and the like, and the time required from clicking to completely browsing the operation page is uncertain. In order to reduce the waiting time of the user and improve the user experience, files such as pictures and styles required by the page need to be cached.
H5 is the static resource buffer package of H5 page application, packs the static resource in the page into an off-line package. The offline package is downloaded to the local in advance, and when an H5 page application is opened, the APP automatically reads resources from the local, so that the downloading request time is reduced.
The offline package needs to be regenerated each time the H5 page function has an update iteration. The whole process is long from the page application online to the regeneration of the release offline package. The prior art is manual operation, which results in long release period and risk of manual misoperation.
Disclosure of Invention
In view of the above technical problems, an embodiment of the present disclosure provides an automatic offline package issuing method, and a technical scheme is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided an offline package automatic publishing method, applied to an offline package management platform, including:
receiving an offline package issuing notification containing an offline package configuration strategy, wherein the offline package issuing notification is automatically sent by a page construction platform after the page application is determined to be issued, and the page construction platform stores the offline package configuration strategies corresponding to different page applications one to one in advance;
determining a page code corresponding to the page application according to the offline package configuration strategy, and traversing the page code to determine a static resource set loaded by the page application;
and downloading the static resource set, generating an offline package, and uploading the offline package to a specified server for release.
Optionally, after the offline packet is uploaded to a designated server, the method further includes:
and generating an updating rule according to the offline package configuration strategy, acquiring offline package address information which can be accessed by the user side from the specified server after the client side hits the updating rule, and issuing the offline package address information to the user side so that the user side downloads the offline package according to the offline package address information. Optionally, the generating an update rule according to the offline package configuration policy, and after the client hits the update rule, obtaining offline package address information accessible by the client from the specified server, and issuing the offline package address information to the client includes:
extracting an offline package identifier and an offline package loading requirement from the offline package configuration strategy;
when the off-line package is determined not to be downloaded by the client according to the off-line package identification information, acquiring the current network condition of the client;
and if the current network condition of the client side meets the offline package loading requirement, acquiring offline package address information which can be accessed by the client side from the specified server, and issuing the offline package address information to the client side. Optionally, the determining, according to the offline package configuration policy, a page code corresponding to the page application, and traversing the page code to determine a static resource set loaded by the page application includes:
extracting page URL information of the page application from the offline package configuration strategy, and determining a page code corresponding to the page application according to the page URL information;
traversing the page codes, and extracting static resource address information contained in one code segment in the page codes after one code segment in the page codes hits a predefined static resource analysis rule;
and after traversing is finished, determining the extracted static resource address information as a static resource set loaded by the page application.
Optionally, the offline package configuration policy applied to the page includes:
an offline package name, an offline package identification, page URL information, offline package loading requirements, and/or configuration authentication information.
Optionally, the static resource of the page application includes:
the page applies the loaded js resource, css resource, audio and video resource, picture resource and/or font resource.
Optionally, before determining the page code corresponding to the page application based on the offline package configuration policy, the method further includes:
extracting page application identification information and corresponding second configuration authentication information contained in the offline package configuration strategy;
searching first configuration authentication information which is stored in advance and corresponds to the page application in an offline package management platform based on the page application identification information;
and matching the received second page configuration authentication information with the prestored first page configuration authentication information, and continuing the subsequent off-line package issuing process after the matching is successful.
Optionally, after the offline packet is uploaded to a designated server, the method further includes:
obtaining the address information of the off-line package which can be accessed by the test end from the designated server, generating the test message comprising the address information of the off-line package, and sending the test message to a predefined test interface, so that the test end downloads the off-line package and tests the off-line package.
According to a second aspect of the embodiments of the present disclosure, there is provided an offline package automatic issuing apparatus, applied to an offline package management platform, including:
the configuration starting module is configured to receive an offline package issuing notification containing an offline package configuration strategy, wherein the offline package issuing notification is automatically sent by a page construction platform after the page application is determined to be issued, and the page construction platform stores the offline package configuration strategies corresponding to different page applications one by one in advance;
the resource determining module is configured to determine a page code corresponding to the page application according to the offline package configuration policy, and traverse the page code to determine a static resource set loaded by the page application;
and the offline package issuing module is configured to download the static resource set, generate an offline package, and upload the offline package to a specified server for issuing.
Optionally, the automatic offline package issuing device further includes:
an offline packet issuing module: and the off-line package configuration policy is configured to generate an update rule according to the off-line package configuration policy, and when a client hits the update rule, the client acquires off-line package address information which can be accessed by the client from the specified server and issues the off-line package address information to the client, so that the client downloads the off-line package according to the off-line package address information.
Optionally, the offline packet issuing module generates an update rule according to the offline packet configuration policy, acquires, from the designated server, offline packet address information that can be accessed by the user terminal after the client hits the update rule, and is configured to, when issuing the offline packet address information to the user terminal:
extracting an offline package identifier and an offline package loading requirement from the offline package configuration strategy;
when the off-line package is determined not to be downloaded by the client according to the off-line package identification information, acquiring the current network condition of the client;
and if the current network condition of the client side meets the offline package loading requirement, acquiring offline package address information which can be accessed by the client side from the specified server, and issuing the offline package address information to the client side.
Optionally, the resource determining module, when determining the page code corresponding to the page application according to the offline package configuration policy and traversing the page code to determine the static resource set loaded by the page application, is configured to:
extracting page URL information of the page application from the offline package configuration strategy, and determining a page code corresponding to the page application according to the page URL information;
traversing the page codes, and extracting static resource address information contained in one code segment in the page codes after one code segment in the page codes hits a predefined static resource analysis rule;
and after traversing is finished, determining the extracted static resource address information as a static resource set loaded by the page application.
Optionally, the offline package configuration policy applied to the page includes:
an offline package name, an offline package identification, page URL information, offline package loading requirements, and/or configuration authentication information.
Optionally, the static resource of the page application includes:
the page applies the loaded js resource, css resource, audio and video resource, picture resource and/or font resource.
Optionally, the offline package automatic issuing device further includes an authentication module configured to:
extracting page application identification information and corresponding second configuration authentication information contained in the offline package configuration strategy;
searching first configuration authentication information which is stored in advance and corresponds to the page application in an offline package management platform based on the page application identification information;
and matching the received second page configuration authentication information with the prestored first page configuration authentication information, and continuing the subsequent off-line package issuing process after the matching is successful.
Optionally, the offline package automatic issuing apparatus further includes a test notification module configured to:
obtaining the address information of the off-line package which can be accessed by the test end from the designated server, generating the test message comprising the address information of the off-line package, and sending the test message to a predefined test interface, so that the test end downloads the off-line package and tests the off-line package.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the offline package automatic issuing method according to the first aspect
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium, wherein instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the offline package automatic issuing method according to the first aspect.
The embodiment of the disclosure provides an automatic issuing method and device of an offline package, electronic equipment and a storage medium. The method comprises the steps of storing offline package configuration strategies corresponding to different page applications in a page construction platform in advance, and automatically sending an offline package issuing notification containing the offline package configuration strategies to an offline management platform after the page applications are issued. Determining a page code corresponding to the page application according to the offline package configuration strategy, traversing the page code to determine a static resource set loaded by the page application, downloading the static resource set, generating an offline package, and uploading the offline package to a specified server for issuing. According to the method and the device, the off-line package is automatically manufactured and issued immediately after the page item is on line according to the predefined strategy, the issuing period is short, the manual operation process is reduced, and the manual operation risk is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of embodiments of the disclosure.
Moreover, any one of the embodiments of the present disclosure need not achieve all of the effects described above.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a flow chart illustrating a method for automatic publishing of offline packages in accordance with an exemplary embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a method for static resource set determination according to an exemplary embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating a method for offline packet delivery according to an exemplary embodiment of the present disclosure;
FIG. 4 is a schematic diagram of an apparatus for automatically publishing offline packets according to an exemplary embodiment of the present disclosure;
fig. 5 is a schematic diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
With the development of H5(HyperText Markup Language 5, fifth version of HyperText Markup Language) technology, the development range of H5 page applications is more and more extensive, such as developing web pages, making small programs, small games, marketing, etc. using H5.
When an H5 page application is opened in a mobile terminal APP, the application is influenced by various factors such as the file size of resources, the network environment, the mobile phone performance and the like, and the time required from clicking to completely browsing the operation page is uncertain. In order to reduce the waiting time of the user and improve the user experience, files such as pictures and styles required by the page need to be cached.
H5 is the static resource buffer package of H5 page application, packs the static resource in the page into an off-line package. The offline package is downloaded to the local in advance, and when an H5 page application is opened, the APP automatically reads resources from the local, so that the downloading request time is reduced.
The offline package needs to be regenerated each time the H5 page function has an update iteration. The whole process is long from the page application online to the regeneration of the release offline package. The prior art is manual operation, which results in long release period and risk of manual misoperation.
Based on this, the disclosure provides an offline package automatic issuing method and an offline package issuing device applying the offline package automatic issuing method, and the offline package automatic issuing method is explained first. Referring to fig. 1, the offline package management platform includes the following steps S101 to S103:
in step S101, an offline package issuing notification including an offline package configuration policy is received, where the offline package issuing notification is automatically issued after a page construction platform detects that a page application is completely issued, and the page construction platform stores offline package configuration policies corresponding to different page applications in advance;
the page building platform related to the step can be used for building a publishing platform for the existing compiling, such as a Jenkins platform and the like, and can also be used for building a self-defined page. The page construction platform is used for compiling codes and constructing functions of the page application and releasing the page application after the compiling and constructing are completed.
In an embodiment of the present specification, after a new project code development test of the page application is completed, the new code may be sent to a code repository pushed to a page building platform to publish the page application, and after the page application is published, a user may access the changed page application through a page website.
Each page application corresponds to a prestored offline package configuration strategy, and the offline package configuration strategy is used for supporting generation and release of an offline package after the page application is released.
In an embodiment of the present disclosure, the offline package configuration policy may include an offline package name, an offline package identifier, page application URL information, offline package loading requirements, and/or configuration authentication information.
The offline package name is named information of the offline package; an off-line package identification, namely ID information of the off-line package; page application URL information, namely accessible website information of the page application corresponding to the offline package;
the offline package loading requirement is a specific condition for automatically loading the offline package by the client, and under a common condition, the offline package loading requirement is divided into a WiFi loading requirement and a non-WiFi loading requirement, namely 1) when the client is in a WiFi environment, the offline package loading requirement is met, the offline package is automatically loaded, and when the client is not in the WiFi environment, the offline package is not automatically loaded, and 2) when the client is not in the WiFi environment, if the client is in a 4G environment, the offline package is met, and the offline package is automatically loaded.
That is, if the loading requirement information is configured as "WiFi only," the offline package will be automatically downloaded in the background only when the client WiFi network. If the loading requirement information is configured to be downloaded by all networks, the user traffic is consumed for automatic downloading in the non-WiFi network.
The configuration authentication information is generally token information, the token information of the page construction platform can be matched with the token information pre-stored by the offline package management platform, and the offline package is continued to generate the release process after the matching is passed.
Specifically, the offline package configuration policy may be automatically generated in advance, or may be configured in advance by the user. The automatic generation mode is exemplified: the offline package can be automatically generated according to a name generation rule, the offline package identification can be generated according to an ID generation rule, the page application URL information can be obtained from original page address data, the offline package loading requirement is set according to a default mode (the default mode is generally that the offline package can be automatically loaded when the client is in a WIFI state) under the condition of no request of special requirements, and the configuration authentication information can be obtained from the set token data.
In an embodiment of the present disclosure, the offline package configuration policies may be pre-stored on the page building platform, each offline package configuration policy corresponds to a page application one to one, and after the new page code completes and issues the updated page application, the issuing behavior triggers an offline package generation notification function of the page building platform, and transmits the corresponding offline package configuration policy to the offline package management platform. Specifically, an interface of the offline packet management platform for automatically issuing the offline packet may be called, and a corresponding offline packet configuration policy is transferred to the interface.
In another embodiment of the present disclosure, the offline package configuration policy may also be pre-stored in the offline package management platform, when the new page code of the page building platform is completed and the updated page application is issued, the issuing behavior triggers the offline package generation notification function of the page building platform, notifies the offline package management platform of the issue completion message of the page application, and the offline package management platform finds the corresponding offline package configuration policy based on the page application.
In another embodiment of the present disclosure, the specific implementation of the function of triggering the page building platform to generate the notification by the offline package by the publishing behavior may be, but is not limited to, a hook function, that is, a hook function is added, after a specific event is hook-executed, once a hook event occurs, the hook-executed program of the event receives the notification from the system, and then the program can respond to the event at the first time.
In step S102, determining a page code corresponding to the page application according to the offline package configuration policy, and traversing the page code to determine a static resource set loaded by the page application;
for H5 web applications, using offline packages may enhance the user experience. Static resources in the page are embedded into the application and issued in an offline mode, and when a user starts the application for the first time, the user does not need to rely on a network environment to download the resources, and immediately starts to use the page application. And the dynamic update of the page application can be realized, when the page application launches a new version or is released emergently, the modified resources can be put into the offline package, and the page application is automatically downloaded and updated through the update configuration.
When the H5 container issues a resource request, the URL it uses to access the local or online resource is consistent. The H5 container intercepts the request first, and after intercepting the request, the H5 container uses the local resource if the local resource can satisfy the request. If there are no local resources that can satisfy the request, the H5 container will use the online resource.
In an embodiment, when step S102 is executed, one of the following ways may be adopted, but not limited to:
(1-1) extracting page URL information of the page application from the offline package configuration strategy, and determining a page code corresponding to the page application according to the page URL information;
(1-2) traversing the page codes, and extracting static resource address information contained in one code segment of the page codes after the code segment hits a predefined static resource analysis rule;
and (1-3) after traversing is finished, determining the extracted static resource address information as a static resource set loaded by the page application.
The detailed implementation of the steps (1-1) to (1-3) can be seen in the embodiment described in fig. 2.
In an embodiment, before executing step S102, the following steps may also be executed:
(4-1) extracting page application identification information and corresponding second configuration authentication information contained in the offline package configuration strategy;
(4-2) searching first configuration authentication information which is stored in advance and corresponds to the page application in an offline package management platform based on the page application identification information;
and (4-3) matching the received second page configuration authentication information with the prestored first page configuration authentication information, and continuing the subsequent off-line package issuing process after the matching is successful.
Specifically, before the offline package is constructed, the transmitted Token value (Token is generated at the server side, if the front end uses a user name/password to request authentication from the server side, and the server side succeeds in authentication, the Token is returned to the front end at the server side, the front end can bring the Token to prove the legal status of the front end at each request) for authentication, the authentication is passed through the subsequent construction and release process, and otherwise, the release is exited and the failure of the release is prompted.
In step S103, the static resource set is downloaded and an offline package is generated, and the offline package is uploaded to a designated server for publication.
In an embodiment of the present disclosure, the offline packet may be uploaded to a CDN for delivery, and the CDN is a novel network content service system that is constructed based on an IP (Internet Protocol, interconnection Protocol between networks) network. By placing node servers at all positions of the network, a layer of intelligent virtual network is formed on the basis of the existing Internet. The CDN system can redirect a request of a user to a service node closest to the user in real time according to the network traffic and comprehensive information such as connection of each node, a load condition, a distance to the user, and response time. The user can obtain the required content nearby, the congestion of the Internet (Internet) network is solved, and the response speed of the user for accessing the website is improved.
In an embodiment, after step S103 is executed, the following steps may be further executed:
(2-1) obtaining accessible offline package address information according to the uploading result;
and (2-2) generating an updating rule according to the offline package configuration strategy, acquiring offline package address information which can be accessed by the user side from the specified server after the client side hits the updating rule, and issuing the offline package address information to the user side so that the user side downloads the offline package according to the offline package address information.
In step (2-2), an update rule is generated according to the offline package configuration policy, and after the client hits the update rule, the offline package address information accessible to the client is obtained from the specified server, and the offline package address information is issued to the client, which may be, but is not limited to, the following manners:
(3-1) extracting an offline package identifier and an offline package loading requirement from the offline package configuration strategy;
(3-2) when the off-line package is determined not to be downloaded by the client according to the off-line package identification information, acquiring the current network condition of the client;
and (3-3) if the current network condition of the client meets the offline package loading requirement, acquiring offline package address information which can be accessed by the client from the specified server, and issuing the offline package address information to the client.
The detailed implementation of the steps (3-1) to (3-3) can be seen in the embodiment described in fig. 3.
Fig. 2 is a flowchart illustrating a static resource set determination method according to an exemplary embodiment, which is based on the method illustrated in fig. 1, and as illustrated in fig. 2, may include the following steps S201 to S203:
in step S201, extracting page URL information of the page application from the offline package configuration policy, and determining a page code corresponding to the page application according to the page URL information;
in step S202, the page code is traversed, and after one code segment in the page code hits a predefined static resource parsing rule, static resource address information included in the code segment is extracted;
in step S203, after the traversal is completed, the extracted static resource address information is determined as the static resource set loaded by the page application.
In this embodiment, the page URL information of the page application may be extracted from the offline package configuration in the offline package configuration policy, a page code corresponding to the page application is determined according to the page URL information, and the static resource set loaded on the page is determined after the page code is analyzed.
Specifically, the static resources of the page application may include js resources, css resources, audio and video resources, image resources, and/or font resources loaded by the page application, and the like.
In an embodiment of the present disclosure, the predefined static resource parsing rule may include a js resource parsing rule, a css resource parsing rule, an audio/video resource parsing rule, a picture resource parsing rule, and/or a font resource parsing rule, etc. In the process of traversing and analyzing the page code, when one code segment hits any static resource analysis rule, the code segment can be determined as a static resource code, and static resource address information contained in the code segment is extracted.
Fig. 3 is a flowchart illustrating an offline package issuing method according to an exemplary embodiment, which is based on the method illustrated in fig. 1, and as illustrated in fig. 3, may include the following steps S301 to S303:
in step S301, an offline package identifier and an offline package loading requirement are extracted from the offline package configuration policy;
in step S302, when it is determined that the client has not downloaded the offline package according to the offline package identification information, acquiring a current network condition of the client;
in step S303, if the current network condition of the client meets the offline package loading requirement, offline package address information that can be accessed by the client is obtained from the specified server, and the offline package address information is issued to the client.
Specifically, the offline packet address information is: the client can obtain the IP address information of the server node of the offline packet resource. After the generated zip package is uploaded to a designated server, a corresponding accessible compressed package address can be obtained, and an offline package updating rule is generated based on the compressed package address in combination with information such as an offline package identifier and an offline package loading requirement. When the user hits the update rule, the server side sends the offline package configuration information, and the user can download the offline package resource of the corresponding version.
After the off-line package is released, a test message can be generated according to an off-line package uploading result, and the test message is sent to a predefined test interface so as to test and verify the off-line package, and the problem of function of the off-line package is avoided. Specifically, after the offline package is released, the related information can be pushed to research and development personnel and product personnel of the corresponding project, and the related information can also be sent to a preset automatic test platform so as to test the certification function in time.
Specifically, the offline package address information that can be accessed by the test end can be acquired from the designated server, the test message including the offline package address information is generated, and the test message is sent to a predefined test interface, so that the test end downloads the offline package and tests the offline package.
As can be seen from the above, in the method for automatically publishing the offline package according to the embodiment of the present disclosure, the offline package configuration policies corresponding to different page applications are stored in the page construction platform in advance, and after the page applications are published, an offline package publishing notification including the offline package configuration policies is automatically sent to the offline management platform. Determining a page code corresponding to the page application according to the offline package configuration strategy, traversing the page code to determine a static resource set loaded by the page application, downloading the static resource set, generating an offline package, and uploading the offline package to a specified server for issuing. According to the method and the device, the off-line package is automatically manufactured and issued immediately after the page item is on line according to the predefined strategy, the issuing period is short, the manual operation process is reduced, and the manual operation risk is reduced.
Corresponding to the above method embodiment, an embodiment of the present disclosure further provides an offline package automatic issuing device, and as shown in fig. 4, the device may include:
a configuration starting module 410 configured to receive an offline package issuing notification including an offline package configuration policy, where the offline package issuing notification is automatically issued by a page construction platform after it is determined that a page application is issued, and the page construction platform stores offline package configuration policies corresponding to different page applications one to one in advance;
a resource determining module 420, configured to determine a page code corresponding to the page application according to the offline package configuration policy, and traverse the page code to determine a static resource set loaded by the page application;
and the offline package issuing module 430 is configured to download the static resource set, generate an offline package, and upload the offline package to a specified server for issuing.
Optionally, the automatic offline package issuing device further includes:
an offline packet issuing module: and the off-line package configuration policy is configured to generate an update rule according to the off-line package configuration policy, and when a client hits the update rule, the client acquires off-line package address information which can be accessed by the client from the specified server and issues the off-line package address information to the client, so that the client downloads the off-line package according to the off-line package address information. .
Optionally, the offline packet issuing module generates an update rule according to the offline packet configuration policy, acquires, from the designated server, offline packet address information that can be accessed by the user terminal after the client hits the update rule, and is configured to, when issuing the offline packet address information to the user terminal:
extracting an offline package identifier and an offline package loading requirement from the offline package configuration strategy;
when the off-line package is determined not to be downloaded by the client according to the off-line package identification information, acquiring the current network condition of the client;
and if the current network condition of the client side meets the offline package loading requirement, acquiring offline package address information which can be accessed by the client side from the specified server, and issuing the offline package address information to the client side.
Optionally, the resource determining module, when determining the page code corresponding to the page application according to the offline package configuration policy and traversing the page code to determine the static resource set loaded by the page application, is configured to:
extracting page URL information of the page application from the offline package configuration strategy, and determining a page code corresponding to the page application according to the page URL information;
traversing the page codes, and extracting static resource address information contained in one code segment in the page codes after one code segment in the page codes hits a predefined static resource analysis rule;
and after traversing is finished, determining the extracted static resource address information as a static resource set loaded by the page application.
Optionally, the offline package configuration policy applied to the page includes:
an offline package name, an offline package identification, page URL information, offline package loading requirements, and/or configuration authentication information.
Optionally, the static resource of the page application includes:
the page applies the loaded js resource, css resource, audio and video resource, picture resource and/or font resource.
Optionally, the offline package automatic issuing device further includes an authentication module configured to:
extracting page application identification information and corresponding second configuration authentication information contained in the offline package configuration strategy;
searching first configuration authentication information which is stored in advance and corresponds to the page application in an offline package management platform based on the page application identification information;
and matching the received second page configuration authentication information with the prestored first page configuration authentication information, and continuing the subsequent off-line package issuing process after the matching is successful.
Optionally, the offline package automatic issuing apparatus further includes a test notification module configured to:
obtaining the address information of the off-line package which can be accessed by the test end from the designated server, generating the test message comprising the address information of the off-line package, and sending the test message to a predefined test interface, so that the test end downloads the off-line package and tests the off-line package.
The embodiment of the present disclosure further provides an electronic device, which at least includes a memory, a processor, and a computer program that is stored in the memory and is executable on the processor, where the processor executes the program to implement the method for automatically issuing an offline packet, and the method includes:
receiving an offline package issuing notification containing an offline package configuration strategy, wherein the offline package issuing notification is automatically sent by a page construction platform after the page application is determined to be issued, and the page construction platform stores the offline package configuration strategies corresponding to different page applications one to one in advance;
determining a page code corresponding to the page application according to the offline package configuration strategy, and traversing the page code to determine a static resource set loaded by the page application;
and downloading the static resource set, generating an offline package, and uploading the offline package to a specified server for release.
Fig. 5 shows a schematic block diagram of a master-based-side electronic device according to an exemplary embodiment of the present disclosure. Referring to fig. 5, at the hardware level, the electronic device includes a processor 502, an internal bus 504, a network interface 506, a memory 508 and a non-volatile memory 510, but may also include hardware required for other services. The processor 502 reads the corresponding computer program from the non-volatile memory 510 into the memory 502 and then runs the computer program, thereby forming a device for executing the offline packet automatic issuing method on a logic level. Of course, besides the software implementation, the present disclosure does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the foregoing method for automatically publishing offline packets, where the method includes:
receiving an offline package issuing notification containing an offline package configuration strategy, wherein the offline package issuing notification is automatically sent by a page construction platform after the page application is determined to be issued, and the page construction platform stores the offline package configuration strategies corresponding to different page applications one to one in advance;
determining a page code corresponding to the page application according to the offline package configuration strategy, and traversing the page code to determine a static resource set loaded by the page application;
and downloading the static resource set, generating an offline package, and uploading the offline package to a specified server for release.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transmyedia) such as modulated data signals and carrier waves.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The foregoing is merely a detailed description of the embodiments of the disclosure, and it should be noted that modifications and decorations can be made by those skilled in the art without departing from the principle of the embodiments of the disclosure, and these modifications and decorations should also be regarded as the scope of protection of the embodiments of the disclosure.

Claims (10)

1. An automatic issuing method of an offline package is applied to an offline package management platform and is characterized by comprising the following steps:
receiving an offline package issuing notification containing an offline package configuration strategy, wherein the offline package issuing notification is automatically sent by a page construction platform after the page application is determined to be issued, and the page construction platform stores the offline package configuration strategies corresponding to different page applications one to one in advance;
determining a page code corresponding to the page application according to the offline package configuration strategy, and traversing the page code to determine a static resource set loaded by the page application;
and downloading the static resource set, generating an offline package, and uploading the offline package to a specified server for release.
2. The method for automatically publishing offline package according to claim 1, wherein after uploading the offline package to a designated server, the method further comprises:
and generating an updating rule according to the offline package configuration strategy, acquiring offline package address information which can be accessed by the user side from the specified server after the client side hits the updating rule, and issuing the offline package address information to the user side so that the user side downloads the offline package according to the offline package address information.
3. The method according to claim 2, wherein the generating an update rule according to the offline package configuration policy, acquiring offline package address information accessible by the user from the designated server after the client hits the update rule, and issuing the offline package address information to the user includes:
extracting an offline package identifier and an offline package loading requirement from the offline package configuration strategy;
when the off-line package is determined not to be downloaded by the client according to the off-line package identification information, acquiring the current network condition of the client;
and if the current network condition of the client side meets the offline package loading requirement, acquiring offline package address information which can be accessed by the client side from the specified server, and issuing the offline package address information to the client side.
4. The method of claim 1, wherein the determining a page code corresponding to the page application according to the offline package configuration policy, traversing the page code to determine a set of static resources loaded by the page application, comprises:
extracting page URL information of the page application from the offline package configuration strategy, and determining a page code corresponding to the page application according to the page URL information;
traversing the page codes, and extracting static resource address information contained in one code segment in the page codes after one code segment in the page codes hits a predefined static resource analysis rule;
and after traversing is finished, determining the extracted static resource address information as a static resource set loaded by the page application.
5. The method for automatically publishing offline package as recited in claim 1, wherein the offline package configuration policy applied by the page comprises:
an offline package name, an offline package identification, page URL information, offline package loading requirements, and/or configuration authentication information.
6. The method for automatically publishing offline package of claim 1, wherein the static resources of the page application comprise:
the page applies the loaded js resource, css resource, audio and video resource, picture resource and/or font resource.
7. The method according to claim 1, wherein before determining the page code corresponding to the page application based on the offline package configuration policy, the method further comprises:
extracting page application identification information and corresponding second configuration authentication information contained in the offline package configuration strategy;
searching first configuration authentication information which is stored in advance and corresponds to the page application in an offline package management platform based on the page application identification information;
and matching the received second page configuration authentication information with the prestored first page configuration authentication information, and continuing the subsequent off-line package issuing process after the matching is successful.
8. The utility model provides an off-line package automatic issuing device, is applied to off-line package management platform, its characterized in that includes:
the configuration starting module is configured to receive an offline package issuing notification containing an offline package configuration strategy, wherein the offline package issuing notification is automatically sent by a page construction platform after the page application is determined to be issued, and the page construction platform stores the offline package configuration strategies corresponding to different page applications one by one in advance;
the resource determining module is configured to determine a page code corresponding to the page application according to the offline package configuration policy, and traverse the page code to determine a static resource set loaded by the page application;
and the offline package issuing module is configured to download the static resource set, generate an offline package, and upload the offline package to a specified server for issuing.
9. An electronic device, comprising: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 7.
10. A storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of any of claims 1-7.
CN202010313719.6A 2020-04-20 2020-04-20 Automatic offline package publishing method and device, electronic equipment and storage medium Pending CN111538926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010313719.6A CN111538926A (en) 2020-04-20 2020-04-20 Automatic offline package publishing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010313719.6A CN111538926A (en) 2020-04-20 2020-04-20 Automatic offline package publishing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111538926A true CN111538926A (en) 2020-08-14

Family

ID=71978777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010313719.6A Pending CN111538926A (en) 2020-04-20 2020-04-20 Automatic offline package publishing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111538926A (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080098291A1 (en) * 2001-04-17 2008-04-24 Adobe Systems Incorporated Method and System for Cross-Platform Form Creation and Deployment
US8812911B2 (en) * 2012-03-16 2014-08-19 Rackspace Us, Inc. Distributed testing of a software platform
CN104035938A (en) * 2013-03-07 2014-09-10 阿里巴巴集团控股有限公司 Performance continuous integration data processing method and device
CN104391689A (en) * 2014-11-04 2015-03-04 中国石油天然气股份有限公司 Internet of things application development method, middleware and PaaS (Platform as a Service)
US9003059B2 (en) * 2008-03-31 2015-04-07 Microsoft Technology Licensing, Llc Running applications in an online or offline mode based on the availability of the connection to the remote web server
US20160350320A1 (en) * 2015-05-27 2016-12-01 Google Inc. Dynamically updatable offline grammar model for resource-constrained offline device
CN107608691A (en) * 2017-08-18 2018-01-19 阿里巴巴集团控股有限公司 A kind of method for updating pages and device
US10021434B2 (en) * 2014-05-30 2018-07-10 Apple Inc. Movie package file format
CN108717359A (en) * 2018-05-10 2018-10-30 北京酷我科技有限公司 A kind of update method based on the APP modules wrapped offline
CN108762807A (en) * 2018-05-28 2018-11-06 北京酷我科技有限公司 It is a kind of based on the H5 page parsing methods wrapped offline by force
CN109725909A (en) * 2018-05-07 2019-05-07 中国平安人寿保险股份有限公司 Code file is packaged dispositions method, continuous integrating server and system
CN109857403A (en) * 2018-12-05 2019-06-07 腾讯科技(深圳)有限公司 A kind of renewal of the page, page processing method and device

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080098291A1 (en) * 2001-04-17 2008-04-24 Adobe Systems Incorporated Method and System for Cross-Platform Form Creation and Deployment
US9003059B2 (en) * 2008-03-31 2015-04-07 Microsoft Technology Licensing, Llc Running applications in an online or offline mode based on the availability of the connection to the remote web server
US8812911B2 (en) * 2012-03-16 2014-08-19 Rackspace Us, Inc. Distributed testing of a software platform
CN104035938A (en) * 2013-03-07 2014-09-10 阿里巴巴集团控股有限公司 Performance continuous integration data processing method and device
US10021434B2 (en) * 2014-05-30 2018-07-10 Apple Inc. Movie package file format
CN104391689A (en) * 2014-11-04 2015-03-04 中国石油天然气股份有限公司 Internet of things application development method, middleware and PaaS (Platform as a Service)
US20160350320A1 (en) * 2015-05-27 2016-12-01 Google Inc. Dynamically updatable offline grammar model for resource-constrained offline device
CN107608691A (en) * 2017-08-18 2018-01-19 阿里巴巴集团控股有限公司 A kind of method for updating pages and device
CN109725909A (en) * 2018-05-07 2019-05-07 中国平安人寿保险股份有限公司 Code file is packaged dispositions method, continuous integrating server and system
CN108717359A (en) * 2018-05-10 2018-10-30 北京酷我科技有限公司 A kind of update method based on the APP modules wrapped offline
CN108762807A (en) * 2018-05-28 2018-11-06 北京酷我科技有限公司 It is a kind of based on the H5 page parsing methods wrapped offline by force
CN109857403A (en) * 2018-12-05 2019-06-07 腾讯科技(深圳)有限公司 A kind of renewal of the page, page processing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
大转转FE: ""转转hybrid app web静态资源离线系统实践"", 《HTTPS://WWW.CNBLOGS.COM/ZHUANZHUANFE/P/8458414.HTML》 *
小火柴的蓝色理想: ""使用jenkins进行前端项目自动部署"", 《HTTPS://WWW.CNBLOGS.COM/XIAOHUOCHAI/P/9096873.HTML》 *

Similar Documents

Publication Publication Date Title
CN109547570B (en) Service registration method, device, registration center management equipment and storage medium
CN110058873B (en) Application page updating method, device, equipment and storage medium
CN105446750B (en) The method and apparatus that WebApp starting runs, generates image file
CN114008994B (en) Method and system for proxy server to receive request from client to network server and response from network server to client corresponding to the request
US11200157B1 (en) Automated execution reporting for container builds
CN106302445B (en) Method and apparatus for handling request
CN104572907B (en) A kind of acquisition methods and device of business object
CN106656920B (en) Processing method, device, storage medium and the processor of HTTP service
US11023558B1 (en) Executing functions on-demand on a server utilizing web browsers
CN113010818A (en) Access current limiting method and device, electronic equipment and storage medium
US10776081B2 (en) Systems and methods for utilizing webhooks integrated in platform-as-a-service supported application development and deployment
US8972968B1 (en) Alternate service for applications
CN104426952A (en) Data migration method, device and system
CN111897623A (en) Cluster management method, device, equipment and storage medium
CN113821307B (en) Method, device and equipment for quickly importing virtual machine images
CN108021564A (en) A kind of method and apparatus of page reorientation
CN110764930B (en) Request or response processing method and device based on message mode
TWI677223B (en) Page display method and device
CN109327468A (en) A kind of offline reminding method, device, equipment and storage medium
CN110874445A (en) Webpage loading method, client and business service center
CN112926002A (en) Service request processing method and device
EP3748493B1 (en) Method and device for downloading installation-free application
CN115174158B (en) Cloud product configuration checking method based on multi-cloud management platform
CN116303309A (en) File mounting method and device and electronic equipment
CN111538926A (en) Automatic offline package publishing method and device, electronic equipment and storage medium

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

Application publication date: 20200814