CN110532029A - Small routine generation method, device, equipment and computer readable storage medium - Google Patents

Small routine generation method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN110532029A
CN110532029A CN201910835860.XA CN201910835860A CN110532029A CN 110532029 A CN110532029 A CN 110532029A CN 201910835860 A CN201910835860 A CN 201910835860A CN 110532029 A CN110532029 A CN 110532029A
Authority
CN
China
Prior art keywords
file
path
resource
small routine
party
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
CN201910835860.XA
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.)
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 Ltd filed Critical WeBank Co Ltd
Priority to CN201910835860.XA priority Critical patent/CN110532029A/en
Publication of CN110532029A publication Critical patent/CN110532029A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Abstract

The present invention relates to financial technology technical field, a kind of small routine generation method, device, equipment and computer readable storage medium are disclosed.This method comprises: obtaining third party's global configuration file, and will be under third party's global configuration file storage to predetermined directory;The first object field information of third party's global configuration file is read, obtains target pages, and copy to page file corresponding with the target pages under the predetermined directory from source code catalogue;The dependence resource of the page file is analyzed based on the page file and preset rules, and obtains the path for relying on resource;The source code for relying on resource is obtained from the source code catalogue according to the path for relying on resource, and is copied under the predetermined directory, to generate third party's small routine.The present invention is able to solve third party in the prior art when accessing small routine, the code of third party's small routine is difficult to the problem of safeguarding.

Description

Small routine generation method, device, equipment and computer readable storage medium
Technical field
The present invention relates to financial technology (Fintech) technical field more particularly to a kind of small routine generation method, device, Equipment and computer readable storage medium.
Background technique
With the development of computer technology, more and more technology (big data, distribution, block chain Blockchain, people Work intelligence etc.) it applies in financial field, traditional financial industry gradually changes to financial technology (Fintech), but due to finance The safety of industry, requirement of real-time, also to technology, more stringent requirements are proposed.
With the continuous development of computer technology, various applications have been come into people's daily life, and small routine is as one Kind does not need the i.e. workable application of downloading installation, has even more obtained the extensive concern of all trades and professions.Currently, the gold such as many banks Some applets can be developed by melting mechanism, provide relevant function, while support the access of trade company.Specifically, when there is trade company When needing to access, access usually is provided by following 2 kinds of modes: 1) developing a set of more common small routine, when needing to access When specific trade company, a branch, trade company is pulled from code main split, and customizes function, even trade company in the branch for trade company Do secondary development;2) only retain a set of Full Featured small routine, each trade company disposes same code, opens by switching Close trade company's function.When 1) kind mode accesses by the, if access trade company's quantity is more, multiple code copies can be generated, are caused Code is difficult to safeguard, such as code is needed to be synchronized to each trade company from main split when the upgrading of some general utility functions in small routine Branch;When by, 2) kind mode is accessed, no matter whether trade company needs the function, requires under the entire code packet small routine It is downloaded to client local.In the project later period, small routine function is more diversified, and code packet may be more than prespecified upper Limit, can not continue to safeguard so as to cause project.Therefore, when existing in the prior art third party (such as trade company) access small routine, the The code of tripartite's small routine is difficult to the problem of safeguarding, will affect the performance and experience of third party's small routine.
Summary of the invention
The main purpose of the present invention is to provide a kind of small routine generation method, device, equipment and computer-readable storages Medium, it is intended to solve the problems, such as when third party's access small routine in the prior art, the code of third party's small routine is difficult to safeguard.
To achieve the above object, the present invention provides a kind of small routine generation method, and the small routine generation method includes:
Third party's global configuration file is obtained, and will be under third party's global configuration file storage to predetermined directory;
It reads the first object field information of third party's global configuration file, obtains target pages, and from source code mesh Page file corresponding with the target pages is copied under the predetermined directory in record;
The dependence resource of the page file is analyzed based on the page file and preset rules, and obtains the dependence money The path in source;
The source code for relying on resource is obtained from the source code catalogue according to the path for relying on resource, and is replicated To under the predetermined directory, to generate third party's small routine.
Optionally, the page file includes configuration file, logical file, template file and pattern file, described to be based on The page file and preset rules analyze the dependence resource of the page file, and obtain the step in the path for relying on resource Suddenly include:
According to the path of goal-selling parameter securing component from the configuration file;
Obtain the path letter that resource is relied on included in the logical file, the template file and the pattern file Breath;
According to the routing information, the corresponding path for relying on resource of the routing information is obtained.
Optionally, described obtain relies on included in the logical file, the template file and the pattern file The step of routing information of resource includes:
The source code of the logical file, the template file and the pattern file is converted respectively by presetting tool At abstract syntax tree;
Each node that the abstract syntax tree is traversed using Depth Priority Algorithm reads the metadata of each node, institute Stating metadata includes routing information.
Optionally, described obtain relies on included in the logical file, the template file and the pattern file The step of routing information of resource includes:
Using default regular expression source generation with the logical file, the template file and the pattern file respectively Code is matched, and obtains routing information according to matching result.
Optionally, described according to the routing information, obtain the step in the corresponding path for relying on resource of the routing information Suddenly include:
Detect whether the routing information meets preset condition;
If the routing information meets preset condition, it is determined that the corresponding path for relying on resource of the routing information is pre- If path;
If the routing information is unsatisfactory for preset condition, judge the corresponding path type of the routing information for absolute road Diameter or relative path;
If the corresponding path type of the routing information is absolute path, it is determined that corresponding dependences of the routing information provides The path in source is the corresponding path of the routing information;
If the corresponding path type of the routing information is relative path, obtain it is corresponding with the routing information relatively Path, and the corresponding path for relying on resource is obtained according to the relative path and the routing information.
Optionally, described that the source for relying on resource is obtained from the source code catalogue according to the path for relying on resource Code, and copying under the predetermined directory, the step of to generate third party's small routine before, further includes:
The second aiming field information of third party's global configuration file is read, and reads the second aiming field letter Target word segment value in breath, obtains the path of icon picture;
Corresponding icon picture is obtained according to the path of the icon picture, and is copied under the predetermined directory.
Optionally, described that page file corresponding with the target pages is copied into the default mesh from source code catalogue Record under step include:
Page file corresponding with the target pages is obtained from source code catalogue, by the default finger in the page file Determine parameter and be compiled as third party identification number ID, and the page file after compiling is copied under the predetermined directory;
It is described that the source code for relying on resource is obtained from the source code catalogue according to the path for relying on resource, and The step copied under the predetermined directory includes:
The source code for relying on resource is obtained from the source code catalogue according to the path for relying on resource, it will be described It relies on the default specified parameter in the source code of resource and is compiled as the third party ID, and by the dependence resource after compiling Source code copies under the predetermined directory.
In addition, to achieve the above object, the present invention also provides a kind of small routine generating means, the small routine generating means Include:
File acquisition module is deposited for obtaining third party's global configuration file, and by third party's global configuration file It stores up under predetermined directory;
First replication module obtains mesh for reading the first object field information of third party's global configuration file The page is marked, and copies to page file corresponding with the target pages under the predetermined directory from source code catalogue;
Path obtains module, and the dependence for being analyzed the page file based on the page file and preset rules is provided Source, and obtain the path for relying on resource;
Second replication module is provided for obtaining the dependence from the source code catalogue according to the path for relying on resource The source code in source, and copy under the predetermined directory, to generate third party's small routine.
In addition, to achieve the above object, the present invention also provides a kind of small routine generating device, the small routine generating device It include: that the small routine that can run on the memory and on the processor of memory, processor and being stored in generates program, The small routine generates the step of realizing small routine generation method as described above when program is executed by the processor.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium It is stored with small routine on storage medium and generates program, the small routine is generated when program is executed by processor and realized as described above The step of small routine generation method.
The present invention provides a kind of small routine generation method, device, equipment and computer readable storage medium, by obtaining the Tripartite's global configuration file, and will be under the storage to predetermined directory of third party's global configuration file;Read third party's global configuration text The first object field information of part obtains target pages, and answers page file corresponding with target pages from source code catalogue It makes under predetermined directory;Dependence resource based on page file and preset rules analysis page file, and obtain and rely on resource Path;The source code for relying on resource is obtained from source code catalogue according to the path for relying on resource, and is copied under predetermined directory, with Generate third party's small routine.By the above-mentioned means, passing through global configuration file (the i.e. third party's overall situation for obtaining third party's small routine Configuration file), and the applicable of minimum size of code is generated according to third party's global configuration file and is met corresponding third-party Small routine, it is ensured that third party's small routine performance and experience.Meanwhile by way of configuration, third party's overall situation need to be only modified Configuration file, i.e., renewable third party's small routine, so as to be convenient for the maintenance of third party's applet code.
Detailed description of the invention
Fig. 1 is the device structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to;
Fig. 2 is the flow diagram of small routine generation method first embodiment of the present invention;
Fig. 3 is the functional block diagram of small routine generating means first embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Referring to Fig.1, Fig. 1 is the device structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to.
Small routine generating device of the embodiment of the present invention can be smart phone, be also possible to PC (Personal Computer, personal computer), tablet computer, the terminal devices such as portable computer.
As shown in Figure 1, the small routine generating device may include: processor 1001, such as CPU, communication bus 1002 is used Family interface 1003, network interface 1004, memory 1005.Wherein, communication bus 1002 is for realizing the company between these components Connect letter.User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), can be selected Family interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 optionally may include standard Wireline interface, wireless interface (such as Wi-Fi interface).Memory 1005 can be high speed RAM memory, be also possible to stable deposit Reservoir (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned place Manage the storage device of device 1001.
It will be understood by those skilled in the art that small routine generating device structure shown in Fig. 1 is not constituted to small routine The restriction of generating device may include perhaps combining certain components or different components than illustrating more or fewer components Arrangement.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium Believe that module, Subscriber Interface Module SIM and small routine generate program.
In terminal shown in Fig. 1, network interface 1004 is mainly used for connecting background server, carries out with background server Data communication;User interface 1003 is mainly used for connecting client, carries out data communication with client;And processor 1001 can be with For calling the small routine stored in memory 1005 to generate program, and execute each step of following small routine generation method.
Based on above-mentioned hardware configuration, each embodiment of small routine generation method of the present invention is proposed.
The present invention provides a kind of small routine generation method.
It is the flow diagram of small routine generation method first embodiment of the present invention referring to Fig. 2, Fig. 2.
In the present embodiment, which includes:
Step S10 obtains third party's global configuration file, and third party's global configuration file is stored to default mesh Under record;
The small routine generation method of the present embodiment is realized by small routine generating device, the equipment by taking server as an example into Row explanation.It in the present embodiment, can be access in code library according to third-party demand when there is third party to want access Third party safeguards a global configuration file, is denoted as third party's global configuration file, specifically, server obtains third party's overall situation Configuration file, and by the storage of third party's global configuration file under predetermined directory, by taking wechat small routine as an example, predetermined directory can be with For dist catalogue (i.e. the code directory of wechat server), order for third party's global configuration file need to be named into App.json, to be identified by wechat.Additionally, there are multiple third parties access, can correspond to be arranged under dist catalogue it is corresponding more Configuration file and subsequent page file and the source code for relying on resource are copied to corresponding operation code packet by a operation code packet In.
Step S20 reads the first object field information of third party's global configuration file, obtains target pages, and Page file corresponding with the target pages is copied under the predetermined directory from source code catalogue;
The first object field information of third party's global configuration file is read, obtains target pages, wherein first object word Segment information is the corresponding information of page (page) field, and in wechat small routine, page field is for specifying small routine by which A little page compositions, path (containing filename) information of all corresponding page of each single item, therefore, by reading first object field Information can acquire target pages (i.e. the page of third party's small routine).It then, will be with target pages pair from source code catalogue The page file answered copies under predetermined directory, i.e., under dist catalogue.Wherein, page file include configuration file, logical file, Template file and pattern file.
Step S30, the dependence resource of the page file is analyzed based on the page file and preset rules, and obtains institute State the path for relying on resource;
Then, the dependence resource based on page file and preset rules analysis page file, and obtain the road for relying on resource Diameter.Wherein, the dependence resource of page file includes that code dependence and static resource rely on, and it includes that small routine is customized that code, which relies on, Component, the code that multiplexing is locally extracted, dependence packet of npm (node package manager, node package manager) installation etc., It includes picture, pdf (file format) file, audio-video document etc. that static resource, which relies on,.
It in the present embodiment, include two classes for the acquisition modes for relying on resource path, specifically, the first kind is for small The acquisition in the path of program Custom component, can be directly according to the path of goal-selling parameter securing component from configuration file; Second class is the acquisition for the path of the dependence packet and picture that rely on the code that multiplexing is locally extracted in resource, npm installation, can Pass through following two mode: 1) respectively being converted the source code of logical file, template file and pattern file by presetting tool At abstract syntax tree, each node of Depth Priority Algorithm ergodic abstract syntax tree is then used, first number of each node is read According to metadata includes routing information, and then according to routing information, obtains the corresponding path for relying on resource of routing information;2) lead to The method for crossing regular expression matching carrys out to acquisite approachs information, i.e., using default regular expression respectively with logical file, template The source code of file and pattern file is matched, and obtains routing information according to matching result, and then according to routing information, obtain The corresponding path for relying on resource of routing information.Specific acquisition process can refer to following embodiments, not repeat herein.
Step S40 obtains the source generation for relying on resource according to the path for relying on resource from the source code catalogue Code, and copy under the predetermined directory, to generate third party's small routine.
Finally, obtaining the source code for relying on resource from source code catalogue according to the path for relying on resource, and copy to default Under catalogue, to generate third party's small routine.
Further, before above-mentioned steps S40, the small routine generation method further include:
The second aiming field information of third party's global configuration file is read, and reads the second aiming field letter Target word segment value in breath, obtains the path of icon picture;
Corresponding icon picture is obtained according to the path of the icon picture, and is copied under the predetermined directory.
In the present embodiment, corresponding since the tabBar field under third party's global configuration file may also have picture , the second aiming field information of third party's global configuration file can be read, and read the target in the second aiming field information Field value obtains the path of icon picture, wherein and the second aiming field information is the information of tabBar (tabs) field, If small routine is that tab more than one applies (bottom or top of client window have tab (label) column that can switch the page), can The corresponding page shown when being switched with the performance for specifying the column tab by tabBar configuration item and tab;Target word segment value is The field value in icon (icon) path, i.e. iconpath (icon path).Then, after getting the path of icon picture, Corresponding icon picture is obtained according to the path of the icon picture, and is copied under predetermined directory, i.e., under dist catalogue.
The embodiment of the present invention provides a kind of small routine generation method, by obtaining third party's global configuration file, and by the Under the storage to predetermined directory of tripartite's global configuration file;The first object field information for reading third party's global configuration file, is obtained Target pages are taken, and copy to page file corresponding with target pages under predetermined directory from source code catalogue;Based on the page The dependence resource of file and preset rules analysis page file, and obtain the path for relying on resource;According to the path for relying on resource The source code for relying on resource is obtained from source code catalogue, and is copied under predetermined directory, to generate third party's small routine.By upper Mode is stated, by obtaining the global configuration file (i.e. third party's global configuration file) of third party's small routine, and according to the third Square global configuration file generates being applicable in and meeting corresponding third-party small routine for minimum size of code, it is ensured that third party little Cheng Sequence energy and experience.Meanwhile by way of configuration, third party's global configuration file only need to be modified, i.e., renewable third party Small routine, so as to be convenient for the maintenance of third party's applet code.
Specifically, in the above-described first embodiment, the page file includes configuration file, logical file, template file With pattern file, step S40 includes:
Step a1, according to the path of goal-selling parameter securing component from the configuration file;
Acquisition for component path, can be directly according to the road of goal-selling parameter securing component from configuration file Diameter, wherein goal-selling parameter is using Components, directly reads the using Components word of configuration file Section, can get the path of component.
Alternatively, the step S40 includes:
Step a2 is obtained and is relied on resource included in the logical file, the template file and the pattern file Routing information;
Then, the routing information that resource is relied on included in logical file, template file and pattern file is obtained.This three The dependence resource for including in class file has the dependence packet and picture of the code that multiplexing is locally extracted, npm installation.
As one of embodiment, step a2 may include:
Step a21, by default tool respectively by the source of the logical file, the template file and the pattern file Code is converted into abstract syntax tree;
Step a22 is traversed each node of the abstract syntax tree using Depth Priority Algorithm, reads the member of each node Data, the metadata include routing information.
It in the present embodiment, can be by default tool respectively by logical file, the source code of template file and pattern file It is converted into abstract syntax tree (Abstract Syntax Tree, AST), wherein default tool can be babel (one JavaScript compiler), certainly, in a particular embodiment, can also using other modes by logical file, template file and The source code of pattern file is converted into abstract syntax tree.
Then each node for using Depth Priority Algorithm ergodic abstract syntax tree, reads the metadata of each node, In, metadata includes routing information.Specifically, can use babel-traverse to AST when default tool is babel Tree is traversed, and reads corresponding metadata by the metadataVisitor of carry.For example, passing through es6 in page code Module incorporation way introduces a tool storage room, i.e. " import { add } from " ../util.js ";", it is explained by babylon After device is converted into AST tree, which is the node of ImportDeclaration (declaration for import), The node contains all metadata of the sentence.Metadata fields source indicates the path letter of the tool library file in node Breath is extracted as the foundation for finding corresponding code file.
It should be noted that depth-first search (Depth First Search, DFS) algorithm belongs to the one of nomography Kind, it is one for figure and traversal of tree algorithm, process is deep into not to each possible individual path Until capable of going deep into again, and each node can only access once.When the node of abstract syntax tree is more, easily produced with other methods The case where raw memory overflows, and each node of Depth Priority Algorithm ergodic abstract syntax tree is used, memory consumption can be reduced, The case where avoiding memory from overflowing.
As another embodiment, step a2 can also include:
Step a23, it is literary with the logical file, the template file and the pattern respectively using default regular expression The source code of part is matched, and obtains routing information according to matching result.
It in the present embodiment, can also be by the method for regular expression matching come to acquisite approachs information, specifically, can adopt It is matched with the source code of logical file, template file and pattern file with default regular expression, is tied according to matching respectively Fruit obtains routing information.For example, a tool storage room is introduced by es6 module incorporation way in page code in above-mentioned example, That is " import { add } from " ../util.js ";", es6 mould can be extracted from source code using regular expression below Block introduces sentence: " ^ (import) (: .* (as)) (: .* (as)) (: .* (from)) * .* $ ".The regular expression Corresponding is exactly all modes that es6 module introduces statement syntax, guarantees no matter developer with which kind of standard syntax writes the sentence It can be recognized from source code.It can be got by simple string operation after taking the es6 sentence in code The subsequent routing information of from keyword.
Step a3 obtains the corresponding path for relying on resource of the routing information according to the routing information.
After getting routing information, according to routing information, the corresponding path for relying on resource of routing information is obtained.Tool Body, step a3 includes:
Step a31, detects whether the routing information meets preset condition;
Step a32, if the routing information meets preset condition, it is determined that the routing information is corresponding to rely on resource Path is preset path;
In the present embodiment, first detect whether the routing information meets preset condition, wherein the preset condition is path letter Do not contained in breath/, if do not contained in routing information/, that is, when meeting preset condition, it is determined that the corresponding dependence resource of routing information Path be preset path, for example, for following two sentence:
import{Page}from'wxa';
import{Page}from'./wxa';
Corresponding after the from of both the above sentence is routing information, do not have in first routing information/, explanation is The path of the dependence tool installed by npm packet management tool, the installation of this tool is defaulted as in a preset path, example In the node_modules catalogue under engineering root.And second routing information have/, illustrate that this is one oneself write A tool, then be unsatisfactory for preset condition, need to further determine that path according to the routing information.
Step a33 judges the corresponding path type of the routing information if the routing information is unsatisfactory for preset condition For absolute path or relative path;
Step a34, if the corresponding path type of the routing information is absolute path, it is determined that the routing information is corresponding Dependence resource path be the corresponding path of the routing information;
Step a35 is obtained and the routing information pair if the corresponding path type of the routing information is relative path The relative path answered, and the corresponding path for relying on resource is obtained according to the relative path and the routing information.
If routing information is unsatisfactory for preset condition, need further to judge that the corresponding path type of routing information is absolute Path or relative path.It can specifically be judged as absolute path or relative path ,/table according to the format of routing information Show root, is absolute path;/ and indicating current path, the upper one layer of catalogue of ../expression belongs to relative path.
If the corresponding path type of routing information is absolute path, it is determined that the corresponding path for relying on resource of routing information For the corresponding path of routing information, for example, the routing information got is /util.js, then it is absolute path, it can direct basis The path obtains corresponding dependence resource.
If the corresponding path type of routing information is relative path, relative path corresponding with routing information is obtained, and The corresponding path for relying on resource is obtained according to relative path and routing information.For example, if routing information is ../util.js, Corresponding relative path, such as/pages/index need to be obtained, then to the two combination of paths, corresponding dependence money can be obtained The path in source, such as/pages/index/util.js.
Further, it is based on first embodiment shown in Fig. 2, proposes that the second of small routine generation method of the present invention is implemented Example.
In the present embodiment, page file corresponding with the target pages " is copied to institute from source code catalogue by step State under predetermined directory " include:
Page file corresponding with the target pages is obtained from source code catalogue, by the default finger in the page file Determine parameter and be compiled as third party identification number ID, and the page file after compiling is copied under the predetermined directory;
In the present embodiment, when different third parties access, can be according to third party's information (such as title) or preset rules Each Merchants register distributes a third party ID (identification number), in a replication process, is compiled, will preset to default specified parameter Specified parameter is compiled as third party ID, so by after compiling page file or source code copy under predetermined directory, to be used for Distinguish third party belonging to each third party's small routine generated.
Specifically, server is got in the first object field information (pages) for reading third party's global configuration file After target pages, page file corresponding with the target pages is obtained from source code catalogue, it then will be pre- in page file If specified parameter is compiled as third party identification number ID, and the page file after compiling is copied under predetermined directory.Wherein, it presets Specified parameter is set according to the source code of small routine, for example, needing to sign an agreement, the corresponding road of code inside code Diameter is http://bank.com/BANK_APPID/xieyi.pdf respectively, at this point it is possible to set default specified parameter as BANK_ APPID.In compiling, BANK_APPID can be replaced with to third party ID.
After copying to the page file after compiling under predetermined directory, the page is analyzed based on page file and preset rules The dependence resource of file, and the path for relying on resource is obtained, specific method for obtaining path can refer to above-described embodiment, herein not It repeats.
At this point, step " obtains the source for relying on resource according to the path for relying on resource from the source code catalogue Code, and copy under the predetermined directory " include:
The source code for relying on resource is obtained from the source code catalogue according to the path for relying on resource, it will be described It relies on the default specified parameter in the source code of resource and is compiled as the third party ID, and by the dependence resource after compiling Source code copies under the predetermined directory.
After getting the path for relying on resource, is obtained from source code catalogue according to the path for relying on resource and rely on resource Source code, the default specified parameter in the source code for relying on resource is then compiled as the third party ID, and will be after compiling The source code for relying on resource copies under predetermined directory, to generate third party's small routine.
By the above-mentioned means, in a replication process, being compiled to default specified parameter, default specified parameter is compiled as Third party ID, so by after compiling page file or source code copy under predetermined directory, to can realize to each of generation Third-party differentiation belonging to third party's small routine.
The present invention also provides a kind of small routine generating means.
It is the functional block diagram of small routine generating means first embodiment of the present invention referring to Fig. 3, Fig. 3.
As shown in figure 3, the small routine generating means include:
File acquisition module 10, for obtaining third party's global configuration file, and by third party's global configuration file It stores under predetermined directory;
First replication module 20 is obtained for reading the first object field information of third party's global configuration file Target pages, and copy to page file corresponding with the target pages under the predetermined directory from source code catalogue;
Path obtains module 30, and the dependence for being analyzed the page file based on the page file and preset rules is provided Source, and obtain the path for relying on resource;
Second replication module 40, for obtaining the dependence from the source code catalogue according to the path for relying on resource The source code of resource, and copy under the predetermined directory, to generate third party's small routine.
Further, the path acquisition module 30 includes:
First acquisition unit, for the path according to goal-selling parameter securing component from the configuration file;
Second acquisition unit, for obtaining included in the logical file, the template file and the pattern file Dependence resource routing information;
Third acquiring unit, for obtaining the corresponding road for relying on resource of the routing information according to the routing information Diameter.
Further, the second acquisition unit is specifically used for: by default tool respectively by the logical file, described The source code of template file and the pattern file is converted into abstract syntax tree;The pumping is traversed using Depth Priority Algorithm As each node of syntax tree, the metadata of each node is read, the metadata includes routing information.
Further, the second acquisition unit also particularly useful for: using default regular expression respectively with the logic The source code of file, the template file and the pattern file is matched, and obtains routing information according to matching result.
Further, the third acquiring unit is specifically used for: detecting whether the routing information meets preset condition;If The routing information meets preset condition, it is determined that the corresponding path for relying on resource of the routing information is preset path;If The routing information is unsatisfactory for preset condition, then judges the corresponding path type of the routing information for absolute path or opposite Path;If the corresponding path type of the routing information is absolute path, it is determined that the corresponding dependence resource of the routing information Path be the corresponding path of the routing information;If the corresponding path type of the routing information is relative path, obtain Relative path corresponding with the routing information, and corresponding dependence is obtained according to the relative path and the routing information and is provided The path in source.
Further, the small routine generating means further include:
Read module, for reading the second aiming field information of third party's global configuration file, and described in reading Target word segment value in second aiming field information, obtains the path of icon picture;
Third replication module for obtaining corresponding icon picture according to the path of the icon picture, and copies to institute It states under predetermined directory.
Further, first replication module 20 is specifically used for:
Page file corresponding with the target pages is obtained from source code catalogue, by the default finger in the page file Determine parameter and be compiled as third party identification number ID, and the page file after compiling is copied under the predetermined directory;
Further, second replication module 40 is specifically used for:
The source code for relying on resource is obtained from the source code catalogue according to the path for relying on resource, it will be described It relies on the default specified parameter in the source code of resource and is compiled as the third party ID, and by the dependence resource after compiling Source code copies under the predetermined directory.
Wherein, the function of modules is realized and above-mentioned small routine generation method embodiment in above-mentioned small routine generating means In each step it is corresponding, function and realization process no longer repeat one by one here.
The present invention also provides a kind of computer readable storage medium, small routine is stored on the computer readable storage medium Program is generated, the small routine, which generates, realizes that the small routine as described in any of the above item embodiment is raw when program is executed by processor The step of at method.
The specific embodiment of computer readable storage medium of the present invention and above-mentioned each embodiment of small routine generation method are basic Identical, therefore not to repeat here.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of small routine generation method, which is characterized in that the small routine generation method includes:
Third party's global configuration file is obtained, and will be under third party's global configuration file storage to predetermined directory;
The first object field information of third party's global configuration file is read, obtains target pages, and from source code catalogue Page file corresponding with the target pages is copied under the predetermined directory;
The dependence resource of the page file is analyzed based on the page file and preset rules, and obtains the dependence resource Path;
The source code for relying on resource is obtained from the source code catalogue according to the path for relying on resource, and copies to institute It states under predetermined directory, to generate third party's small routine.
2. small routine generation method as described in claim 1, which is characterized in that the page file includes configuration file, patrols Volume file, template file and pattern file, it is described based on the page file and preset rules analyze the page file according to Rely resource, and the step of obtaining the path for relying on resource includes:
According to the path of goal-selling parameter securing component from the configuration file;
Obtain the routing information that resource is relied on included in the logical file, the template file and the pattern file;
According to the routing information, the corresponding path for relying on resource of the routing information is obtained.
3. small routine generation method as claimed in claim 2, which is characterized in that described to obtain the logical file, the mould Included in plate file and the pattern file rely on resource routing information the step of include:
Respectively the source code of the logical file, the template file and the pattern file is converted into taking out by default tool As syntax tree;
Each node that the abstract syntax tree is traversed using Depth Priority Algorithm reads the metadata of each node, the member Data include routing information.
4. small routine generation method as claimed in claim 2, which is characterized in that described to obtain the logical file, the mould Included in plate file and the pattern file rely on resource routing information the step of include:
Using default regular expression respectively with the source code of the logical file, the template file and the pattern file into Row matching, obtains routing information according to matching result.
5. the small routine generation method as described in any one of claim 2 to 4, which is characterized in that described according to the path Information, obtain the routing information it is corresponding rely on resource path the step of include:
Detect whether the routing information meets preset condition;
If the routing information meets preset condition, it is determined that the corresponding path for relying on resource of the routing information is default road Diameter;
If the routing information is unsatisfactory for preset condition, judge the corresponding path type of the routing information for absolute path also It is relative path;
If the corresponding path type of the routing information is absolute path, it is determined that the routing information is corresponding to rely on resource Path is the corresponding path of the routing information;
If the corresponding path type of the routing information is relative path, obtain corresponding with the routing information with respect to road Diameter, and the corresponding path for relying on resource is obtained according to the relative path and the routing information.
6. small routine generation method as described in claim 1, which is characterized in that it is described according to it is described rely on resource path from The source code for relying on resource is obtained in the source code catalogue, and is copied under the predetermined directory, it is small to generate third party Before the step of program, further includes:
The second aiming field information of third party's global configuration file is read, and is read in the second aiming field information Target word segment value, obtain the path of icon picture;
Corresponding icon picture is obtained according to the path of the icon picture, and is copied under the predetermined directory.
7. small routine generation method as described in claim 1, which is characterized in that it is described will be with the target from source code catalogue The step that the corresponding page file of the page copies under the predetermined directory includes:
Page file corresponding with the target pages is obtained from source code catalogue, by the default specified ginseng in the page file Number is compiled as third party identification number ID, and the page file after compiling is copied under the predetermined directory;
It is described that the source code for relying on resource is obtained from the source code catalogue according to the path for relying on resource, and replicate Step under to the predetermined directory includes:
The source code for relying on resource is obtained from the source code catalogue according to the path for relying on resource, by the dependence The default specified parameter in the source code of resource is compiled as the third party ID, and by the source generation of the dependence resource after compiling Code copies under the predetermined directory.
8. a kind of small routine generating means, which is characterized in that the small routine generating means include:
File acquisition module is arrived for obtaining third party's global configuration file, and by third party's global configuration file storage Under predetermined directory;
First replication module obtains page object for reading the first object field information of third party's global configuration file Face, and copy to page file corresponding with the target pages under the predetermined directory from source code catalogue;
Path obtains module, for analyzing the dependence resource of the page file based on the page file and preset rules, and Obtain the path for relying on resource;
Second replication module, for obtaining the dependence resource from the source code catalogue according to the path for relying on resource Source code, and copy under the predetermined directory, to generate third party's small routine.
9. a kind of small routine generating device, which is characterized in that the small routine generating device includes: memory, processor and deposits The small routine that storing up can run on the memory and on the processor generates program, and the small routine generates program by institute State the step of realizing the small routine generation method as described in any one of claims 1 to 7 when processor executes.
10. a kind of computer readable storage medium, which is characterized in that be stored with small routine on the computer readable storage medium Program is generated, the small routine generates the little Cheng realized as described in any one of claims 1 to 7 when program is executed by processor The step of sequence generation method.
CN201910835860.XA 2019-09-04 2019-09-04 Small routine generation method, device, equipment and computer readable storage medium Pending CN110532029A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910835860.XA CN110532029A (en) 2019-09-04 2019-09-04 Small routine generation method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910835860.XA CN110532029A (en) 2019-09-04 2019-09-04 Small routine generation method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110532029A true CN110532029A (en) 2019-12-03

Family

ID=68667212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910835860.XA Pending CN110532029A (en) 2019-09-04 2019-09-04 Small routine generation method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110532029A (en)

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367565A (en) * 2020-03-20 2020-07-03 成都药王科技股份有限公司 Program release system
CN111475142A (en) * 2020-04-03 2020-07-31 支付宝(杭州)信息技术有限公司 Method, device and equipment for generating applet file package
CN111506300A (en) * 2020-04-22 2020-08-07 上海极链网络科技有限公司 Applet generation method, device, equipment and storage medium
CN111580820A (en) * 2020-05-25 2020-08-25 泰康保险集团股份有限公司 Applet generation method and device
CN111639019A (en) * 2020-04-24 2020-09-08 北京五八信息技术有限公司 Code testing method and device and readable storage medium
CN111782197A (en) * 2020-08-03 2020-10-16 网易(杭州)网络有限公司 Resource publishing method and device
CN111796829A (en) * 2020-05-19 2020-10-20 北京三快在线科技有限公司 Applet updating method and device, electronic equipment and computer readable storage medium
CN111984300A (en) * 2020-09-08 2020-11-24 网易(杭州)网络有限公司 Code copying method and device, electronic equipment and computer readable storage medium
CN112000572A (en) * 2020-08-07 2020-11-27 北京浪潮数据技术有限公司 Source code scanning tool, method, equipment and medium
CN112181429A (en) * 2020-09-28 2021-01-05 百度在线网络技术(北京)有限公司 Information processing method and device and electronic equipment
CN112286528A (en) * 2020-11-04 2021-01-29 豆盟(北京)科技股份有限公司 Applet generation method, device and equipment and computer storage medium
CN112506854A (en) * 2020-11-24 2021-03-16 百度在线网络技术(北京)有限公司 Method, device, equipment and medium for storing page template file and generating page
CN112685040A (en) * 2021-01-22 2021-04-20 爱驰汽车有限公司 Method, device, equipment and storage medium for generating interface file in android system
CN112947990A (en) * 2021-03-23 2021-06-11 四川虹美智能科技有限公司 Development library creating method and device and computer readable medium
CN112965719A (en) * 2020-03-06 2021-06-15 北京五八信息技术有限公司 Method and device for generating small program
CN113094040A (en) * 2021-03-08 2021-07-09 南京唯优信息技术有限公司 Applet compiling method and device
CN113268237A (en) * 2021-05-25 2021-08-17 平安科技(深圳)有限公司 Function page generation method, device, equipment and medium of function module
CN113282291A (en) * 2021-06-10 2021-08-20 豆盟(北京)科技股份有限公司 Method, device and equipment for generating small program and storage medium
CN113821252A (en) * 2021-09-24 2021-12-21 深圳市明源云采购科技有限公司 Method and device for constructing small program, terminal device and storage medium
CN114564230A (en) * 2022-02-23 2022-05-31 北京布局未来教育科技有限公司 One-key uploading implementation method and device of Hongming system, electronic equipment and medium
CN116955279A (en) * 2023-09-19 2023-10-27 腾讯科技(深圳)有限公司 File uploading method, device, equipment and storage medium
CN113821252B (en) * 2021-09-24 2024-05-14 深圳市明源云采购科技有限公司 Method and device for constructing applet, terminal equipment and storage medium

Cited By (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965719A (en) * 2020-03-06 2021-06-15 北京五八信息技术有限公司 Method and device for generating small program
CN111367565A (en) * 2020-03-20 2020-07-03 成都药王科技股份有限公司 Program release system
CN111475142A (en) * 2020-04-03 2020-07-31 支付宝(杭州)信息技术有限公司 Method, device and equipment for generating applet file package
CN111506300A (en) * 2020-04-22 2020-08-07 上海极链网络科技有限公司 Applet generation method, device, equipment and storage medium
CN111639019A (en) * 2020-04-24 2020-09-08 北京五八信息技术有限公司 Code testing method and device and readable storage medium
CN111639019B (en) * 2020-04-24 2023-08-25 北京五八信息技术有限公司 Code testing method, device and readable storage medium
CN111796829A (en) * 2020-05-19 2020-10-20 北京三快在线科技有限公司 Applet updating method and device, electronic equipment and computer readable storage medium
CN111580820A (en) * 2020-05-25 2020-08-25 泰康保险集团股份有限公司 Applet generation method and device
CN111580820B (en) * 2020-05-25 2023-09-15 泰康保险集团股份有限公司 Applet generation method and device
CN111782197B (en) * 2020-08-03 2023-12-29 网易(杭州)网络有限公司 Resource release method and device
CN111782197A (en) * 2020-08-03 2020-10-16 网易(杭州)网络有限公司 Resource publishing method and device
CN112000572A (en) * 2020-08-07 2020-11-27 北京浪潮数据技术有限公司 Source code scanning tool, method, equipment and medium
CN112000572B (en) * 2020-08-07 2022-06-17 北京浪潮数据技术有限公司 Tool, method, equipment and medium for scanning source code
CN111984300A (en) * 2020-09-08 2020-11-24 网易(杭州)网络有限公司 Code copying method and device, electronic equipment and computer readable storage medium
CN111984300B (en) * 2020-09-08 2024-01-23 网易(杭州)网络有限公司 Code copying method and device, electronic equipment and computer readable storage medium
CN112181429A (en) * 2020-09-28 2021-01-05 百度在线网络技术(北京)有限公司 Information processing method and device and electronic equipment
CN112181429B (en) * 2020-09-28 2023-10-20 百度在线网络技术(北京)有限公司 Information processing method and device and electronic equipment
CN112286528A (en) * 2020-11-04 2021-01-29 豆盟(北京)科技股份有限公司 Applet generation method, device and equipment and computer storage medium
CN112506854A (en) * 2020-11-24 2021-03-16 百度在线网络技术(北京)有限公司 Method, device, equipment and medium for storing page template file and generating page
CN112506854B (en) * 2020-11-24 2024-04-02 百度在线网络技术(北京)有限公司 Page template file storage and page generation methods, devices, equipment and media
CN112685040A (en) * 2021-01-22 2021-04-20 爱驰汽车有限公司 Method, device, equipment and storage medium for generating interface file in android system
CN113094040A (en) * 2021-03-08 2021-07-09 南京唯优信息技术有限公司 Applet compiling method and device
CN112947990B (en) * 2021-03-23 2023-04-07 四川虹美智能科技有限公司 Development library creating method, device and computer readable medium
CN112947990A (en) * 2021-03-23 2021-06-11 四川虹美智能科技有限公司 Development library creating method and device and computer readable medium
CN113268237A (en) * 2021-05-25 2021-08-17 平安科技(深圳)有限公司 Function page generation method, device, equipment and medium of function module
CN113282291A (en) * 2021-06-10 2021-08-20 豆盟(北京)科技股份有限公司 Method, device and equipment for generating small program and storage medium
CN113821252A (en) * 2021-09-24 2021-12-21 深圳市明源云采购科技有限公司 Method and device for constructing small program, terminal device and storage medium
CN113821252B (en) * 2021-09-24 2024-05-14 深圳市明源云采购科技有限公司 Method and device for constructing applet, terminal equipment and storage medium
CN114564230A (en) * 2022-02-23 2022-05-31 北京布局未来教育科技有限公司 One-key uploading implementation method and device of Hongming system, electronic equipment and medium
CN114564230B (en) * 2022-02-23 2024-01-16 北京布局未来科技发展有限公司 One-key uploading realization method and device of hong Monte-go system, electronic equipment and medium
CN116955279A (en) * 2023-09-19 2023-10-27 腾讯科技(深圳)有限公司 File uploading method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110532029A (en) Small routine generation method, device, equipment and computer readable storage medium
US10162610B2 (en) Method and apparatus for migration of application source code
Pandita et al. {WHYPER}: Towards automating risk assessment of mobile applications
Bagheri et al. Software architectural principles in contemporary mobile software: from conception to practice
CN103049271A (en) Method and device for automatically generating description document of API (application program interface)
CN107357593A (en) Source code file construction method, device, electric terminal and readable storage medium storing program for executing
Kamburjan Behavioral program logic
Uddin et al. Modeling and reasoning about preference-based context-aware agents over heterogeneous knowledge sources
Shezan et al. TKPERM: cross-platform permission knowledge transfer to detect overprivileged third-party applications
Yu et al. Localizing function errors in mobile apps with user reviews
Qiu et al. Mobile Applications Development with Android: Technologies and Algorithms
CN109063059A (en) User behaviors log processing method, device and electronic equipment
Lodge et al. Developing GDPR compliant apps for the edge
Bieliková et al. Sharing user models for adaptive hypermedia applications
Bride et al. N-PAT: A Nested Model-Checker: (System Description)
Ma et al. Roaming through the castle tunnels: an empirical analysis of inter-app navigation of Android apps
Ying et al. Developer profiles for recommendation systems
Khungar et al. A context based storage for ubiquitous computing applications
Yu et al. Towards automatically localizing function errors in mobile apps with user reviews
Di Noia et al. Fuzzy description logics for component selection in software design
Arcega et al. On the influence of models at run-time traces in dynamic feature location
Gurcan Identification of mobile development issues using semantic topic modeling of Stack Overflow posts
Feichtner et al. Code between the lines: semantic analysis of android applications
Shi et al. Automatic recommendation of user interface examples for mobile app development
Xu et al. Web APIs recommendation with neural content embedding for mobile multimedia computing

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