Code debugging method, device, electronic device and storage medium

By adding debug building blocks to the programming interface of the graphical programming platform and generating target building blocks, the problems of complex and low efficiency of code debugging in the existing technology are solved, and quick positioning and viewing debugging information is achieved, and code debugging efficiency is improved.

CN113626308BActive Publication Date: 2024-12-10SHENZHEN DIANMAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110762450.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-06
Publication Date
2024-12-10
Estimated Expiration
2041-07-06

Smart Images

  • Figure CN113626308B_ABST
    Figure CN113626308B_ABST
Patent Text Reader

Abstract

The present invention discloses a code debugging method, device, electronic device and 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: in response to a debugging block adding instruction, adding a preset debugging block to an original block, 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 the execution result of the original block; generating a target block according to the debugging block; in response to a running instruction, converting the target block into a target source code and then running it; outputting debugging information corresponding to the target block according to the running result of the target source code; and locating the original block according to the debugging information. The embodiment of the present invention obtains the output result of the original block according to the debugging block after adding the preset debugging block to the original block, thereby facilitating the user to debug the code in a timely and fast manner and improving the debugging efficiency of the code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a code debugging method, device, electronic equipment and storage medium. Background Art

[0002] Code debugging is the process of testing and correcting syntax errors and logic errors by manual or compiled program code before putting the compiled program code into actual operation. This is an essential step to ensure the correctness of computer information systems. After the computer program code is compiled, it must be sent to the computer for testing. According to the errors found during the test, further diagnosis is carried out to find out the cause and specific location for correction.

[0003] In the prior art graphical programming platform, programming is achieved by dragging blocks. When debugging blocks on the graphical programming platform, the blocks can only be debugged by disconnecting the block link or using the troubleshooting method. The code debugging method of the existing graphical programming platform is complicated to operate. If there are multiple blocks, it takes a long time to debug the blocks, and the debugging efficiency is low.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a code debugging method, device, electronic device and storage medium, aiming to solve the problems that the code debugging method of the existing graphical programming platform is complicated to operate, if there are multiple building blocks, it takes a long time to debug the building blocks, and the debugging efficiency is low.

[0006] The technical solution of the present invention is as follows:

[0007] A first embodiment of the present 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:

[0008] 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;

[0009] Generate a target product according to the debugging building block;

[0010] In response to the execution instruction, the target building block is converted into a target source code and then executed;

[0011] Outputting debugging information corresponding to the target building block according to the running result of the target source code;

[0012] The original building block is positioned according to the debugging information.

[0013] Furthermore, the graphical programming platform is also provided with a console display interface;

[0014] The step of adding a preset debugging building block to the original building block includes:

[0015] 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;

[0016] And / or, a preset error reporting and debugging building block is added to the original building block, and the error reporting and debugging building block is used to output error information on the console display interface.

[0017] Furthermore, if the preset debugging building block is an error debugging building block,

[0018] After locating the debugging building block according to the debugging information, the following steps are performed:

[0019] In response to a trigger instruction of the error message, displaying an original building block corresponding to the error message on the programming interface;

[0020] The background of the original building block is obtained, and the background is controlled to be in a flashing state.

[0021] Furthermore, after obtaining the background of the original building block and controlling the background to be in a flashing state, the method further includes:

[0022] In response to the modification instruction of the original building block, the background is controlled to stop flashing.

[0023] Further, positioning the original building block according to the debugging information includes:

[0024] Acquire a block identifier and a screen identifier of the original block according to the debugging information;

[0025] According to the building block identifier and the screen identifier, obtaining the building block position where the original building block is located;

[0026] Calculate the offset of the current programming interface display area relative to the block position;

[0027] Scroll the offset at the current programming interface position to achieve the original block positioning.

[0028] Furthermore, the graphical programming platform is provided with a console UI (user interface) component, and the console UI component is used to control the console interface output information;

[0029] 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:

[0030] A message manager is defined, wherein the message manager is used to manage message types;

[0031] Subscribe the console UI component as an observer in the message manager;

[0032] Defining the type of debugging information in the message manager;

[0033] The debugging information is obtained according to the console UI component.

[0034] Furthermore, the debugging block is provided with a debugging function, and according to the running result of the target source code, the debugging information corresponding to the target block is output, including:

[0035] 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;

[0036] Send the call result to the console UI component;

[0037] 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.

[0038] Another embodiment of the present invention provides a code debugging device, which is applied to a graphical programming platform, wherein the graphical programming platform is provided with a programming interface, and the device comprises:

[0039] 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;

[0040] A target building block generation module, used to generate a target building block according to the debugging building block;

[0041] 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;

[0042] 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;

[0043] A positioning module is used to position the original building block according to the debugging information.

[0044] Another embodiment of the present invention provides an electronic device, the electronic device comprising at least one processor; and,

[0045] a memory communicatively connected to the at least one processor; wherein,

[0046] 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 above-mentioned code debugging method.

[0047] Another embodiment of the present invention further provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned code debugging method.

[0048] Beneficial effect: The embodiment of the present invention provides convenience for users to view the output results of original codes by adding preset debugging blocks to the original blocks and obtaining the output results of the original blocks according to the debugging blocks. Moreover, the debugging blocks do not affect the running results of the blocks, thereby facilitating users to debug codes in a timely and fast manner and improving the debugging efficiency of codes. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0050] Figure 1 A flowchart of a preferred embodiment of a code debugging method of the present invention;

[0051] Figure 2a A schematic diagram of a building block style of a debugging output building block of a specific application embodiment of a code debugging method of the present invention;

[0052] Figure 2b A schematic diagram of a building block style of an error reporting debugging building block in a specific application embodiment of a code debugging method of the present invention;

[0053] Figure 3 A schematic diagram of error information of a specific application embodiment of a code debugging method of the present invention;

[0054] Figure 4 A schematic diagram of click instructions for error information in a specific application embodiment of a code debugging method of the present invention;

[0055] Figure 5 A schematic diagram of functional modules of a preferred embodiment of a code debugging device of the present invention;

[0056] Figure 6 The figure is a schematic diagram of the hardware structure of a preferred embodiment of an electronic device of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0058] The embodiments of the present invention are described below with reference to the accompanying drawings.

[0059] The embodiment of the present invention provides a code debugging method, which is applied to a graphical programming platform. The graphical programming platform is provided with a programming interface. Figure 1 , Figure 1 FIG. 1 is a flow chart of a preferred embodiment of a code debugging method of the present invention. Figure 1 As shown, it includes the steps of:

[0060] Step S101, in response to a debugging block adding instruction, adding a preset debugging block to the original blocks, the original block being a block combination composed of at least one block on the programming interface, and the debugging block being used to output the execution result of the original block;

[0061] Specifically, the code debugging method of the embodiment of the present invention is implemented through a graphical programming platform, which is a program with an interface. The programming language is a standardized communication skill used to issue instructions to the computer and define the computer program. Graphical programming can be used to perform good page layout. In many existing web applications, the page layout of the application program often requires the use of images, which can make the overall effect of the page more user-friendly.

[0062] The graphical programming platform in the embodiment of the present invention realizes programming through the combination of building blocks. A programming language is embedded in each building block. There are multiple types of building blocks corresponding to different functions, and each building block is embedded with a corresponding programming language. The graphical programming platform is provided with a programming interface. After dragging the building blocks on the programming interface, the building blocks are stacked to achieve a certain function. After the building blocks on the programming interface are stacked, the program corresponding to the building blocks can be run.

[0063] After receiving the debugging block adding instruction from the user, the programming interface adds the preset debugging block to the original block. The original block is a block combination composed of at least one block on the programming interface, and the block combination is a block with certain functions. The debugging block is a block pre-defined by the user to output the execution result of the original block.

[0064] The debugging block adding instruction may be a block editing instruction set on a graphical programming interface. The user may generate a target block by dragging a corresponding block from a preset block pool on the programming interface to the programming interface for stacking.

[0065] Step S102, generating a target building block according to the debugging building block;

[0066] In specific implementation, after adding the debugging block to the original block, a target block with debugging information is generated. The debugging block does not affect the output result of the original block, but only outputs the output result of the original block, so that users can view the output result of the original block in real time. Therefore, the target block is based on the original block, and you can also view the output result of the original block or the debugging information in the debugging block.

[0067] Step S103, in response to the running instruction, converting the target building block into the target source code and then running it;

[0068] In specific implementation, after receiving the user's running instruction, the graphical programming platform runs the target building block. During the running process, the target building block needs to be converted into the target source code corresponding to the building block, and the target source code is run.

[0069] The operation instruction can be a run button of a graphical programming interface or a picture button corresponding to the operation. In practical applications, the operation instruction can be restricted according to requirements, and the embodiment of the present invention does not limit this.

[0070] The target source code refers to the code corresponding to the building blocks combined on the programming interface. The programming language format of the source code is based on the language embedded in the building blocks. It can be one of the programming languages ​​such as Java, C, PYTHON, etc., and is not limited here.

[0071] Step S104: output debugging information corresponding to the target building block according to the running result of the target source code;

[0072] In specific implementation, the running result of the target source code is obtained, and the corresponding debugging information is obtained according to the running result of the target source code. The debugging information in the embodiment of the present invention generally refers to the debugging information defined by the user.

[0073] The debugging building block in the target building block includes debugging information and a debugging information output function. After the target source code is run, the debugging information is output on the interface of the graphical programming platform according to the debugging information output function.

[0074] Step S105: Position the original building block according to the debugging information.

[0075] In specific implementation, debugging information is output on the interface of the graphical programming platform, and the original building block can be located through the debugging information. Specifically, the location of the original building block can be marked in the debugging information, so that the user can locate the original building block conveniently. Alternatively, the user can click on the debugging information to directly locate the original building block.

[0076] In one embodiment, the graphical programming platform is further provided with a console display interface;

[0077] Add preset debugging blocks to the original blocks, including:

[0078] Add a preset debug output block to the original block. The debug output block is used to output debug information on the console display interface.

[0079] And / or, a preset error reporting and debugging building block is added to the original building block, and the error reporting and debugging building block is used to output error information on the console display interface.

[0080] In specific implementation, a console display interface is also provided in the graphical programming platform, and the debugging blocks may be debugging output blocks and / or error debugging blocks; wherein the debugging output blocks will output debugging information on the console display interface during the operation of the target source code. The debugging information is generally user-defined debugging content. In actual application, the debugging content may be set as required, and the embodiment of the present invention does not limit this.

[0081] During the operation of the target source code, the error debugging block will output error information on the console display interface. The error information is generally user-defined error content. In actual application, the error content can be set as needed, and the embodiment of the present invention does not limit this.

[0082] In one embodiment, if the preset debugging block is an error debugging block,

[0083] After locating the debugging block according to the debugging information, it includes:

[0084] In response to the triggering instruction of the error message, the original building block corresponding to the error message is displayed on the programming interface;

[0085] Get the background of the original building block and control the background to be in a flashing state.

[0086] In specific implementation, after receiving the prompt information trigger instruction from the user, the console display interface obtains the original building block corresponding to the error message, locates the position of the original building block, and displays the original building block in the visible area of ​​the programming interface. The prompt information trigger instruction can be the prompt information of the user clicking on the console interface, the prompt information of the console interface can be single-clicked, the prompt information of the console interface can be double-clicked, or the prompt information of the console interface can be right-clicked. In actual applications, the prompt information trigger instruction can be set as needed, and there is no restriction here.

[0087] After locating the original block, get the background of the original block in the programming interface. Use JavaScript blink technology to control the background of the original block to blink, so that users can quickly get the location of the original block in the programming interface. The blink() method is used to display a blinking string. The specific syntax is stringObject.blink().

[0088] In actual application, the method of controlling the flashing of the building block background can be limited according to requirements, and the embodiment of the present invention does not limit this.

[0089] In one embodiment, if the background of the building blocks is flashing, the background of the original building blocks is obtained, and after the background is controlled to be in a flashing state, the method may further include:

[0090] In response to the modification instruction of the original building block, the background is controlled to stop flashing.

[0091] In specific implementation, when the programming page detects the user's modification instruction for the original building block, it is determined that the user has actually located the position of the original building block, and the original building block background is controlled to stop flashing. The modification instruction is detected to indicate that the user has received the error building block, the position of the error building block is determined, and the building block debugging error is realized. At this time, the background flashing stops to prepare for the next user modification and debugging.

[0092] In one embodiment, locating the original building block according to the debugging information includes:

[0093] Get the block ID and screen ID of the original block according to the debugging information;

[0094] According to the block identifier and screen identifier, obtain the block position where the original block is located;

[0095] Calculate the offset of the current programming interface display area relative to the block position;

[0096] Scroll the offset at the current programming interface position to achieve the original block positioning.

[0097] In specific implementation, the debugging information will carry the block ID (identity) and screen ID. The block ID and screen ID of the original block are obtained according to the debugging information, and then the position of the current block is obtained according to the block ID and screen ID, and the offset of the current visual area relative to the block position is calculated, and the offset is scrolled at the position of the current block work area, so as to realize the block positioning. The block ID in the embodiment of the present invention is used to identify the block. In the original block, each block has a corresponding block ID, and the block ID is unique. The corresponding block can be located by the block ID. The screen ID identifies the screen. Each screen ID is also unique. The screen position where the block is located can be located by the screen ID, and then the position of the block is obtained in the located screen position by the block ID. The position of the original block in the programming area is obtained by the block ID and the screen ID, and the original block located in the screen is displayed by scrolling the offset, so as to realize the rapid positioning of the original block, which provides convenience for users to view the error information of the block.

[0098] In one embodiment, the graphical programming platform is provided with a console UI component, and the console UI component is used to control the console interface to output information;

[0099] In response to the running instruction, the target building block is converted into the target source code before running, and the method further includes:

[0100] Define a message manager, which is used to manage message types;

[0101] Subscribe the console UI component as an observer in the message manager;

[0102] Define the type of debugging information in the message manager;

[0103] Get debugging information based on the console UI component.

[0104] In the specific implementation, a message manager is defined, where the message manager is responsible for defining the message type and reading, writing, and sending messages; the message manager is a console manager, which includes but is not limited to consoleManager. In some other embodiments, the console file manager ranger can also be used to implement file management, which is not limited in the embodiment of the present invention. Subscribe the console UI component as an observer; output the type corresponding to the 'debugging information' in the console, where the type corresponding to the output debugging information includes but is not limited to consoleManager.log. In some other embodiments, other methods can also be used to output the type corresponding to the debugging information, which is not limited in the embodiment of the present invention; the type corresponding to the 'error information' in the console error includes but is not limited to consoleManager.customError. In some other embodiments, other methods can also be used to output the type corresponding to the error information, which is not limited in the embodiment of the present invention.

[0105] Console is an enhanced version of the Windows console window. Console features include: multiple tabs, text editors (such as text selection), different types of backgrounds, transparency of letters and colors, configurable fonts, and different window styles. Console Manager is a console program. Debug information is obtained through the observer feature of the controller UI component. By pre-defining the type of debug information in the controller, the console UI component can obtain debug information, making it convenient for users to view debug information in the UI component.

[0106] In one embodiment, a debugging function is set in the debugging building block, and the debugging information corresponding to the target building block is output according to the running result of the target source code, including:

[0107] Get the calling result of the debugging function, which includes the building block information and debugging information of the debugging building block;

[0108] Send the call result to the console UI component;

[0109] The debug information is output on the console display interface through the control console UI component. The type of debug information is custom print information.

[0110] In specific implementation, when the user clicks to run the code, the method of converting the block logic into the code logic includes but is not limited to conversion through the JavascriptGenerator library of Blink. In some other embodiments, other methods can also be used to convert the blocks into code, and the embodiments of the present invention do not limit this. Among them, the block "output 'debugging information' in the console" will be converted into a function code with the current block information and the user-defined printing information. The block "report 'error information' in the console" will be converted into a function code with the current block information and the user-defined error information.

[0111] When the function is called, the building block information and the user-defined print message will be sent out, and the sending method includes but is not limited to sending through consoleManager.pushMessage. In some other embodiments, other sending methods can also be used, and the embodiment of the present invention does not limit this. This method uses the observer design pattern, in which the observer has been defined in advance in the console UI component. When the message is pushed, it will be captured by the observer (console), so as to implement the business logic according to the captured information.

[0112] Blink consists of a main thread, multiple worker threads, and some other threads. Almost all important work runs on the main thread. This includes running JavaScript (except Workers), DOM generation, CSS style and layout calculations, etc., so the key to optimizing interactive performance is mainly around the main thread. Blink will create independent threads for Web workers and Serviceworkers. Although both are running JavaScript, the operating environment of the main thread and the worker thread is not shared, and data needs to be passed through messages.

[0113] The JavascriptGenerator library is a generator. A generator is some code that runs inside a function. After returning a value, the JavascriptGenerator library pauses itself, and the caller can ask to unpause and return another value. This "return" is not a traditional return from a function. So it is given a special name - yield. The generator syntax varies from language to language. Javascript's generator syntax is similar to PHP.

[0114] In JavaScript, if you want to use a generator, you need to: define a special generator function; call the function to create a generator object; use the generator object in a loop, or directly call its next method.

[0115] PushMessageData is an interface of the Push API, which provides some methods that allow you to obtain push data sent by the server in various formats. The methods of this interface can be called multiple times. Messages received through the Push API will be encrypted and sent by the push service, and then automatically decrypted by the browser before they can be accessed through the methods of the PushMessageData interface. The embodiment of the present invention can output debugging information through the console display interface, and the debugging information can use user-defined print information, so that it is convenient for users to check whether the debugging of the building block is normal and to check the debugging results of the building block.

[0116] In one embodiment, the technical solution adopted by the embodiment of the present invention is: using Javascript, HTML language, and referencing the BlinkJS library. Adding debugging blocks is implemented through the BlinkJS library. Two blocks are defined to output "debugging information" in the console and "error information" in the console; Figure 2a As shown, Figure 2a This is a block diagram of the debug output block that outputs 'debug information' in the console; Figure 2b As shown, Figure 2b This is a schematic diagram of the error debugging building block that reports the 'error information' in the console; the user can selectively connect any of the above building blocks in the building blocks, and when the code runs to this point, the corresponding information will be output in the console.

[0117] HTML is a markup language. It includes a series of tags. Through these tags, the document format on the network can be unified, and scattered Internet resources can be connected into a logical whole. HTML text is a descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, etc.

[0118] like Figure 3 As shown in the figure, add the debug output block and the error debugging block to the original block. When the user connects the original block, the debug output block and the error debugging block, click Run, the console will pop up, and the user-defined debugging information will appear.

[0119] like Figure 4 As shown in the figure, when the user clicks the error message, the block is defined in the visible area and the background of the block flashes. When the user modifies the block, the flashing effect disappears.

[0120] In the specific implementation, a message manager consoleManager is defined, which is responsible for defining message types and reading, writing, and sending messages;

[0121] Subscribe the console UI component as an observer;

[0122] "Output 'debugging information' in the console" and "Report 'error information' in the console" correspond to the two types of consoleManager.log and consoleManager.customError respectively;

[0123] When the user clicks to run the code, the block logic is converted into code logic through Blink's JavascriptGenerator library. The block "Output 'debugging information' in the console" will be converted into function code with the current block information and user-defined print information. The block "Report 'error information' in the console" will be converted into function code with the current block information and user-defined error information.

[0124] When this function is called, the block information and user-defined print message will be sent out through consoleManager.pushMessage. This method uses the observer design pattern, in which the observer has been defined in advance in the console UI component. When pushMessage is sent, it will be captured by the observer (console), so as to implement business logic based on the captured information.

[0125] When the debugging information is successfully reported to the console, the information will carry the block ID and the screen ID. Then, according to the block ID, the current block position is obtained, and the offset of the current visual area relative to the block position is calculated, and the offset is scrolled at the current block work area. This achieves block positioning.

[0126] The embodiment of the present invention enables the user to debug the code promptly and quickly through the method, and outputs information in the console to quickly help the user find a more efficient development project and improve the code debugging efficiency.

[0127] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.

[0128] Another embodiment of the present invention provides a code debugging device, which is applied to a graphical programming platform. The graphical programming platform is provided with a programming interface, such as Figure 5 As shown, the device 1 comprises:

[0129] The debugging block adding module 11 is used to add a preset debugging block to the original blocks in response to the debugging block adding instruction, where the original blocks are blocks composed of at least one block on the programming interface, and the debugging blocks are used to output the execution results of the original blocks;

[0130] A target building block generation module 12, used to generate a target building block according to a debugging building block;

[0131] An operation module 13, for responding to an operation instruction, converting the target building block into a target source code and then executing the target source code;

[0132] The debugging information output module 14 is used to output the debugging information corresponding to the target building block according to the running result of the target source code;

[0133] The positioning module 15 is used to position the original building block according to the debugging information.

[0134] The specific implementation method is shown in the method embodiment, which will not be described in detail here.

[0135] Another embodiment of the present invention provides an electronic device, such as Figure 6 As shown, the electronic device 10 includes:

[0136] One or more processors 110 and memory 120, Figure 6 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0137] The processor 110 is used to complete various control logics of the electronic device 10, and it can 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 RISCMachine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware control, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.

[0138] The memory 120 is a non-volatile computer-readable storage medium that 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 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implementing the code debugging method in the above method embodiment.

[0139] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store applications required for operating the device and at least one function; the data storage area may store data created according to the use of the device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0140] One or more units are stored in the memory 120, and when executed by one or more processors 110, the code debugging method in any of the above method embodiments is executed, for example, the code debugging method described above is executed. Figure 1 The method comprises steps S101 to S105.

[0141] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, to execute the above-described Figure 1 The method comprises steps S101 to S105.

[0142] As an 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) as external cache memory. By way of illustration and not limitation, RAM can be obtained 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 include one or more of these and / or any other suitable types of memory.

[0143] Another embodiment of the present invention provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a processor, the processor executes the code debugging method of the above method embodiment. For example, executing the above described Figure 1The method comprises steps S101 to S105.

[0144] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0145] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0146] Conditional language such as "can," "can," "might," or "may," among other things, unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey that particular embodiments can include (while other embodiments do not) particular features, elements, and / or operations. Thus, such conditional language is also generally intended to imply that features, elements, and / or operations are anyway required for one or more embodiments or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, and / or operations are included or will be performed in any particular embodiment.

[0147] What has been described herein in this specification and the accompanying drawings includes examples that can provide code debugging methods and devices. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it is recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is obvious that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure. In addition, or in an alternative, other embodiments of the present disclosure may be apparent from consideration of this specification and the accompanying drawings and from the practice of the present disclosure as presented herein. It is intended that the examples proposed in this specification and the accompanying drawings are considered to be illustrative and not restrictive in all respects. Although specific terms are employed herein, they are used in a general and descriptive sense and are not used for limiting purposes.

Claims

1. A code debugging method, characterized in that , applied to a graphical programming platform, the graphical programming platform is provided with a programming interface, 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. 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; Subscribe the console UI component as an observer in the message manager; Defining the type of debugging information in the message manager; The debugging information is obtained according to the console UI component.

3. The method according to claim 2, characterized in that The debugging block is provided with a debugging function, and according to the running result of the target source code, the debugging information corresponding to the target block is output, including: 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; Send the call result to the console UI component; 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. A code debugging device, characterized in that: Applied to a graphical programming platform, the graphical programming platform is provided with a programming interface, 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. 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, 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. 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 according to any one of claims 1 to 3.