CN110209388A - The generation method of applet file - Google Patents

The generation method of applet file Download PDF

Info

Publication number
CN110209388A
CN110209388A CN201910456351.6A CN201910456351A CN110209388A CN 110209388 A CN110209388 A CN 110209388A CN 201910456351 A CN201910456351 A CN 201910456351A CN 110209388 A CN110209388 A CN 110209388A
Authority
CN
China
Prior art keywords
file
applet
information
replaceable
template
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
CN201910456351.6A
Other languages
Chinese (zh)
Inventor
李伟玲
黎洪武
钟雪艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Cool Car Information Technology Co Ltd
Original Assignee
Guangzhou Cool Car Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Cool Car Information Technology Co Ltd filed Critical Guangzhou Cool Car Information Technology Co Ltd
Priority to CN201910456351.6A priority Critical patent/CN110209388A/en
Publication of CN110209388A publication Critical patent/CN110209388A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

This application involves generation method, device, computer equipment and the storage mediums of a kind of applet file.The described method includes: the template file for obtaining applet and the replaceable information in the template file;Obtain the replacement information for replacing the replaceable information;Target data objects are generated according to the replacement information;The replaceable information in the template file is replaced using the target data objects, generates the corresponding target alternate file of the applet.Using this method, realize the replacement information according to the replaceable information in the template file of applet and the template file for replacing applet, automatically generate the purpose of the target alternate file of applet, without passing through manual compiling, duplication and the complicated processes for modifying code, to simplify the product process of applet file, the formation efficiency of applet file is further improved.

Description

The generation method of applet file
Technical field
This application involves field of computer technology, more particularly to a kind of generation method of applet file, device, Computer equipment and storage medium.
Background technique
With the rapid development of computer technology, the exploitation of various applets has also obtained unprecedented development, various Applet emerges one after another, and more and more APP have a corresponding applet, for example wechat small routine, Alipay are small Program etc..
Currently, in order to develop with a series of multiple applets, such as automobile brand small routine, generally by opening Hair engineer writes multiple applet codes manually respectively, or writes what a small application in advance by Developmental Engineer Process template, then modified by imagineering's the corresponding of line code of going forward side by side, to generate another applet file.But If more with a series of applet quantity, pass through manual compiling, duplication and the process for modifying code is comparatively laborious, cause The development time of applet is longer, to cause the formation efficiency of applet file lower.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of generation effect that can be improved applet file Generation method, device, computer equipment and the storage medium of the applet file of rate.
A kind of generation method of applet file, which comprises
The template file for obtaining applet and the replaceable information in the template file;
Obtain the replacement information for replacing the replaceable information;
Target data objects are generated according to the replacement information;
The replaceable information in the template file is replaced using the target data objects, described in generation The corresponding target alternate file of applet.
The replaceable information in the template file is obtained in one of the embodiments, comprising:
Obtain the file to be modified in the template file;
The file to be modified is converted into corresponding character string;
Character string corresponding with default identifier is obtained from the character string, as replaceable in the template file Information.
The replacement information obtained for replacing the replaceable information in one of the embodiments, comprising:
Identify the meaning of the replaceable information;The meaning of the replaceable information includes automobile brand ID and automobile brand Title;
The corresponding content information of the meaning is extracted from preset replacement information list, as replace it is described can The replacement information of replacement information;Record has the corresponding at least two contents letter of every kind of meaning in the preset replacement information list Breath.
It is described in one of the embodiments, that target data objects are generated according to the replacement information, comprising:
Obtain preset data object template;
According to the replacement information, assignment processing, generation pair are carried out to the attribute value of the preset data object template The target data objects answered.
In one of the embodiments, it is described using the target data objects to can replace described in the template file It changes information to be replaced, generates the corresponding target alternate file of the applet, comprising:
According to the replaceable information in the target data objects and the template file, generate and the template The corresponding information matches file of file;
The replaceable information is replaced according to the information matches file, it is corresponding to generate the applet Target alternate file.
It is described in one of the embodiments, can according in the target data objects and the template file Replacement information generates information matches file corresponding with the template file, comprising:
The canonical replacement established between the replaceable information in the target data objects and the template file is closed System;
Information corresponding with the template file is generated according to the canonical fallback relationship and the target data objects Matching files.
It is described in one of the embodiments, that the replaceable information is replaced according to the information matches file, Generate the corresponding target alternate file of the applet, comprising:
Obtain the target data objects for including in the information matches file and the canonical fallback relationship;
According to the canonical fallback relationship, the replaceable information in the template file is replaced with into the number of targets According to object, the corresponding target alternate file of the applet is generated.
In one of the embodiments, the method also includes:
Obtain the data verification file of the corresponding target alternate file of the applet;
The target alternate file is verified according to the data verification file;
If verifying is correct, applet file is generated according to the corresponding target alternate file of the applet, it will The applet file is sent to corresponding audit terminal;The audit terminal be used for the applet file into The corresponding audit processing of row.
In one of the embodiments, the method also includes:
If the audit terminal passes through the applet Note Auditing, according to the applet file generated Corresponding applet stores the applet according to program identification.
In one of the embodiments, the method also includes:
Receive the inquiry request of requesting terminal;The inquiry request includes program identification;
Applet corresponding with described program mark is obtained from the applet of storage, it will be described small using journey Sequence is sent to the requesting terminal;The requesting terminal is for showing the corresponding page of the applet.
A kind of generating means of applet file, described device include:
File acquisition module, it is replaceable in the template file and the template file for obtaining applet Information;
Data obtaining module, for obtaining the replacement information for replacing the replaceable information;
Object generation module, for generating target data objects according to the replacement information;
File generating module, for using the target data objects to the replaceable information in the template file It is replaced, generates the corresponding target alternate file of the applet.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing Device performs the steps of when executing the computer program
The template file for obtaining applet and the replaceable information in the template file;
Obtain the replacement information for replacing the replaceable information;
Target data objects are generated according to the replacement information;
The replaceable information in the template file is replaced using the target data objects, described in generation The corresponding target alternate file of applet.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor It is performed the steps of when row
The template file for obtaining applet and the replaceable information in the template file;
Obtain the replacement information for replacing the replaceable information;
Target data objects are generated according to the replacement information;
The replaceable information in the template file is replaced using the target data objects, described in generation The corresponding target alternate file of applet.
Generation method, device, computer equipment and the storage medium of above-mentioned applet file, by obtaining for replacing The replacement information of the replaceable information in the template file of applet is changed, target data objects are generated based on replacement information, And the replaceable information in template file is replaced using target data objects, it generates the corresponding target of applet and replaces Exchange of notes part;It realizes according to replacing in the template file of applet and the template file for replacing applet The replacement information for changing information automatically generates the purpose of the target alternate file of applet, without passing through manual compiling, duplication And the complicated processes of code are modified, to simplify the product process of applet file, further improve small using journey The formation efficiency of preface part.Meanwhile by automatically generating applet file, be conducive to save human cost, and effectively Avoid the defect that error is easy by manual compiling code.
Detailed description of the invention
Fig. 1 is the application scenario diagram of the generation method of small application file in one embodiment;
Fig. 2 is the flow diagram of the generation method of small application file in one embodiment;
Fig. 3 is flow diagram the step of generating the corresponding target alternate file of applet in one embodiment;
Fig. 4 is the flow diagram of the generation method of small application file in another embodiment;
Fig. 5 is the structural block diagram of the generating means of small application file in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not For limiting the application.
The generation method of applet file provided by the present application, can be applied to computer equipment as shown in Figure 1 In.The computer equipment can be server, and internal structure chart can be as shown in Figure 1.The computer equipment includes passing through to be Processor, memory, network interface and the database of bus of uniting connection.Wherein, the processor of the computer equipment is for providing Calculating and control ability.The memory of the computer equipment includes non-volatile memory medium, built-in storage.This is non-volatile to deposit Storage media is stored with operating system, computer program and database.The built-in storage is the operation in non-volatile memory medium The operation of system and computer program provides environment.The database of the computer equipment is used to store the template text of applet The replacement information of replaceable information in part, the template file for replacing applet, small applies journey at target data objects The data such as the corresponding target alternate file of sequence.The network interface of the computer equipment is used to pass through network connection with external terminal Communication.A kind of generation method of applet file is realized when the computer program is executed by processor.
It will be understood by those skilled in the art that structure shown in Fig. 1, only part relevant to application scheme is tied The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
Generation method, device, computer equipment and the storage that the embodiment of the present invention provides a kind of applet file are situated between Matter is described in detail separately below:
In one embodiment, as shown in Fig. 2, providing a kind of generation method of applet file, in this way Applied to being illustrated for the server in Fig. 1, comprising the following steps:
Step S201 obtains the replaceable information in the template file and template file of applet.
In this step, applet, which refers to, does not need the i.e. workable application of downloading installation, such as wechat small routine, Alipay small routine etc.;Applet, which needs to operate in corresponding application program, can just be used, such as wechat small routine Needing to operate in wechat can just be used using upper.Template file refers to that the general file of applet is (such as small using journey The demo file of sequence), including ACSS file, Jscript Script file, JSON file etc.;Replaceable information refers to small application The information for needing to be replaced in the template file of program.
In the specific implementation, user writes the template file of applet in advance, by the template file of applet It is uploaded to server;Server extracts the default identifier pair with replaceable information from the template file of applet The information answered, as the replaceable information in template file.
In addition, server can also replicate automatically the template file for the applet that user writes in advance, such as adopt With the fs module of node.js, All Files and file under the catalogue of the template file of applet are obtained, applies journey for small The template file of All Files and file as the applet obtained under the catalogue of the template file of sequence;From the small of acquisition In the template file of application program, information corresponding with the default identifier of replaceable information is extracted, as in template file Replaceable information.
Further, using the fs module of node.js, All Files under the catalogue of the template file of applet are obtained And file, can be accomplished in the following manner: server is obtained using the readdirSync method in fs module in node.js Take All Files and file under the catalogue of template file;The file and file that get are judged, are texts to distinguish Part or file are directly replicated if file;If file, this document folder is replicated, and after having replicated Continue recurrence to find this document and press from both sides following file or file, until entering the last layer file, completes this document The traversal of folder replicates;Using the All Files replicated and file as the template file of the applet obtained.
Step S202 obtains the replacement information for replacing replaceable information.
In this step, replacement information refers to the content information for replacing replaceable information, for example, with replaceable information Belong to the content information of same meaning, such as in automobile brand small routine, replaceable information is automobile brand ID, then replacing Information is another automobile brand ID.
In the specific implementation, server is based on information discriminating technology, the meaning of the replaceable information in recognition template file is obtained Content information corresponding with the meaning is taken, as the replacement information for replacing replaceable information;In this way, realizing automatic acquisition For replacing the purpose of the replacement information of replaceable information, target data objects are generated based on replacement information convenient for subsequent.
Step S203 generates target data objects according to replacement information.
In this step, target data objects refer to the object using replacement information as attribute value.In the specific implementation, service Device constructs the object that attribute value is replacement information, as target data objects.
Step S204 is replaced the replaceable information in template file using target data objects, generates small application The corresponding target alternate file of program.
In this step, target alternate file refers to that the replaceable information in template file is the file of replacement information, than Such as in automobile brand small routine, target alternate file refers to automobile brand ID in template file, automobile brand title difference For another automobile brand ID, the file of another automobile brand title.
In the specific implementation, server traverses template file according to target data objects, the replacement letter in template file is determined Breath, and the replacement information in template file is replaced with into target data objects one by one, to generate the corresponding mesh of applet Mark alternate file.In this way, the purpose for automatically generating the target alternate file of applet is realized, without by manually compiling The complicated processes of code are write, replicated and modify, to simplify the product process of applet file, are further improved small The formation efficiency of application file;Simultaneously effective avoid the defect that error is easy by manual compiling code.
In the generation method of above-mentioned applet file, by obtaining in the template file for replacing applet Replaceable information replacement information, based on replacement information generate target data objects, and using target data objects to template Replaceable information in file is replaced, and generates the corresponding target alternate file of applet;It realizes according to small application The replacement information of replaceable information in the template file of program and template file for replacing applet, it is automatic raw At the purpose of the target alternate file of applet, without passing through manual compiling, duplication and the complicated processes for modifying code, from And the product process of applet file is simplified, further improve the formation efficiency of applet file.Meanwhile it is logical It crosses and automatically generates applet file, be conducive to save human cost, and efficiently avoid through manual compiling code It is easy the defect of error.
In one embodiment, above-mentioned steps S201 obtains the replaceable information in template file, comprising: obtains template File to be modified in file;File to be modified is converted into corresponding character string;It is obtained and default identifier from character string Corresponding character string, as the replaceable information in template file.
In the present embodiment, file to be modified refers to the file comprising replaceable information;Default identifier refers to for marking Know the identifier of the replaceable information in template file.
For example, server traversal template file in file and file, obtain include replaceable information file, make For file to be modified;File to be modified is subjected to character string conversion, obtains corresponding character string;Obtained character string is inquired, is obtained Character string corresponding with default identifier is taken, as the replaceable information in template file.Through this embodiment, it realizes automatic The purpose of the replaceable information in template file is obtained, convenient for the subsequent replacement information obtained for replacing replaceable information.
In one embodiment, above-mentioned steps S202 obtains the replacement information for replacing replaceable information, comprising: knows The meaning of not replaceable information;The meaning of replaceable information includes automobile brand ID and automobile brand title;From preset replacement The corresponding content information of meaning is extracted in information list, as the replacement information for replacing replaceable information;It is preset to replace Changing record in information list has corresponding at least two content information of every kind of meaning.
In the present embodiment, automobile brand ID refers to that automobile brand is numbered, and content information can be 1,2,3 etc., automobile The content information of brand ID has corresponding vehicle database;It is i.e. accessible corresponding by the content information of automobile brand ID Vehicle database.The content information of automobile brand title can be Audi, benz, Toyota etc.;Preset replacement information list is Refer to that record has the Excel table of automobile brand ID and corresponding at least two content information of automobile brand title.
In the specific implementation, server acquires the meanings such as automobile brand ID, automobile brand title corresponding at least two in advance A content information constructs information list, as preset replacement information list according to the content information of acquisition;Server is based on Information discriminating technology identifies the meaning that replaceable information represents;Preset replacement information list is inquired, and is believed from preset replacement The corresponding content information of the meaning is extracted in breath list, as the replacement information for replacing replaceable information.In this way, realizing Automatic acquisition is used to replace the purpose of the replacement information of replaceable information, generates target data based on replacement information convenient for subsequent Object.
In one embodiment, above-mentioned steps S203 generates target data objects according to replacement information, comprising: obtains pre- If data object template;According to replacement information, assignment processing, generation pair are carried out to the attribute value of preset data object template The target data objects answered.
In the present embodiment, data object template refers to that attribute value is empty data object;Target data objects refer to category Property value be replacement information data object, processing can be replaced to replaceable information.In the specific implementation, server obtains in advance If data object template, the attribute value of preset data object template is assigned a value of corresponding replacement information, such as by attribute Value is assigned a value of automobile brand ID, automobile brand title respectively, to generate corresponding target data objects;Facilitate subsequent using mesh Mark data object is replaced the replaceable information in template file, to generate the corresponding target replacement text of applet Part, without further improving the formation efficiency of applet file, while saving by imagineering, modification code Human cost.
In one embodiment, as shown in figure 3, being carried out using target data objects to the replaceable information in template file Replacement generates the corresponding target alternate file of applet, specifically includes step:
Step S301 is generated and template file pair according to the replaceable information in target data objects and template file The information matches file answered.
Wherein, information matches file is that one kind can be automatically using target data objects to the replaceable letter in template file Cease the file being replaced.
Step S302 is replaced replaceable information according to information matches file, generates the corresponding mesh of applet Mark alternate file.
In the present embodiment, replacing between the replaceable information in server construction target data objects and template file Relationship is changed, information matches file corresponding with template file is generated according to the fallback relationship, and will by the information matches file Replaceable information in template file replaces with replacement information, to generate the corresponding target alternate file of applet.This Sample realizes the purpose for automatically generating the target alternate file of applet, without passing through manual compiling, duplication and modifying generation The complicated processes of code further improve applet file to simplify the product process of applet file Formation efficiency;Simultaneously effective avoid the defect that error is easy by manual compiling code.
In one embodiment, above-mentioned steps S301, according to the replaceable letter in target data objects and template file Breath generates corresponding with template file information matches file, comprising: establish target data objects with it is replaceable in template file Canonical fallback relationship between information;Letter corresponding with template file is generated according to canonical fallback relationship and target data objects Cease matching files.
In the present embodiment, canonical fallback relationship is to refer to the replaceable information in template file replacing with number of targets According to the relationship of object.For example, the canonical that server is established between the replaceable information in target data objects and template file is replaced Relationship is changed, and using target data objects as the object for replacing replaceable information, to generate information corresponding with template file With file;In this way, be conducive to it is subsequent replaceable information is replaced automatically according to information matches file, to generate small application The corresponding target alternate file of program, without passing through manual amendment's code, to improve the generation effect of applet file Rate.
In one embodiment, above-mentioned steps S302 is replaced replaceable information according to information matches file, generates The corresponding target alternate file of applet, comprising: obtain the target data objects and just for including in information matches file Then fallback relationship;According to canonical fallback relationship, the replaceable information in template file is replaced with into target data objects, is generated small The corresponding target alternate file of application program.
In the specific implementation, server parses information matches file, the target for including in information matches file is obtained Data object and canonical fallback relationship;According to canonical fallback relationship, the replaceable information in template file is replaced with into target Data object replaces the content information " $ { id } " of the automobile brand ID in template file such as automobile brand small routine For the content information (jsonData [tar] .brandId) of another automobile brand ID, by the automobile brand title in template file Content information " $ { brandName } " replace with the content information (jsonData [tar] of another automobile brand title .brandName), to generate the corresponding target alternate file of applet.Through this embodiment, it realizes and automatically generates The purpose of the target alternate file of applet, without passing through manual compiling, duplication and the complicated processes for modifying code, thus The product process for simplifying applet file further improves the formation efficiency of applet file.
It further, can also be by server to mesh after generating the corresponding target alternate file of applet Mark alternate file is verified, and the target alternate file generated is avoided mistake occur.In one embodiment, applet text The generation method of part further include: obtain the data verification file of the corresponding target alternate file of applet;It is tested according to data Card file verifies target alternate file;If verifying is correct, generated according to the corresponding target alternate file of applet Applet file is sent to corresponding audit terminal by applet file;Audit terminal is used for applet File carries out corresponding audit processing.
In the present embodiment, data verification file is the information referred to the corresponding target alternate file of applet The file that format, information integrity, information accuracy etc. are verified;Applet file refers to be corresponded to by applet Target alternate file encapsulation made of file.Audit terminal refers to the end that review operations can be carried out to applet file End, for example the computer equipment of corresponding applet audit platform (such as Alipay small routine audit platform) is installed.
In the specific implementation, server inquiry is stored with the data verification of the corresponding target alternate file of multiple applets The presetting database of file obtains the data verification file of the corresponding target alternate file of applet;According to data verification File verifies target alternate file, for example whether the replaceable information in verifying target alternate file replaces all with and replace Information, the information format in target alternate file are changed with the presence or absence of mistake etc.;If verifying is correct, mesh corresponding to applet Mark alternate file is packaged processing, generates applet file, and applet file is sent to corresponding audit Terminal;Audit terminal is used to carry out applet file corresponding audit processing, for example audits the basic of applet Function, content of pages, availability and integrality, privacy of user and data safety, UI specification etc..
In this way, being conducive to improve generation by verifying the corresponding target alternate file of the applet of generation The corresponding target alternate file of applet accuracy and audit percent of pass, avoid target alternate file from mistake occur Or it audits not by needing by checking manually, the defect for causing the formation efficiency of applet file to decline, into one Step improves the formation efficiency of applet file.
If identifying that target is replaced in addition, server, which authenticates to the corresponding target alternate file of applet, mistake occurs The type of error of exchange of notes part obtains reparation instruction corresponding with the type of error, is instructed according to the reparation to target alternate file Reparation operation is carried out, the target alternate file after being repaired.In this way, realizing corresponding to the applet that there is mistake The purpose that target alternate file is automatically repaired, without further improving applet text by manually checking mistake The formation efficiency of part.
In one embodiment, the generation method of applet file further include: if audit terminal is to applet Note Auditing passes through, according to the corresponding applet of applet file generated, by applet according to program identification It is stored.
Wherein, program identification refers to the identification information for identifying applet, for example applet title, small answers With program coding etc..In the specific implementation, audit terminal audits received applet file, corresponding audit is obtained As a result, and auditing result is sent to server;Server parses auditing result, confirms audit terminal to applet file Audit passes through, then according to the corresponding applet of applet file generated, and by the applet of generation according to journey Sequence mark classification is stored, for example is stored into the program library pre-established.In this way, being conducive to subsequent server according to request The inquiry request of terminal obtains corresponding applet, and applet is sent to corresponding requesting terminal.
In one embodiment, the generation method of applet file further include: receive the inquiry request of requesting terminal; Inquiry request includes program identification;Applet corresponding with program identification is obtained from the applet of storage, it will be small Application program is sent to requesting terminal;Requesting terminal is for showing the corresponding page of applet.
In the present embodiment, requesting terminal refers to smart phone.For example, to be equipped with applet corresponding for requesting terminal Application program, such as the corresponding Alipay application of Alipay small routine;User logs in the application program by account number cipher, is answering With applet title is inputted on the query interface of program, name format is automobile brand _ big flat foreign grid motor, such as difficult to understand Enlightening _ big flat foreign grid motor;Requesting terminal recognizes the input operation of user, and applet name is referred to as program identification;Root Inquiry request is generated according to the program identification, and the inquiry request is sent to server.Server parses inquiry request, Obtain program identification;Obtain corresponding with program identification applet from the applet of storage, and by small application Program is sent to corresponding requesting terminal;Requesting terminal is for showing the corresponding page of applet.
For example, the corresponding page of automobile brand small routine includes homepage general view, vehicle system complete works, dealer, vehicle system page;Its In, homepage general view shows a part of automobile information under the automobile brand, and vehicle system complete works shows whole vapour under the automobile brand Vehicle information;Distributor information is shown according to different vendor, different regions, is specifically included dealer name, dealer address, is sold Quotient's address navigation information, Dealer service telephone call etc.;Vehicle system page information refers to that each British Standard, Automobile Series, such as Audi Q3 correspond to Specifying information, comprising: British Standard, Automobile Series title, official's quotation, reserve price information, purchase vehicle discount coupon, automobile model, automobile public praise letter Breath, distributor information, price reduction information, automobile ginseng are with information etc..
In one embodiment, as shown in figure 4, providing the generation method of another applet file, including with Lower step:
Step S401 obtains the replaceable information in the template file and template file of applet.
Step S402 obtains the replacement information for replacing replaceable information.
Step S403 generates target data objects according to replacement information.
Step S404 is replaced the replaceable information in template file using target data objects, generates small application The corresponding target alternate file of program.
Step S405 obtains the data verification file of the corresponding target alternate file of applet;According to data verification File verifies target alternate file;If verifying is correct, generated according to the corresponding target alternate file of applet small Applet file is sent to corresponding audit terminal by application file;Audit terminal is used for applet text Part carries out corresponding audit processing.
Step S406, if audit terminal passes through applet Note Auditing, according to applet file generated pair The applet answered stores applet according to program identification.
The generation method of above-mentioned applet file, realizes according to the template file of applet and for replacing The replacement information for changing the replaceable information in the template file of applet automatically generates the target replacement text of applet The purpose of part, without passing through manual compiling, duplication and the complicated processes for modifying code, to simplify applet file Product process further improves the formation efficiency of applet file.Meanwhile by automatically generating applet text Part is conducive to save human cost, and efficiently avoids the defect that error is easy by manual compiling code.
It should be understood that although each step in the flow chart of Fig. 2-4 is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 2-4 Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively It carries out, but can be at least part of the sub-step or stage of other steps or other steps in turn or alternately It executes.
In one embodiment, as shown in figure 5, providing a kind of generating means of applet file, comprising: file Obtain module 510, data obtaining module 520, object generation module 530 and file generating module 540, in which:
File acquisition module 510, the replaceable letter in template file and template file for obtaining applet Breath.
Data obtaining module 520, for obtaining the replacement information for replacing replaceable information.
Object generation module 530, for generating target data objects according to replacement information.
File generating module 540, for being replaced using target data objects to the replaceable information in template file, Generate the corresponding target alternate file of applet.
In one embodiment, file acquisition module is also used to obtain the file to be modified in template file;It will be to be modified File is converted to corresponding character string;Character string corresponding with default identifier is obtained from character string, as in template file Replaceable information.
In one embodiment, data obtaining module is also used to identify the meaning of replaceable information;Replaceable information contains Justice includes automobile brand ID and automobile brand title;The corresponding content letter of meaning is extracted from preset replacement information list Breath, as the replacement information for replacing replaceable information;Record has every kind of meaning corresponding in preset replacement information list At least two content informations.
In one embodiment, object generation module is also used to obtain preset data object template;According to replacement information, Assignment processing is carried out to the attribute value of preset data object template, generates corresponding target data objects.
In one embodiment, file generating module is also used to according to replacing in target data objects and template file Information is changed, information matches file corresponding with template file is generated;Replaceable information is replaced according to information matches file, Generate the corresponding target alternate file of applet.
In one embodiment, file generating module be also used to establish target data objects with it is replaceable in template file Canonical fallback relationship between information;Letter corresponding with template file is generated according to canonical fallback relationship and target data objects Cease matching files.
In one embodiment, file generating module is also used to obtain the target data objects in information matches file included And canonical fallback relationship;According to canonical fallback relationship, the replaceable information in template file is replaced with into target data objects, Generate the corresponding target alternate file of applet.
In one embodiment, the generating means of applet file further include file verification module, small for obtaining The data verification file of the corresponding target alternate file of application program;According to data verification file to the target alternate file into Row verifying;If verifying is correct, applet file is generated according to the corresponding target alternate file of applet, by small application Program file is sent to corresponding audit terminal;Audit terminal is used to carry out corresponding audit processing to applet file.
In one embodiment, the generating means of applet file further include program generating module, if for auditing Terminal passes through applet Note Auditing, according to the corresponding applet of applet file generated, by small application Program is stored according to program identification.
In one embodiment, the generating means of applet file further include program sending module, are asked for receiving Seek the inquiry request of terminal;Inquiry request includes program identification;It is obtained from the applet of storage corresponding with program identification Applet, applet is sent to requesting terminal;Requesting terminal is for showing the corresponding page of applet.
Above-mentioned each embodiment, the generating means of applet file pass through the mould obtained for replacing applet The replacement information of replaceable information in plate file generates target data objects based on replacement information, and uses target data pair As being replaced to the replaceable information in template file, the corresponding target alternate file of applet is generated;Realize root Believe according to the replacement of the replaceable information in the template file of applet and the template file for replacing applet Breath, automatically generates the purpose of the target alternate file of applet, without passing through manual compiling, duplication and modifying the numerous of code Trivial process further improves the generation effect of applet file to simplify the product process of applet file Rate.Meanwhile by automatically generating applet file, be conducive to save human cost, and efficiently avoid by artificial It writes code and is easy the defect to malfunction.
The specific restriction of generating means about applet file may refer to above for applet text The restriction of the generation method of part, details are not described herein.Modules in the generating means of above-mentioned applet file can be complete Portion or part are realized by software, hardware and combinations thereof.Above-mentioned each module can be embedded in the form of hardware or independently of calculating In processor in machine equipment, it can also be stored in a software form in the memory in computer equipment, in order to processor It calls and executes the corresponding operation of the above modules.
In one embodiment, a kind of computer equipment, including memory and processor are provided, which is stored with Computer program, the processor perform the steps of when executing computer program
The template file for obtaining applet and the replaceable information in template file;
Obtain the replacement information for replacing replaceable information;
Target data objects are generated according to replacement information;
The replaceable information in template file is replaced using target data objects, it is corresponding to generate applet Target alternate file.
In one embodiment, it also performs the steps of and is obtained in template file when processor executes computer program File to be modified;File to be modified is converted into corresponding character string;Word corresponding with default identifier is obtained from character string Symbol string, as the replaceable information in template file.
In one embodiment, identification replaceable information is also performed the steps of when processor executes computer program Meaning;The meaning of replaceable information includes automobile brand ID and automobile brand title;It is extracted from preset replacement information list The corresponding content information of meaning out, as the replacement information for replacing replaceable information;Remember in preset replacement information list Record has corresponding at least two content information of every kind of meaning.
In one embodiment, it is also performed the steps of when processor executes computer program and obtains preset data pair As template;According to replacement information, assignment processing is carried out to the attribute value of preset data object template, generates corresponding number of targets According to object.
In one embodiment, it also performs the steps of when processor executes computer program according to target data objects And the replaceable information in template file, generate information matches file corresponding with template file;According to information matches file Replaceable information is replaced, the corresponding target alternate file of applet is generated.
In one embodiment, it is also performed the steps of when processor executes computer program and establishes target data objects With the canonical fallback relationship between the replaceable information in template file;It is raw according to canonical fallback relationship and target data objects At information matches file corresponding with template file.
In one embodiment, it is also performed the steps of when processor executes computer program and obtains information matches file In include target data objects and canonical fallback relationship;According to canonical fallback relationship, by the replaceable letter in template file Breath replaces with target data objects, generates the corresponding target alternate file of applet.
In one embodiment, it is also performed the steps of when processor executes computer program and obtains applet pair The data verification file for the target alternate file answered;The target alternate file is verified according to data verification file;If Verifying is correct, applet file is generated according to the corresponding target alternate file of applet, by applet file It is sent to corresponding audit terminal;Audit terminal is used to carry out corresponding audit processing to applet file.
In one embodiment, it answers if processor also performs the steps of audit terminal when executing computer program small Passed through with program file audit, according to the corresponding applet of applet file generated, by applet according to journey Sequence mark is stored.
In one embodiment, it is also performed the steps of when processor executes computer program and receives looking into for requesting terminal Ask request;Inquiry request includes program identification;It is obtained from the applet of storage corresponding with program identification small using journey Applet is sent to requesting terminal by sequence;Requesting terminal is for showing the corresponding page of applet.
Above-mentioned each embodiment, computer equipment are realized and are answered according to small by the computer program run on processor With the replacement information of the replaceable information in the template file of program and the template file for replacing applet, automatically The purpose for generating the target alternate file of applet, without passing through manual compiling, duplication and the complicated processes for modifying code, To simplify the product process of applet file, the formation efficiency of applet file is further improved.Meanwhile By automatically generating applet file, be conducive to save human cost, and efficiently avoid through manual compiling code And it is easy the defect of error.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
The template file for obtaining applet and the replaceable information in template file;
Obtain the replacement information for replacing replaceable information;
Target data objects are generated according to replacement information;
The replaceable information in template file is replaced using target data objects, it is corresponding to generate applet Target alternate file.
In one embodiment, it also performs the steps of and is obtained in template file when computer program is executed by processor File to be modified;File to be modified is converted into corresponding character string;It is obtained from character string corresponding with default identifier Character string, as the replaceable information in template file.
In one embodiment, identification replaceable information is also performed the steps of when computer program is executed by processor Meaning;The meaning of replaceable information includes automobile brand ID and automobile brand title;It is mentioned from preset replacement information list The corresponding content information of meaning is taken out, as the replacement information for replacing replaceable information;In preset replacement information list Record has corresponding at least two content information of every kind of meaning.
In one embodiment, it is also performed the steps of when computer program is executed by processor and obtains preset data Object template;According to replacement information, assignment processing is carried out to the attribute value of preset data object template, generates corresponding target Data object.
In one embodiment, it also performs the steps of when computer program is executed by processor according to target data pair As and template file in replaceable information, generate corresponding with template file information matches file;According to information matches text Part is replaced replaceable information, generates the corresponding target alternate file of applet.
In one embodiment, it is also performed the steps of when computer program is executed by processor and establishes target data pair As the canonical fallback relationship between the replaceable information in template file;According to canonical fallback relationship and target data objects Generate information matches file corresponding with template file.
In one embodiment, it is also performed the steps of when computer program is executed by processor and obtains information matches text The target data objects and canonical fallback relationship for including in part;It, will be replaceable in template file according to canonical fallback relationship Information replaces with target data objects, generates the corresponding target alternate file of applet.
In one embodiment, acquisition applet is also performed the steps of when computer program is executed by processor The data verification file of corresponding target alternate file;The target alternate file is verified according to data verification file; If verifying is correct, applet file is generated according to the corresponding target alternate file of applet, by applet text Part is sent to corresponding audit terminal;Audit terminal is used to carry out corresponding audit processing to applet file.
In one embodiment, if also performing the steps of audit terminal when computer program is executed by processor to small Application file audit passes through, according to the corresponding applet of applet file generated, by applet according to Program identification is stored.
In one embodiment, it is also performed the steps of when computer program is executed by processor and receives requesting terminal Inquiry request;Inquiry request includes program identification;Small application corresponding with program identification is obtained from the applet of storage Applet is sent to requesting terminal by program;Requesting terminal is for showing the corresponding page of applet.
Above-mentioned each embodiment, the computer program that computer readable storage medium is stored by it, realizes according to small The replacement information of replaceable information in the template file of application program and template file for replacing applet, from The purpose of the dynamic target alternate file for generating applet, without passing through manual compiling, duplication and the cumbersome mistake for modifying code Journey further improves the formation efficiency of applet file to simplify the product process of applet file.Together When, by automatically generating applet file, be conducive to save human cost, and efficiently avoid through manual compiling generation Code and be easy error defect.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (10)

1. a kind of generation method of applet file, which is characterized in that the described method includes:
The template file for obtaining applet and the replaceable information in the template file;
Obtain the replacement information for replacing the replaceable information;
Target data objects are generated according to the replacement information;
The replaceable information in the template file is replaced using the target data objects, generates described small answer With the corresponding target alternate file of program.
2. the method according to claim 1, wherein obtaining the replaceable information in the template file, comprising:
Obtain the file to be modified in the template file;
The file to be modified is converted into corresponding character string;
Character string corresponding with default identifier is obtained from the character string, as the replaceable letter in the template file Breath.
3. the method according to claim 1, wherein the replacement obtained for replacing the replaceable information Information, comprising:
Identify the meaning of the replaceable information;The meaning of the replaceable information includes automobile brand ID and automobile brand name Claim;
The corresponding content information of the meaning is extracted from preset replacement information list, as described replaceable for replacing The replacement information of information;Record has corresponding at least two content information of every kind of meaning in the preset replacement information list.
4. the method according to claim 1, wherein described generate target data pair according to the replacement information As, comprising:
Obtain preset data object template;
According to the replacement information, assignment processing is carried out to the attribute value of the preset data object template, is generated corresponding Target data objects.
5. the method according to claim 1, wherein described literary to the template using the target data objects The replaceable information in part is replaced, and generates the corresponding target alternate file of the applet, comprising:
According to the replaceable information in the target data objects and the template file, generate and the template file Corresponding information matches file;
The replaceable information is replaced according to the information matches file, generates the corresponding target of the applet Alternate file.
6. according to the method described in claim 5, it is characterized in that, described according to the target data objects and the template The replaceable information in file generates information matches file corresponding with the template file, comprising:
Establish the canonical fallback relationship between the replaceable information in the target data objects and the template file;
Information matches corresponding with the template file are generated according to the canonical fallback relationship and the target data objects File.
7. according to the method described in claim 6, it is characterized in that, it is described according to the information matches file to described replaceable Information is replaced, and generates the corresponding target alternate file of the applet, comprising:
Obtain the target data objects for including in the information matches file and the canonical fallback relationship;
According to the canonical fallback relationship, the replaceable information in the template file is replaced with into the target data pair As generating the corresponding target alternate file of the applet.
8. method according to any one of claims 1 to 7, which is characterized in that the method also includes:
Obtain the data verification file of the corresponding target alternate file of the applet;
The target alternate file is verified according to the data verification file;
If verifying is correct, applet file is generated according to the corresponding target alternate file of the applet, it will be described Applet file is sent to corresponding audit terminal;The audit terminal is used to carry out phase to the applet file The audit processing answered.
9. according to the method described in claim 8, it is characterized in that, the method also includes:
It is corresponding according to the applet file generated if the audit terminal passes through the applet Note Auditing Applet, the applet is stored according to program identification.
10. according to the method described in claim 9, it is characterized in that, the method also includes:
Receive the inquiry request of requesting terminal;The inquiry request includes program identification;
Applet corresponding with described program mark is obtained from the applet of storage, and the applet is sent out It send to the requesting terminal;The requesting terminal is for showing the corresponding page of the applet.
CN201910456351.6A 2019-05-29 2019-05-29 The generation method of applet file Pending CN110209388A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910456351.6A CN110209388A (en) 2019-05-29 2019-05-29 The generation method of applet file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910456351.6A CN110209388A (en) 2019-05-29 2019-05-29 The generation method of applet file

Publications (1)

Publication Number Publication Date
CN110209388A true CN110209388A (en) 2019-09-06

Family

ID=67789355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910456351.6A Pending CN110209388A (en) 2019-05-29 2019-05-29 The generation method of applet file

Country Status (1)

Country Link
CN (1) CN110209388A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727431A (en) * 2019-09-17 2020-01-24 阿里巴巴集团控股有限公司 Applet generation method and apparatus
CN110807022A (en) * 2019-11-06 2020-02-18 积成电子股份有限公司 Method for realizing sequential control operation order interval copying of intelligent substation monitoring system
CN111381825A (en) * 2020-03-06 2020-07-07 北京五八信息技术有限公司 Method and device for generating small program
CN112506642A (en) * 2019-09-13 2021-03-16 富士通株式会社 Information processing apparatus, recording medium of information processing program, and information processing method
CN113111631A (en) * 2021-04-15 2021-07-13 北京同邦卓益科技有限公司 Data processing method, device, equipment, storage medium and program product

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120137227A1 (en) * 2010-11-30 2012-05-31 International Business Machines Corporation Multi-environment widget assembly, generation, and operation
CN102508669A (en) * 2011-11-14 2012-06-20 浙江鸿程计算机***有限公司 Automatic program code generating method
CN104267967A (en) * 2014-10-15 2015-01-07 北京国双科技有限公司 Method and device for generating program codes of software
CN104331285A (en) * 2014-10-30 2015-02-04 北京思特奇信息技术股份有限公司 Automatic code generation method and system
CN106528165A (en) * 2016-11-11 2017-03-22 深圳中兴网信科技有限公司 Code generation method and code generation system
CN107168702A (en) * 2017-05-10 2017-09-15 苏州奇松软件有限公司 A kind of App, small routine and web interface definition and code generating method
CN108681547A (en) * 2018-03-27 2018-10-19 厦门欣旅通科技有限公司 A kind of web content converting method and device based on small routine
CN109240661A (en) * 2018-08-02 2019-01-18 武汉烽火众智数字技术有限责任公司 A kind of code generating method and device
CN109669736A (en) * 2018-12-18 2019-04-23 北京城市网邻信息技术有限公司 A kind of loading method of small routine, device, terminal device and storage medium
CN109710260A (en) * 2018-11-16 2019-05-03 青岛特锐德电气股份有限公司 It is a kind of based on multi-platform applet code converting system and conversion method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120137227A1 (en) * 2010-11-30 2012-05-31 International Business Machines Corporation Multi-environment widget assembly, generation, and operation
CN102508669A (en) * 2011-11-14 2012-06-20 浙江鸿程计算机***有限公司 Automatic program code generating method
CN104267967A (en) * 2014-10-15 2015-01-07 北京国双科技有限公司 Method and device for generating program codes of software
CN104331285A (en) * 2014-10-30 2015-02-04 北京思特奇信息技术股份有限公司 Automatic code generation method and system
CN106528165A (en) * 2016-11-11 2017-03-22 深圳中兴网信科技有限公司 Code generation method and code generation system
CN107168702A (en) * 2017-05-10 2017-09-15 苏州奇松软件有限公司 A kind of App, small routine and web interface definition and code generating method
CN108681547A (en) * 2018-03-27 2018-10-19 厦门欣旅通科技有限公司 A kind of web content converting method and device based on small routine
CN109240661A (en) * 2018-08-02 2019-01-18 武汉烽火众智数字技术有限责任公司 A kind of code generating method and device
CN109710260A (en) * 2018-11-16 2019-05-03 青岛特锐德电气股份有限公司 It is a kind of based on multi-platform applet code converting system and conversion method
CN109669736A (en) * 2018-12-18 2019-04-23 北京城市网邻信息技术有限公司 A kind of loading method of small routine, device, terminal device and storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506642A (en) * 2019-09-13 2021-03-16 富士通株式会社 Information processing apparatus, recording medium of information processing program, and information processing method
CN110727431A (en) * 2019-09-17 2020-01-24 阿里巴巴集团控股有限公司 Applet generation method and apparatus
WO2021051913A1 (en) * 2019-09-17 2021-03-25 创新先进技术有限公司 Method and device for generating applet
CN110807022A (en) * 2019-11-06 2020-02-18 积成电子股份有限公司 Method for realizing sequential control operation order interval copying of intelligent substation monitoring system
CN110807022B (en) * 2019-11-06 2022-10-14 积成电子股份有限公司 Method for realizing sequential control operation order interval copying of intelligent substation monitoring system
CN111381825A (en) * 2020-03-06 2020-07-07 北京五八信息技术有限公司 Method and device for generating small program
CN113111631A (en) * 2021-04-15 2021-07-13 北京同邦卓益科技有限公司 Data processing method, device, equipment, storage medium and program product

Similar Documents

Publication Publication Date Title
CN110209388A (en) The generation method of applet file
CN109474578B (en) Message checking method, device, computer equipment and storage medium
CN108595597A (en) Data lead-in method, device, computer equipment and storage medium
CN109359939A (en) Business datum method of calibration, device, computer equipment and storage medium
CN109597754B (en) Business process interface testing method and device, computer equipment and storage medium
CN110209652A (en) Tables of data moving method, device, computer equipment and storage medium
CN110399294A (en) Method for generating test case, device, computer equipment and storage medium
CN110008266A (en) Data interchange file analysis method and device
CN109144519A (en) Generation method, device, computer equipment and the storage medium of upgrade package
CN109726134B (en) Interface test method and system
CN111767704B (en) Excel form template generation method and device
CN109361628A (en) Message assemble method, device, computer equipment and storage medium
CN108491367A (en) Method, apparatus, computer equipment and the storage medium that report file generates
CN109766121A (en) Environment profile generation method, device, computer equipment and storage medium
CN109783558A (en) Introduction method, device, computer equipment and the storage medium of Excel data
CN110472219A (en) Electronic document generation method, device, computer equipment and storage medium
CN112988601A (en) Test script development method and device
CN112181854A (en) Method, device, equipment and storage medium for generating flow automation script
CN110297761A (en) Acquisition methods, device, computer equipment and the storage medium of returned data
CN110502362A (en) Error code based on micro services framework defines method, apparatus and computer equipment
CN110334303A (en) Form validation method, device, computer equipment and storage medium
CN113590465B (en) Method for automatically generating mock service based on SDK
CN111984595B (en) File processing method and device and storage medium
CN109429260A (en) A kind of method of calibration and device of northbound data
CN103796193B (en) The PRI parameter automatic configuration methods and system of a kind of cdma mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190906