CN114398032A - Program writing method, apparatus and medium - Google Patents

Program writing method, apparatus and medium Download PDF

Info

Publication number
CN114398032A
CN114398032A CN202111562330.6A CN202111562330A CN114398032A CN 114398032 A CN114398032 A CN 114398032A CN 202111562330 A CN202111562330 A CN 202111562330A CN 114398032 A CN114398032 A CN 114398032A
Authority
CN
China
Prior art keywords
code
prototype
information
target
window
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.)
Granted
Application number
CN202111562330.6A
Other languages
Chinese (zh)
Other versions
CN114398032B (en
Inventor
周翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Spacetime Ink Technology Co ltd
Original Assignee
Beijing Spacetime Ink 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 Beijing Spacetime Ink Technology Co ltd filed Critical Beijing Spacetime Ink Technology Co ltd
Priority to CN202111562330.6A priority Critical patent/CN114398032B/en
Publication of CN114398032A publication Critical patent/CN114398032A/en
Application granted granted Critical
Publication of CN114398032B publication Critical patent/CN114398032B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

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

Abstract

The invention discloses a program compiling method, which comprises the following steps: acquiring a prototype file corresponding to a target program; the prototype file is a character string for describing program function requirements, the character string comprises prototype information with different dimensions, and the prototype information with different dimensions comprises operation environment information, component information, front-end logic information, cloud logic information and parameter information. Then, acquiring an original code specification and an original conversion rule, and screening the original code specification according to the original file to obtain a target code specification and a target conversion rule; wherein the target code specification and the target transformation rules are adapted to the prototype file. Finally, converting the prototype file into a complete code according to the target code specification and the target conversion rule; and packaging the complete code to obtain an executable engineering file corresponding to the target program.

Description

Program writing method, apparatus and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a medium for programming.
Background
The cost of manually writing codes is high, logic bugs are many, and the period is long. When writing the judgment loop logic in the code text, professional code logic such as if else, do while, switch, etc. is needed, and although this is simple for the programmer, it is also cost-requiring to learn.
If the saas product is used to write the program, the function can only be selected in the planned or previously restricted rules, which cannot meet the variable requirements. Secondly, such products are generally based on a certain industry, a certain service and poor service coupling.
If a non-code and low-code product is used for writing a program, a certain code base and code thinking are still required for a user, the requirement on the user is high, and the processing speed and the processing efficiency of the product are poor.
For a product without code, although the program function can be realized by dragging, the bottom logic of the program function is packaged in advance, in other words, the user can only rotate in the designed function and cannot realize the function beyond the range, and the innovation of the user is also greatly limited.
Disclosure of Invention
In view of the above, there is a need to provide a program writing method, apparatus and medium for addressing the above problems.
A method of programming, the method comprising:
acquiring a prototype file corresponding to a target program; the prototype file is a character string for describing program function requirements, the character string comprises prototype information with different dimensions, and the prototype information with different dimensions comprises operation environment information, component information, front-end logic information, cloud logic information and parameter information;
acquiring an original code specification and an original conversion rule, and screening the original code specification according to the original file to obtain a target code specification and a target conversion rule; wherein the target code specification and the target transformation rules are adapted to the prototype file;
converting the prototype file into complete code according to the target code specification and the target conversion rule; and packaging the complete code to obtain an executable engineering file corresponding to the target program.
A computer-readable storage medium, in which a computer program is stored which, when executed by a processor, causes the processor to carry out the steps of the above-mentioned programming method.
A terminal device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to carry out the steps of the above-mentioned programming method.
The program writing method, the device and the medium design the prototype file containing the program function from the design level and then cooperate with the conversion algorithm of the prototype file, thereby realizing the rapid writing of the program. So that the user does not need to memorize the format of the code, the specific meaning and usage of the code word, etc. In addition, multi-platform adaptation can be realized, in other words, ecological barriers between different program systems can be broken, and one-time design can be adapted to all platforms.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
FIG. 1 is a schematic flow chart illustrating the process of obtaining a prototype document according to one embodiment;
FIG. 2 is a diagram of a prototype file editing interface, in accordance with one embodiment;
FIG. 3 is a diagram illustrating a display window, a property setting window, and a style control window, in one embodiment;
FIG. 4 is a diagram that illustrates associating components within a style control window, under an embodiment;
FIG. 5 is a diagram of an event window in one embodiment;
FIG. 6 is a diagram illustrating the association of logical elements of logical components within an event window with control variables within a style control window, in one embodiment;
FIG. 7 is a schematic diagram of creating cloud logic within a server window in one embodiment;
FIG. 8 is a schematic diagram that illustrates associating cloud logic with a functional event of a user in one embodiment;
FIG. 9 is a flowchart illustrating a method of programming in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the embodiment, the program function requirement of the user is realized by creating a prototype file, and the simple dragging action is only executed without manually writing the code in the process. And the bottom layer logic and data corresponding to each functional requirement can be flexibly adjusted without any limitation. As shown in fig. 1, fig. 1 is a schematic flowchart of acquiring a prototype file in an embodiment, and the steps include:
and 102, displaying an original file editing interface.
As shown in fig. 2, the display prototype file editing interface includes a display window, a property setting window, a style control window, an event window, and a server window. The display window, the attribute setting window and the style control window form a front-end display interface of the user terminal, and display contents of a plurality of pages can be edited. A plurality of functional events (e.g., an event for storing a file, an event for modifying a file format) may be edited within an event window, and a plurality of cloud logics may be edited within a server window. In the embodiment, the front-end display interface and the logic are designed separately, so that the design independence of the service logic and the display interface can be realized.
Within the display window, at least one component may be added. The types of the components comprise logic components and data components, and in addition, the components comprise text components, picture components and the like. Each component is composed of elements, and the elements comprise pictures, texts, videos, shapes (such as rectangles), input boxes and other different forms.
As shown in FIG. 3, within the display window, various relationships between components, elements and between components and elements are managed and exposed by the component element manager. When editing the page, the components can be added from the component element manager by dragging and pulling operation, or by copying and pasting the components which are designed before.
Step 104: when the instruction added by the component is not received, the instruction of selecting the component is not received, and the instruction of selecting the element is not received, setting the display window style of the display window in the attribute setting window; and when an instruction of selecting the component is received or an instruction of selecting the element is received, setting the component style of the selected component or the component corresponding to the selected element in the attribute setting window.
As shown in fig. 3, the component style and the window display style include different angles such as a state, a brief introduction, a color, a position, a special style and a content. Specifically, the states include normal state, click time, move-in, and the like; the brief introduction comprises name, belongings, remarks and the like; colors include background colors, font colors, and the like; the position includes a position relation, a relation specific value and the like; special patterns include round corners, stroking, and the like; the content includes picture sources, display text, and the like.
When one of the components is selected, the component style can be set; when a component is not created and any one component or element is not selected, the display window style may be set at this time.
Step 106: and in the style control window, when a style control instruction is received, adding a data module, and associating a plurality of components through a connecting line in response to the style control instruction.
Wherein the associated components uniformly modify component styles based on the data modules.
As shown in fig. 4, a data module may be added in the style control window, and then several components may be associated by a wire, for example, the backgrounds of all the components are connected to the same data module, so that the uniform modification and editing of the backgrounds of all the components can be realized based on the data module.
The parameter information given in the data module comprises data introduction, data initial value and data range. Specifically, the data introduction includes details of different types of data such as text data, objects, arrays and the like. And secondly, the data initial information is an initial setting value of the data. And thirdly, the data range is the range of the data which can be taken. This allows for controlled variation of data, particularly in the course of data processing and data operations, based on the extent of data, to detect logic holes in the logic portion.
Step 108: in the event window, when an event creating instruction is received, a plurality of blank events are created in response to the event creating instruction, a plurality of added logic components are sequentially connected in each blank event, and parameter information is given to the plurality of added data components, so that a plurality of function events containing user function logic are obtained.
The user function logic is logic executed by the user terminal, is used for realizing program function requirements of target users, such as modifying document content, changing document color and the like, and can directly control the change of the front-end display interface. The parameter information assigned within the event window also includes data presentation, initial values of data, and data ranges.
In this step, a plurality of blank events may be created. As shown in fig. 5, in one of the blank events, various logic components are allowed to be added from the floating window by dragging and pulling, and then the logic elements are connected by arrows to form a flow chart, so that the basic functional logic can be obtained. Of course, the functional logic may also be expressed in a fishbone map, a tree map or other forms, and is not limited in detail herein. Furthermore, various data components are added from the floating window in a dragging and pulling mode, and parameter information is given to each data component, namely, a data introduction, a data initial value and a data range are given. And finally, performing association binding on data to be filled in the logic assembly and the data assembly in the whole framework through a connecting line and dragging mode, and obtaining the functional event of the complete user functional logic.
Therefore, in the embodiment, the logic of the program is expressed by using a flow chart and other modes, so that the judgment cycle logic can be visually displayed, and the logic materialization is realized. And because the program is edited in the form of components and modules, the code writing format and the completeness of the code writing are not noticed in real time like the code. And the variables, the logics, the components and the like are independent and complete and are finally stored in a character string form, the program function is not influenced by the upper and lower code environments when being written, in addition, the function migration is very convenient, and the configuration environment is not needed for any individual local migration. The content after the migration is used as an initial state, and the content after the user modification is used as a second state, and meanwhile, the user can manually add a plurality of states for use under different conditions.
Step 110: when an event correlation instruction is received, an event module is added or a plurality of event windows are connected in response to the event correlation instruction so as to correlate a plurality of functional events, and logic components and data components in the event windows are correlated with data modules in the style control windows through connection.
The event module comprises associated event information of the associated functional event, and carries data information and return data information.
Specifically, for the plurality of function events created in step 108, there may be a relationship between each two of the trigger events and the response events, so as to form a specific complex function. In this embodiment, the association of the functional events can be completed by connecting the components of the two functional events.
Further, as shown in fig. 6, by connecting the logic elements of the logic components in the event window with the control variables in the style control window, the logical association of the components at the front end and the logic at the back can also be realized. For example, after the data is processed by the logic based on the functional event and the data result is obtained, the obtained data result needs to be displayed at the front end. The change and control of the front-end content can be realized through the association of the logic elements of the logic components and the control variables in the style control window.
The existing low-code has no code, and also has text code, so that the program function can not be edited while the local function is demonstrated. In the embodiment, any small-range demonstration adjustment can be realized by associating the logic component and the data component in the event window with the data module in the style control window.
Step 112: in the server window, when a cloud logic creating instruction is received, responding to the cloud logic creating instruction, sequentially connecting a plurality of added logic components based on program function requirements of a user, endowing parameter information for the plurality of added data components to obtain cloud logic, storing the data information of the cloud logic into a corresponding database according to a preset storage rule, and associating the cloud logic with function events of the user.
The cloud logic is logic placed in the server and includes logic executed by the user terminal. The cloud logic cannot be directly associated with the front-end display interface, but can be associated with a functional event of the user.
In this embodiment, referring to fig. 7, based on the program function requirement of the user, the content similar to step 108 is repeatedly executed to obtain the cloud logic. Meanwhile, the cloud logic has one more data storage content than the fifth step, which means that the data stores the cloud logic into a database according to a preset storage rule, not only in a data cache, but also in the existing database position by default.
Referring to fig. 8, after the cloud logic is associated with the functional event of the user, data transmission and feedback between the functional event and the cloud logic may be performed. Specifically, there is a type of access component in the functional event, which can be directly connected to the cloud logic to implement data transmission, the cloud logic is implemented by a feedback component, and the cloud end generates an access result to the front end; the access component of the front-end event comprises a data acquisition component (acquiring pseudo data) and is the result of data transfer. For example, a function of recharging members is implemented based on the function event, and the cloud logic feeds back the result of success or failure of recharging and the member function of response.
Further, in this embodiment, a plurality of components of each window in the prototype file editing interface may be associated through an Identity Document (ID). Wherein the components associated by the identity allow for uniform modification of component styles. Therefore, any design can be synchronized, and manual multiple point addition and adjustment are not needed. For example, only one variable name needs to be modified, and the contents in other places are synchronously adjusted, so that the problem that a person cannot easily modify the contents in the written code is solved. Also for example, it is troublesome to adjust the attribution in the code. But with the unique id as a guide, the affiliation can be modified as desired. And a plurality of states (multi-state) of the same component can be recorded through the id, so that a component style compiled in history can be checked, and the component style can be used as different versions without services and can be replaced and adjusted at any time.
Step 114: and outputting prototype information formed by the prototype file editing interface in the editing process of the display window, the attribute setting window, the style control window, the event window and the server window to obtain a prototype file.
The prototype information includes information such as operating environment information, component information, front-end logic information, cloud logic information, and parameter information. The component information in the prototype information comprises information formed in a display window, a property setting window and a style control window, the front-end logic information in the prototype information comprises information formed in an event window, and the cloud logic information in the prototype information comprises information formed in a server window.
In addition, the parameter information in the prototype information includes data created within the style control window, referred to as controller data; also included are data created within the event window, referred to as event data; and also data created within the server window, referred to as cloud data. The controller data effectively corresponds to a control switch. The event data is essentially ordinary data, is generally stored in a cache form, and is transmitted and recorded through corresponding environments. The event data generally contains controller data, so that users generally need to create data in the content and then multiplex the data into a controller column, and thus a good correlation effect is formed. Cloud data is similar to event data, but also includes data storage information (i.e., information related to storing cloud logic). In this embodiment, the controller data, the event data, and the cloud data are allowed to be transferred and replaced with each other.
And outputting prototype information formed by the prototype file editing interface in the editing process of each window to obtain a prototype file. The data structure of the prototype file is a string of characters.
In the process of acquiring the prototype file, the operation is performed only in intuitive forms such as dragging, connecting lines and arrows, so that the missing of contents and the errors of information editing cannot occur. Meanwhile, the logic of the program is expressed by means of flow charts and the like, the judgment circulating logic is visually displayed, and the logic materialization is realized. And because the program is edited in the form of components and modules, the integrity of the code writing format and the code writing is not noticed in real time as if the code were not. And the variables, the logics, the components and the like are independent and complete and are finally stored in a character string form, the program function is not influenced by the upper and lower code environments when being written, in addition, the function migration is very convenient, and the configuration environment is not needed for any individual local migration. The content after the migration is used as an initial state, and the content after the user modification is used as a second state, and meanwhile, the user can manually add a plurality of states for use under different conditions. The present embodiment may implement any small range of presentation adjustments by associating the logic and data components within the event window with the data modules within the style control window.
As shown in fig. 9, fig. 9 is a flowchart illustrating a program writing method in an embodiment, where the program writing method in this embodiment provides steps including:
and step 902, acquiring a prototype file corresponding to the target program.
Based on the above steps 102 and 104, the prototype file corresponding to the target program can be obtained, which is not described herein again. The prototype file comprises prototype information with different dimensions, such as operation environment information, component information, front-end logic information, cloud logic information, parameter information and the like.
Further, the prototype file is preliminarily analyzed, and the compiling and running environment of the prototype file is initialized according to the obtained analysis result, so that the preparation work of the subsequent conversion code is completed.
And 904, acquiring the original code specification and the original conversion rule, and screening the original code specification according to the prototype file to obtain a target code specification and a target conversion rule.
Specifically, the code specification is used for converting the component information, the front-end logic information and the cloud logic information, and includes: specification introduction, operating environment specification, corresponding code specification of prototype function, code format specification of prototype function and placement position specification of function code.
A. The specification introduction, including the introduction (names) and detailed introduction of various specifications, is used to record the details and cautions of different code specifications. Specification introduction during the compilation process of program codes, various code specifications are mainly introduced so as to facilitate the next query and modification. If the running platform or system of the program is changed, the specific code specification can be modified reasonably according to the content in the specification introduction, and the modified code specification is ensured not to have errors later.
B. The operating environment specification, including the effective operating environment of different code specifications, is also a prerequisite for the use of the code specification. For example, converted code based on a particular code specification is allowed to run normally under js files, but is not allowed to be used under json files. It will be appreciated that the code is only capable of implementing the unexpected functional design, controlled implementation of the functionality described in the prototype, in the appropriate circumstances.
C. And the corresponding code specification of the prototype function comprises filling contents corresponding to different prototype functions. The prototype function is one of the functions which can be realized by the prototype file; and the filler content is a pre-created code framework whose realizable functions match the prototype functions.
D. And the code format specification of the prototype function comprises a parameter format specification in the filling type content. The specification here determines the format of the code content that is ultimately derived. In general, some contents in the filling contents need to be replaced by corresponding parameters, for example, the judgment conditions in the if judgment statement need to be adjusted correspondingly according to actual requirements, so that the personalized requirements of the user and some unexpected creatives and innovations can be met.
E. And the placement position specification of the function codes comprises target placement positions of different segment codes. The C, D converted codes may have many sections, and each section of codes needs to be placed in a corresponding position in a different file and adapted accordingly, so that the codes can be triggered and run normally and effectively. The target placement position is expressed in two ways: one is an absolute placement position, which is represented by taking the starting position of the program as a starting point until the code describes the corresponding positional relationship of the positions. This is the absolute placement position used when modifying global configuration information and also when executing a logic that requires the addition of a global variable. The other is relative placement position, which is embodied by taking the current processing code position as a starting point and then reaching the corresponding position relation of the code description position. This relative placement is used when modifying the page configuration information of the code currently being translated, and also when executing certain logic that requires the addition of a page variable.
And the conversion rule is used for converting the parameter information of the prototype file and comprises the following steps: parameter introduction, actual meaning corresponding to the parameter and parameter content.
A. Parameter descriptions, including profiles (names) and detailed descriptions of different types of parameters, are used to record details and notes of different parameters. The same functions as those described in the specification will not be described again.
B. The actual meanings corresponding to the parameters comprise the code meanings corresponding to different parameters in the prototype file. Such as parameter 10 in the prototype file, corresponds to a "large" meaning in one of the platforms and a "bold font" meaning in the other platform.
C. Parameter content, including actual conversion results of different parameters. Is the result content returned when a certain practical meaning corresponding to the parameter is satisfied. Therefore, the actual meaning corresponding to the parameter can be understood as the conversion judgment condition of the parameter so as to determine the type of the code parameter into which the parameter in the prototype file is converted; and "parameter content" is the result of the transformation of the parameter.
In summary, the code specification can be understood as an architecture, and the transformation rules are bricks that are filled. The prototype file can be transformed based on the contents of the two parts.
In this embodiment, an original code and an original transformation rule are first obtained. However, the original code and the original transformation rule are a common content, and many of the contents are invalid in the transformation process, so that further screening needs to be performed based on the prototype file to obtain the adapted target code specification and the target transformation rule.
In one embodiment, three screens are required. And during the first screening, screening the original code specification and the original conversion rule according to the operating environment information and the operating environment specification to obtain a first code specification and a first conversion rule which accord with the operating environment information. The original code specification consists of a plurality of code specifications with parent-child relationship and parallel relationship, and the original conversion rule consists of a plurality of conversion rules with parent-child relationship and parallel relationship. And in the second screening, screening the first code specification and the first conversion rule according to the prototype function to obtain a second code specification and a second conversion rule which can realize the prototype function. And in the third screening, screening the second code specification and the second conversion rule according to the filling content, the parameters in the prototype file and the parameter related items in the conversion rule to obtain a target code specification and a target conversion rule which can be converted.
Step 906, converting the prototype file into a complete code according to the target code specification and the target conversion rule; and packaging the complete code to obtain an executable engineering file corresponding to the target program.
Specifically, first, according to prototype information of a prototype file, C in target code specifications, a code specification corresponding to a prototype function, D and a code format specification of the prototype function, filling type contents and parameter formats of different prototype functions are matched;
and converting the parameters in the prototype information into a plurality of corresponding code parameters according to the actual meanings corresponding to the parameters and the B in the target conversion rule so as to fill the parameters into the filling type content. And combining a plurality of filling contents filled with the code parameters according to the target code specification to obtain a plurality of segment codes. Specifically, the plurality of segment codes comprise a main segment code and a plurality of auxiliary segment codes, wherein the main segment code determines the main segment code position based on the code specification of the parent level in the target code specification. The auxiliary segment code determines a target placement location based on the placement location specification of the function code, E, in the target code specification, and the target placement location is within the main segment code location.
And finally, selecting one of the prototype information which meets the conditions and has a parallel relation in the target code specification for execution, or selecting one of the prototype information which meets the conditions and has a parallel relation in the target conversion rule for execution, so as to place different auxiliary fragment codes in the main body fragment according to the target placement position, thereby obtaining the complete code.
Further, the complete code is encapsulated according to the structure of the prototype file to be converted into an executable engineering file capable of realizing the functions described in the prototype file. And simultaneously, the obtained executable engineering file can be released to a specified operation platform according to the requirements of the operation platform, so that the target program described by the prototype file on the specified operation platform is obtained.
The program writing method designs the prototype file containing the program function from the design level and then is matched with the conversion algorithm of the prototype file, so that the quick writing of the program can be realized. So that the user does not need to memorize the format of the code, the specific meaning and usage of the code word, etc. In addition, multi-platform adaptation can be realized, in other words, ecological barriers between different program systems can be broken, and one-time design can be adapted to all platforms.
A program writing device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer program: acquiring a prototype file corresponding to a target program; the prototype file is a character string for describing program function requirements, the character string comprises prototype information with different dimensions, and the prototype information with different dimensions comprises operation environment information, component information, front-end logic information, cloud logic information and parameter information; acquiring an original code specification and an original conversion rule, and screening the original code specification according to an original file to obtain a target code specification and a target conversion rule; wherein the target code specification and the target transformation rule are adapted to the prototype file; converting the prototype file into a complete code according to the target code specification and the target conversion rule; and packaging the complete code to obtain an executable engineering file corresponding to the target program.
A computer-readable storage medium storing a computer program which, when executed by a processor, performs the steps of: acquiring a prototype file corresponding to a target program; the prototype file is a character string for describing program function requirements, the character string comprises prototype information with different dimensions, and the prototype information with different dimensions comprises operation environment information, component information, front-end logic information, cloud logic information and parameter information; acquiring an original code specification and an original conversion rule, and screening the original code specification according to an original file to obtain a target code specification and a target conversion rule; wherein the target code specification and the target transformation rule are adapted to the prototype file; converting the prototype file into a complete code according to the target code specification and the target conversion rule; and packaging the complete code to obtain an executable engineering file corresponding to the target program.
It should be noted that the above program writing method, apparatus and computer readable storage medium belong to a general inventive concept, and the contents in the embodiments of the program writing method, apparatus and computer readable storage medium may be mutually applicable.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of programming, the method comprising:
acquiring a prototype file corresponding to a target program; the prototype file is a character string for describing program function requirements, the character string comprises prototype information with different dimensions, and the prototype information with different dimensions comprises operation environment information, component information, front-end logic information, cloud logic information and parameter information;
acquiring an original code specification and an original conversion rule, and screening the original code specification according to the original file to obtain a target code specification and a target conversion rule; wherein the target code specification and the target transformation rules are adapted to the prototype file;
converting the prototype file into complete code according to the target code specification and the target conversion rule; and packaging the complete code to obtain an executable engineering file corresponding to the target program.
2. The method according to claim 1, wherein the obtaining of the prototype file corresponding to the target program comprises:
displaying a prototype file editing interface; the display prototype file editing interface comprises a display window, a property setting window, a style control window, an event window and a server window, wherein at least one component can be added to the display window, and the component is composed of elements;
when an instruction added by the component is not received, an instruction of selecting the component is not received, and an instruction of selecting an element is not received, setting the display window style of the display window in the attribute setting window; when an instruction of selecting the component is received or an instruction of selecting the element is received, setting the component style of the selected component or the component corresponding to the selected element in the attribute setting window; the component styles and window display styles include status, vignette, color, position, special styles and content;
in the style control window, when a style control instruction is received, adding a data module, and responding to the style control instruction to associate a plurality of components through a connecting line; the associated components uniformly modify component styles based on the data modules, and the parameter information given in the data modules comprises data introduction, data initial values and data ranges;
in the event window, when an event creating instruction is received, creating a plurality of blank events in response to the event creating instruction, sequentially connecting a plurality of added logic components in each blank event, and giving parameter information to the plurality of added data components to obtain a plurality of functional events containing user functional logic; the parameter information given in the event window comprises data introduction, a data initial value and a data range, and the user function logic is used for realizing the program function requirements of a target user;
when an event correlation instruction is received, responding to the event correlation instruction, adding an event module or connecting a plurality of event windows to correlate the plurality of functional events, and correlating logic components and data components in the event windows with data modules in the style control windows through connecting lines; the event module comprises associated event information of the associated functional event, and carries data information and return data information;
in the server window, when a cloud logic creation instruction is received, responding to the cloud logic creation instruction, sequentially connecting a plurality of added logic components based on the program function requirements of a user, endowing parameter information for the plurality of added data components to obtain cloud logic, and storing the data information of the cloud logic into a corresponding database according to a preset storage rule; wherein the cloud logic is configured to meet a program function requirement of a user;
outputting prototype information formed by the prototype file editing interface in the editing process of the display window, the attribute setting window, the style control window, the event window and the server window to obtain the prototype file; the component information in the prototype information includes information formed in the display window, the property setting window and the style control window, the front-end logic information in the prototype information includes information formed in the event window, and the cloud logic information in the prototype information includes information formed in the server window.
3. The method of claim 2, wherein the parameter information includes controller data created within the style control window, event data created within the event window, and cloud data created within the server window;
the controller data, the event data and the cloud data are allowed to be communicated and replaced with each other.
4. The method of claim 2, further comprising:
associating a plurality of components of each window in the prototype file editing interface through the identity; wherein the components associated by the identity allow for uniform modification of component styles.
5. The method of claim 1, wherein the original code specification comprises: specification introduction, operating environment specification, corresponding code specification of a prototype function, code format specification of the prototype function and placement position specification of a function code; the code specification is used for converting the component information, the front-end logic information and the cloud logic information;
wherein the specification introduction includes details and notes of different code specifications;
the operating environment specification comprises effective operating environments of different code specifications;
the corresponding code specification of the prototype function comprises filling type contents corresponding to different prototype functions; the prototype function is a function which can be realized by the prototype file, and the filled-in content is a pre-created code frame;
the code format specification of the prototype function comprises a parameter format specification in the filler content;
the placement position specification of the function code comprises target placement positions of different segment codes;
the conversion rule comprises: parameter introduction, actual meaning corresponding to the parameters and parameter content; the conversion rule is used for converting the parameter information; the parameter belongs to the parameter information;
wherein the parameter introduction comprises details and cautions of different parameters;
the actual meanings corresponding to the parameters comprise code meanings corresponding to different parameters in the prototype file;
the parameter content comprises the actual conversion results of the different parameters.
6. The method of claim 5, wherein obtaining the original code specification and the original transformation rule, and filtering the original code specification according to the prototype file to obtain a target code specification and a target transformation rule comprises:
screening the original code specification and the original conversion rule according to the operating environment information and the operating environment specification to obtain a first code specification and a first conversion rule; the original code specification consists of a plurality of code specifications with parent-child relationship and parallel relationship, and the original conversion rule consists of a plurality of conversion rules with parent-child relationship and parallel relationship;
screening the first code specification and the first conversion rule according to the prototype function to obtain a second code specification and a second conversion rule;
and screening the second code specification and the second conversion rule according to the filling content, the parameters in the prototype file and the parameter related items in the conversion rule to obtain a target code specification and a target conversion rule.
7. The method of claim 6, wherein converting the prototype file to full code according to the target code specification and the target transformation rules comprises:
matching filling type contents and parameter formats of different prototype functions according to prototype information of the prototype file, corresponding code rules of the prototype functions and code format specifications of the prototype functions;
converting parameters in the prototype information into a plurality of corresponding code parameters according to the target conversion rule so as to fill the filling type contents; combining a plurality of filling contents filled with code parameters according to the target code specification to obtain a plurality of segment codes; wherein the plurality of segment codes include a main segment code and a plurality of auxiliary segment codes, the main segment code determines a main segment code position based on a code specification of a parent level in the target code specification, the auxiliary segment codes determine a target placement position based on a placement position specification of a function code in the target code specification, the target placement position is located within the main segment code position;
and selecting one of the prototype information which meets the condition and has a parallel relation in the target code specification to execute, or selecting one of the prototype information which meets the condition and has a parallel relation in the target conversion rule to execute, so as to place different auxiliary fragment codes in the main body fragment according to the target placement position to obtain the complete code.
8. The method according to claim 1, wherein after obtaining the prototype file corresponding to the target program, the method further comprises:
and analyzing the prototype file, and initializing the compiling operation environment of the prototype file according to the obtained analysis result.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 8.
10. A terminal device comprising a memory and a processor, characterized in that the memory stores a computer program which, when executed by the processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 8.
CN202111562330.6A 2021-12-20 2021-12-20 Program writing method, apparatus and medium Active CN114398032B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111562330.6A CN114398032B (en) 2021-12-20 2021-12-20 Program writing method, apparatus and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111562330.6A CN114398032B (en) 2021-12-20 2021-12-20 Program writing method, apparatus and medium

Publications (2)

Publication Number Publication Date
CN114398032A true CN114398032A (en) 2022-04-26
CN114398032B CN114398032B (en) 2022-08-09

Family

ID=81227130

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111562330.6A Active CN114398032B (en) 2021-12-20 2021-12-20 Program writing method, apparatus and medium

Country Status (1)

Country Link
CN (1) CN114398032B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116604535A (en) * 2023-07-19 2023-08-18 深圳墨影科技有限公司 Teaching system and method applied to modular design of robot industrial chain

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427731A (en) * 2018-02-26 2018-08-21 平安普惠企业管理有限公司 Processing method, device, terminal device and the medium of page code
US10095486B2 (en) * 2010-02-25 2018-10-09 Sita Information Networking Computing Ireland Limited Software application development tool
CN110764753A (en) * 2019-09-18 2020-02-07 亚信创新技术(南京)有限公司 Business logic code generation method, device, equipment and storage medium
US20200097261A1 (en) * 2018-09-22 2020-03-26 Manhattan Engineering Incorporated Code completion
US20200201608A1 (en) * 2018-12-21 2020-06-25 Dspace Digital Signal Processing And Control Engineering Gmbh Method and system for generating program code
CN111427559A (en) * 2019-01-10 2020-07-17 阿里巴巴集团控股有限公司 Method for realizing form customized service, form generation method, device and system
CN111966339A (en) * 2020-07-23 2020-11-20 招联消费金融有限公司 Method and device for recording buried point parameters, computer equipment and storage medium
US20210072962A1 (en) * 2019-01-31 2021-03-11 Splunk Inc. Executing playbooks including multi-prompt blocks
WO2021051913A1 (en) * 2019-09-17 2021-03-25 创新先进技术有限公司 Method and device for generating applet
CN112965701A (en) * 2021-02-08 2021-06-15 中国工商银行股份有限公司 Front-end code generation method and device
CN113515715A (en) * 2020-10-15 2021-10-19 腾讯科技(深圳)有限公司 Generating method, processing method and related equipment of buried point event code
WO2021217660A1 (en) * 2020-04-30 2021-11-04 深圳中砼物联网科技有限公司 Method for realizing graphical code-free development of user interface, and computer device and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10095486B2 (en) * 2010-02-25 2018-10-09 Sita Information Networking Computing Ireland Limited Software application development tool
CN108427731A (en) * 2018-02-26 2018-08-21 平安普惠企业管理有限公司 Processing method, device, terminal device and the medium of page code
US20200097261A1 (en) * 2018-09-22 2020-03-26 Manhattan Engineering Incorporated Code completion
US20200201608A1 (en) * 2018-12-21 2020-06-25 Dspace Digital Signal Processing And Control Engineering Gmbh Method and system for generating program code
CN111427559A (en) * 2019-01-10 2020-07-17 阿里巴巴集团控股有限公司 Method for realizing form customized service, form generation method, device and system
US20210072962A1 (en) * 2019-01-31 2021-03-11 Splunk Inc. Executing playbooks including multi-prompt blocks
WO2021051913A1 (en) * 2019-09-17 2021-03-25 创新先进技术有限公司 Method and device for generating applet
CN110764753A (en) * 2019-09-18 2020-02-07 亚信创新技术(南京)有限公司 Business logic code generation method, device, equipment and storage medium
WO2021217660A1 (en) * 2020-04-30 2021-11-04 深圳中砼物联网科技有限公司 Method for realizing graphical code-free development of user interface, and computer device and storage medium
CN111966339A (en) * 2020-07-23 2020-11-20 招联消费金融有限公司 Method and device for recording buried point parameters, computer equipment and storage medium
CN113515715A (en) * 2020-10-15 2021-10-19 腾讯科技(深圳)有限公司 Generating method, processing method and related equipment of buried point event code
CN112965701A (en) * 2021-02-08 2021-06-15 中国工商银行股份有限公司 Front-end code generation method and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
SHAWNJ: ""No Code/Codeless/Low Code testing: What’s the difference"", 《HTTPS://WWW.TESTIM.IO/BLOG/LOW-CODE/》 *
文建全 等: ""无代码平台技术及其在HIS系统中的应用"", 《电脑与信息技术》 *
老马啸西风: ""low-code低代码平台java代码自动一键生成工具"", 《HTTPS://JUEJIN.CN/POST/6955866661798805534》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116604535A (en) * 2023-07-19 2023-08-18 深圳墨影科技有限公司 Teaching system and method applied to modular design of robot industrial chain
CN116604535B (en) * 2023-07-19 2023-09-12 深圳墨影科技有限公司 Teaching system and method applied to modular design of robot industrial chain

Also Published As

Publication number Publication date
CN114398032B (en) 2022-08-09

Similar Documents

Publication Publication Date Title
CN111475163B (en) Method, device and equipment for generating code file of view template and storage medium
CN112416339A (en) Page development method and device and computer equipment
CN112181416B (en) Method and device for directly generating UI code from visual manuscript
CA3152833C (en) Webpage editing method and device
CN109388396A (en) Page generation method, device, computer equipment and storage medium
CN109840083B (en) Webpage component template construction method and device, computer equipment and storage medium
CN105094832A (en) WYSIWYG method and system for dynamically generating user interface
CN112364496B (en) Avionics simulation panel generation system based on HTML5 and VUE technologies
CN114398032B (en) Program writing method, apparatus and medium
US10949175B2 (en) Method of carrying out modifications to a software application
CN108664242B (en) Method and device for generating visual interface, electronic equipment and readable storage medium
CN112631580A (en) Data processing method and device and computing equipment
CN111459501A (en) SVG-based Web configuration picture storage and display system, method and medium
CN113918144A (en) Method and system for generating reusable page based on image
CN112559446A (en) Nuclear power station regulation digital conversion method and system based on DCS (distributed control System)
CN115982266A (en) Page dynamic rendering method and system based on custom configuration attribute field
US9098263B2 (en) Database application assembly and preparation
de Lange et al. Collaborative wireframing for model-driven web engineering
CN114089999A (en) Front-end page generation method and system
CN111079382A (en) Form rendering method and system based on MVVM (multifunction virtual machine) mode
CN112486378A (en) Graph generation method, device, terminal and storage medium
CN111552529B (en) UI (user interface) adapting method and device, computer equipment and storage medium
CN114327432A (en) Application generation method and device, electronic equipment and storage medium
CN111694723B (en) Method for editing nodes and components when product runs under H5 and storage medium
CN116881596A (en) Webpage design method and device

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
GR01 Patent grant
GR01 Patent grant