CN110989982A - Building block construction method and device with return value function, storage medium and processor - Google Patents

Building block construction method and device with return value function, storage medium and processor Download PDF

Info

Publication number
CN110989982A
CN110989982A CN201911189750.7A CN201911189750A CN110989982A CN 110989982 A CN110989982 A CN 110989982A CN 201911189750 A CN201911189750 A CN 201911189750A CN 110989982 A CN110989982 A CN 110989982A
Authority
CN
China
Prior art keywords
return value
building block
function
definition content
definition
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
CN201911189750.7A
Other languages
Chinese (zh)
Other versions
CN110989982B (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.)
Suzhou Jingyihui Information Technology Co ltd
Original Assignee
Suzhou Jingyihui Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Jingyihui Information Technology Co ltd filed Critical Suzhou Jingyihui Information Technology Co ltd
Priority to CN201911189750.7A priority Critical patent/CN110989982B/en
Publication of CN110989982A publication Critical patent/CN110989982A/en
Application granted granted Critical
Publication of CN110989982B publication Critical patent/CN110989982B/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/20Software design

Abstract

The invention discloses a building block construction method with a return value function, a building block construction device with a return value function, a storage medium and a processor, wherein the method comprises the following steps: acquiring building block definition content with a return value function, wherein the building block definition content comprises function definition content and return value definition content, the function definition content comprises a function name and N function parameters, and N is a natural number; generating a return value variable according to the return value definition content; generating a building block with the return value variable according to the building block definition content; and displaying the building blocks. The invention solves the problems that the current realization process can only be processed by assigning the realization process to another building block, the construction process of the return value is complicated, and the logic error can not be found in time due to the fact that the return value information can not be obtained in time during use, is easy to use and maintain, can well support the multilayer nesting of objects, and further improves the development efficiency.

Description

Building block construction method and device with return value function, storage medium and processor
Technical Field
The invention relates to the field of graphical information processing, in particular to a building block construction method with a return value function, a building block construction device with a return value function, a storage medium and a processor.
Background
The building block type programming method has the advantages that the building block type programming is represented by Scratch and Google Block abroad, programming cats are used domestically, the building block type programming method is increasingly used in the field of teenager education, and teenagers can realize the design of software logic in a mode similar to splicing of building blocks and teach through lively activities, so that the software development difficulty and requirements are reduced. Due to the easy-to-use characteristic of the building block programming technology, the development of application software such as few internet of things software products and APP client software is also trying to introduce the technology so as to realize the rapid design and adjustment of software logic.
The construction of the function return value of the existing building block programming technology can only be processed in a mode of assigning the function return value to another building block, the construction process of the return value is complicated, the constructed building block does not display specific return value information, the data type corresponding to the return value of the function cannot be automatically identified, logic errors possibly occur during use, the logic errors cannot be found in time, and the later maintenance cost is high.
Disclosure of Invention
In view of the defects of the prior art, the invention aims to provide a building block construction method with a return value function, a building block construction device with a return value function, a storage medium and a processor, and aims to solve the problems that the return value construction process is complicated in the prior building block programming technology, and logic errors cannot be found in time due to the fact that return value information cannot be obtained in time during use.
According to a first aspect of the invention, there is provided a building block construction method with a return value function, the method comprising:
acquiring building block definition content with a return value function, wherein the building block definition content comprises function definition content and return value definition content, the function definition content comprises a function name and N function parameters, and N is a natural number;
generating a return value variable according to the return value definition content;
generating a building block with the return value variable according to the building block definition content;
and displaying the building block, wherein the display content comprises the return value variable, the function name and N function parameters.
Optionally, the return value definition content includes a return value type.
Optionally, the return value type is an object type.
Optionally, the return value definition content includes a return value hierarchy.
Optionally, the return variable has uniqueness.
According to a second aspect of the present invention, there is provided a building block building apparatus with a return value function, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring building block definition contents with a return value function, the building block definition contents comprise function definition contents and return value definition contents, the function definition contents comprise function names and N function parameters, and N is a natural number;
a generation module comprising the following processing units:
the first processing unit is used for generating a return value variable according to the return value definition content;
the second processing unit is used for generating a building block with the return value variable according to the building block definition content;
and the display module is used for displaying the building blocks, and the display content comprises the return value variable, the function name and the N function parameters.
According to a third aspect of the present invention, there is provided a storage medium including a stored program and data processed by the program, wherein the program executes a building block construction method based on the above-described function with a return value.
According to a fourth aspect of the present invention, there is provided a processor for executing a program, wherein the program executes the building block construction method with a return value function as described above when running.
Has the advantages that: compared with the existing return value construction method, the invention solves the problems that the building block with the return value function is only processed by assigning the building block to another building block in the prior realization process, the construction process of the return value is complicated, and the logic error cannot be found in time due to the fact that the return value information cannot be obtained in time during use, is easy to use and maintain, can well support multilayer nesting of objects, and further improves the development efficiency.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
FIG. 1 illustrates a block building method flow diagram with return value function of an embodiment of the present invention;
FIG. 2a is a block building method diagram with a return value function according to a first embodiment of the present invention;
FIG. 2b is a block building method diagram with a return value function according to the second embodiment of the present invention;
FIG. 2c is a block building method diagram with a return value function according to a third embodiment of the present invention;
FIG. 3 shows a block schematic diagram of a building block building apparatus with return value function of an embodiment of the invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all 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 application.
It should be noted that the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
FIG. 1 shows a flow chart of a building block construction method with a return value function according to an embodiment of the invention, and the building block construction method with the return value function comprises the following steps according to the flow chart shown in FIG. 1:
step S110, obtaining a building block definition content with a return value function, wherein the building block definition content comprises function definition content and return value definition content, the function definition content comprises a function name and N function parameters, and N is a natural number.
In the embodiment of the present invention, when the number N of the function parameters is 0, the function definition content only includes the function name.
The default parameter definitions of the system, such as ID, HTML address, request mode, etc., are not described in detail.
The return value definition content can comprise a return value type, wherein the return value type comprises an object type, a numerical value type, a character type and a Boolean type;
on the basis of containing the return value type, the return value definition content can also comprise a return value hierarchical structure, and when the return value type is a numerical value type, a character type and a Boolean type, the return value hierarchical structure is a single layer; when the return value type is an object type, the return value hierarchy is multi-layered.
And step S120, generating a return value variable according to the return value definition content.
If the return value definition includes a hierarchy, the generated return value variables include the same hierarchy.
Step S130, generating a building block with the return value variable according to the building block definition content.
The return value variable may be set to one of several display modes:
the generated return value variable is an independent building block embedded in a building block with a return value function, and the two are integrated to form the building block;
the generated return value variable and other similar variables form a variable drop-down box;
the generated return value variable is displayed by sensing that the cursor moves to the function building block.
Step S140, displaying the building block, wherein the display content comprises the return value variable, the function name and N function parameters.
And receiving a building block adding instruction, and displaying the building blocks with the return value function in the logic design area, wherein the adding instruction is different, and the display shapes of the building blocks are also different. The logic design area refers to a certain area or a pop-up box type area in the interface and is used for a user to design the service logic in a mode of dragging the building block.
For ease of understanding, the return value variable generated is associated with the function by "═ ing" to increase friendliness. Other forms of display are possible.
FIG. 2a is a schematic diagram illustrating a building block construction method with a return value function according to an embodiment of the present invention, and as shown in FIG. 2a, a building block definition content with a return value function is obtained, where the function definition content includes a function name "para", the function has no parameter and no return value type, a return value variable "i" is generated according to the return value definition content, a building block with a return value variable "i" is generated according to the building block definition content, a building block addition instruction is received, and a building block with a return value function "para" is displayed in a logic design area.
The return value variable display may be in various modes, for example, the return value variable "i" is an independent small building block embedded in the "para" function building block, or the return value variable "i" and other similar variables form a variable drop-down box, or the return value variable "i" is displayed when the cursor is sensed to move to the "para" function building block.
After the function building blocks are built, the building blocks with the return value functions can be directly dragged to carry out logic design, the function building blocks are not dragged first, then the return value building blocks are dragged to be spliced, or the return value design is realized by adopting a roundabout intermediate step, so that the design steps are simplified.
Fig. 2b shows a building block construction method with a return value function according to a second embodiment of the present invention, as shown in fig. 2b, a building block definition content with a return value function is obtained, the function definition content includes a function name "demo", the function parameter "id", the return value is a single-layer structure, the return value type may be a numerical value type, a character type, or a boolean type, a return value variable "j" is generated according to the return value definition content, a building block with a return value variable "j" is generated according to the building block definition content, a building block addition instruction is received, and a building block with a return value function "demo" is displayed in a logic design area.
The shape display of the function building block is not limited to this embodiment, and the generated return value variable display may also be in various manners, for example, the return value variable "j" is an independent small building block embedded in the "demo" function building block, or the return value variable "j" and other similar variables form a variable drop-down box, or the return value variable "j" is displayed when a cursor is sensed to move to the "demo" function building block.
On the basis of the first embodiment, the returned value variable of the embodiment contains type information, and when the method is used, different types of building blocks cannot be spliced and early-warning is carried out in advance, so that logic errors caused by variable types cannot occur.
Fig. 2c shows a building block construction method with a return value function according to a third embodiment of the present invention, as shown in fig. 2c, a building block definition content with a return value function is obtained, where the function definition content includes a function name "product", the function has 3 parameters, which are "PAGE", "SIZE", "product type", respectively, the return value is an object type, the return value definition includes a hierarchical structure, the first layer includes a single attribute "m", "the next layer attribute of m" is "result", "total", "the next layer attribute of result" is "id", "code", "name", "product type", and the next layer attribute of total "is" PAGE "," SIZE "," rowcount ", a return value variable" i "is generated according to the return value definition content, and the return value variable" i "includes the same hierarchical structure.
In this embodiment, the variable generation manner may be that a specific keyword "properties" is added, and the keyword name may also be "children" or other, and is used for identifying a return value hierarchy during traversal, which is convenient for storage, and specifically: traversing the returned value hierarchical structure step by step, and if traversing to a specific keyword 'properties', continuing traversing; if the specific keyword 'properties' cannot be traversed, ending the current level until the traversal is completed, and generating a return value variable 'i'.
In this embodiment, the variable generation mode may also obtain the return value hierarchy information by directly traversing the return value hierarchy, and further generate the return value variable "i".
The return value variable comprises a variable identifier, the current variable identifier is compared, a new variable identifier is generated according to a preset generation rule, and the return value variable has uniqueness.
Generating a building block with a return value variable i according to the building block definition content, receiving a building block adding instruction, and displaying the building block with a return value function 'product' in a logic design area.
The method includes the steps that the function building block is displayed in a mode of displaying, the shape of the function building block is not limited to the mode, the generated return value variable can be displayed in multiple modes, for example, the return value variable i is an independent small building block and is embedded into a product function building block, or the return value variable i and other similar variables form a variable drop-down box, or the return value variable i is displayed when a cursor is sensed to move to the product function building block.
On the basis of the second embodiment, the return value variable of the embodiment comprises a hierarchical structure, particularly when the processing return value is an object type, multi-layer nesting of the object is well supported, more complex business logic can be designed by using the building blocks, and the existing building block programming technology cannot build the building blocks of the type.
FIG. 3 is a block diagram of a building block building apparatus with a return value function according to an embodiment of the present invention, which includes:
the obtaining module 310 is configured to obtain a building block definition content with a return value function, where the building block definition content includes a function definition content and a return value definition content, and the function definition content includes a function name and N function parameters, where N is a natural number.
A generating module 320 comprising the following processing units:
a first processing unit 321, configured to generate a return value variable according to the return value definition content;
a second processing unit 322 for generating a building block with the return value variable according to the building block definition content.
And the display module 330 is configured to display the building block, where the display content includes the return value variable, the function name, and the N function parameters.
The technical solution of the present application may be embodied in the form of a software product stored in a computer-readable storage medium, which may be a tangible device that can hold and store instructions for use by an instruction execution device, or all or part of the technical solution. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
Various aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus, and/or devices according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, storage media, processors, according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (8)

1. A building block construction method with a return value function is characterized by comprising the following steps:
acquiring building block definition content with a return value function, wherein the building block definition content comprises function definition content and return value definition content, the function definition content comprises a function name and N function parameters, and N is a natural number;
generating a return value variable according to the return value definition content;
generating a building block with the return value variable according to the building block definition content;
and displaying the building block, wherein the display content comprises the return value variable, the function name and N function parameters.
2. The building block building method with a return value function of claim 1, wherein the return value definition content includes a return value type.
3. The building block construction method with a return value function according to claim 2, characterized in that the return value type is an object type.
4. A building block construction method with return value function according to any of claims 1-3, characterized in that the return value definition content comprises a return value hierarchy.
5. A building block construction method with a return value function according to claim 1, characterized in that the return variable has uniqueness.
6. A building block building apparatus with a return value function, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring building block definition contents with a return value function, the building block definition contents comprise function definition contents and return value definition contents, the function definition contents comprise function names and N function parameters, and N is a natural number;
a generation module comprising the following processing units:
the first processing unit is used for generating a return value variable according to the return value definition content;
the second processing unit is used for generating a building block with the return value variable according to the building block definition content;
and the display module is used for displaying the building blocks, and the display content comprises the return value variable, the function name and the N function parameters.
7. A storage medium characterized by comprising a stored program and data processed by the program, wherein the program executes the building block construction method with a return value function of any one of claims 1 to 5.
8. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to execute the building block construction method with a return value function according to any one of claims 1 to 5 when the program is run.
CN201911189750.7A 2019-11-29 2019-11-29 Building block construction method and device with return value function, storage medium and processor Active CN110989982B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911189750.7A CN110989982B (en) 2019-11-29 2019-11-29 Building block construction method and device with return value function, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911189750.7A CN110989982B (en) 2019-11-29 2019-11-29 Building block construction method and device with return value function, storage medium and processor

Publications (2)

Publication Number Publication Date
CN110989982A true CN110989982A (en) 2020-04-10
CN110989982B CN110989982B (en) 2023-10-31

Family

ID=70087725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911189750.7A Active CN110989982B (en) 2019-11-29 2019-11-29 Building block construction method and device with return value function, storage medium and processor

Country Status (1)

Country Link
CN (1) CN110989982B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094038A (en) * 2021-05-10 2021-07-09 乐聚(深圳)机器人技术有限公司 Processing method, device, terminal and storage medium of function programming building block

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030088850A1 (en) * 2001-10-12 2003-05-08 Allison David S. Method and apparatus for deriving functions from other functions in a programming language
CN109471622A (en) * 2018-11-02 2019-03-15 成都娄外科技有限公司 A kind of program editing method and device
CN110377280A (en) * 2019-07-29 2019-10-25 郑州幻视科技有限公司 A kind of visualization system for teaching programming

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030088850A1 (en) * 2001-10-12 2003-05-08 Allison David S. Method and apparatus for deriving functions from other functions in a programming language
CN109471622A (en) * 2018-11-02 2019-03-15 成都娄外科技有限公司 A kind of program editing method and device
CN110377280A (en) * 2019-07-29 2019-10-25 郑州幻视科技有限公司 A kind of visualization system for teaching programming

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094038A (en) * 2021-05-10 2021-07-09 乐聚(深圳)机器人技术有限公司 Processing method, device, terminal and storage medium of function programming building block

Also Published As

Publication number Publication date
CN110989982B (en) 2023-10-31

Similar Documents

Publication Publication Date Title
CN109634598B (en) Page display method, device, equipment and storage medium
US11150893B2 (en) Collaborative software development tool for resolving potential code-change conflicts in real time
CN109408685B (en) Thinking guide graph display method and device
CN108415702B (en) Dynamic rendering method and device for application interface of mobile terminal
CN104798094B (en) Determine the configuration of content item display environment
CN110442330A (en) List element conversion method, device, electronic equipment and storage medium
US10628465B2 (en) Generating a ranked list of best fitting place names
CN108279882B (en) Framework generation method, device, equipment and computer readable medium
CN110727869A (en) Page construction method and device
US20130007377A1 (en) Message oriented middleware with integrated rules engine
CN111666100A (en) Software framework generation method and device, electronic equipment and storage medium
CN110989982B (en) Building block construction method and device with return value function, storage medium and processor
US9361209B2 (en) Capturing domain validations and domain element initializations
CN103092582B (en) For the treatment of the method and system of the event of issue with the event of subscription
US11163830B2 (en) Augmenting the display of data in a tree format
CN112486482A (en) Page display method and device
CN110908647B (en) Building block type programmed object variable presenting method, device, terminal and storage medium
US20150160815A1 (en) Visualizing migration of a resource of a distributed computing environment
CN110908646B (en) Building block type callback function block construction method and device, storage medium and processor
US11289092B2 (en) Text editing using speech recognition
CN116775174A (en) Processing method, device, equipment and medium based on user interface frame
CN113781608A (en) Animation editing method and device
CN116820555B (en) Application program packetizing method and device, electronic equipment and readable storage medium
US10838696B2 (en) Management of L-shaped swim lanes of variable heights and widths in a graphical editor used to represent multiple asynchronous process in the same view
US20230401040A1 (en) Dynamically altering a code execution workflow during development using augmented reality

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 215123 room 402, building 1, maishanlong building, 168 Yuxin Road, Suzhou Industrial Park, Jiangsu Province

Applicant after: SUZHOU JINGYIHUI INFORMATION TECHNOLOGY Co.,Ltd.

Address before: Room 503, HaoChen building, 286 Dongping street, Suzhou Industrial Park, Jiangsu Province

Applicant before: SUZHOU JINGYIHUI INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant