Movatterモバイル変換


[0]ホーム

URL:


CN110532029B - Mini-program generation method, device, equipment, and computer-readable storage medium - Google Patents

Mini-program generation method, device, equipment, and computer-readable storage medium
Download PDF

Info

Publication number
CN110532029B
CN110532029BCN201910835860.XACN201910835860ACN110532029BCN 110532029 BCN110532029 BCN 110532029BCN 201910835860 ACN201910835860 ACN 201910835860ACN 110532029 BCN110532029 BCN 110532029B
Authority
CN
China
Prior art keywords
path
page
file
preset
applet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910835860.XA
Other languages
Chinese (zh)
Other versions
CN110532029A (en
Inventor
黎俊标
文泽添
林挺
卢道和
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co LtdfiledCriticalWeBank Co Ltd
Priority to CN201910835860.XApriorityCriticalpatent/CN110532029B/en
Publication of CN110532029ApublicationCriticalpatent/CN110532029A/en
Application grantedgrantedCritical
Publication of CN110532029BpublicationCriticalpatent/CN110532029B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention relates to the technical field of financial science and technology, and discloses an applet generation method, device and equipment and a computer readable storage medium. The method comprises the steps of obtaining a third-party global configuration file, storing the third-party global configuration file in a preset directory, reading first target field information of the third-party global configuration file, obtaining a target page, copying a page file corresponding to the target page from a source code directory to the preset directory, analyzing dependent resources of the page file based on the page file and preset rules, obtaining a path of the dependent resources, obtaining source codes of the dependent resources from the source code directory according to the path of the dependent resources, and copying the source codes to the preset directory to generate a third-party applet. The invention can solve the problem that the codes of the third party applet are difficult to maintain when the third party accesses the applet in the prior art.

Description

Applet generation method, device, apparatus and computer readable storage medium
Technical Field
The present invention relates to the technical field of financial science and technology (Fintech), and in particular, to an applet generating method, apparatus, device and computer readable storage medium.
Background
With the development of computer technology, more and more technologies (big data, distributed, blockchain Blockchain, artificial intelligence, etc.) are applied in the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech), but due to the requirements of security and real-time performance of the financial industry, higher requirements are also put forward on the technologies.
With the continuous development of computer technology, various applications have been put into daily life, and applets have been widely paid attention to by various industries as an application that can be used without downloading and installing. At present, many banking institutions, such as banks, develop application programs to provide related functions and support access of merchants. Specifically, when a merchant needs to access, access is generally provided by 2 modes, namely 1) developing a set of relatively general applets, when a specific merchant needs to access, pulling a merchant branch from a code main branch, customizing functions for the merchant and even secondarily developing the merchant on the branch, and 2) only reserving a set of full-function applets, each merchant is provided with the same code, and the merchant functions are opened and closed through a switch. When the method is accessed in the 1) mode, if the number of the accessed merchants is large, a plurality of code copies are generated, so that the codes are difficult to maintain, for example, when a certain general function in the applet is upgraded, the codes need to be synchronized from a main branch to each merchant branch, and when the method is accessed in the 2) mode, whether the merchant needs the function or not, the whole code package of the applet needs to be downloaded to the local client. In the later stages of the project, the applet functions are diversified, and the code package may exceed a predetermined upper limit, thereby causing the project to be unable to continue maintenance. Therefore, in the prior art, when a third party (such as a merchant) accesses the applet, the code of the applet is difficult to maintain, which can affect the performance and experience of the applet.
Disclosure of Invention
The invention mainly aims to provide an applet generating method, device, equipment and computer readable storage medium, and aims to solve the problem that codes of third party applets are difficult to maintain when the third party applets are accessed in the prior art.
In order to achieve the above object, the present invention provides an applet generation method comprising:
Acquiring a third-party global configuration file, and storing the third-party global configuration file into a preset directory;
Reading first target field information of the third-party global configuration file, obtaining a target page, and copying a page file corresponding to the target page from a source code catalog to the preset catalog;
Analyzing dependent resources of the page file based on the page file and a preset rule, and acquiring paths of the dependent resources;
and acquiring the source codes of the dependent resources from the source code catalog according to the paths of the dependent resources, and copying the source codes to the preset catalog to generate a third-party applet.
Optionally, the page file includes a configuration file, a logic file, a template file and a style file, and the step of analyzing the dependent resource of the page file based on the page file and a preset rule and acquiring the path of the dependent resource includes:
Acquiring a path of the component from the configuration file according to a preset target parameter;
Acquiring path information of the dependent resources contained in the logic file, the template file and the style file;
and obtaining a resource-dependent path corresponding to the path information according to the path information.
Optionally, the step of obtaining the path information of the dependent resource contained in the logic file, the template file and the style file includes:
Respectively converting source codes of the logic file, the template file and the style file into abstract syntax trees through a preset tool;
traversing each node of the abstract syntax tree by adopting a depth-first search algorithm, and reading metadata of each node, wherein the metadata comprises path information.
Optionally, the step of obtaining the path information of the dependent resource contained in the logic file, the template file and the style file includes:
And respectively matching the source codes of the logic file, the template file and the style file by adopting a preset regular expression, and obtaining path information according to a matching result.
Optionally, the step of obtaining the resource-dependent path corresponding to the path information according to the path information includes:
detecting whether the path information meets a preset condition or not;
If the path information meets the preset condition, determining the path which is dependent on the resource and corresponds to the path information as a preset path;
If the path information does not meet the preset condition, judging whether the path type corresponding to the path information is an absolute path or a relative path;
If the path type corresponding to the path information is an absolute path, determining the path dependent on the resource corresponding to the path information as the path corresponding to the path information;
And if the path type corresponding to the path information is a relative path, acquiring a relative path corresponding to the path information, and obtaining a corresponding path depending on resources according to the relative path and the path information.
Optionally, before the step of obtaining the source code of the dependent resource from the source code directory according to the path of the dependent resource and copying the source code to the preset directory to generate the third party applet, the method further includes:
Reading second target field information of the third-party global configuration file, and reading a target field value in the second target field information to obtain a path of the icon picture;
And acquiring a corresponding icon picture according to the path of the icon picture, and copying the icon picture to the preset directory.
Optionally, the step of copying the page file corresponding to the target page from the source code directory to the preset directory includes:
Acquiring a page file corresponding to the target page from a source code catalog, compiling preset specified parameters in the page file into a third party identification number ID, and copying the compiled page file to the preset catalog;
the step of obtaining the source code of the dependent resource from the source code catalog according to the path of the dependent resource and copying the source code to the preset catalog comprises the following steps:
And acquiring the source codes of the dependent resources from the source code catalog according to the paths of the dependent resources, compiling the preset specified parameters in the source codes of the dependent resources into the third party ID, and copying the compiled source codes of the dependent resources to the preset catalog.
In addition, in order to achieve the above object, the present invention also provides an applet generating apparatus comprising:
the file acquisition module is used for acquiring a third-party global configuration file and storing the third-party global configuration file into a preset directory;
The first copying module is used for reading first target field information of the third-party global configuration file, obtaining a target page, and copying a page file corresponding to the target page from a source code catalog to the preset catalog;
The path acquisition module is used for analyzing the dependent resources of the page file based on the page file and a preset rule and acquiring paths of the dependent resources;
The second copying module is used for acquiring the source codes of the dependent resources from the source code catalog according to the paths of the dependent resources and copying the source codes to the preset catalog to generate a third-party applet.
In addition, in order to achieve the above object, the present invention also provides an applet generating apparatus comprising a memory, a processor and an applet generating program stored on the memory and executable on the processor, the applet generating program implementing the steps of the applet generating method as described above when being executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon an applet generating program which, when executed by a processor, implements the steps of the applet generating method as described above.
The invention provides a method, a device, equipment and a computer readable storage medium for generating an applet, which are used for acquiring a third-party global configuration file and storing the third-party global configuration file under a preset directory; the method comprises the steps of reading first target field information of a third-party global configuration file, obtaining a target page, copying a page file corresponding to the target page to a preset directory from a source code directory, analyzing dependent resources of the page file based on the page file and a preset rule, obtaining a path of the dependent resources, obtaining source codes of the dependent resources from the source code directory according to the path of the dependent resources, and copying the source codes to the preset directory to generate a third-party applet. By the method, the performance and experience of the third-party applet can be ensured by acquiring the global configuration file (namely the third-party global configuration file) of the third-party applet and generating the application of the minimum code amount according to the third-party global configuration file and meeting the applet corresponding to the third party. Meanwhile, by means of configuration, the third-party applet can be updated only by modifying the third-party global configuration file, so that maintenance of the third-party applet codes can be facilitated.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a first embodiment of an applet generation method according to the invention;
fig. 3 is a schematic functional block diagram of a first embodiment of the applet generating apparatus according to the invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware running environment according to an embodiment of the present invention.
The applet generating device in the embodiment of the invention can be a smart phone or terminal devices such as a PC (Personal Computer ), a tablet personal computer, a portable computer and the like.
As shown in fig. 1, the applet generating device may comprise a processor 1001, e.g. a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the applet generating device structure shown in fig. 1 does not constitute a limitation of the applet generating device, and may comprise more or fewer components than shown, or may combine certain components, or may be arranged in different components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and an applet generation program may be included in a memory 1005 as one type of computer storage medium.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server, the user interface 1003 is mainly used for connecting to a client and performing data communication with the client, and the processor 1001 may be used for calling an applet generating program stored in the memory 1005 and performing the steps of the applet generating method below.
Based on the above hardware structure, various embodiments of the applet generation method of the present invention are presented.
The invention provides an applet generation method.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of an applet generation method according to the present invention.
In this embodiment, the applet generation method includes:
step S10, a third-party global configuration file is obtained, and the third-party global configuration file is stored under a preset directory;
The applet generating method of the present embodiment is implemented by an applet generating apparatus, which is described as an example of a server. In this embodiment, when a third party wants to access, a global configuration file may be maintained in a code base for the accessed third party according to the requirement of the third party, and is recorded as the third party global configuration file, specifically, the server obtains the third party global configuration file, and stores the third party global configuration file under a preset directory, taking a WeChat applet as an example, the preset directory may be a dist directory (i.e. a code directory of the WeChat server), and for the command of the third party global configuration file, the command needs to be named app. Json to be identified by WeChat. In addition, a plurality of third party accesses exist, a plurality of corresponding running code packages can be correspondingly set under the dist directory, and the configuration file, the subsequent page file and the source code depending on the resource are copied into the corresponding running code packages.
Step S20, reading first target field information of the third-party global configuration file, obtaining a target page, and copying a page file corresponding to the target page from a source code catalog to the preset catalog;
and reading first target field information of the third-party global configuration file to obtain a target page, wherein the first target field information is information corresponding to a page field, and in the WeChat applet, the page field is used for designating which pages the applet consists of, and each item corresponds to path (including file name) information of one page, so that the target page (namely the page of the third-party applet) can be obtained by reading the first target field information. And then copying the page file corresponding to the target page from the source code directory to a preset directory, namely, a dist directory. The page files comprise configuration files, logic files, template files and style files.
Step S30, analyzing the dependent resources of the page file based on the page file and a preset rule, and acquiring paths of the dependent resources;
Then, the dependent resources of the page file are analyzed based on the page file and preset rules, and paths of the dependent resources are obtained. The dependent resources of the page file include code dependence and static resource dependence, the code dependence includes an applet custom component, locally extracted and multiplexed code, npm (node PACKAGE MANAGER, node packet manager) installed dependent packets, and the static resource dependence includes pictures, pdf (file format) files, audio and video files, and the like.
In this embodiment, the obtaining mode of the dependent resource path includes two types, specifically, the first type is to obtain the path of the component from the configuration file according to the preset target parameter, and the second type is to obtain the path of the dependent resource corresponding to the path information by locally extracting the multiplexed code in the dependent resource, the dependent package installed by npm and the path of the picture, and the second type is to obtain the path information by 1) converting the source codes of the logic file, the template file and the pattern file into abstract syntax tree through a preset tool, then traversing each node of the abstract syntax tree through a depth-first search algorithm, reading metadata of each node, including the path information, further obtaining the path of the dependent resource corresponding to the path information according to the path information, and 2) obtaining the path information through a regular expression matching method, namely, matching the preset regular expression with the source codes of the logic file, the template file and the pattern file respectively, obtaining the path information according to the matching result, and obtaining the path of the dependent resource corresponding to the path information according to the path information. The specific acquisition process may refer to the following embodiments, and will not be described herein.
And S40, acquiring the source codes of the dependent resources from the source code catalog according to the paths of the dependent resources, and copying the source codes to the preset catalog to generate a third-party applet.
And finally, acquiring the source codes of the dependent resources from the source code catalog according to the paths of the dependent resources, and copying the source codes to a preset catalog to generate the third-party applet.
Further, before the step S40, the applet generating method further includes:
Reading second target field information of the third-party global configuration file, and reading a target field value in the second target field information to obtain a path of the icon picture;
And acquiring a corresponding icon picture according to the path of the icon picture, and copying the icon picture to the preset directory.
In this embodiment, since the tabBar fields under the third-party global configuration file may also have pictures, corresponding second target field information of the third-party global configuration file may be read, and a target field value in the second target field information may be read to obtain a path of the icon picture, where the second target field information is tabBar (tab) field information, and if the applet is a multi-tab application (a tab (tab) column is located at the bottom or top of the client window and can be switched to a page), the representation of the tab column may be specified by the tabBar configuration item, and the corresponding page displayed during tab switching, and the target field value is a field value of the icon path, that is iconpath (icon path). Then, after the path of the icon picture is obtained, the corresponding icon picture is obtained according to the path of the icon picture, and is copied to a preset directory, namely, a dist directory.
The embodiment of the invention provides an applet generation method, which comprises the steps of obtaining a third-party global configuration file, storing the third-party global configuration file under a preset catalog, reading first target field information of the third-party global configuration file, obtaining a target page, copying a page file corresponding to the target page under the preset catalog from a source code catalog, analyzing dependent resources of the page file based on the page file and preset rules, obtaining a path of the dependent resources, obtaining source codes of the dependent resources from the source code catalog according to the path of the dependent resources, and copying the source codes of the dependent resources under the preset catalog to generate the applet of the third-party. By the method, the performance and experience of the third-party applet can be ensured by acquiring the global configuration file (namely the third-party global configuration file) of the third-party applet and generating the application of the minimum code amount according to the third-party global configuration file and meeting the applet corresponding to the third party. Meanwhile, by means of configuration, the third-party applet can be updated only by modifying the third-party global configuration file, so that maintenance of the third-party applet codes can be facilitated.
Specifically, in the first embodiment, the page file includes a configuration file, a logic file, a template file, and a style file, and step S40 includes:
Step a1, acquiring a path of a component from the configuration file according to preset target parameters;
For obtaining the component path, the path of the component can be directly obtained from the configuration file according to the preset target parameter, wherein the preset target parameter is using Components, and the using Components field of the configuration file is directly read, so that the path of the component can be obtained.
Or the step S40 includes:
Step a2, obtaining path information of the dependent resources contained in the logic file, the template file and the style file;
Then, path information of the dependent resource contained in the logical file, the template file, and the style file is acquired. The dependent resources contained in these three types of files have locally extracted multiplexed code, npm installed dependent packets and pictures.
As one embodiment, step a2 may include:
Step a21, converting source codes of the logic file, the template file and the style file into abstract syntax trees through a preset tool respectively;
Step a22, traversing each node of the abstract syntax tree by adopting a depth-first search algorithm, and reading metadata of each node, wherein the metadata comprises path information.
In this embodiment, the source codes of the logic file, the template file and the style file may be respectively converted into abstract syntax trees (Abstract Syntax Tree, AST) by a preset tool, where the preset tool may be babel (a JavaScript compiler), and of course, in a specific embodiment, other manners may be used to convert the source codes of the logic file, the template file and the style file into abstract syntax trees.
And traversing each node of the abstract syntax tree by adopting a depth-first search algorithm, and reading metadata of each node, wherein the metadata comprises path information. Specifically, when the preset tool is babel, the AST tree may be traversed by using babel-reverse, and the corresponding metadata may be read through the mounted metadataVisitor. For example, a tool library, i.e. "import { add } from"/util. Js "", is introduced into the page code by means of the es6 module, and after being converted into an AST tree by means of the babylon interpreter, the statement corresponds to a node of type ImportDeclaration (import declaration) on the AST tree, and the node contains all metadata of the statement. And the metadata field source in the node represents the path information of the tool library file, and the path information is extracted to be used as the basis for searching the corresponding code file.
It should be noted that the depth-first search (DEPTH FIRST SEARCH, DFS) algorithm belongs to one of the graph algorithms, and is a traversal algorithm for graphs and trees, and the process is briefly described as going deep enough for each possible branch path to no further deep, and each node can only access once. When the abstract syntax tree has more nodes, memory overflow is easy to occur by other methods, and the depth-first search algorithm is adopted to traverse all the nodes of the abstract syntax tree, so that the memory consumption can be reduced, and the memory overflow is avoided.
As another embodiment, step a2 may further include:
And a step a23 of respectively matching the source codes of the logic file, the template file and the style file by adopting a preset regular expression, and obtaining path information according to a matching result.
In this embodiment, path information may also be obtained by a regular expression matching method, specifically, a preset regular expression may be adopted to match source codes of a logic file, a template file and a style file respectively, and path information may be obtained according to a matching result. For example, for the above example, a tool library is introduced in the page code by means of an es6 module introduction, i.e. "import { add } from"./ util.js ";" regular expressions can be used to extract the es6 module introduction statement from the source code: ". The regular expression corresponds to all modes of the statement grammar introduced by the es6 module, so that the statement can be identified from the source code no matter what standard grammar a developer writes. After the es6 sentence in the code is taken, the path information behind the from keyword can be obtained through simple string operation.
And a step a3, obtaining a resource-dependent path corresponding to the path information according to the path information.
After the path information is acquired, a path which depends on resources and corresponds to the path information is acquired according to the path information. Specifically, step a3 includes:
Step a31, detecting whether the path information meets a preset condition;
step a32, if the path information meets the preset condition, determining the path which is dependent on the resource and corresponds to the path information as a preset path;
in this embodiment, whether the path information satisfies a preset condition is detected, where the preset condition is that the path information does not include/, and if the path information does not include/, that is, the preset condition is satisfied, it is determined that the path dependent on the resource corresponding to the path information is a preset path, for example, for the following two statements:
import{Page}from'wxa';
import{Page}from'./wxa';
The from of the above two sentences corresponds to path information, the first path information is none/is indicated by a dependent tool installed through npm package management tools, and the path installed by the tool defaults to a preset path, for example, a node_ modules directory under the project root directory. And the second path information is/is provided, which indicates that the tool is a self-writing tool, and the preset condition is not met, and the path is further determined according to the path information.
Step a33, judging whether the path type corresponding to the path information is an absolute path or a relative path if the path information does not meet the preset condition;
Step a34, if the path type corresponding to the path information is an absolute path, determining the path dependent on the resource corresponding to the path information as the path corresponding to the path information;
And a step a35 of acquiring a relative path corresponding to the path information if the path type corresponding to the path information is a relative path, and acquiring a corresponding path depending on resources according to the relative path and the path information.
If the path information does not meet the preset condition, further judging whether the path type corresponding to the path information is an absolute path or a relative path. Specifically, whether the path information is an absolute path or a relative path can be determined according to the format of the path information,/represents a root directory and is an absolute path,/represents a current path,/represents a higher-layer directory, and belongs to a relative path.
If the path type corresponding to the path information is an absolute path, determining that the path of the dependent resource corresponding to the path information is the path corresponding to the path information, for example, the obtained path information is/uteil.js, and if the path type corresponding to the path information is the absolute path, the corresponding dependent resource can be directly obtained according to the path.
And if the path type corresponding to the path information is a relative path, acquiring the relative path corresponding to the path information, and acquiring a corresponding path depending on the resource according to the relative path and the path information. For example, if the path information is./ util. Js, a corresponding relative path, e.g.,/pages/index, is acquired, and then the two paths are combined to obtain a corresponding resource-dependent path, e.g.,/pages/index/util. Js.
Further, based on the first embodiment shown in fig. 2, a second embodiment of the applet generating method of the present invention is proposed.
In this embodiment, the step of copying the page file corresponding to the target page from the source code directory to the preset directory includes:
Acquiring a page file corresponding to the target page from a source code catalog, compiling preset specified parameters in the page file into a third party identification number ID, and copying the compiled page file to the preset catalog;
In this embodiment, when different third parties access, a third party ID (identification number) may be allocated to each merchant registration according to third party information (such as a name) or a preset rule, and in the copying process, the preset specified parameters are compiled into the third party ID, and then the compiled page file or source code is copied to a preset directory, so as to be used for distinguishing the third parties to which each generated third party applet belongs.
Specifically, after reading first target field information (pages) of a third-party global configuration file and acquiring a target page, the server acquires a page file corresponding to the target page from a source code catalog, compiles preset specified parameters in the page file into a third-party identification number ID, and copies the compiled page file to a preset catalog. The preset specified parameter is set according to the source code of the applet, for example, a protocol needs to be signed in the code, paths corresponding to the code are http:// bank.com/bank_appid/xieii.pdf respectively, and at this time, the preset specified parameter can be set as bank_appid. At compile time, bank_appid may be replaced with a third party ID.
After the compiled page file is copied to the preset directory, the dependent resource of the page file is analyzed based on the page file and the preset rule, and the path of the dependent resource is obtained, and the specific path obtaining method may refer to the above embodiment and will not be described herein.
At this time, the step of "obtaining the source code of the dependent resource from the source code directory according to the path of the dependent resource and copying the source code to the preset directory" includes:
And acquiring the source codes of the dependent resources from the source code catalog according to the paths of the dependent resources, compiling the preset specified parameters in the source codes of the dependent resources into the third party ID, and copying the compiled source codes of the dependent resources to the preset catalog.
After the path of the dependent resource is obtained, the source code of the dependent resource is obtained from the source code catalog according to the path of the dependent resource, then preset appointed parameters in the source code of the dependent resource are compiled into the third party ID, and the compiled source code of the dependent resource is copied to the preset catalog to generate the third party applet.
By means of the method, in the copying process, the preset specified parameters are compiled into the third party ID, and further the compiled page file or source code is copied to the preset directory, so that the generated third party applets can be distinguished from the third parties.
The invention also provides an applet generating device.
Referring to fig. 3, fig. 3 is a schematic functional block diagram of a first embodiment of the applet generating apparatus according to the invention.
As shown in fig. 3, the applet generating apparatus includes:
The file acquisition module 10 is configured to acquire a third-party global configuration file, and store the third-party global configuration file under a preset directory;
The first copying module 20 is configured to read first target field information of the third party global configuration file, obtain a target page, and copy a page file corresponding to the target page from a source code directory to the preset directory;
A path acquisition module 30, configured to analyze a dependent resource of the page file based on the page file and a preset rule, and acquire a path of the dependent resource;
The second copying module 40 is configured to obtain the source code of the dependent resource from the source code directory according to the path of the dependent resource, and copy the source code to the preset directory to generate a third party applet.
Further, the path acquisition module 30 includes:
The first acquisition unit is used for acquiring the path of the component from the configuration file according to preset target parameters;
A second obtaining unit, configured to obtain path information of the dependent resource included in the logic file, the template file, and the style file;
and a third acquisition unit, configured to obtain a resource-dependent path corresponding to the path information according to the path information.
Further, the second obtaining unit is specifically configured to convert source codes of the logic file, the template file and the style file into abstract syntax trees through a preset tool, traverse each node of the abstract syntax trees by using a depth-first search algorithm, and read metadata of each node, where the metadata includes path information.
Further, the second obtaining unit is further specifically configured to match the source codes of the logic file, the template file and the style file with a preset regular expression, and obtain path information according to a matching result.
The third obtaining unit is specifically configured to detect whether the path information meets a preset condition, determine that a path of a dependent resource corresponding to the path information is a preset path if the path information meets the preset condition, determine whether a path type corresponding to the path information is an absolute path or a relative path if the path information does not meet the preset condition, determine that the path of the dependent resource corresponding to the path information is the path corresponding to the path information if the path type corresponding to the path information is the absolute path, and obtain a relative path corresponding to the path information and obtain a path of the dependent resource according to the relative path and the path information if the path type corresponding to the path information is the relative path.
Further, the applet generating apparatus further includes:
the reading module is used for reading second target field information of the third-party global configuration file and reading a target field value in the second target field information to obtain a path of the icon picture;
And the third copying module is used for acquiring the corresponding icon picture according to the path of the icon picture and copying the icon picture to the preset directory.
Further, the first replication module 20 is specifically configured to:
Acquiring a page file corresponding to the target page from a source code catalog, compiling preset specified parameters in the page file into a third party identification number ID, and copying the compiled page file to the preset catalog;
further, the second replication module 40 is specifically configured to:
And acquiring the source codes of the dependent resources from the source code catalog according to the paths of the dependent resources, compiling the preset specified parameters in the source codes of the dependent resources into the third party ID, and copying the compiled source codes of the dependent resources to the preset catalog.
The function implementation of each module in the applet generating device corresponds to each step in the applet generating method embodiment, and the function and implementation process thereof are not described in detail herein.
The present invention also provides a computer-readable storage medium having stored thereon an applet generating program which, when executed by a processor, implements the steps of the applet generating method according to any one of the embodiments above.
The specific embodiments of the computer readable storage medium of the present invention are substantially the same as the embodiments of the applet generating method described above, and will not be described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

CN201910835860.XA2019-09-042019-09-04 Mini-program generation method, device, equipment, and computer-readable storage mediumActiveCN110532029B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910835860.XACN110532029B (en)2019-09-042019-09-04 Mini-program generation method, device, equipment, and computer-readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910835860.XACN110532029B (en)2019-09-042019-09-04 Mini-program generation method, device, equipment, and computer-readable storage medium

Publications (2)

Publication NumberPublication Date
CN110532029A CN110532029A (en)2019-12-03
CN110532029Btrue CN110532029B (en)2025-05-30

Family

ID=68667212

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910835860.XAActiveCN110532029B (en)2019-09-042019-09-04 Mini-program generation method, device, equipment, and computer-readable storage medium

Country Status (1)

CountryLink
CN (1)CN110532029B (en)

Families Citing this family (31)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113110825B (en)*2020-03-062022-06-03北京五八信息技术有限公司Method and device for converting interfaces of small programs
CN111399863B (en)*2020-03-132024-07-02深圳前海微众银行股份有限公司Method, apparatus, device and computer readable storage medium for packaging dependent files
CN111367565A (en)*2020-03-202020-07-03成都药王科技股份有限公司Program release system
CN111475142B (en)*2020-04-032023-04-28支付宝(杭州)信息技术有限公司Method, device and equipment for generating applet file package
CN111459537B (en)*2020-04-032025-01-28深圳前海微众银行股份有限公司 Redundant code removal method, device, equipment and computer-readable storage medium
CN111506300A (en)*2020-04-222020-08-07上海极链网络科技有限公司Applet generation method, device, equipment and storage medium
CN111639019B (en)*2020-04-242023-08-25北京五八信息技术有限公司Code testing method, device and readable storage medium
CN111796829B (en)*2020-05-192024-06-07北京三快在线科技有限公司Applet updating method, device, electronic equipment and computer readable storage medium
CN111580820B (en)*2020-05-252023-09-15泰康保险集团股份有限公司Applet generation method and device
CN113886216B (en)*2020-07-032024-09-17腾讯科技(深圳)有限公司Interface test and tool configuration method, device, electronic equipment and storage medium
CN111782197B (en)*2020-08-032023-12-29网易(杭州)网络有限公司Resource release method and device
CN112000572B (en)*2020-08-072022-06-17北京浪潮数据技术有限公司Tool, method, equipment and medium for scanning source code
CN111984300B (en)*2020-09-082024-01-23网易(杭州)网络有限公司Code copying method and device, electronic equipment and computer readable storage medium
CN112181429B (en)*2020-09-282023-10-20百度在线网络技术(北京)有限公司Information processing method and device and electronic equipment
CN112286528A (en)*2020-11-042021-01-29豆盟(北京)科技股份有限公司Applet generation method, device and equipment and computer storage medium
CN112506854B (en)*2020-11-242024-04-02百度在线网络技术(北京)有限公司Page template file storage and page generation methods, devices, equipment and media
CN112685040B (en)*2021-01-222024-08-09爱驰汽车有限公司Method, device, equipment and storage medium for generating interface file in android system
CN113094040B (en)*2021-03-082024-06-28南京唯优信息技术有限公司Applet compiling method and device
CN112947990B (en)*2021-03-232023-04-07四川虹美智能科技有限公司Development library creating method, device and computer readable medium
CN113268237B (en)*2021-05-252024-08-13平安科技(深圳)有限公司Function page generation method, device, equipment and medium of function module
CN113282291B (en)*2021-06-102024-07-26豆盟(北京)科技股份有限公司Method, device, equipment and storage medium for generating applet
CN113821252B (en)*2021-09-242024-05-14深圳市明源云采购科技有限公司Method and device for constructing applet, terminal equipment and storage medium
CN114168183A (en)*2021-11-172022-03-11北京五八信息技术有限公司Front-end resource information processing method, device, equipment and storage medium
CN114356288A (en)*2021-12-212022-04-15上海瑞家信息技术有限公司 Small program integration method, device, electronic device and storage medium
CN114564230B (en)*2022-02-232024-01-16北京布局未来科技发展有限公司One-key uploading realization method and device of hong Monte-go system, electronic equipment and medium
CN114579178A (en)*2022-03-102022-06-03平安普惠企业管理有限公司 Multi-version component operation method, device, terminal device and storage medium
CN114780075A (en)*2022-04-242022-07-22中国银行股份有限公司 Method and device for generating code frame
CN115061796B (en)*2022-06-172024-09-10特赞(上海)信息科技有限公司Execution method and system for calling between subtasks and electronic equipment
CN115291942B (en)*2022-08-182025-08-26中国工商银行股份有限公司 Application processing method, device and computer-readable storage medium
CN116955279A (en)*2023-09-192023-10-27腾讯科技(深圳)有限公司File uploading method, device, equipment and storage medium
CN119556912A (en)*2025-01-272025-03-04中科南京智能技术研究院 Edge device program software development method, system, edge device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109426516A (en)*2017-06-212019-03-05北京信威通信技术股份有限公司Software version management method and device
CN110032358A (en)*2019-01-032019-07-19阿里巴巴集团控股有限公司A kind of application program generation method, device, equipment and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
EP1113361A1 (en)*2000-01-032001-07-04Wimba.Com S.A.Process of communication between an applet and a local agent using a socket communication channel
US9294482B2 (en)*2013-07-252016-03-22Oracle International CorporationExternal platform extensions in a multi-tenant environment
US10248536B2 (en)*2016-10-312019-04-02International Business Machines CorporationMethod for static and dynamic configuration verification
CN106980504B (en)*2017-03-282022-07-01腾讯科技(深圳)有限公司Application program development method and tool and equipment thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109426516A (en)*2017-06-212019-03-05北京信威通信技术股份有限公司Software version management method and device
CN110032358A (en)*2019-01-032019-07-19阿里巴巴集团控股有限公司A kind of application program generation method, device, equipment and system

Also Published As

Publication numberPublication date
CN110532029A (en)2019-12-03

Similar Documents

PublicationPublication DateTitle
CN110532029B (en) Mini-program generation method, device, equipment, and computer-readable storage medium
EP3605324B1 (en)Application development method and tool, and storage medium thereof
CN111708539B (en)Application program code conversion method and device, electronic equipment and storage medium
WO2018082562A1 (en)Method and device for compiling page data and rendering page, and storage medium
US11403536B2 (en)System and method for anti-pattern detection for computing applications
CN112114805B (en)Page generation method, device and equipment
US20240126624A1 (en)Automatically generating application programming interfaces
CN111309332A (en)File content on-demand loading method and device, electronic equipment and storage medium
CN114297700B (en)Dynamic and static combined mobile application privacy protocol extraction method and related equipment
CN115481040A (en)Micro-service platform-based cyclic dependence detection method and device
EP4254175A1 (en)Enriching code for code explainability
CN113869789A (en)Risk monitoring method and device, computer equipment and storage medium
US9898467B1 (en)System for data normalization
CN111260080A (en)Process optimization method, device, terminal and storage medium based on machine learning
CN116643814A (en) Method for building model library, method for invoking model based on model library, and related equipment
CN116560683A (en)Software updating method, device, equipment and storage medium
US20180032510A1 (en)Automated translation of source code
CN118519661B (en)Application program updating method and related device
CN110928896A (en)Data query method and device
CN114625373A (en)Application conversion method and device, electronic equipment and storage medium
CN115525305A (en)Data processing method, application starting method, device, computer equipment and storage medium
Garófalo-Jerez et al.RESTful API for Intent Recognition Based on RASA
Lekeufack Foulefack et al.Enhanced Graph Neural Networks for Vulnerability Detection in Java via Advanced Subgraph Construction
CN114238944A (en) File type determination method, apparatus, device and medium
Rodriguez et al.Reducing efforts in web services refactoring

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp