[go: up one dir, main page]

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

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

Info

Publication number
CN113626308B
CN113626308B CN202110762450.4A CN202110762450A CN113626308B CN 113626308 B CN113626308 B CN 113626308B CN 202110762450 A CN202110762450 A CN 202110762450A CN 113626308 B CN113626308 B CN 113626308B
Authority
CN
China
Prior art keywords
debugging
building block
block
original
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110762450.4A
Other languages
Chinese (zh)
Other versions
CN113626308A (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.)
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/CN113626308B/en
Publication of CN113626308A publication Critical patent/CN113626308A/en
Application granted granted Critical
Publication of CN113626308B publication Critical patent/CN113626308B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/362Debugging of software
    • G06F11/3644Debugging of software by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/362Debugging of software
    • G06F11/3636Debugging of software 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 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: in response 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; the method comprises the steps of generating target building blocks according to debugging building blocks, responding to an operation instruction, converting the target building blocks into target source codes and then operating the target building blocks, outputting debugging information corresponding to the target building blocks according to an operation result of the target source codes, and positioning original building blocks according to the debugging information. According to the embodiment of the invention, after the preset debugging building blocks are added to the original building blocks, the output result of the original building blocks is obtained according to the debugging building blocks, so that a user can conveniently and quickly debug codes in time, and the code debugging efficiency 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, a code debugging device, an electronic device, and a storage medium.
Background
Code debugging is the process of testing the programmed code by manual or compiling the program code before the programmed code is put into actual operation and correcting grammar errors and logic errors. This is an essential step in ensuring the correctness of computer information systems. The computer program code must be entered into a computer for testing. And further diagnosing according to the errors found during the test, and finding out the reasons and specific positions for correction.
In the graphical programming platform in the prior art, programming is realized by dragging building blocks. When the graphical programming platform is used for debugging the building blocks, the building blocks can be debugged only by disconnecting the building block links or using an investigation method. The code debugging method of the existing graphical programming platform is complex in operation, long in time and low in debugging efficiency, and if a plurality of building blocks exist, the building blocks are required to be debugged.
Accordingly, the prior art is still in need of improvement and development.
Disclosure of Invention
In view of the shortcomings of the prior art, the invention provides a code debugging method, a 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, long in time consumption and low in debugging efficiency when a plurality of building blocks exist and are used for realizing debugging.
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:
In response 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 at least one building block combination 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 blocks into target source codes and then operating the target building blocks;
outputting debugging information corresponding to the target building blocks according to the operation result of the target source codes;
and positioning the original building blocks according to the debugging information.
Further, the graphical programming platform is also provided with a console display interface;
the debugging building blocks of interpolation default in original building blocks include:
Adding a preset debugging output building block into the original building block, wherein the debugging output building block is used for outputting debugging information on the display interface of the console;
And/or adding a preset error reporting and debugging building block into the original building block, wherein the error reporting and debugging building block is used for outputting error reporting information on the display interface of the control console.
Further, if the preset debugging building blocks are error reporting debugging building blocks,
After positioning the debugging building blocks according to the debugging information, the method comprises the following steps:
Responding to the triggering instruction of the error reporting information, and displaying the original building blocks corresponding to the error reporting information on the programming interface;
And obtaining the background of the original building block, and controlling the background to be in a flickering state.
Further, the obtaining the background of the original building block, and controlling the background to be in a flashing state, further includes:
and responding to the modification instruction of the original building block, and controlling the background to stop flashing.
Further, the positioning the original building blocks according to the debugging information includes:
obtaining building block identifiers and screen identifiers of the original building blocks according to the debugging information;
According to the building block identification and the screen identification, obtaining the building block position of the original building block;
Calculating the offset of the current programming interface display area relative to the building block position;
And rolling the offset at the current programming interface position 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;
The response to the operation instruction, before the operation after converting the target building block into the target source code, further comprises:
Defining a message manager, wherein the message manager is used for managing the message type;
Subscribing a console UI component in the message manager as a watcher;
defining the type of the scheduling information at the message manager;
And acquiring the debugging information according to the control console UI component.
Further, if a debug function is set in the debug building block, outputting debug information corresponding to the target building block according to an operation result of the target source code, including:
Acquiring 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 call result to the console UI component;
And outputting debugging information on the console display interface through a control console UI component, wherein the type of the debugging information is self-defined printing information.
Another embodiment of the present invention provides a code debugging device applied to a graphical programming platform, where the graphical programming platform is provided with a programming interface, the device includes:
The debugging building block adding module is used for responding to a debugging building block adding instruction and adding preset debugging building blocks into original building blocks, wherein the original building blocks are building block combinations formed by at least one building block combination on the programming interface, and the debugging building blocks are used for outputting execution results of the original building blocks;
The target building block generation module is used for generating target building blocks according to the debugging building blocks;
The operation module is used for responding to an operation instruction, converting the target building blocks into target source codes and then operating the target building blocks;
the debugging information output module is used for outputting the debugging information corresponding to the target building blocks according to the running result of the target source codes;
And the positioning module is used for positioning the original building blocks according to the debugging information.
Another embodiment of the invention provides an electronic device including at least one processor, and
A memory communicatively coupled to the at least one processor, wherein,
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.
Another embodiment of the present invention also provides a non-volatile 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.
The method has the advantages that after the preset debugging building blocks are added to the original building blocks, the output results of the original building blocks are obtained according to the debugging building blocks, convenience is provided for a user to check the output results of the original codes, and the running results of the building blocks are not affected by the debugging building blocks, so that the user can conveniently and quickly debug codes in time, and the debugging efficiency of the codes is improved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flow chart of a code debugging method according to a preferred embodiment of the present invention;
FIG. 2a is a block diagram of a debug output block according to an embodiment of the present invention;
FIG. 2b is a schematic block diagram of a debug building block according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of error reporting information of a specific application embodiment of a code debugging method according to the present invention;
FIG. 4 is a schematic diagram of a click command of error reporting information according to an embodiment of the present invention;
FIG. 5 is a functional block diagram of a code debugging device according to a preferred embodiment of the present invention;
Fig. 6 is a schematic hardware structure of an electronic device according to a preferred embodiment of the invention.
Detailed Description
The present invention will be described in further detail below in order to make the objects, technical solutions and effects of the present invention more clear and distinct. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Embodiments of the present invention are described below with reference to the accompanying drawings.
The 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, refer to fig. 1, and fig. 1 is a flow chart of a preferred embodiment of the code debugging method. As shown in fig. 1, it comprises the steps of:
Step S101, adding preset debugging building blocks in original building blocks in response to a debugging building block adding instruction, wherein the original building blocks are building block combinations formed by at least one building block combination on a programming interface, and the debugging building blocks are used for outputting an execution result of the original building blocks;
specifically, the code debugging method of the embodiment of the invention is realized through a graphical programming platform, wherein the graphical programming platform is a program written with an interface, and the programming language is a standardized communication skill used for sending instructions to a computer to define the computer program. 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. Program language is nested in each building block. The building blocks have various types and correspond to different functions, and each building block is nested with corresponding program languages. 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 corresponding program of the building blocks can be operated.
After receiving the instruction for adding the debugging building blocks of the user, the programming interface adds preset debugging building blocks into the original building blocks. The original building blocks are building block combinations formed by at least one building block combination on a programming interface, and the building block combinations are building blocks with certain functions. The debugging building blocks are building blocks which are predefined by a user and output the execution results of the original building blocks.
The building block adding debugging instruction can be a building block editing instruction set on the graphical programming interface, and a user can drag corresponding building blocks from a building block pool preset on the programming interface to stack the building blocks to generate target building blocks.
Step S102, generating target building blocks according to the debugging building blocks;
In the concrete implementation, after the debugging building blocks are added to the original building blocks, the target building blocks with the debugging information are generated. The debugging building blocks do not influence the output results of the original building blocks, only output the output results of the original building blocks, and users can conveniently check the output results of the original building blocks in real time. Therefore, the target building block can also check the output result of the original building block or debug information in the debugging building block on the basis of the original building block.
Step S103, responding to an operation instruction, converting the target building blocks into target source codes and then operating the target building blocks;
In the implementation, after receiving an operation instruction of a user, the graphical programming platform operates the target building blocks, and in the operation process, the target building blocks need to be converted into target source codes corresponding to the building blocks, and the target source codes are operated.
The running instruction may be a running button of the graphical programming interface or a corresponding picture button. In practical applications, the running instructions may be limited according to requirements, which is not limited in the embodiment of the present invention.
The target source code is a code corresponding to the building blocks combined on the programming interface, and the program language format of the source code is based on the language nested in the building blocks, and can be one of Java, C, PYTHON and other program languages, which is not limited in particular.
Step S104, outputting debugging information corresponding to the target building blocks according to the operation result of the target source codes;
in specific implementation, an operation result of the target source code is obtained, and corresponding debugging information is obtained according to the operation result of the target source code. The debug information of the embodiment of the invention generally refers to user-defined debug information.
The debugging building blocks in the target building blocks comprise debugging information and debugging information output functions, and after the target source codes are operated, the debugging information is output on an interface of the graphical programming platform according to the debugging information output functions.
And step 105, positioning the original building blocks according to the debugging information.
In specific implementation, debugging information is output on the 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 the original building blocks.
In one embodiment, the graphical programming platform is further provided with a console display interface;
adding the debugging building blocks of predetermineeing in original building blocks, include:
adding a preset debugging output building block into the original building block, wherein the debugging output building block is used for outputting debugging information on a console display interface;
And/or adding a preset error reporting and debugging building block into the original building block, wherein the error reporting and debugging building block is used for outputting error reporting information on a display interface of the control console.
In the 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 error reporting debugging building blocks, wherein the debugging output building blocks can output debugging information on the console display interface in the running process of the target source codes. The debug information is typically user-defined debug content. In practical application, the content of the debug may be set as required, which is not limited by the embodiment of the present invention.
The error reporting debugging building blocks can output error reporting information on a display interface of a control console in the running process of the target source codes. Wherein the error reporting information is generally user-defined error reporting content. In practical application, the error reporting content can be set according to the requirement, and the embodiment of the invention is not limited to the setting.
In one embodiment, if the preset debug building block is a debug building block,
After positioning the debugging building blocks according to the debugging information, the method comprises the following steps:
responding to a triggering instruction of the error reporting information, and displaying an original building block corresponding to the error reporting information on a programming interface;
and obtaining the background of the original building block, and controlling the background to be in a flickering state.
When the method is implemented, after a prompt message triggering instruction of a user is received by a console display interface, the original building blocks corresponding to the error message are obtained, the positions of the original building blocks are positioned, and the original building blocks are displayed in a visible area of a programming interface. The prompt message triggering instruction can be prompt message of clicking the console interface by the user, prompt message of clicking the console interface by the user, and prompt message of clicking the console interface by double clicking or prompt message of clicking the console interface by right clicking. In practical application, the prompt message triggering instruction can be set according to the requirement, and the method is not limited.
After the original building blocks are positioned, the background of the original building blocks on the programming interface is obtained, and the background of the original building blocks is controlled to be in a flashing state through JavaScript blink technology, so that a user can conveniently and quickly obtain the positions of the original building blocks on the programming interface. The blink () method is used to display the flashing string. A specific syntax is stringobject.
In practical application, the method for controlling the background flicker of the building blocks can be limited according to requirements, and the embodiment of the invention is not limited to the method.
In one embodiment, if the building block background flashes, 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 responding to the modification instruction of the original building blocks, and controlling the background to stop flashing.
When the programming page detects the modification instruction of the user to the original building blocks, the user is judged to have actually positioned the positions of the original building blocks, the background of the original building blocks is controlled to stop flashing, the modification instruction is detected to indicate the user to have received the building blocks with errors, the positions of the error building blocks are determined, the debugging errors of the building blocks are realized, the background flashing is stopped at the moment, and preparation is made for the next user to modify and debug.
In one embodiment, locating the original building block according to the commissioning information includes:
Obtaining building block identifications and screen identifications of original building blocks according to the debugging information;
according to the building block identification and the screen identification, obtaining the building block position of the original building block;
Calculating the offset of the current programming interface display area relative to the building block position;
And rolling the offset at the current programming interface position to realize the positioning of the original building blocks.
When the method is implemented, the debugging information carries building block ID (identity) and screen ID, the building block ID and screen ID of the original building block are obtained according to the debugging information, then the position of the current building block is obtained according to the building block ID and the screen ID, the offset of the current visible area relative to the position of the building block is calculated, and the offset is rolled at the position of the current building block working area, so that the positioning of the building block is realized. In the embodiment of the invention, the building block ID is used for marking the building blocks, each building block is provided with a corresponding building block ID in the original building blocks, the building block ID is unique, and the corresponding building blocks 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 positioned through the screen ID, and then the position of the building block is acquired from the positioned screen position through the building block ID. The position of the original building block in the programming area is obtained through the building block ID and the screen ID, and the original building block positioned in the screen is displayed through the rolling offset, so that the position of the original building block is quickly positioned, and convenience is provided for a user to check error information of the building block.
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;
Then, in response to the operation instruction, before the operation after the target building block is converted into the target source code, the method further comprises:
defining a message manager for managing the message types;
Subscribing the console UI component in the message manager as a watcher;
Defining the type of the debug information at the message manager;
and acquiring debugging information according to the UI component of the control console.
In particular, a message manager is defined, wherein the message manager is responsible for defining message types and reading, writing, and sending messages, and is a console manager, including but not limited to consoleManager, and in some other embodiments, the console file manager ranger may also be used to implement file management, as the embodiments of the invention are not limited in this respect. Subscribing the UI component of the control console as an observer, outputting a type corresponding to 'debug information' at the control console, wherein the type corresponding to the output debug information comprises but is not limited to a confole manager log, other types corresponding to the output debug information can be adopted in other embodiments, the invention is not limited to the type corresponding to the error reporting 'at the control console, and the type corresponding to the error reporting' at the control console comprises but is not limited to a confole manager. In some other embodiments, other manners may be used to output the type corresponding to the error reporting information, which is not limited by the embodiment of the present invention.
Where Console is a Console window enhancement where the Console is Windows. The console functions include a plurality of labels, 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. Debug 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 control console UI component can acquire the debugging information, and a user can conveniently check the debugging information in the UI component.
In one embodiment, if a debug function is set in the debug building block, outputting debug information corresponding to the target building block according to an operation result of the target source code, including:
acquiring a calling result of the debugging function, wherein the calling result comprises building block information and debugging information of the debugging building block;
Sending the calling result to a control console UI component;
And outputting debugging information on a console display interface through a control console UI component, wherein the type of the debugging information is self-defined printing information.
In particular, when a user clicks on an operation code, the method of converting the building block logic into the code logic includes, but is not limited to, converting the building block logic into the code logic through a JavascriptGenerator library of Blink, and in some other embodiments, other manners of converting the building block logic into the code may be used, which embodiments of the present invention are not limited in this respect. The 'debugging information' output from the console is converted into function codes with current building block information and user-defined printing information. The ' error reporting information ' reported by the control console ' block will be converted into function codes with the current block information and user-defined error reporting information.
When the function is called, the building block information and the user-defined printing message are sent out, and the sending mode includes but is not limited to sending out through a confole manager. The method uses a design mode of a viewer, wherein the viewer is defined in a console UI component in advance, and the viewer can be captured by the viewer (console) when the message is pushed, so that business logic is realized according to the captured information.
The Blink contains a main thread, multiple Worker threads, and some other threads. Almost all important work runs on the main thread. Including running JavaScript (except Workers), DOM generation, CSS style and layout computation, etc., the optimization of interaction performance is primarily around the main thread. Blink creates a separate thread for Web workers, service workers. Although JavaScript is running, the running environments of the main thread and the worker thread are not shared, and data needs to be transferred through messages.
The JavascriptGenerator library is a generator that is some code that runs inside the function, javascriptGenerator library pauses itself after the value is returned, and the caller may ask to cancel the pause and return another value. This "return" is not a traditional slave function return. It is given a special name-yieldd. The generator grammar varies from language to language. The producer syntax of Javascript is similar to PHP.
In javascript, if a producer is desired, it is necessary to define a special producer function, call the function to create a producer object, use the producer object in a loop, or call its next method directly.
PushMessageData is an interface of Push API, which provides some means to get you to get Push data sent by the server in various formats. The method of the interface may be invoked multiple times. The message received by the Push API is encrypted and sent by the Push service, then automatically decrypted by the browser, and then can be accessed by the PushMessageData interface method. According to the embodiment of the invention, the debugging information can be output through the control console display interface, and the user-defined printing information can be adopted for the debugging information, so that the user can conveniently check whether the debugging of the building block is normal or not, and the user can conveniently check the debugging result of the building block.
In one embodiment, the technical scheme adopted by the embodiment of the invention is that a Javascript, HTML language is used for referring to BlinkJS libraries. And adding debugging building blocks through BlinkJS libraries. Defining two kinds of building blocks to output debugging information and error reporting information at a control console, wherein as shown in fig. 2a, fig. 2a is a schematic diagram of a building block pattern of the debugging output building block for outputting the debugging information at the control console, as shown in fig. 2b, fig. 2b is a schematic diagram of the error reporting debugging building block for reporting the error reporting information at the control console, a user selectively splices any building block above the spliced building blocks, and when a code runs to the position, corresponding information is output at the control console.
Wherein 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 composed of HTML commands that can specify words, graphics, animations, sounds, tables, links, etc.
As shown in FIG. 3, the debugging output building block and the debugging trial building block are added in the original building block at the same time. When a user splices the original building blocks, debugs the output building blocks and debugs the debugging building blocks, clicking operation is performed, the control console is popped up, and user-defined debugging information appears.
As shown in fig. 4, when the user clicks on the error message, the blocks are defined to the visible area and the background of the blocks blinks. When the user modifies the building block, the flickering effect disappears.
In practice, a message manager consoleManager is defined and is responsible for defining message types and reading, writing, and messaging;
subscribing the console UI component as a watcher;
"output 'debug information" at console "and" report error' report error information "at console correspond to two types of confole manager. Log and confole manager. Customerror respectively;
When a user clicks the running code, the building block logic is converted into code logic through a JavascriptGenerator library of Blink, wherein the building block with 'debugging information' output on a console is converted into a function code with current building block information and user-defined printing information. The ' error reporting information ' reported by the control console ' block will be converted into function codes with the current block information and user-defined error reporting information.
When the function is called, building block information and user-defined printing information are sent out through a confeleManager. Pushmessage, the method uses a design mode of an observer, wherein the observer is defined in advance in a control console UI component, and when pushMessage, the function is captured by the observer (control console), so that business logic is realized according to the captured information.
After the debugging information is successfully reported to the console, the information carries the building block ID and the ID of the screen, then the position of the current building block is obtained according to the building block ID, the offset of the current visible area relative to the position of the building block is calculated, and the offset is rolled at the position of the current building block working area. Thereby realizing the positioning of building blocks.
The embodiment of the invention can help the user to timely and quickly debug the code and output information in the console so as to quickly help the user to find more efficient development projects and improve the code debugging efficiency.
It should be noted that, there is not necessarily a certain sequence between the steps, and those skilled in the art will understand that, in different embodiments, the steps may be performed in different orders, that is, may be performed in parallel, may be performed interchangeably, or the like.
Another embodiment of the present invention provides a code debugging device, applied to a graphical programming platform, where the graphical programming platform is provided with a programming interface, as shown in fig. 5, the device 1 includes:
The debugging building block adding module 11 is used for adding preset debugging building blocks in the original building blocks in response to the debugging building block adding instruction, wherein the original building blocks are building block combinations formed by at least one building block combination on a programming interface, and the debugging building blocks are used for outputting an execution result of the original building blocks;
The target building block generating module 12 is used for generating target building blocks according to the debugging building blocks;
The operation module 13 is used for responding to the operation instruction, converting the target building blocks into target source codes and then operating;
The debug information output module 14 is used for outputting debug information corresponding to the target building blocks according to the operation result of the target source codes;
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 will not be described herein.
Another embodiment of the present invention provides an electronic device, as shown in fig. 6, the electronic device 10 includes:
One or more processors 110 and a memory 120, one processor 110 being illustrated in fig. 6, the processors 110 and the memory 120 being coupled via a bus or other means, the bus coupling being illustrated in fig. 6.
Processor 110 is configured to implement various control logic for 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 microcomputer, 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. The 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 used as a non-volatile computer readable storage medium for storing 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 performs various functional applications of the device 10 and data processing, i.e., implements the code debugging method in the above-described method embodiments, by running non-volatile software programs, instructions, and units stored in the memory 120.
The memory 120 may include a storage program area that may store operating means, application programs required for at least one function, and a storage data area that may store data created according to the use of the device 10, etc. In addition, 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 may optionally include 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 memory 120 that, when executed by one or more processors 110, perform the code debugging method in any of the method embodiments described above, e.g., perform method steps S101 through S105 in fig. 1 described above.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, e.g., to perform the method steps S101 through S105 of fig. 1 described above.
By way of example, nonvolatile 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 may be 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 environment described herein are intended to comprise one or more of these and/or any other suitable types of memory.
Another embodiment of the present invention provides a computer program product comprising a computer program stored on a non-transitory 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 method embodiment described above. For example, the above-described method steps S101 to S105 in fig. 1 are performed.
The embodiments described above are merely illustrative, wherein elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
From the above description of embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus a general purpose hardware platform, or may be implemented by hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the related art in the form of a software product, which may exist in a computer-readable storage medium such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method of the respective embodiments or some parts of the embodiments.
Conditional language such as "capable," "energy," "possible," or "may," among others, is generally intended to convey that a particular embodiment can include (but other embodiments do not include) particular features, elements, and/or operations 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 these 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 are capable of providing code debugging methods and apparatus. It is, of course, not possible to describe every conceivable combination of components and/or methodologies for purposes of describing the various features of the present disclosure, but it may be appreciated that many further combinations and permutations of the disclosed features are possible. It is therefore evident that various modifications may be made thereto without departing from the scope or spirit of the disclosure. Further, or in the alternative, other embodiments of the disclosure may be apparent from consideration of the specification and drawings, and practice of the disclosure as presented herein. It is intended that the examples set forth in this specification and figures be considered illustrative in all respects as illustrative and not limiting. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.

Claims (6)

1.一种代码调试方法,其特征在于,应用于图形化编程平台,所述图形化编程平台设置有编程界面,所述方法包括:1. A code debugging method, characterized in that it is applied to a graphical programming platform, wherein the graphical programming platform is provided with a programming interface, and the method comprises: 响应于调试积木添加指令,在原始积木中添加预设的调试积木,所述原始积木为所述编程界面上由至少一个积木组合成的积木组合,所述调试积木用于输出所述原始积木的执行结果;In response to a debugging block adding instruction, adding a preset debugging block to the original blocks, the original blocks being a block combination formed by at least one block on the programming interface, and the debugging block being used to output the execution result of the original blocks; 在所述原始积木添加所述调试积木后,根据所述调试积木生成具备调试信息的目标积木;After the debugging block is added to the original block, a target block with debugging information is generated according to the debugging block; 响应于运行指令,将所述目标积木转化为目标源代码后运行;In response to the execution instruction, the target building block is converted into a target source code and then executed; 根据所述目标源代码的运行结果,输出所述目标积木对应的调试信息;Outputting debugging information corresponding to the target building block according to the running result of the target source code; 根据所述调试信息对所述原始积木进行定位;Positioning the original building block according to the debugging information; 所述图形化编程平台还设置有控制台显示界面;The graphical programming platform is also provided with a console display interface; 所述在原始积木中添加预设的调试积木,包括:The step of adding a preset debugging building block to the original building block includes: 在所述原始积木中添加预设的调试输出积木,所述调试输出积木用于在所述控制台显示界面输出调试信息;Add a preset debug output building block to the original building block, where the debug output building block is used to output debug information on the console display interface; 和在所述原始积木中添加预设的报错调试积木,所述报错调试积木用于在所述控制台显示界面输出报错信息;and adding a preset error debugging block to the original building block, the error debugging block is used to output error information on the console display interface; 若所述预设的调试积木为报错调试积木,If the preset debugging block is an error debugging block, 则根据所述调试信息对原始积木进行定位后,包括:After locating the original building block according to the debugging information, the following steps are performed: 响应于所述报错信息的触发指令,在所述编程界面上显示所述报错信息对应的原始积木;In response to a trigger instruction of the error message, displaying an original building block corresponding to the error message on the programming interface; 获取所述原始积木的背景,控制所述背景处于闪烁状态;Obtain the background of the original building block and control the background to be in a flashing state; 所述获取所述原始积木的背景,控制所述背景处于闪烁状态后,还包括:After obtaining the background of the original building block and controlling the background to be in a flashing state, the method further includes: 响应于所述原始积木的修改指令,则控制所述背景停止闪烁;In response to the modification instruction of the original building block, controlling the background to stop flashing; 所述根据所述调试信息对所述原始积木进行定位,包括:The positioning of the original building block according to the debugging information includes: 根据调试信息获取所述原始积木的积木标识和屏幕标识;Acquire a block identifier and a screen identifier of the original block according to the debugging information; 根据所述积木标识和屏幕标识,获取所述原始积木所在的积木位置;According to the building block identifier and the screen identifier, obtaining the building block position where the original building block is located; 计算出当前编程界面显示区域相对于积木位置的偏移量;Calculate the offset of the current programming interface display area relative to the block position; 在当前编程界面位置滚动偏移量,实现原始积木定位。Scroll the offset at the current programming interface position to achieve the original block positioning. 2.根据权利要求1所述的方法,其特征在于,所述图形化编程平台设置有控制台UI组件,所述控制台UI组件用于控制所述控制台显示界面输出信息;2. The method according to claim 1, characterized in that the graphical programming platform is provided with a console UI component, and the console UI component is used to control the console display interface to output information; 则所述响应于运行指令,将所述目标积木转化为目标源代码后运行前,还包括:Then, in response to the running instruction, converting the target building block into the target source code before running the target building block further includes: 定义一消息管理器,所述消息管理器用于对消息类型进行管理;A message manager is defined, wherein the message manager is used to manage message types; 在所述消息管理器中将控制台UI组件订阅为一观察者;Subscribe the console UI component as an observer in the message manager; 在所述消息管理器对调试信息的类型进行定义;Defining the type of debugging information in the message manager; 根据控制台UI组件获取所述调试信息。The debugging information is obtained according to the console UI component. 3.根据权利要求2所述的方法,其特征在于,所述调试积木中设置有调试函数,则根据所述目标源代码的运行结果,输出所述目标积木对应的调试信息,包括:3. The method according to claim 2, characterized in that the debugging building block is provided with a debugging function, and then outputting the debugging information corresponding to the target building block according to the running result of the target source code, comprising: 获取调试函数的调用结果,所述调用结果包括调试积木的积木信息和调试信息;Obtaining a call result of a debugging function, wherein the call result includes the building block information and debugging information of the debugging building block; 将所述调用结果发送至所述控制台UI组件;Send the call result to the console UI component; 通过控件台UI组件在所述控制台显示界面输出调试信息,所述调试信息的类型为自定义的打印信息。The debugging information is output on the console display interface through the control console UI component, and the type of the debugging information is customized printing information. 4.一种代码调试装置,其特征在于,应用于图形化编程平台,所述图形化编程平台设置有编程界面,所述装置包括:4. A code debugging device, characterized in that it is applied to a graphical programming platform, the graphical programming platform is provided with a programming interface, and the device comprises: 调试积木添加模块,用于响应于调试积木添加指令,在原始积木中添加预设的调试积木,所述原始积木为所述编程界面上由至少一个积木组合成的积木组合,所述调试积木用于输出所述原始积木的执行结果;A debugging block adding module, configured to add a preset debugging block to an original block in response to a debugging block adding instruction, wherein the original block is a block combination composed of at least one block on the programming interface, and the debugging block is used to output an execution result of the original block; 目标积木生成模块,用于在所述原始积木添加所述调试积木后,根据所述调试积木生成具备调试信息的目标积木;A target building block generation module, configured to generate a target building block with debugging information according to the debugging building block after the debugging building block is added to the original building block; 运行模块,用于响应于运行指令,将所述目标积木转化为目标源代码后运行;An operation module, used for converting the target building block into a target source code and then executing the target source code in response to the operation instruction; 调试信息输出模块,用于根据所述目标源代码的运行结果,输出所述目标积木对应的调试信息;A debugging information output module, used to output debugging information corresponding to the target building block according to the running result of the target source code; 定位模块,用于根据所述调试信息对所述原始积木进行定位;A positioning module, used for positioning the original building block according to the debugging information; 所述图形化编程平台还设置有控制台显示界面;The graphical programming platform is also provided with a console display interface; 所述在原始积木中添加预设的调试积木,包括:The step of adding a preset debugging building block to the original building block includes: 在所述原始积木中添加预设的调试输出积木,所述调试输出积木用于在所述控制台显示界面输出调试信息;Add a preset debug output building block to the original building block, where the debug output building block is used to output debug information on the console display interface; 和在所述原始积木中添加预设的报错调试积木,所述报错调试积木用于在所述控制台显示界面输出报错信息;and adding a preset error debugging block to the original building block, the error debugging block is used to output error information on the console display interface; 若所述预设的调试积木为报错调试积木,If the preset debugging block is an error debugging block, 则根据所述调试信息对原始积木进行定位后,包括:After locating the original building block according to the debugging information, the following steps are performed: 响应于所述报错信息的触发指令,在所述编程界面上显示所述报错信息对应的原始积木;In response to a trigger instruction of the error message, displaying an original building block corresponding to the error message on the programming interface; 获取所述原始积木的背景,控制所述背景处于闪烁状态;Obtain the background of the original building block and control the background to be in a flashing state; 所述获取所述原始积木的背景,控制所述背景处于闪烁状态后,还包括:After obtaining the background of the original building block and controlling the background to be in a flashing state, the method further includes: 响应于所述原始积木的修改指令,则控制所述背景停止闪烁;In response to the modification instruction of the original building block, controlling the background to stop flashing; 所述根据所述调试信息对所述原始积木进行定位,包括:The positioning of the original building block according to the debugging information includes: 根据调试信息获取所述原始积木的积木标识和屏幕标识;Acquire a block identifier and a screen identifier of the original block according to the debugging information; 根据所述积木标识和屏幕标识,获取所述原始积木所在的积木位置;According to the building block identifier and the screen identifier, obtaining the building block position where the original building block is located; 计算出当前编程界面显示区域相对于积木位置的偏移量;Calculate the offset of the current programming interface display area relative to the block position; 在当前编程界面位置滚动偏移量,实现原始积木定位。Scroll the offset at the current programming interface position to achieve the original block positioning. 5.一种电子设备,其特征在于,所述电子设备包括至少一个处理器;以及,5. An electronic device, characterized in that the electronic device comprises at least one processor; and 与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein, 所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1至3任一项所述的代码调试方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the code debugging method according to any one of claims 1 to 3. 6.一种非易失性计算机可读存储介质,其特征在于,所述非易失性计算机可读存储介质存储有计算机可执行指令,该计算机可执行指令被一个或多个处理器执行时,可使得所述一个或多个处理器执行权利要求1至3任一项所述的代码调试方法。6. A non-volatile computer-readable storage medium, characterized in that the non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the code debugging method described in any one of claims 1 to 3.
CN202110762450.4A 2021-07-06 2021-07-06 Code debugging method, device, electronic device and storage medium Active CN113626308B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN113626308A CN113626308A (en) 2021-11-09
CN113626308B true CN113626308B (en) 2024-12-10

Family

ID=78379147

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN113626308B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114153439A (en) * 2021-11-22 2022-03-08 上海维恩孛特信息技术有限公司 Building block programming method and system, storage medium and computing equipment
CN114138253A (en) * 2021-11-27 2022-03-04 深圳市优必选科技股份有限公司 Test feedback method, device, equipment and storage medium of graphical programming code
CN114840198B (en) * 2022-04-18 2023-04-28 北京聪明核桃教育科技有限公司 Function execution method, building block function rewriting method and related equipment
CN118012407B (en) * 2024-01-03 2024-09-27 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6957421B2 (en) * 2001-01-26 2005-10-18 Hewlett-Packard Development Company, L.P. Providing debugging capability for program instrumented code
CN104102574B (en) * 2013-04-07 2017-12-26 腾讯科技(深圳)有限公司 Applied program testing method and device
US9852045B2 (en) * 2015-10-13 2017-12-26 International Business Machines Corporation Debugging program code
CN107590066A (en) * 2016-07-08 2018-01-16 广州市动景计算机科技有限公司 Method of testing, equipment and the programmable device of application program
CN109684224B (en) * 2018-12-29 2020-12-22 深圳点猫科技有限公司 Method and device for testing conversion process of python code and building block
WO2020220184A1 (en) * 2019-04-29 2020-11-05 深圳市大疆创新科技有限公司 Visual programming control apparatus, programmable control device and control method therefor, computer readable storage medium, and programming control system
CN110362299B (en) * 2019-06-14 2020-06-26 杭州古德微机器人有限公司 Online graphical programming system based on block and raspberry pie and using method thereof
CN111475151B (en) * 2020-04-10 2021-10-15 腾讯科技(深圳)有限公司 Modular programming method and related device
CN111932985A (en) * 2020-08-25 2020-11-13 算法积木(广州)教育投资有限公司 Programming language materialized building block programming system
CN112256570B (en) * 2020-10-19 2023-08-11 网易(杭州)网络有限公司 Remote debugging method, device, equipment and storage medium
CN112463139B (en) * 2020-11-23 2024-04-02 乐聚(深圳)机器人技术有限公司 Programming method and device based on electronic building blocks, electronic equipment and storage medium
CN112558953A (en) * 2020-12-23 2021-03-26 广州密码营地教育科技有限公司 Programming implementation method, device and equipment based on graphical editor
CN113342563B (en) * 2021-04-27 2024-07-19 武汉深之度科技有限公司 Method and device for positioning source code during program running error and computing equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN113626308A (en) 2021-11-09

Similar Documents

Publication Publication Date Title
CN113626308B (en) Code debugging method, device, electronic device and storage medium
CN111241454B (en) Method, system and device for generating webpage codes
CN108319547B (en) Test case generation method, device and system
US9183113B2 (en) Debugging analysis in running multi-user systems
CN113778405A (en) Cross-platform APP construction method, device, system and medium
US20160366248A1 (en) System, method, and device for remotely operating a server
CN111176629A (en) Application development method and device
CN104756086A (en) System and method for debugging domain specific languages
CN114329297A (en) Content management system, static page management method, device and storage medium
CN110134600A (en) Test script recording method, device and storage medium
CN114116443B (en) A page data transmission method, device, system and medium
US20060265469A1 (en) XML based scripting framework, and methods of providing automated interactions with remote systems
US20190052542A1 (en) System and method for providing visualizations of computing infrastructure using a domain-specific language for cloud services infrastructure
KR20220132459A (en) User interface platform integrated development system and method with design system
CN107193570A (en) A kind of method and system for automatically generating API documents
CN112506492A (en) Visual point burying method supporting dynamic scene configuration
CN111596913A (en) Visual component framework arrangement method and device
CN117075858A (en) Scene development method, system, equipment and storage medium based on Internet of things platform
WO2020039900A1 (en) Information processing apparatus and program
US11687326B2 (en) Method and apparatus for data interaction
US10929121B2 (en) Method, device and related system for dynamically repairing application
JP6097231B2 (en) Program generating apparatus and method
CN115905020A (en) Application testing method and device, electronic equipment and storage medium
CN116909553A (en) Page online development and local compiling operation system
CN115293122A (en) H5 data template processing method, device and device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant