CN109614097A - Generation method, device and the server of platform code - Google Patents
Generation method, device and the server of platform code Download PDFInfo
- Publication number
- CN109614097A CN109614097A CN201811501713.0A CN201811501713A CN109614097A CN 109614097 A CN109614097 A CN 109614097A CN 201811501713 A CN201811501713 A CN 201811501713A CN 109614097 A CN109614097 A CN 109614097A
- Authority
- CN
- China
- Prior art keywords
- source code
- data object
- component
- interface
- information
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
Abstract
The present invention provides a kind of generation method of platform code, device and servers, this method comprises: obtaining the description components information that user is drawn to each component in interface;Wherein, description components information includes: preset attribute information and at least one source code template corresponding with target platform;Based on user to the hierarchical relationship between the component in the dragging event dynamic generation interface of component;Data object is generated based on hierarchical relationship and preset attribute information;Wherein, data object is for recording the content information that interface includes;The source code at interface is generated based on source code template and data object;Wherein, the source code at the interface of generation can adapt to target platform.The present invention can reduce the process that developer writes platform code, improve the efficiency that platform code generates.
Description
Technical field
The present invention relates to Internet technical fields, more particularly, to a kind of generation method of platform code, device and service
Device.
Background technique
Currently, the webpage and program of each platform are made of corresponding code, the code that different platforms uses
Language is had nothing in common with each other, therefore when constructing the webpage or program of different platform, and developer is needed to write platform according to design original text
Corresponding code, this has certain requirement to developer, and development efficiency is lower.
Summary of the invention
In view of this, the purpose of the present invention is to provide a kind of generation method of platform code, device and server, it can
The process that developer writes platform code is reduced, the efficiency that platform code generates is improved.
In a first aspect, the embodiment of the invention provides a kind of generation method of platform code, this method comprises: obtaining user
It is drawn to the description components information of each component in interface;Wherein, description components information includes: preset attribute information and at least
One source code template corresponding with target platform;Based on user to the component in the dragging event dynamic generation interface of component it
Between hierarchical relationship;Data object is generated based on hierarchical relationship and preset attribute information;Wherein, data object is for recording interface
The content information for including;The source code at interface is generated based on source code template and data object;Wherein, the source generation at the interface of generation
Code can adapt to target platform.
With reference to first aspect, the embodiment of the invention provides the first possible embodiments of first aspect, wherein
It include: raw based on modification of the user to preset attribute information before generating data object based on hierarchical relationship and description components information
At Custom Attributes information;This method further include: generated based on hierarchical relationship, description components information and Custom Attributes information
Data object.
With reference to first aspect, the embodiment of the invention provides second of possible embodiments of first aspect, wherein on
Stating the source code for generating interface based on source code template and data object includes: the platform information for obtaining target platform;It searches every
A component source code template corresponding with platform information;According to the corresponding source code template of each component found and data pair
Source code as generating interface.
The possible embodiment of second with reference to first aspect, the embodiment of the invention provides the third of first aspect
Possible embodiment, wherein the corresponding source code template of each component that above-mentioned basis is found and data object generate boundary
The source code in face, comprising: realize that module carries out source code template based on preset code corresponding with each source code template
Load generates the corresponding source code of each component and realizes;The source code that interface is generated with data object is realized based on source code.
Second aspect, the embodiment of the present invention also provide a kind of generating means of platform code, which includes: acquisition of information
Module, for obtaining the description components information for each component that user is drawn in interface;Wherein, description components information includes:
Preset attribute information and at least one source code template corresponding with target platform;Hierarchical relationship generation module, for based on use
Family is to the hierarchical relationship between the component in the dragging event dynamic generation interface of component;Data object generation module is used for base
Data object is generated in hierarchical relationship and preset attribute information;Wherein, data object is for recording the content information that interface includes;
Source code generation module, for generating the source code at interface based on source code template and data object;Wherein, the interface of generation
Source code can adapt to target platform.
In conjunction with second aspect, the embodiment of the invention provides the first possible embodiments of second aspect, wherein on
It states data object generation module to be also used to: including: base before generating data object based on hierarchical relationship and description components information
Custom Attributes information is generated to the modification of preset attribute information in user;Above-mentioned data object generation module is also used to: being based on
Hierarchical relationship, description components information and Custom Attributes information generate data object.
In conjunction with second aspect, the embodiment of the invention provides second of possible embodiments of second aspect, wherein on
It states source code generation module to be also used to: obtaining the platform information of target platform;Search each component source corresponding with platform information
Code Template;The source code at interface is generated according to the corresponding source code template of each component found and data object.
In conjunction with second of possible embodiment of second aspect, the embodiment of the invention provides the third of second aspect
Possible embodiment, wherein above-mentioned source code generation module is also used to: based on preset corresponding with each source code template
Code realizes that module loads source code template, generates the corresponding source code of each component and realizes;It is realized based on source code
The source code at interface is generated with data object.
The third aspect, the embodiment of the present invention also provide a kind of server, and server includes memory and processor, storage
Device supports processor to execute first aspect to any one of the third possible embodiment of first aspect method for storing
Program, processor are configurable for executing the program stored in memory.
Fourth aspect, the embodiment of the present invention also provide a kind of computer storage medium, for being stored as first aspect to
Computer software instructions used in any one of the third possible embodiment of one side method.
The embodiment of the present invention bring it is following the utility model has the advantages that
Generation method, device and the server of platform code provided in an embodiment of the present invention can obtain user and be drawn to
The description components information of each component in interface, wherein description components information includes preset attribute information and at least one mesh
The corresponding source code template of platform is marked, the hierarchical relationship that dragging event is dynamically generated between the inner assembly of interface is then based on, and
Data object is generated based on hierarchical relationship and above-mentioned preset attribute information, it is finally raw based on above-mentioned source code template and data object
At the source code at interface.The embodiment of the present invention can be pulled based on component interaction and generate data object, and according to template and data
Object generates the source code of target platform, reduces the process that developer writes platform code, improves the effect that platform code generates
Rate.
Other features and advantages of the present invention will illustrate in the following description, also, partly become from specification
It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention are in specification, claims
And specifically noted structure is achieved and obtained in attached drawing.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate
Appended attached drawing, is described in detail below.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art
Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below
Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor
It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow chart of the generation method of platform code provided in an embodiment of the present invention;
Fig. 2 is the flow chart of the generation method of another platform code provided in an embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram at interface provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of the generating means of platform code provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of server provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention
Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than
Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise
Under every other embodiment obtained, shall fall within the protection scope of the present invention.
There is some difference for the code language that different platform uses at present, therefore in different platform edit code, needs
It grasps the code language of the platform and code is write according to design original text, to developer's requirement with higher, be based on this, this hair
Generation method, device and the server for a kind of platform code that bright embodiment provides can pull acquisition group based on component interaction
Part information, and the identifiable source code of target platform is generated according to module information.
For the generation convenient for understanding the present embodiment, first to a kind of platform code disclosed in the embodiment of the present invention
Method describes in detail, and a kind of flow chart of the generation method of platform code shown in Figure 1, this method includes following step
It is rapid:
Step S102 obtains the description components information that user is drawn to each component in interface.
Wherein, description components information includes: preset attribute information and at least one source code mould corresponding with target platform
Plate, for preset attribute information for the every terms of information of component to be described, the every terms of information of component may include the use of component
The function that condition, placement location and component are realized.It should be understood that because the programming language of different platform application not
Together, therefore for different platforms corresponding source code template should be set.
In addition, pulling, effect is mainly related with three events of mouse, these three events include selection component event
Mousedown, moving assembly event mousemove and release component event mouseup.Further, the whole process of dragging
Successively triggering it can pull beginning event dragstart, dragging event drag and pull End Event dragend.Wherein, dragging is opened
Beginning event corresponds to the selection component event of mouse, and dragging event corresponds to the moving assembly event of mouse, and it is corresponding to pull End Event
The release component event of mouse.When choosing dragged component, dragging beginning event can be triggered first by starting mobile mouse, with
After trigger dragging event, dragging End Event can be triggered when mouse stops mobile, no matter the component of mouse drag is to be discharged into
Active position or inoperative position can trigger dragging End Event.Wherein, triggering can be continued in mouse moving process to drag
Event is dragged, while the moving assembly event of mouse also can persistently trigger in mouse moving process.
It can successively be triggered when component is dragged and dropped in interface and pull entry event dragenter, pull suspension event
Dragover, dragging leave event dragleave or pull completion event dragdrop, wherein are dragged and dropped to target in component
When on position, dragging entry event can be triggered first, and then triggering pulls suspension event, and is also putting in dragged component
When being moved in the target zone set, triggering can be continued and pull suspension event.It can trigger and drag when mouse directly removes target position
It drags and leaves event dragleave, pull suspension event and be no longer triggered;It can trigger and drag when component has been released to target position
Drag completion event dragdrop.After triggering pulls completion event, illustrate that component is successfully drawn in interface.
Further, target platform can for Mac platform, windows platform, Linux or Web (World Wide Web,
WWW) platform, there is some difference for the programming language that different platform uses.Specifically, Web platform is most normal in above-mentioned platform
Platform.Mac platform often includes C language, Obiective-C programming, Swift language and UIKit frame with language;
The common language of Windows system includes C Plus Plus, C language and assembler language;The common language of linux system is C language;
Web platform often with programming language include HTML (HyperText Markup Language, HyperText Markup Language) language,
CSS (Cascading Style Sheets, cascading style sheets) language and JS (JavaScript, formula scripting language of literal translating) language
Speech.As can be seen that the programming language that different platform uses differs greatly, therefore should be directed to different platform, it is flat even for difference
Corresponding source code template is respectively set in the programming language that do not have to of platform.
Step S104, based on user to the hierarchical relationship between the component in the dragging event dynamic generation interface of component.
Wherein, relationship of the hierarchical relationship between each component, it is possible to understand that, based on user to the dragging event of component,
At least one component is obtained in interface, when multiple components are drawn to interface, between each component in interface there may be
Certain hierarchical relationship.For example, component A includes component B or component A and component B arranged side by side.
Step S106 generates data object based on hierarchical relationship and preset attribute information.
Wherein, data object is a kind of data structure for recording the content information that interface includes.In the specific implementation,
The content that data object is recorded may include the preset attribute information of hierarchical relationship and each component between each component, to pass through
Data object is recorded for the hierarchical relationship between each component, it is assumed that component A includes component B, then can remember in data object
It carries are as follows: component B is the daughter element of component A;Assuming that component A and component B is coordination, then can be recorded in data object
Are as follows: component A and component B is fraternal element.
Step S108 generates the source code at interface based on source code template and data object.
Because including at least one source code template in preset attribute information, for the source code at the interface of generation
It can adapt to target platform, need first determine before generating the source code at interface based on source code template and data object
Target platform, and then determine source code template corresponding with the target platform, it is then based on the interface recorded in data object
Content information generates the source code of required target platform.
The generation method of platform code provided in an embodiment of the present invention can obtain each group that user is drawn in interface
The description components information of part, wherein description components information includes preset attribute information source corresponding at least one target platform
Code Template, is then based on the hierarchical relationship that dragging event is dynamically generated between the inner assembly of interface, and based on hierarchical relationship and
Above-mentioned preset attribute information generates data object, and the source generation at interface is finally generated based on above-mentioned source code template and data object
Code.The embodiment of the present invention can be pulled based on component interaction and generate data object, and generate target according to template and data object
The source code of platform reduces the process that developer writes platform code, improves the efficiency that platform code generates.
For ease of understanding, the embodiment of the present invention proposes the generation side of another platform code on the basis of the above embodiments
Method, the flow chart of the generation method of another platform code shown in Figure 2, method includes the following steps:
Step S202 obtains the description components information that user is drawn to each component in interface.
After each component is drawn in interface by user, the description components information of each component in interface is obtained.
Step S204, based on user to the hierarchical relationship between the component in the dragging event dynamic generation interface of component.
Step S206 generates data object based on hierarchical relationship and preset attribute information.
Further, before generating data object based on hierarchical relationship and description components information, user couple can be based on
The modification of preset attribute information generates Custom Attributes information.It should be understood that because there are some in preset attribute information
Default parameters, user, which can choose, modifies to these default parameters.In addition, when user wishes to change other attribute informations
When parameter, it can also modify to preset attribute, Custom Attributes needed for obtaining user.For example, user can be to default
Component Name in attribute information is modified.
It, will be based on hierarchical relationship, description components information and customized after user modifies to preset attribute information
Attribute information generates data object.
Step S208 obtains the platform information of target platform.
In view of needing to generate the source code of target platform according to data object, so the platform of target platform is needed to believe
Breath in order to obtain corresponding source code template for platform information, and then generates the source code that can adapt to target platform.It is excellent
Choosing because the programming language that uses of each platform is not only one kind, platform information can also include using programming
Language message.Further, platform information input or select button can be provided a user, for selection by the user required mesh
Mark platform.
For example, user clicks " platform selecting " button, it is flat in user's selection target for target platform needed for user's selection
It after platform, then to user shows " programming language selection " button, selects programming language for user, it is final to obtain target platform information.
Assuming that user wishes the source code for generating the C Plus Plus of windows platform according to data object, user is in click " platform selecting "
After button, multiple platforms such as Mac platform, windows platform, Linux platform and WEB platform, user can be shown to user
After clicking windows platform, the language list that windows platform uses, such as C Plus Plus, C language and the language that collects will be shown
Speech can be obtained the platform information of the C Plus Plus of windows platform after user clicks C Plus Plus.
Step S210 searches each component source code template corresponding with platform information.
For the ease of searching corresponding with platform information source code template, platform information and source code template can be set
Related information, or platform information is associated with preservation into preset table with the corresponding relationship of source code template.In addition, working as interface
When inside there is multiple components, the corresponding source code template of target platform will be searched in the preset attribute information of each component respectively.
Step S212 generates the source generation at interface according to the corresponding source code template of each component found and data object
Code.
Further, the embodiment of the invention also provides according to the corresponding source code template sum number of each component found
The process that the source code at interface is generated according to object, referring specifically to following steps:
(1) realize that module loads source code template based on preset code corresponding with each source code template,
The corresponding source code of each component is generated to realize.Wherein, the generation that source code is realized for realizing source code, code realize template
It is realized for generating corresponding source code.
(2) source code that interface is generated with data object is realized based on source code.
The generation method of platform code provided in an embodiment of the present invention can obtain each group that user is drawn in interface
The description components information of part, wherein description components information includes preset attribute information source corresponding at least one target platform
Code Template, is then based on the hierarchical relationship that dragging event is dynamically generated between the inner assembly of interface, and based on hierarchical relationship and
Above-mentioned preset attribute information generates data object, obtains target platform and with target platform to the source code template of reply, and
Source code is generated according to source code template and data object of the target platform to reply.The embodiment of the present invention can be based on component
Interaction, which pulls, generates data object, and the source code of target platform is generated according to template and data object, reduces developer and compiles
The process of platform code is write, the efficiency that platform code generates is improved.
For ease of understanding, the embodiment of the invention provides the generation methods of another platform code, with one kind shown in Fig. 3
For the structural schematic diagram at interface, which is to pull the log-in interface to be formed based on component, and interface includes " user name ", " close
Code ", " logging in ", user name input frame and Password Input frame, wherein " user name " is based on pulling component A generation, and " password " is based on
Pull component B generation, user name input frame is based on dragging component C generation, Password Input frame is based on dragging component D and generates and " step on
Land " is based on pulling component E generation.
After component A, component B, component C, component D and component E are drawn to interface respectively by user, securing component A, component
B, component C, component D and the corresponding description components information of component E are then based on and generate in interface to the dragging event of each component
Hierarchical relationship between each component, for example, component C is the daughter element of component A, the daughter element that component D is component B, component A, group
Part B and component E is fraternal element, the hierarchical relationship being then based between component A, component B, component C, component D and component E and each
The preset attribute information of component generates data object.After generating corresponding data object, the platform information of target platform is obtained,
Then it is searched respectively in the description components information of component A, component B, component C, component D and component E corresponding with platform information
Source code template, and it is based respectively on the source code of respective source code template and data structure building interface.
The embodiment of the present invention can be pulled based on component interaction and generate data object in summary, and according to template and data
Object generates the source code of target platform, reduces the process that developer writes platform code, improves the effect that platform code generates
Rate.
For ease of understanding, the embodiment of the present invention provides a kind of generation dress of platform code on the basis of the above embodiments
It sets, a kind of structural schematic diagram of platform code generating means shown in Figure 4, the device comprises the following modules:
Data obtaining module 402, for obtaining the description components information for each component that user is drawn in interface;Its
In, description components information includes: preset attribute information and at least one source code template corresponding with target platform.
Hierarchical relationship generation module 404, for based on user to the component in the dragging event dynamic generation interface of component
Between hierarchical relationship.
Data object generation module 406, for generating data object based on hierarchical relationship and preset attribute information;Wherein,
Data object is for recording the content information that interface includes.
Source code generation module 408, for generating the source code at interface based on source code template and data object;Wherein,
The source code at the interface of generation can adapt to target platform.
The generating means of platform code provided in an embodiment of the present invention, data obtaining module can obtain user and be drawn to boundary
The description components information of each component in face, wherein description components information includes preset attribute information and at least one target
The corresponding source code template of platform, then hierarchical relationship generation module is dynamically generated between the inner assembly of interface based on dragging event
Hierarchical relationship, and hierarchical relationship and above-mentioned preset attribute information are based on by data object generation module and generate data object,
Last source code generation module generates the source code at interface based on above-mentioned source code template and data object.Energy of the embodiment of the present invention
It is enough pulled based on component interaction and generates data object, and generate the source code of target platform according to template and data object, reduced
Developer writes the process of platform code, improves the efficiency that platform code generates.
Further, above-mentioned data object generation module is also used to: being generated based on hierarchical relationship and description components information
Before data object, Custom Attributes information is generated to the modification of preset attribute information based on user, be then based on hierarchical relationship,
Description components information and Custom Attributes information generate data object.
Further, above-mentioned source code generation module is also used to: being obtained the platform information of target platform, and is searched each group
Part source code template corresponding with platform information, then according to the corresponding source code template of each component and data pair found
Source code as generating interface.
Further, above-mentioned source code generation module is also used to: being based on preset generation corresponding with each source code template
Code realizes that module loads source code template, generates the corresponding source code of each component and realizes, and is realized based on source code
The source code at interface is generated with data object.
The technical effect of device provided by the present embodiment, realization principle and generation is identical with previous embodiment, for letter
It describes, Installation practice part does not refer to place, can refer to corresponding contents in preceding method embodiment.
The equipment is a kind of server, specifically, the server includes processor and storage device;It is stored on storage device
There is computer program, computer program executes the described in any item of embodiment as described above when being run by the processor
Method.
Fig. 5 is a kind of structural schematic diagram of server provided in an embodiment of the present invention, which includes: processor
50, memory 51, bus 52 and communication interface 53, the processor 50, communication interface 53 and memory 51 are connected by bus 52
It connects;Processor 50 is for executing the executable module stored in memory 51, such as computer program.
Wherein, memory 51 may include high-speed random access memory (RAM, Random Access Memory),
It may further include non-labile memory (non-volatile memory), for example, at least a magnetic disk storage.By extremely
A few communication interface 53 (can be wired or wireless) is realized logical between the system network element and at least one other network element
Letter connection, can be used internet, wide area network, local network, Metropolitan Area Network (MAN) etc..
Bus 52 can be isa bus, pci bus or eisa bus etc..The bus can be divided into address bus, data
Bus, control bus etc..Only to be indicated with a four-headed arrow convenient for indicating, in Fig. 5, it is not intended that an only bus or
A type of bus.
Wherein, memory 51 is for storing program, and the processor 50 executes the journey after receiving and executing instruction
Sequence, method performed by the device that the stream process that aforementioned any embodiment of the embodiment of the present invention discloses defines can be applied to handle
In device 50, or realized by processor 50.
Processor 50 may be a kind of IC chip, the processing capacity with signal.During realization, above-mentioned side
Each step of method can be completed by the integrated logic circuit of the hardware in processor 50 or the instruction of software form.Above-mentioned
Processor 50 can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network
Processor (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal
Processing, abbreviation DSP), specific integrated circuit (Application Specific Integrated Circuit, referred to as
ASIC), ready-made programmable gate array (Field-Programmable Gate Array, abbreviation FPGA) or other are programmable
Logical device, discrete gate or transistor logic, discrete hardware components.
Processor 50 may be implemented or execute disclosed each method, step and logic diagram in the embodiment of the present invention.
General processor can be microprocessor or the processor is also possible to any conventional processor etc..Implement in conjunction with the present invention
The step of method disclosed in example, can be embodied directly in hardware decoding processor and execute completion, or in decoding processor
Hardware and software module combination execute completion.Software module can be located at random access memory, and flash memory, read-only memory may be programmed
In the storage medium of this fields such as read-only memory or electrically erasable programmable memory, register maturation.The storage medium
Positioned at memory 51, processor 50 reads the information in memory 51, in conjunction with the step of its hardware completion above method.
The computer program product of the generation method of platform code provided by the embodiment of the present invention, device and server,
Computer readable storage medium including storing the executable non-volatile program code of processor, computer-readable storage medium
It is stored with computer program in matter, previous methods side as described in the examples is executed when which is run by processor
Method, specific implementation can be found in embodiment of the method, and details are not described herein.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description
Specific work process, can be with reference to the corresponding process in previous embodiment, and details are not described herein.
The computer program product of readable storage medium storing program for executing provided by the embodiment of the present invention, including storing program code
Computer readable storage medium, the instruction that said program code includes can be used for executing previous methods side as described in the examples
Method, specific implementation can be found in embodiment of the method, and details are not described herein.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product
It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words
The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a
People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
Finally, it should be noted that embodiment described above, only a specific embodiment of the invention, to illustrate the present invention
Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair
It is bright to be described in detail, those skilled in the art should understand that: anyone skilled in the art
In the technical scope disclosed by the present invention, it can still modify to technical solution documented by previous embodiment or can be light
It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make
The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection of the invention
Within the scope of.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. a kind of generation method of platform code, which is characterized in that the described method includes:
Obtain the description components information that user is drawn to each component in interface;Wherein, the description components information includes: pre-
If attribute information and at least one source code template corresponding with target platform;
The hierarchical relationship between component in interface described in dragging event dynamic generation based on user to the component;
Data object is generated based on described hierarchical relationship and the preset attribute information;Wherein, the data object is for recording
The content information that the interface includes;
The source code at the interface is generated based on the source code template and the data object;Wherein, the interface of generation
Source code can adapt to the target platform.
2. the method according to claim 1, wherein being based on described hierarchical relationship and the description components described
Information generates data object
Custom Attributes information is generated to the modification of the preset attribute information based on user;
The method also includes:
Data object is generated based on described hierarchical relationship, the description components information and the Custom Attributes information.
3. the method according to claim 1, wherein described be based on the source code template and the data object
The source code for generating the interface includes:
Obtain the platform information of the target platform;
Search each component source code template corresponding with the platform information;
According to each of finding the corresponding source code template of the component and data object generates the source generation at the interface
Code.
4. according to the method described in claim 3, it is characterized in that, the basis each of finds the corresponding institute of the component
It states source code template and data object generates the source code at the interface, comprising:
Realize that module loads the source code template based on preset code corresponding with each source code template,
The corresponding source code of each component is generated to realize;
The source code that the interface is generated with the data object is realized based on the source code.
5. a kind of generating means of platform code, which is characterized in that described device includes:
Data obtaining module, for obtaining the description components information for each component that user is drawn in interface;Wherein, described pre-
If module information includes: preset attribute information and at least one source code template corresponding with target platform;
Hierarchical relationship generation module, for based on the component in interface described in dragging event dynamic generation of the user to the component
Between hierarchical relationship;
Data object generation module, for generating data object based on described hierarchical relationship and the preset attribute information;Wherein,
The data object is for recording the content information that the interface includes;
Source code generation module, for generating the source code at the interface based on the source code template and the data object;
Wherein, the source code at the interface of generation can adapt to the target platform.
6. device according to claim 5, which is characterized in that the data object generation module is also used to: in the base
Include: before described hierarchical relationship and the description components information generate data object
Custom Attributes information is generated to the modification of the preset attribute information based on user;
The data object generation module is also used to:
Data object is generated based on described hierarchical relationship, the description components information and the Custom Attributes information.
7. device according to claim 5, which is characterized in that the source code generation module is also used to:
Obtain the platform information of the target platform;
Search each component source code template corresponding with the platform information;
According to each of finding the corresponding source code template of the component and data object generates the source generation at the interface
Code.
8. device according to claim 7, which is characterized in that the source code generation module is also used to:
Realize that module loads the source code template based on preset code corresponding with each source code template,
The corresponding source code of each component is generated to realize;
The source code that the interface is generated with the data object is realized based on the source code.
9. a kind of server, which is characterized in that the server includes memory and processor, and the memory is for storing
Processor perform claim is supported to require the program of any one of 1 to 4 the method, the processor is configured to described for executing
The program stored in memory.
10. a kind of computer storage medium, which is characterized in that for being stored as used in any one of Claims 1-4 the method
Computer software instructions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811501713.0A CN109614097A (en) | 2018-12-07 | 2018-12-07 | Generation method, device and the server of platform code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811501713.0A CN109614097A (en) | 2018-12-07 | 2018-12-07 | Generation method, device and the server of platform code |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109614097A true CN109614097A (en) | 2019-04-12 |
Family
ID=66008770
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811501713.0A Pending CN109614097A (en) | 2018-12-07 | 2018-12-07 | Generation method, device and the server of platform code |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109614097A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111221525A (en) * | 2020-01-09 | 2020-06-02 | 北京金山安全软件有限公司 | Script code generation method and device, electronic equipment and storage medium |
CN111273900A (en) * | 2020-01-14 | 2020-06-12 | 浙江华云信息科技有限公司 | On-line drag code generation method based on gitlab real-time code sharing |
CN111694618A (en) * | 2020-06-04 | 2020-09-22 | 北京字节跳动网络技术有限公司 | Object processing method, device, equipment and storage medium |
CN111767026A (en) * | 2020-06-22 | 2020-10-13 | 北京百度网讯科技有限公司 | Method, device, equipment and medium for generating business object template |
CN112860248A (en) * | 2019-11-27 | 2021-05-28 | 中盈优创资讯科技有限公司 | Source code generation method and device |
CN113448552A (en) * | 2020-03-27 | 2021-09-28 | 北京沃东天骏信息技术有限公司 | Code generation method and device |
CN113590103A (en) * | 2020-04-30 | 2021-11-02 | 深圳中砼物联网科技有限公司 | Method, computer device and storage medium for realizing graphical code-free development user interface |
CN114185531A (en) * | 2021-12-17 | 2022-03-15 | 北京字节跳动网络技术有限公司 | Interface code generation method and device, computer equipment and storage medium |
CN114564176A (en) * | 2022-01-27 | 2022-05-31 | 阿里云计算有限公司 | Code development method, server and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101114226A (en) * | 2007-08-28 | 2008-01-30 | 北京中企开源信息技术有限公司 | Code automatically generating device based on model component, system and method |
CN102681841A (en) * | 2012-02-01 | 2012-09-19 | 中兴通讯(香港)有限公司 | Method and system for developing mobile phone application |
US20160041815A1 (en) * | 2014-08-11 | 2016-02-11 | Chirag P. Bhagat | Computer Source Code Generator for Building Software Applications |
US20160357526A1 (en) * | 2015-06-02 | 2016-12-08 | Sap Portals Israel Ltd | Declarative design-time experience platform for code generation |
CN106648690A (en) * | 2016-12-29 | 2017-05-10 | 北京恒华伟业科技股份有限公司 | Code automatic generation method and apparatus |
CN108304183A (en) * | 2018-02-26 | 2018-07-20 | 北京车和家信息技术有限公司 | A kind of user interface creating method, device and electronic equipment |
CN108345456A (en) * | 2018-03-07 | 2018-07-31 | 平安普惠企业管理有限公司 | Page code generation method, device, computer equipment and storage medium |
-
2018
- 2018-12-07 CN CN201811501713.0A patent/CN109614097A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101114226A (en) * | 2007-08-28 | 2008-01-30 | 北京中企开源信息技术有限公司 | Code automatically generating device based on model component, system and method |
CN102681841A (en) * | 2012-02-01 | 2012-09-19 | 中兴通讯(香港)有限公司 | Method and system for developing mobile phone application |
US20160041815A1 (en) * | 2014-08-11 | 2016-02-11 | Chirag P. Bhagat | Computer Source Code Generator for Building Software Applications |
US20160357526A1 (en) * | 2015-06-02 | 2016-12-08 | Sap Portals Israel Ltd | Declarative design-time experience platform for code generation |
CN106648690A (en) * | 2016-12-29 | 2017-05-10 | 北京恒华伟业科技股份有限公司 | Code automatic generation method and apparatus |
CN108304183A (en) * | 2018-02-26 | 2018-07-20 | 北京车和家信息技术有限公司 | A kind of user interface creating method, device and electronic equipment |
CN108345456A (en) * | 2018-03-07 | 2018-07-31 | 平安普惠企业管理有限公司 | Page code generation method, device, computer equipment and storage medium |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112860248B (en) * | 2019-11-27 | 2023-12-05 | 中盈优创资讯科技有限公司 | Source code generation method and device |
CN112860248A (en) * | 2019-11-27 | 2021-05-28 | 中盈优创资讯科技有限公司 | Source code generation method and device |
CN111221525A (en) * | 2020-01-09 | 2020-06-02 | 北京金山安全软件有限公司 | Script code generation method and device, electronic equipment and storage medium |
CN111273900A (en) * | 2020-01-14 | 2020-06-12 | 浙江华云信息科技有限公司 | On-line drag code generation method based on gitlab real-time code sharing |
CN113448552A (en) * | 2020-03-27 | 2021-09-28 | 北京沃东天骏信息技术有限公司 | Code generation method and device |
CN113590103A (en) * | 2020-04-30 | 2021-11-02 | 深圳中砼物联网科技有限公司 | Method, computer device and storage medium for realizing graphical code-free development user interface |
CN113590103B (en) * | 2020-04-30 | 2024-02-02 | 广东中砼物联网科技有限公司 | Method, computer device and storage medium for realizing graphical code-free development user interface |
CN111694618A (en) * | 2020-06-04 | 2020-09-22 | 北京字节跳动网络技术有限公司 | Object processing method, device, equipment and storage medium |
CN111767026A (en) * | 2020-06-22 | 2020-10-13 | 北京百度网讯科技有限公司 | Method, device, equipment and medium for generating business object template |
CN111767026B (en) * | 2020-06-22 | 2023-11-03 | 北京百度网讯科技有限公司 | Method, device, equipment and medium for generating business object template |
CN114185531A (en) * | 2021-12-17 | 2022-03-15 | 北京字节跳动网络技术有限公司 | Interface code generation method and device, computer equipment and storage medium |
CN114185531B (en) * | 2021-12-17 | 2024-03-29 | 抖音视界有限公司 | Interface code generation method, device, computer equipment and storage medium |
CN114564176B (en) * | 2022-01-27 | 2023-08-22 | 阿里云计算有限公司 | Code development method, server and storage medium |
CN114564176A (en) * | 2022-01-27 | 2022-05-31 | 阿里云计算有限公司 | Code development method, server and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109614097A (en) | Generation method, device and the server of platform code | |
US7801891B2 (en) | System and method for collecting user interest data | |
US11093242B2 (en) | Automatically mapping data while designing process flows | |
CN110083790A (en) | Page editing method, page output method, device, computer equipment and medium | |
CN109614095A (en) | The method of user's Custom component, the generation method of platform code and device | |
CN106354483B (en) | Data processing method and device and electronic equipment | |
CN103389895A (en) | Method and system for generating front end page | |
CN112711418B (en) | Front-end interface layout method and device for multiple components, electronic equipment and storage medium | |
US20120102390A1 (en) | Method and apparatus for generating widget | |
CN108351768A (en) | The method for writing document with markup language | |
EP3667493B1 (en) | A method for a software development system | |
CN109284152A (en) | A kind of menu visual configuration method, equipment and computer readable storage medium | |
CN106874247A (en) | A kind of report form generation method and device | |
CN109657220A (en) | The online editing method, apparatus and electronic equipment of PDF document | |
CN103354990A (en) | System and method for processing virtual machine in cloud platform | |
CN111124382A (en) | Attribute assignment method and device in Java and server | |
CN112527288B (en) | Visual system prototype design method, system and storage medium capable of generating codes | |
EP2850542A1 (en) | Pattern mining based on occupancy | |
CN107742239A (en) | The collocation method and device of a kind of conditional expression | |
CN110135797A (en) | Product design Template Manager method, the network terminal and the device with store function | |
CN109558403A (en) | Data aggregation method and device, computer installation and computer readable storage medium | |
CN106528730B (en) | Method and device for designing components in webpage | |
CN106610833A (en) | Method and device for triggering overlapped HTML (Hypertext Markup Language) element mouse events | |
CN107545062A (en) | Entrance recalls method, apparatus, storage medium and electronic equipment | |
CN113656533A (en) | Tree control processing method and device and electronic equipment |
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 |
Application publication date: 20190412 |
|
RJ01 | Rejection of invention patent application after publication |