CN113626308A - Code debugging method and device, electronic equipment and storage medium - Google Patents

Code debugging method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113626308A
CN113626308A CN202110762450.4A CN202110762450A CN113626308A CN 113626308 A CN113626308 A CN 113626308A CN 202110762450 A CN202110762450 A CN 202110762450A CN 113626308 A CN113626308 A CN 113626308A
Authority
CN
China
Prior art keywords
building block
debugging
information
original
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110762450.4A
Other languages
Chinese (zh)
Inventor
李天驰
孙悦
李其军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Dianmao Technology Co Ltd
Original Assignee
Shenzhen Dianmao 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 Shenzhen Dianmao Technology Co Ltd filed Critical Shenzhen Dianmao Technology Co Ltd
Priority to CN202110762450.4A priority Critical patent/CN113626308A/en
Publication of CN113626308A publication Critical patent/CN113626308A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a code debugging method, a code debugging device, electronic equipment and a storage medium, which are applied to a graphical programming platform, wherein the graphical programming platform is provided with a programming interface, and the method comprises the following steps: responding to a debugging building block adding instruction, adding a preset debugging building block into an original building block, wherein the original building block is a building block combination formed by combining at least one building block on a programming interface, and the debugging building block is used for outputting an execution result of the original building block; generating a target building block according to the debugging building block; responding to the operation instruction, converting the target building block into a target source code and then operating; outputting debugging information corresponding to the target building block according to the running result of the target source code; and positioning the original building blocks according to the debugging information. According to the embodiment of the invention, the output result of the original building block is obtained according to the debugging building block after the preset debugging building block is added to the original building block, so that a user can conveniently and rapidly debug the code in time, and the debugging efficiency of the code is improved.

Description

Code debugging method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a code debugging method and apparatus, an electronic device, and a storage medium.
Background
The code debugging is a process of testing by manual or compiled program codes and the like before the compiled program codes are put into actual operation, and correcting syntax errors and logic errors. This is an essential step in ensuring the correctness of the computer information system. After the computer program codes are compiled, the computer program codes must be sent to a computer for testing. And further diagnosing according to errors found in the test, finding out reasons and specific positions and correcting.
In the graphical programming platform in the prior art, programming is realized by dragging building blocks. When the graphical programming platform debugs the building blocks, the building blocks can only be debugged by disconnecting the building block links or using a troubleshooting method. The code debugging method of the conventional graphical programming platform is complex in operation, and if a plurality of building blocks exist, the building blocks need to be debugged, so that the time is long, and the debugging efficiency is low.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
In view of the defects of the prior art, the invention provides a code debugging method, a code debugging device, electronic equipment and a storage medium, and aims to solve the problems that the code debugging method of the conventional graphical programming platform is complex in operation, and if a plurality of building blocks exist, the building blocks need to be debugged, the time is long, and the debugging efficiency is low.
The technical scheme of the invention is as follows:
the first embodiment of the invention provides a code debugging method, which is applied to a graphical programming platform, wherein the graphical programming platform is provided with a programming interface, and the method comprises the following steps:
responding to a debugging building block adding instruction, adding a preset debugging building block into an original building block, wherein the original building block is a building block combination formed by combining at least one building block on the programming interface, and the debugging building block is used for outputting an execution result of the original building block;
generating a target product according to the debugging building blocks;
responding to an operation instruction, converting the target building block into a target source code and then operating;
outputting debugging information corresponding to the target building block according to the running result of the target source code;
and positioning the original building blocks according to the debugging information.
Furthermore, the graphical programming platform is also provided with a console display interface;
add predetermined debugging building blocks in original building blocks, include:
adding a preset debugging output building block in the original building block, wherein the debugging output building block is used for outputting debugging information on a display interface of the console;
and/or adding a preset error reporting debugging building block in the original building block, wherein the error reporting debugging building block is used for outputting error reporting information on the display interface of the console.
Further, if the preset debugging building block is an error-reporting debugging building block,
then according to debug information fixes a position the back to debugging building blocks, include:
responding to a trigger instruction of the error reporting information, and displaying an original building block corresponding to the error reporting information on the programming interface;
and acquiring the background of the original building block, and controlling the background to be in a flashing state.
Further, the obtaining the background of the original building block and controlling the background to be in a flashing state further includes:
and controlling the background to stop flashing in response to the modification instruction of the original building block.
Further, the positioning the original building block according to the debugging information includes:
acquiring a building block identifier and a screen identifier of the original building block according to debugging information;
acquiring the position of the original building block according to the building block identifier and the screen identifier;
calculating the offset of the display area of the current programming interface relative to the position of the building block;
and rolling the offset at the position of the current programming interface to realize the positioning of the original building blocks.
Further, the graphical programming platform is provided with a console UI (user interface) component, and the console UI component is used for controlling the console interface to output information;
then, before the operation after the target block is converted into the target source code in response to the operation instruction, the method further includes:
defining a message manager, wherein the message manager is used for managing message types;
subscribing a console UI component as an observer in the message manager;
defining the type of debugging information at the message manager;
and acquiring the debugging information according to the UI component of the control console.
Further, a debugging function is set in the debugging building block, and then debugging information corresponding to the target building block is output according to the running result of the target source code, including:
obtaining a calling result of a debugging function, wherein the calling result comprises building block information and debugging information of a debugging building block;
sending the calling result to the console UI component;
and debugging information is output on the control console display interface through a control console UI component, and the type of the debugging information is self-defined printing information.
Another embodiment of the present invention provides a code debugging apparatus, which is applied to a graphical programming platform, wherein the graphical programming platform is provided with a programming interface, and the apparatus includes:
the debugging building block adding module is used for responding to a debugging building block adding instruction and adding a preset debugging building block into an original building block, wherein the original building block is a building block combination formed by combining at least one building block on the programming interface, and the debugging building block is used for outputting an execution result of the original building block;
the target building block generating module is used for generating a target building block according to the debugging building block;
the operation module is used for responding to an operation instruction, converting the target building block into a target source code and then operating the target building block;
the debugging information output module is used for outputting debugging information corresponding to the target building block according to the running result of the target source code;
and the positioning module is used for positioning the original building blocks according to the debugging information.
Another embodiment of the present invention provides an electronic device comprising at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the code debugging method described above.
Yet another embodiment of the present invention provides a non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the code debugging method described above.
Has the advantages that: according to the embodiment of the invention, after the preset debugging building block is added to the original building block, the output result of the original building block is obtained according to the debugging building block, so that convenience is provided for a user to check the output result of the original code, and the debugging building block does not influence the operation result of the building block, so that the user can conveniently and rapidly debug the code in time, and the debugging efficiency of the code is improved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flowchart of a preferred embodiment of a code debugging method according to the present invention;
fig. 2a is a schematic diagram of a block style of a debugging output block according to an embodiment of the code debugging method of the present invention;
FIG. 2b is a schematic diagram of a block style of an error-reporting debugging block according to an embodiment of the code debugging method of the present invention;
FIG. 3 is a schematic diagram of error information reporting of an embodiment of a code debugging method according to the present invention;
FIG. 4 is a schematic diagram of a click command of error information according to an embodiment of the present invention;
FIG. 5 is a functional block diagram of a code debugging apparatus according to a preferred embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to a preferred embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is described in further detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Embodiments of the present invention will be described below with reference to the accompanying drawings.
An embodiment of the present invention provides a code debugging method, which is applied to a graphical programming platform, where the graphical programming platform is provided with a programming interface, please refer to fig. 1, and fig. 1 is a flowchart of a preferred embodiment of the code debugging method according to the present invention. As shown in fig. 1, it includes the steps of:
step S101, responding to a debugging building block adding instruction, adding a preset debugging building block in an original building block, wherein the original building block is a building block combination formed by combining at least one building block on a programming interface, and the debugging building block is used for outputting an execution result of the original building block;
specifically, the code debugging method of the embodiment of the invention is realized through a graphical programming platform, the graphical programming platform is a program written with an interface, and a programming language is a standardized communication skill and is used for sending instructions to a computer and defining the computer program. The method has the advantages that good page layout can be achieved by using graphical programming, and in many existing web applications, the page layout of an application program often needs to use images, so that the overall effect of the page is more friendly.
The graphical programming platform in the embodiment of the invention realizes programming through the combination of building blocks. A programming language is nested in each block. The building blocks have various types corresponding to different functions, and each type of building block is nested with a corresponding program language. The graphical programming platform is provided with a programming interface, and after the building blocks are dragged on the programming interface, stacking of the building blocks is completed, so that certain functions can be realized. After the building blocks on the programming interface are stacked, the programs corresponding to the building blocks can be operated.
And after the programming interface receives a debugging building block adding instruction of a user, adding a preset debugging building block in the original building block. The original building blocks are building block combinations formed by combining at least one building block on the programming interface, and the building block combinations are building blocks with certain functions. The debugging building block is a building block which is defined by a user in advance and outputs an execution result of an original building block.
The debugging building block adding instruction can be a building block editing instruction set on a graphical programming interface, and a user can drag corresponding building blocks from a building block pool preset on the programming interface to the programming interface for stacking to generate target building blocks.
Step S102, generating a target building block according to the debugging building block;
during specific implementation, after debugging building blocks are added to the original building blocks, target building blocks with debugging information are generated. The debugging building blocks do not influence the output result of the original building blocks, only output the output result of the original building blocks, and a user can conveniently check the output result of the original building blocks in real time. Therefore, the target building block can also look up the output result of the original building block or debug the debugging information in the building block on the basis of the original building block.
Step S103, responding to the operation instruction, converting the target building block into a target source code and then operating;
during specific implementation, after receiving an operation instruction of a user, the graphical programming platform operates the target building block, and in the operation process, the target building block needs to be converted into a target source code corresponding to the building block, so that the target source code is operated.
The operation instruction can be an operation button of the graphical programming interface or an operation corresponding picture button. In practical applications, the operation instruction may be limited according to requirements, which is not limited in the embodiment of the present invention.
The target source code refers to a code corresponding to a building block combined on a programming interface, a programming language format of the source code is subject to the language nested in the building block, and the source code may be one of Java language, C language, PYTHON language and other programming languages, and is not limited herein.
Step S104, outputting debugging information corresponding to the target building block according to the running result of the target source code;
and during specific implementation, acquiring the running result of the target source code, and acquiring corresponding debugging information according to the running result of the target source code. The debugging information of the embodiment of the invention generally refers to user-defined debugging information.
And the debugging building block in the target building block comprises debugging information and a debugging information output function, and after the target source code runs, the debugging information is output on the interface of the graphical programming platform according to the debugging information output function.
And S105, positioning the original building blocks according to the debugging information.
During specific implementation, debugging information is output on an interface of the graphical programming platform, and the original building blocks can be positioned through the debugging information. Specifically, the position of the original building block can be identified in the debugging information, so that a user can conveniently position the original building block. Or the user clicks the debugging information to directly position to the original building block.
In one embodiment, the graphical programming platform is further provided with a console display interface;
add predetermined debugging building blocks in original building blocks, include:
adding a preset debugging output building block in the original building block, wherein the debugging output building block is used for outputting debugging information on a display interface of a console;
and/or adding a preset error reporting debugging building block in the original building block, wherein the error reporting debugging building block is used for outputting error reporting information on a display interface of the console.
In specific implementation, a console display interface is further arranged on the graphical programming platform, and the debugging building blocks can be debugging output building blocks and/or debugging building blocks capable of reporting errors; the debugging output building block can output debugging information on a display interface of a console in the running process of the target source code. The debugging information is generally user-defined debugging content. In practical application, the debugging content may be set as needed, which is not limited in the embodiment of the present invention.
And the error reporting debugging building block can output error reporting information on a display interface of the console in the running process of the target source code. The error information is generally the error content defined by the user. In practical application, the error reporting content may be set according to needs, which is not limited in the embodiment of the present invention.
In one embodiment, if the preset debugging block is an error-reporting debugging block,
then after fixing a position debugging building blocks according to debugging information, include:
responding to a trigger instruction of the error reporting information, and displaying an original building block corresponding to the error reporting information on a programming interface;
and acquiring the background of the original building block, and controlling the background to be in a flashing state.
During specific implementation, after a prompt message triggering instruction of a user is received on a console display interface, the original building blocks corresponding to the error reporting information are obtained, the positions of the original building blocks are located, and the original building blocks are displayed in a visual area of a programming interface. The prompt information trigger instruction can be prompt information of clicking the console interface by a user, prompt information of clicking the console interface, prompt information of double clicking the console interface or prompt information of right clicking the console interface. In practical application, the prompt information triggering instruction can be set according to needs, and is not limited here.
After the original building blocks are positioned, the background of the original building blocks on the programming interface is obtained, the background of the original building blocks is controlled to be in a flashing state through a JavaScript blink technology, and a user can conveniently and quickly obtain the positions of the original building blocks in the programming interface. The blink () method is used to display a flashing string. The specific syntax is stringobject.
In practical application, the manner of controlling the flicker of the background of the building blocks can be limited according to requirements, which is not limited in the embodiment of the invention.
In an embodiment, if a building block background flashing manner is adopted, the background of the original building block is obtained, and after the background is controlled to be in a flashing state, the method may further include:
and controlling the background to stop flashing in response to the modification instruction of the original building block.
During specific implementation, when a programming page detects a modification instruction of a user on an original building block, the position of the original building block is actually positioned by the user at the moment, the original building block background is controlled to stop flashing, the modification instruction is detected to indicate that the user has received an error-reported building block, the position of a wrong building block is determined, a building block debugging error is realized, the background flashing is stopped at the moment, and preparation is made for next user modification debugging.
In one embodiment, locating the original building block according to the debugging information comprises:
acquiring a building block identifier and a screen identifier of an original building block according to debugging information;
acquiring the position of the original building block according to the building block identifier and the screen identifier;
calculating the offset of the display area of the current programming interface relative to the position of the building block;
and rolling the offset at the position of the current programming interface to realize the positioning of the original building blocks.
During specific implementation, the debugging information can carry a building block ID (identity) and a screen ID, the building block ID and the screen ID of the original building block are obtained according to the debugging information, then the current building block position is obtained according to the building block ID and the screen ID, the offset of the current visual area relative to the building block position is calculated, and the offset is rolled at the position of the current building block working area, so that building block positioning is realized. The building block ID in the embodiment of the invention is used for identifying the building blocks, each building block has a corresponding building block ID in the original building blocks, the building block ID is unique, and the corresponding building block can be positioned through the building block ID. And the screen ID identifies the screen. Each screen ID is also unique, the screen position of the building block can be located through the screen ID, and the position of the building block is obtained from the located screen position through the building block ID. Through building blocks ID and screen ID, acquire the position of original building blocks in the programming region, through the roll offset, the original building blocks of location in the display in the screen realize fixing a position to original building blocks fast, look over the error message of building blocks for the user and provide convenience.
In one embodiment, the graphical programming platform is provided with a console UI component, and the console UI component is used for controlling the console interface to output information;
responding to the operation instruction, converting the target building block into the target source code and then before operation, the method further comprises the following steps:
defining a message manager, wherein the message manager is used for managing message types;
subscribing a console UI component as an observer in a message manager;
defining the type of the debugging information at the message manager;
and acquiring debugging information according to the UI component of the control console.
When the method is implemented specifically, a message manager is defined, wherein the message manager is responsible for defining message types, reading, writing and sending messages; the message manager is a console manager, and the message manager includes but is not limited to a console file manager, and in some other embodiments, a console file manager, a storage, and the embodiment of the present invention is not limited thereto. Subscribing a console UI component as an observer; outputting a type corresponding to 'debugging information' in the console, where the type corresponding to the outputted debugging information includes but is not limited to consoleman.log, and in some other embodiments, the type corresponding to the debugging information may also be outputted in other manners, which is not limited in this embodiment of the present invention; the type corresponding to the error reporting information includes, but is not limited to, ConsoleManager. In some other embodiments, other manners may also be used to output the type corresponding to the error information, which is not limited in this embodiment of the present invention.
Where Console is a Console window enhancement where the Console is Windows. The console functions include: multiple tabs, text editors (such as text selection), different types of backgrounds, transparency of letters and colors, configurable fonts, different window styles. Console Manager is a Console program. The debugging information is obtained through observer features of the controller UI component. The type of the debugging information is defined in the controller in advance, so that the UI component of the control console can acquire the debugging information, and a user can check the debugging information in the UI component conveniently.
In one embodiment, the setting of the debugging function in the debugging block outputs debugging information corresponding to the target block according to the running result of the target source code, and the debugging information includes:
obtaining a calling result of the debugging function, wherein the calling result comprises building block information and debugging information of a debugging building block;
sending the calling result to a control console UI component;
and debugging information is output on a control console display interface through the control console UI component, and the type of the debugging information is self-defined printing information.
In specific implementation, when the user clicks the run code, the method for converting the building block logic into the code logic includes, but is not limited to, converting through a javascript generator library of Blink, and in some other embodiments, the building block logic may also be converted into the code in other manners, which is not limited in this embodiment of the present invention. Wherein the block "output debug info at console" will translate to function code with current block information, and user-defined print information. The building block of ' error reporting information ' reported in the console ' can be converted into a function code with current building block information and user-defined error reporting information.
When the function is called, the building block information and the user-defined print message are sent, and the sending mode includes but is not limited to sending through a ConsoleManager. The method uses a design mode of an observer, wherein the observer is defined in the console UI component in advance, and the information is captured by the observer (console) when the message is pushed, so that the service logic is realized according to the captured information.
Blink contains one main thread, multiple Worker threads, and some other threads. Almost all important work is running on the main thread. Including running JavaScript (other than Workers), DOM generation, CSS style and layout calculations, etc., the optimization of interaction performance is critical mainly around the main thread. Blink creates an independent thread for Web workers and Service workers. Although JavaScript is run, the running environments of the main thread and the worker thread are not shared, and data needs to be transferred through messages.
The javascript generator library is a generator that is some code running inside a function, it pauses itself after a value is returned, and the caller may ask to unpause and return another value. This "return" is not the traditional slave function return. It is given a special name, yield. The generator grammar varies from language to language. The generator syntax of Javascript is similar to PHP.
In javascript, if a generator is intended to be used, it is necessary to: defining a special generator function; calling the function to create a generator object; the generator object is used in the loop or its next method is called directly.
pushMessageData is an interface of a Push API, and provides methods for enabling you to acquire Push data sent by a server in various formats. The method of the interface may be invoked multiple times. Messages received through the Push API are encrypted and sent by a Push service, then are automatically decrypted by a browser, and then can be accessed through a method of a Push message data interface. The embodiment of the invention can output the debugging information through the display interface of the console, and the debugging information can adopt the printing information defined by the user, thereby facilitating the user to check whether the debugging of the building blocks is normal or not and checking the debugging result of the building blocks.
In one embodiment, the technical solution adopted by the embodiment of the present invention is: using Javascript, HTML language, reference the BlinkJS library. And the addition of debugging building blocks is realized through a BlinkJS library. Defining two types of building blocks to output 'debugging information' and 'error reporting information' in a control console; as shown in fig. 2a, fig. 2a is a schematic diagram of a block style of a debugging output block outputting 'debugging information' at a console; as shown in fig. 2b, fig. 2b is a schematic diagram of an error reporting debugging building block for reporting an error 'error message' in a console; and the user can selectively splice any building block in the spliced building blocks, and when the code runs to the place, corresponding information can be output at the console.
Where the HTML language is a markup language. The document format on the network can be unified through the labels, so that the scattered Internet resources are connected into a logic whole. HTML text is descriptive text consisting of HTML commands that can specify words, graphics, animations, sounds, tables, links, etc.
As shown in fig. 3, a debugging output block and an error-reporting debugging block are added to the original block at the same time. When the user splices the original building blocks, debugs the output building blocks and reports the debugging building blocks by mistake, the operation is clicked, the console is popped up, and the debugging information defined by the user appears.
As shown in fig. 4, when the user clicks on the error message, the block is defined to the visible area and the background of the block flickers. When the user modifies the block, the flashing effect disappears.
In specific implementation, a message manager consoleman is defined, which is responsible for defining message types, reading, writing and sending messages;
subscribing a console UI component as an observer;
the 'debugging information' output on the console 'and the' error reporting information 'reporting error on the console' correspond to a consolem manager.
When the user clicks on the run code, the block logic is converted into code logic by using the javascript generator library of Blink, wherein the block "output 'debug information' in the console" will be converted into a function code with the current block information and the user-defined print information. The building block of ' error reporting information ' reported in the console ' can be converted into a function code with current building block information and user-defined error reporting information.
The method uses a design mode of an observer, wherein the observer is defined in a console UI component in advance, and the observer (console) captures the information when the message is pushed, so that business logic is realized according to the captured information.
After debugging information is successfully reported to the console, the information carries a building block ID and a screen ID, then the current position of the building block is obtained according to the building block ID, the offset of the current visual area relative to the building block position is calculated, and the offset is rolled at the position of the current building block working area. Thereby realizing the positioning of the building blocks.
According to the embodiment of the invention, a user can debug the code in time and quickly by the method, and information is output in the console, so that the user can be helped to find a more efficient development project quickly, and the code debugging efficiency is improved.
It should be noted that, a certain order does not necessarily exist between the above steps, and those skilled in the art can understand, according to the description of the embodiments of the present invention, that in different embodiments, the above steps may have different execution orders, that is, may be executed in parallel, may also be executed interchangeably, and the like.
Another embodiment of the present invention provides a code debugging apparatus, which is applied to a graphical programming platform, where the graphical programming platform is provided with a programming interface, and as shown in fig. 5, the apparatus 1 includes:
the debugging building block adding module 11 is used for responding to a debugging building block adding instruction, adding a preset debugging building block in an original building block, wherein the original building block is a building block combination formed by combining at least one building block on a programming interface, and the debugging building block is used for outputting an execution result of the original building block;
a target building block generation module 12, configured to generate a target building block according to the debugging building block;
the operation module 13 is used for responding to the operation instruction, converting the target building block into a target source code and then operating the target building block;
the debugging information output module 14 is used for outputting debugging information corresponding to the target building block according to the running result of the target source code;
and the positioning module 15 is used for positioning the original building blocks according to the debugging information.
The specific implementation is shown in the method embodiment, and is not described herein again.
Another embodiment of the present invention provides an electronic device, as shown in fig. 6, an electronic device 10 includes:
one or more processors 110 and a memory 120, where one processor 110 is illustrated in fig. 6, the processor 110 and the memory 120 may be connected by a bus or other means, and fig. 6 illustrates a connection by a bus as an example.
The processor 110 is used to implement various control logic for the electronic device 10, which may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a single chip, an ARM (Acorn RISC machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware controls, or any combination of these components. Also, the processor 110 may be any conventional processor, microprocessor, or state machine. Processor 110 may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The memory 120 is a non-volatile computer-readable storage medium, and can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions corresponding to the code debugging method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the device 10, namely, implements the code debugging method in the above-described method embodiments, by executing the nonvolatile software programs, instructions and units stored in the memory 120.
The memory 120 may include a storage program area and a storage data area, wherein the storage program area may store an application program required for operating the device, at least one function; the storage data area may store data created according to the use of the device 10, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 120 optionally includes memory located remotely from processor 110, which may be connected to device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more units are stored in the memory 120, which when executed by the one or more processors 110, perform the code debugging method in any of the above-described method embodiments, e.g., performing the above-described method steps S101 to S105 in fig. 1.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, for example, to perform method steps S101-S105 of fig. 1 described above.
By way of example, non-volatile storage media can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Synchronous RAM (SRAM), dynamic RAM, (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The disclosed memory controls or memories of the operating environments described herein are intended to comprise one or more of these and/or any other suitable types of memory.
Another embodiment of the invention provides a computer program product comprising a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to perform the code debugging method of the above-described method embodiment. For example, the method steps S101 to S105 in fig. 1 described above are performed.
The above-described embodiments are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that the embodiments may be implemented by software plus a general hardware platform, and may also be implemented by hardware. Based on such understanding, the above technical solutions essentially or contributing to the related art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Conditional language such as "can," "might," or "may" is generally intended to convey that a particular embodiment can include (yet other embodiments do not include) particular features, elements, and/or operations, among others, unless specifically stated otherwise or otherwise understood within the context as used. Thus, such conditional language is also generally intended to imply that features, elements, and/or operations are in any way required for one or more embodiments or that one or more embodiments must include logic for deciding, with or without input or prompting, whether such features, elements, and/or operations are included or are to be performed in any particular embodiment.
What has been described herein in the specification and drawings includes examples that can provide a code debugging method and apparatus. It will, of course, not be possible to describe every conceivable combination of components and/or methodologies for purposes of describing the various features of the disclosure, but it can be appreciated that many further combinations and permutations of the disclosed features are possible. It is therefore evident that various modifications can be made to the disclosure without departing from the scope or spirit thereof. In addition, or in the alternative, other embodiments of the disclosure may be apparent from consideration of the specification and drawings and from practice of the disclosure as presented herein. It is intended that the examples set forth in this specification and the drawings be considered in all respects as illustrative and not restrictive. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.

Claims (10)

1. A code debugging method is applied to a graphical programming platform, the graphical programming platform is provided with a programming interface, and the method comprises the following steps:
responding to a debugging building block adding instruction, adding a preset debugging building block into an original building block, wherein the original building block is a building block combination formed by combining at least one building block on the programming interface, and the debugging building block is used for outputting an execution result of the original building block;
generating a target building block according to the debugging building block;
responding to an operation instruction, converting the target building block into a target source code and then operating;
outputting debugging information corresponding to the target building block according to the running result of the target source code;
and positioning the original building blocks according to the debugging information.
2. The method of claim 1, wherein the graphical programming platform is further provided with a console display interface;
add predetermined debugging building blocks in original building blocks, include:
adding a preset debugging output building block in the original building block, wherein the debugging output building block is used for outputting debugging information on a display interface of the console;
and/or adding a preset error reporting debugging building block in the original building block, wherein the error reporting debugging building block is used for outputting error reporting information on the display interface of the console.
3. The method of claim 2, wherein if the predetermined debugging block is an error-reporting debugging block,
then according to debug information fixes a position the back to debugging building blocks, include:
responding to a trigger instruction of the error reporting information, and displaying an original building block corresponding to the error reporting information on the programming interface;
and acquiring the background of the original building block, and controlling the background to be in a flashing state.
4. The method of claim 3, wherein the obtaining the background of the original building block and controlling the background to be in a flashing state further comprises:
and controlling the background to stop flashing in response to the modification instruction of the original building block.
5. The method according to claim 1 or 2, wherein said positioning said original building block according to said commissioning information comprises:
acquiring a building block identifier and a screen identifier of the original building block according to debugging information;
acquiring the position of the original building block according to the building block identifier and the screen identifier;
calculating the offset of the display area of the current programming interface relative to the position of the building block;
and rolling the offset at the position of the current programming interface to realize the positioning of the original building blocks.
6. The method according to any one of claims 2-5, wherein the graphical programming platform is provided with a console UI component for controlling the console interface to output information;
then, before the operation after the target block is converted into the target source code in response to the operation instruction, the method further includes:
defining a message manager, wherein the message manager is used for managing message types;
subscribing a console UI component as an observer in the message manager;
defining the type of debugging information at the message manager;
and acquiring the debugging information according to the UI component of the control console.
7. The method of claim 6, wherein the setting of the debugging function in the debugging block outputs debugging information corresponding to the target block according to the running result of the target source code, and the method includes:
obtaining a calling result of a debugging function, wherein the calling result comprises building block information and debugging information of a debugging building block;
sending the calling result to the console UI component;
and debugging information is output on the control console display interface through a control console UI component, and the type of the debugging information is self-defined printing information.
8. A code debugging device is applied to a graphical programming platform, the graphical programming platform is provided with a programming interface, and the device comprises:
the debugging building block adding module is used for responding to a debugging building block adding instruction and adding a preset debugging building block into an original building block, wherein the original building block is a building block combination formed by combining at least one building block on the programming interface, and the debugging building block is used for outputting an execution result of the original building block;
the target building block generating module is used for generating a target building block according to the debugging building block;
the operation module is used for responding to an operation instruction, converting the target building block into a target source code and then operating the target building block;
the debugging information output module is used for outputting debugging information corresponding to the target building block according to the running result of the target source code;
and the positioning module is used for positioning the original building blocks according to the debugging information.
9. An electronic device, characterized in that the electronic device comprises at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the code debugging method of any of claims 1-7.
10. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the code debugging method of any of claims 1-7.
CN202110762450.4A 2021-07-06 2021-07-06 Code debugging method and device, electronic equipment and storage medium Pending CN113626308A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110762450.4A CN113626308A (en) 2021-07-06 2021-07-06 Code debugging method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110762450.4A CN113626308A (en) 2021-07-06 2021-07-06 Code debugging method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113626308A true CN113626308A (en) 2021-11-09

Family

ID=78379147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110762450.4A Pending CN113626308A (en) 2021-07-06 2021-07-06 Code debugging method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113626308A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114840198A (en) * 2022-04-18 2022-08-02 北京聪明核桃教育科技有限公司 Function execution method, building block function rewriting method and related equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104102574A (en) * 2013-04-07 2014-10-15 腾讯科技(深圳)有限公司 Method and device for testing application program
CN107590066A (en) * 2016-07-08 2018-01-16 广州市动景计算机科技有限公司 Method of testing, equipment and the programmable device of application program
CN109684224A (en) * 2018-12-29 2019-04-26 深圳点猫科技有限公司 The test method and device of the conversion process of python code and building blocks
CN109710242A (en) * 2018-12-29 2019-05-03 深圳点猫科技有限公司 Exchange method, system and the electronic equipment of web terminal graphic programming
CN110069404A (en) * 2019-03-27 2019-07-30 广东高云半导体科技股份有限公司 Code debugging method, apparatus, equipment and medium
CN111932985A (en) * 2020-08-25 2020-11-13 算法积木(广州)教育投资有限公司 Programming language materialized building block programming system
CN112256570A (en) * 2020-10-19 2021-01-22 网易(杭州)网络有限公司 Remote debugging method, device, equipment and storage medium
CN112558953A (en) * 2020-12-23 2021-03-26 广州密码营地教育科技有限公司 Programming implementation method, device and equipment based on graphical editor
CN112860473A (en) * 2021-04-27 2021-05-28 武汉深之度科技有限公司 Method and device for positioning source code during program operation error and computing equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104102574A (en) * 2013-04-07 2014-10-15 腾讯科技(深圳)有限公司 Method and device for testing application program
CN107590066A (en) * 2016-07-08 2018-01-16 广州市动景计算机科技有限公司 Method of testing, equipment and the programmable device of application program
CN109684224A (en) * 2018-12-29 2019-04-26 深圳点猫科技有限公司 The test method and device of the conversion process of python code and building blocks
CN109710242A (en) * 2018-12-29 2019-05-03 深圳点猫科技有限公司 Exchange method, system and the electronic equipment of web terminal graphic programming
CN110069404A (en) * 2019-03-27 2019-07-30 广东高云半导体科技股份有限公司 Code debugging method, apparatus, equipment and medium
CN111932985A (en) * 2020-08-25 2020-11-13 算法积木(广州)教育投资有限公司 Programming language materialized building block programming system
CN112256570A (en) * 2020-10-19 2021-01-22 网易(杭州)网络有限公司 Remote debugging method, device, equipment and storage medium
CN112558953A (en) * 2020-12-23 2021-03-26 广州密码营地教育科技有限公司 Programming implementation method, device and equipment based on graphical editor
CN112860473A (en) * 2021-04-27 2021-05-28 武汉深之度科技有限公司 Method and device for positioning source code during program operation error and computing equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114840198A (en) * 2022-04-18 2022-08-02 北京聪明核桃教育科技有限公司 Function execution method, building block function rewriting method and related equipment

Similar Documents

Publication Publication Date Title
EP2915047B1 (en) System and method for debugging domain specific languages
US9514026B2 (en) Debugging analysis in running multi-user systems
US20160366248A1 (en) System, method, and device for remotely operating a server
US20100309212A1 (en) Platform agnostic screen capture tool
CN107688529B (en) Component debugging method and device
CN111090431B (en) Data processing method and device
US9792198B2 (en) Debugger with method restart capability
CN113778898B (en) User interface automatic test method and device, electronic equipment and storage medium
KR101416104B1 (en) A dynamic loading apparatus and method of java script code performing native functions of hybrid web applications
CN108664247B (en) Page template data interaction method and device
Stocco et al. PESTO: A tool for migrating DOM-based to visual web tests
KR20220132459A (en) User interface platform developing system and method with design system
JP2019109884A (en) Technique for test automation
CN113626308A (en) Code debugging method and device, electronic equipment and storage medium
US11687326B2 (en) Method and apparatus for data interaction
CN114116443A (en) Page data transmission method, device, system and medium
CN107918587A (en) The adjustment method and system of a kind of application program
CN116974537A (en) Component-based product development method, device, computer equipment and storage medium
CN112433929A (en) Webpage debugging method and device, computer equipment and storage medium
CN113778853A (en) Development and debugging method and device of application program, electronic equipment and storage medium
CN114327416A (en) Interface synchronization method and device applied to development branch and electronic equipment
CN114968751A (en) Program debugging method and program debugging device of code-free development platform
CN109656556B (en) Method and device for generating self-adaptive page
JP2015148925A (en) Program generation device and method
CN104252409A (en) Method and system for obtaining WebApp executing process

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