Disclosure of Invention
In view of the above, the application provides an application program running method, device and system, which improve the efficiency of commonly using a common code package by multiple applications and avoid repeated loading and packaging.
In order to solve the technical problems, the technical scheme of the application is realized as follows:
in one embodiment, there is provided an application running method, the method including:
acquiring an application code packet corresponding to an application program issued by application issuing equipment;
When the application code package is operated, if the application code package is determined to contain a CDN address, the corresponding shared code package is called to operate through the CDN address;
Wherein the common code package is common to a plurality of applications; and the CDN address is the storage address of the shared code packet on a CDN server.
In another embodiment, there is provided an application running method, the method including:
The application release equipment sends a request for acquiring a CDN address to a management server, wherein the CDN address is a storage address of the shared code packet on the CDN server;
when the management server receives a request for acquiring a CDN address, acquiring the CDN address corresponding to an application identifier carried in the request according to a stored corresponding relationship, and responding to the application release equipment, wherein the corresponding relationship is the corresponding relationship between the application identifier and the CDN address;
when the application releasing equipment receives the CDN address responded by the management server, the CDN address is used for replacing a corresponding common code packet to package and release an application code packet;
when the program running device runs the application code package released by the application releasing device, the corresponding common code package is called to run through the CDN address in the application code package.
In another embodiment, an application running device is provided, which includes an acquisition unit and a running unit;
the acquisition unit is used for acquiring an application code packet corresponding to the application program issued by the application issuing equipment;
the running unit is used for calling a corresponding shared code packet to run through the CDN address when the application code packet acquired by the acquiring unit is run and determining that the CDN address is included in the application code packet, wherein the shared code packet is shared by a plurality of application programs, and the CDN address is a storage address of the shared code packet on a CDN server.
In another embodiment, an application running system is provided, the system comprising an application publishing device, a management server and a program running device;
When receiving the CDN address responded by the management server, the application release equipment uses the CDN address to replace a corresponding shared code packet to carry out application code packet packaging and release, wherein the CDN address is a storage address of the shared code packet on the CDN server;
The management server acquires a CDN address corresponding to an application identifier carried in a request according to a stored corresponding relation when receiving the request for acquiring the CDN address, and responds to the application delivery device, wherein the corresponding relation is the corresponding relation between the application identifier and the CDN address;
And the program running device calls a corresponding common code packet to run through the CDN address in the application code packet when running the application code packet released by the application releasing device.
In another embodiment, an electronic device is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor that when executed implements the steps of an application execution method.
In another embodiment, a computer readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps of the application program running method.
As can be seen from the above technical solutions, in the above embodiments, when packaging an application code packet, for the case of multiplexing a common code packet by an application, a CDN address of the common code packet is used to replace the common code packet to package the application code packet, and when the application code packet is run, when traversing to the CDN address, the application code packet is run by referencing the corresponding common code packet by the CDN address. The scheme improves the efficiency of commonly using the common code package by multiple applications and avoids repeated loading and packaging.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented, for example, in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The technical scheme of the invention is described in detail below by specific examples. The following embodiments may be combined with each other, and some embodiments may not be repeated for the same or similar concepts or processes.
The embodiment of the application provides an application program running method which is applied to an application program running system and is realized by using webpack and node. Js technology. webpack is used as a static module packer of the JavaScript application program to support dynamic introduction and module naming, and node. Js is an open source and cross-platform JavaScript runtime environment, which is simply the JavaScript running on the server side.
In the dynamic introduction of webpack, the JavaScript file of the common code is loaded according to the requirement by combining with the node. Js service, so that the low updating efficiency of the common code package is avoided, meanwhile, the repeated loading and packaging of the module (common code package) are avoided by using the module naming, and in multiple applications, the automatic separation of the common library among the applications is realized through the common webpack plug-in, so that the problem of manual maintenance is solved.
Referring to fig. 1, fig. 1 is a schematic diagram of an application running system in an embodiment of the present application. The system shown in fig. 1 includes an application publishing device, a management server, and a program running device;
When the CDN address responded by the management server is received, the CDN address is used for replacing a corresponding shared code packet to package and release an application code packet;
The management server acquires a CDN address corresponding to an application identifier carried in a request according to a stored corresponding relation when receiving the request for acquiring the CDN address, and responds to the application delivery device, wherein the corresponding relation is the corresponding relation between the application identifier and the CDN address;
And the program running device calls a corresponding common code packet to run through the CDN address in the application code packet when running the application code packet released by the application releasing device.
The system further comprises an application development device;
the application development equipment sends a request for acquiring a shared code packet identifier to the management server, and selects a shared code packet identifier corresponding to an application identifier from a shared code packet identifier list when receiving the shared code packet identifier list responded by the management server;
and the management server responds to the registered common code packet identification list to the application development equipment when receiving a request for acquiring the common code packet identification sent by the application development equipment.
Wherein, the
The application development device is further configured to register a correspondence between an application identifier and a common code identifier to the management server;
The management server is further used for storing the corresponding relation between the application identifier and the shared code packet identifier when receiving the corresponding relation between the application identifier registered by the application development device and the shared code packet identifier, and storing the corresponding relation between the CDN address and the application identifier according to the stored corresponding relation between the application identifier and the shared code packet identifier when receiving the CDN address of the shared code packet registered and stored by the shared code delivery device.
The device further comprises a shared code packet development device;
The shared code packet development equipment registers a shared code packet identifier of a shared code packet to the management server;
And the management server stores the common code packet identifier in a common code packet identifier list when receiving the common code packet identifier registered by the common code packet.
The device further comprises a common code issuing equipment;
The common code issuing equipment acquires CDN addresses of the common code packets when issuing the common code packets, issues the common code packets to positions corresponding to the CDN addresses of CDN servers if the CDN addresses are acquired, designates and stores the CDN addresses of the common code packets on the CDN servers if the CDN addresses of the common code packets are not acquired, and registers the CDN addresses on the management server.
When the method is concretely implemented, if the common code packet is released before, the corresponding common code packet is updated at a storage position corresponding to the CDN address of the common code packet, otherwise, the corresponding common code packet is stored at a storage position corresponding to the appointed CDN address, and the corresponding relation between the CDN address and the common code packet identification is registered to the management server.
When the embodiment of the application is specifically implemented, the application development device, the application release device, the common code package development device and the common code package release device can be deployed on one device or a plurality of devices for implementation, and the embodiment of the application is not limited to this.
One common code packet is shared by a plurality of applications, and each application can use one or more common code packets.
In the embodiment of the application, when the application code package is packaged, aiming at the situation that the application multiplexes the shared code package, the CDN address of the shared code package is used for replacing the shared code package to package the application code package, and when the application code package is operated, the corresponding shared code package is referenced through the CDN address to operate when the application code package is traversed to the CDN address. The scheme improves the efficiency of commonly using the common code package by multiple applications, and avoids the problems of repeated loading and packaging and manual maintenance.
When the shared code packet is updated, as long as the CDN address stored on the CDN server is unchanged, the application code packet does not need to be repackaged, and the problem of low updating efficiency of the shared code packet is solved.
Example 1
Referring to fig. 2, fig. 2 is a schematic diagram of an application running process in accordance with a first embodiment of the present application. The method comprises the following specific steps:
In step 201, the application delivery device sends a request for acquiring a CDN address to the management server.
Step 202, when the management server receives a request for acquiring a CDN address, acquiring the CDN address corresponding to the application identifier carried in the request according to the stored correspondence, and responding to the application delivery device.
The corresponding relation stored on the management server is the corresponding relation between the application identifier and the CDN address.
The specific implementation of the management server to obtain the corresponding relation between the application identifier and the CDN address is as follows:
The common code packet development equipment registers a common code packet identifier of a common code packet to the management server;
and when receiving the shared code packet identifier registered by the shared code packet, the management server stores the shared code packet identifier in a shared code packet identifier list.
The application development equipment sends a request for acquiring the shared code packet identifier to the management server;
And when receiving a request for acquiring the shared code packet identifier sent by the application development equipment, the management server responds to the registered shared code packet identifier list to the application development equipment.
When the application development equipment receives the shared code packet identification list responded by the management server, the shared code packet identification corresponding to the application identification is selected from the shared code packet identification list.
The application development equipment registers the obtained corresponding relation between the application identifier and the common code identifier to the management server;
When receiving the corresponding relation between the application identification registered by the application development equipment and the shared code package identification, the management server stores the corresponding relation between the application identification and the shared code package identification.
The method comprises the steps of acquiring a CDN address of a common code packet when the common code packet is issued by common code issuing equipment, issuing the common code packet to a position corresponding to the CDN address of a CDN server if the CDN address of the common code packet is acquired, designating and storing the CDN address of the common code packet on the CDN server if the CDN address of the common code packet is not acquired, and registering the CDN address of the common code packet on a management server.
When the method is concretely implemented, if the common code packet is released before, the corresponding common code packet is updated at a storage position corresponding to the CDN address of the common code packet, otherwise, the corresponding common code packet is stored at a storage position corresponding to the appointed CDN address, and the corresponding relation between the CDN address and the common code packet identification is registered to the management server.
When receiving a CDN address of a shared code packet registered and stored by shared code release equipment, a management server stores the corresponding relation between the CDN address and the application identifier according to the stored corresponding relation between the application identifier and the shared code packet identifier.
And 203, when the application delivery device receives the CDN address responded by the management server, packaging and delivering the application code package by using the CDN address to replace the corresponding common code package.
In the embodiment of the application, when the application and release equipment releases the application code package, the CDN address is used for replacing the common code package corresponding to the CDN address to package and release the application code package, and the dynamically introduced related code package is intercepted to package the application code package, so that the problems of repeated loading and packaging and manual maintenance are avoided.
Step 204, when the program running device runs the application code package released by the application releasing device, the corresponding common code package is called to run through the CDN address in the application code package.
When running the application code package, the program running device directly runs the code if traversing to the code package, and calls the corresponding shared code package to run through the CDN address if traversing to the CDN address.
In the embodiment of the application, when the application code package is packaged, aiming at the situation that the application multiplexes the shared code package, the CDN address of the shared code package is used for replacing the shared code package to package the application code package, and when the application code package is operated, the corresponding shared code package is referenced through the CDN address to operate when the application code package is traversed to the CDN address. The scheme improves the efficiency of commonly using the common code package by multiple applications, and avoids the problems of repeated loading and packaging and manual maintenance.
When the shared code packet is updated, as long as the CDN address stored on the CDN server is unchanged, the application code packet does not need to be repackaged, and the problem of low updating efficiency of the shared code packet is solved.
Example two
Referring to fig. 3, fig. 3 is a schematic diagram of an application running process in a third embodiment of the present application. The method comprises the following specific steps:
Step 301, an application code packet corresponding to an application program published by an application publishing device is obtained.
Step 302, when the application code package is run, if it is determined that the application code package includes a CDN address, a corresponding common code package is invoked to run through the CDN address.
Wherein the common code package is common to a plurality of applications; and the CDN address is the storage address of the shared code packet on a CDN server.
When the application code package is packaged, the CDN address of the common code package is used for replacing the common code package to package the application code package.
When the method is specifically implemented, an application code package is packaged and released by application release equipment;
The specific implementation of acquiring the CDN address of the common code package shared with other applications by the application release equipment when packaging the application code package comprises the following steps:
storing the corresponding relation between the application identifier and the CDN address on the management server;
And the application release equipment acquires the CDN address corresponding to the application identifier corresponding to the application code package to be packaged from the management server.
The number of CDN addresses obtained at this time may be one or more, and the current application may obtain several CDN addresses corresponding to several common code packets.
The specific implementation of the management server to obtain the corresponding relation between the application identifier and the CDN address is as follows:
The common code packet development equipment registers a common code packet identifier of a common code packet to the management server;
and when receiving the shared code packet identifier registered by the shared code packet, the management server stores the shared code packet identifier in a shared code packet identifier list.
The application development equipment sends a request for acquiring the shared code packet identifier to the management server;
And when receiving a request for acquiring the shared code packet identifier sent by the application development equipment, the management server responds to the registered shared code packet identifier list to the application development equipment.
When the application development equipment receives the shared code packet identification list responded by the management server, the shared code packet identification corresponding to the application identification is selected from the shared code packet identification list.
The application development equipment registers the obtained corresponding relation between the application identifier and the common code identifier to the management server;
When receiving the corresponding relation between the application identification registered by the application development equipment and the shared code package identification, the management server stores the corresponding relation between the application identification and the shared code package identification.
The method comprises the steps of acquiring a CDN address of a common code packet when the common code packet is issued by common code issuing equipment, issuing the common code packet to a position corresponding to the CDN address of a CDN server if the CDN address of the common code packet is acquired, designating and storing the CDN address of the common code packet on the CDN server if the CDN address of the common code packet is not acquired, and registering the CDN address of the common code packet on a management server.
When the method is concretely implemented, if the common code packet is released before, the corresponding common code packet is updated at a storage position corresponding to the CDN address of the common code packet, otherwise, the corresponding common code packet is stored at a storage position corresponding to the appointed CDN address, and the corresponding relation between the CDN address and the common code packet identification is registered to the management server.
When receiving a CDN address of a shared code packet registered and stored by shared code release equipment, a management server stores the corresponding relation between the CDN address and the application identifier according to the stored corresponding relation between the application identifier and the shared code packet identifier.
When the embodiment of the application is specifically implemented, the application development device, the application release device, the common code package development device and the common code package release device can be deployed on one device or a plurality of devices for implementation, and the embodiment of the application is not limited to this.
One common code packet is shared by a plurality of applications, and each application can use one or more common code packets.
In the embodiment of the application, when the application code package is packaged, aiming at the situation that the application multiplexes the shared code package, the CDN address of the shared code package is used for replacing the shared code package to package the application code package, and when the application code package is operated, the corresponding shared code package is referenced through the CDN address to operate when the application code package is traversed to the CDN address. The scheme improves the efficiency of commonly using the common code package by multiple applications, and avoids the problems of repeated loading and packaging and manual maintenance.
When the shared code packet is updated, as long as the CDN address stored on the CDN server is unchanged, the application code packet does not need to be repackaged, and the problem of low updating efficiency of the shared code packet is solved.
Based on the same inventive concept, the embodiment of the application also provides an application program running device. Referring to fig. 4, fig. 4 is a schematic view of a device structure according to an embodiment of the present application, where the device structure is applied to the above technology. The device comprises an acquisition unit 401 and an operation unit 402;
An acquiring unit 401, configured to acquire an application code packet corresponding to an application program published by an application publishing device;
And an operation unit 402, configured to, when the application code packet acquired by the operation acquisition unit 401 is executed, invoke a corresponding shared code packet to operate through the CDN address if it is determined that the application code packet includes the CDN address, where the shared code packet is shared by a plurality of application programs, and the CDN address is a storage address of the shared code packet on a CDN server.
Preferably, the method comprises the steps of,
When the application code package is packaged, the CDN address of the common code package is used for replacing the common code package to package the application code package.
The units of the embodiment can be integrated into a whole or can be separated and deployed, and can be combined into one unit or can be further separated into a plurality of sub-units.
In another embodiment, there is also provided an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the application running method when executing the program.
In another embodiment, a computer readable storage medium having stored thereon computer instructions which when executed by a processor perform steps in the application running method is also provided.
Fig. 5 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention. As shown in FIG. 5, the electronic device may include a Processor (Processor) 510, a communication interface (Communications Interface) 520, a Memory (Memory) 530, and a communication bus 540, where the Processor 510, the communication interface 520, and the Memory 530 communicate with each other via the communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform the following method:
acquiring an application code packet corresponding to an application program issued by application issuing equipment;
When the application code package is operated, if the application code package is determined to contain a CDN address, the corresponding shared code package is called to operate through the CDN address;
Wherein the common code package is common to a plurality of applications; and the CDN address is the storage address of the shared code packet on a CDN server.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the invention.