Object variable operation method and device, storage medium and electronic equipment

By receiving variable object operations in the visual programming interface and determining the target variable type, the problem of low efficiency in variable type confirmation in the prior art is solved, real-time type matching and variable management are realized, and programming efficiency is improved.

CN119292583AActive Publication Date: 2025-01-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
CN202411330681.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-01-10
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

Existing visual programming methods have inefficient problems when processing tiles representing variables. Developers need to confirm the variable types one by one to avoid type errors, and errors are usually discovered at compile time, resulting in inefficient programming.

Method used

By receiving variable object operations in the visual programming interface, obtaining the target variable type, determining the matching operation interface based on the type, performing object operations, and mapping interactive operations in real time to the variable object collection, ensuring type matching and improving programming efficiency.

Benefits of technology

It realizes the real-time acquisition of variable type matching results in visual programming, avoids type errors, improves programming efficiency and unified management of variable objects, and solves the problem of inefficiency in existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292583A_ABST
    Figure CN119292583A_ABST
Patent Text Reader

Abstract

The invention discloses an object variable operation method and device, a storage medium and electronic equipment. The method comprises the steps that in response to variable object operation received in a visual programming interface, a target variable type indicated by the variable object operation is obtained, and the visual programming interface is used for receiving interactive operation so as to generate program content matched with the interactive operation; at least one target variable operation interface matched with the variable object operation is determined from a variable operation interface set, and the variable operation interface set comprises a plurality of variable operation interfaces; according to the at least one target variable operation interface and the target variable type, at least one object operation is executed on a variable object set, the variable object set is used for storing object information of at least one variable object created according to the visual programming interface, and the variable object is displayed in a variable graph block style on the visual programming interface. The technical problem that conventional visual programming is low in efficiency is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to an object variable operation method and device, a storage medium and an electronic device. Background Art

[0002] In a visual programming environment, developers can usually use a series of predefined visualization blocks, each of which corresponds to a preset program code. By dragging and dropping the preset visualization blocks and setting configurations, the processing and visualization of program codes can be made quick and easy. This method significantly improves development efficiency and simplifies the programming process.

[0003] However, in the existing programming practice based on the visual environment, when developers drag or edit the visual blocks representing variables, they must confirm the variable type associated with each block one by one to prevent errors in the program code generated by the visual blocks. In addition, if developers make mistakes when using the visual blocks representing variables, the program errors caused by the mismatch of variable types can usually only be discovered when the overall program code is compiled. Therefore, the existing visual programming method has the technical problem of low programming efficiency.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present invention provide an object variable operation method and device, a storage medium and an electronic device, so as to at least solve the technical problem of low efficiency of conventional visual programming.

[0006] According to one aspect of an embodiment of the present invention, a method for operating an object variable is provided, comprising: in response to a variable object operation received in a visual programming interface, obtaining a target variable type indicated by the variable object operation, wherein the visual programming interface is used to receive an interactive operation to generate program content matching the interactive operation, and the interactive operation includes the variable object operation; from a variable operation interface set, determining at least one target variable operation interface matching the variable object operation, wherein the variable operation interface set includes a plurality of variable operation interfaces; and performing at least one object operation on a variable object set according to at least one target variable operation interface and the target variable type, wherein the variable object set is used to store object information of at least one variable object created according to the visual programming interface, and the variable object is displayed as a variable tile style in the visual programming interface.

[0007] According to another aspect of an embodiment of the present invention, there is also provided an object variable operation device, comprising: an acquisition unit, for acquiring, in response to a variable object operation received in a visual programming interface, a target variable type indicated by the variable object operation, wherein the visual programming interface is used to receive an interactive operation to generate program content matching the interactive operation, and the interactive operation includes the variable object operation; a determination unit, for determining, from a variable operation interface set, at least one target variable operation interface matching the variable object operation, wherein the variable operation interface set includes a plurality of variable operation interfaces; an operation unit, for performing at least one object operation on a variable object set according to at least one target variable operation interface and the target variable type, wherein the variable object set is used to store object information of at least one variable object created according to the visual programming interface, and the variable object is displayed as a variable block style in the visual programming interface.

[0008] In some embodiments, the above-mentioned operation unit includes: a generation module, which is used to generate a target array element matching the target variable object according to the variable identification information indicated by the above-mentioned variable creation operation and the type description information indicating the above-mentioned target variable type when the above-mentioned variable object operation is a variable creation operation; an adding module, which is used to add the above-mentioned target array element to the object array used to indicate the above-mentioned variable object set, wherein the array elements in the above-mentioned object array are respectively used to indicate a variable object.

[0009] In some embodiments, the above-mentioned determination unit includes: a first determination module, used to determine the array element adding interface that matches the above-mentioned variable creation operation from the above-mentioned variable operation interface set, wherein the above-mentioned variable operation interface set includes the above-mentioned array element adding interface, and the above-mentioned array element adding interface is used to generate the above-mentioned array element that matches the variable object according to the variable identification information and type description information indicated by the above-mentioned variable creation operation.

[0010] In some embodiments, the operating device of the object variable further includes: an editing unit, which is used to respond to receiving a variable editing operation performed on the target variable object in the visual programming interface, and determine the array element editing interface that matches the variable editing operation from the variable operation interface set, wherein the variable operation interface set includes the array element editing interface; according to the variable editing information carried in the variable editing operation and the array element editing interface, perform an element editing operation on the target array element to obtain the updated target array element.

[0011] In some embodiments, the operating device of the object variable further includes: a display unit, which is used to determine the array element acquisition interface from the variable operation interface set when the variable creation control is displayed on the variable preview page in the visual programming interface, wherein the variable creation control is used to detect the variable creation operation, the variable preview page is used to display the variable object of the target variable type, and the variable operation interface set includes the array element acquisition interface; when at least one first array element is found from the object array according to the array element acquisition interface and the target variable type, a first code block corresponding to the at least one first array element is obtained, wherein the first array element matches the first variable object of the target variable type, and the first code block is used to display a first variable block indicating the first variable object in the visual programming interface.

[0012] In some embodiments, the operating device of the object variable includes: a deletion unit, used to obtain a second variable identifier indicated by the variable deletion operation when the variable object operation is a variable deletion operation; determine an array element deletion interface matching the variable deletion operation from the variable operation interface set, wherein the variable operation interface set includes the array element deletion interface; and delete a second array element matching the second variable object from the variable object set according to the second variable identifier and the array element deletion interface, wherein the second variable identifier is used to indicate the second variable object.

[0013] In some embodiments, the operating device of the object variable further includes: a code block generating unit, which is used to obtain a first code block matching the target variable type when the variable object operation is a variable creation operation, wherein the first code block is used to describe the variable attribute information of the variable object; according to the variable description information carried by the variable creation operation, the first code block is updated to a second code block, wherein the second code block is used to display the target variable block matching the target variable object in the visual programming interface, and the variable description information includes the variable identification information.

[0014] In some embodiments, the above-mentioned code block generation unit also includes: a prompt module, which is used to obtain a reference variable type matching the above-mentioned operation block in response to dragging the above-mentioned target variable block to the block area associated with the operation block in the above-mentioned visual programming interface, wherein the above-mentioned operation block is used to generate a variable operation code block associated with the variable object, and the above-mentioned reference variable type is a variable type matching the above-mentioned variable operation code block; according to the matching relationship between the above-mentioned reference variable type and the above-mentioned second code block, determine the dragging result of the dragging operation.

[0015] In some embodiments, the prompt module is used to: when the target variable object is the variable object to be input in the operation block, obtain the first variable type from the first field in the second code block, wherein the first field is used to indicate the variable type that allows the target variable object to be obtained as input; when the first variable type does not match the reference variable type, display target prompt information; when the target variable object is the variable object that accepts input in the operation block, obtain the target variable type from the second field in the second code block, wherein the second field is used to indicate the target variable type of the target variable object; when the target variable type does not match the reference variable type, display target prompt information; wherein the target prompt information is used to indicate that the drag operation has failed.

[0016] In some embodiments, the above-mentioned code block generation unit is also used to: in case the above-mentioned drag operation fails to execute, obtain a third code block matching the above-mentioned reference variable type, wherein the above-mentioned third code block is used to describe the variable attribute information of the candidate variable object; and display the candidate variable block in the above-mentioned visual programming interface according to the above-mentioned third code block.

[0017] In some embodiments, the above-mentioned code block generation unit is also used to: in response to a variable editing operation on the above-mentioned target variable block in the above-mentioned visual programming interface, obtain variable editing information indicated by the above-mentioned variable editing operation; update the third field in the above-mentioned second code block according to the above-mentioned variable editing information, wherein the above-mentioned third field is used to indicate the variable identification information of the above-mentioned target variable object.

[0018] In some embodiments, the above-mentioned code block generation unit is used to: when the above-mentioned variable creation operation is a first variable creation operation, update the third field in the above-mentioned first code block according to the variable identification information included in the above-mentioned variable description information to obtain the above-mentioned second code block, wherein the variable type corresponding to the above-mentioned first variable creation operation is determined from multiple preset variable types; when the above-mentioned variable creation operation is a second variable creation operation, update the above-mentioned first code block to a fourth code block according to the variable identification information and variable combination information included in the above-mentioned variable description information, wherein the variable type corresponding to the above-mentioned second variable creation operation is a custom variable type, and the above-mentioned variable combination information is used to indicate at least one data type carried in the above-mentioned target variable.

[0019] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned object variable operation method when running.

[0020] According to another aspect of the embodiments of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer instruction being stored in a computer-readable storage medium. A processor of a computer device reads the computer program / instruction from the computer-readable storage medium, and the processor executes the computer program / instruction, so that the computer device executes the above object variable operation method.

[0021] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the object variable operation method through the computer program.

[0022] In an embodiment of the present invention, when a variable object operation is received based on a visual programming interface, the target variable type indicated by the variable object operation is obtained; at least one target variable operation interface matching the variable object operation is determined from a variable operation interface set, wherein the variable operation interface set includes multiple variable operation interfaces; and at least one object operation is performed on the variable object set according to the at least one target variable operation interface and the target variable type. Thus, through the operation interface provided by the variable operation interface set, the interactive operations related to the variable object in the visual programming interface are mapped to object operations on the variable object set in real time.

[0023] Since it is necessary to call the variable operation interface based on the variable type of the object variable, it is possible to accurately obtain the type matching results of the object operations on the variable objects in the process of mapping the interactive operations into object operations on the variable object set in real time, thereby achieving real-time acquisition of variable matching results in the process of visual programming, avoiding program failure or unexpected results caused by type errors; in addition, the variable object set can be used to achieve unified and efficient management of the variable objects involved in the visual programming process, thereby improving the efficiency of visual programming and solving the technical problem of low efficiency of existing visual programming methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0025] Figure 1 is a schematic diagram of a hardware environment of an optional object variable operation method according to an embodiment of the present invention;

[0026] Figure 2 is a flowchart of an optional method for operating object variables according to an embodiment of the present invention;

[0027] Figure 3 is a schematic diagram of an optional object variable operation method according to an embodiment of the present invention;

[0028] Figure 4 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0029] Figure 5 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0030] Figure 6 is a timing diagram of another optional object variable operation method according to an embodiment of the present invention;

[0031] Figure 7 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0032] Figure 8 is a timing diagram of another optional object variable operation method according to an embodiment of the present invention;

[0033] Fig. 9 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0034] Fig.10 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0035] Fig.11 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0036] Fig.12 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0037] Fig.13 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0038] Fig.14 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0039] Fig.15 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0040] Fig.16 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0041] Fig.17is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0042] Fig.18 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0043] Fig.19 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0044] Fig. 20 is a schematic diagram of another optional object variable operation method according to an embodiment of the present invention;

[0045] Fig.21 is a timing diagram of another optional object variable operation method according to an embodiment of the present invention;

[0046] Fig. 22 is a timing diagram of another optional object variable operation method according to an embodiment of the present invention;

[0047] Fig.23 is a schematic structural diagram of an optional object variable operation device according to an embodiment of the present invention;

[0048] Fig.24 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0050] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0051] According to one aspect of an embodiment of the present invention, a method for operating an object variable is provided. As an optional implementation, the method for operating an object variable can be applied to, but is not limited to, Figure 1 The operating system of the object variable in the hardware environment shown in FIG. 1 , wherein the operating system of the object variable may include but is not limited to the terminal device 102, the network 104, the server 106, and the database 108. The terminal device 102 runs a target client (such as Figure 1 As shown, the target client is a client that can provide visual programming functions as an example), and the target client may include but is not limited to an instant messaging client, a learning and education client, a game client, etc. The terminal device 102 includes a human-computer interaction screen, a processor and a memory. The human-computer interaction screen is used to display the application interface and the interactive operation results (such as Figure 1 The processor is used to generate an interactive instruction in response to the above human-computer interactive operation, and send the program code generated according to the interactive instruction to the server. The memory is used to store relevant attribute data.

[0052] Among them, visual programming provides an intuitive interface that allows users to build programs by dragging and connecting various blocks (such as programming building blocks) used to indicate different code blocks; each block represents a programming concept or operation, such as loops, conditional statements, mathematical operations, variables, etc. Visual programming usually supports multiple programming languages, such as JavaScript, Python, etc. Optionally, the visual programming function can be a function built into an application, such as a user-generated content (UGC) editor provided in a game application. It should be noted that the UGC editor supports the use of objects to create, adjust, and share custom content (such as virtual maps, virtual scenes, virtual characters, etc.). The UGC editor can be used to lower the threshold for creation while maintaining high-quality output; among them, the UGC editor has a visual programming function.

[0053] Illustratively, the terminal device 102 can be used to display a UGC editor in a game application, and the UGC editor provides a visual programming interface, which includes multiple interactive functions, and the user performs a visual programming process in the visual programming interface through the interactive functions. The interactive function includes at least one of a selection function, a zoom-in function, a zoom-out function, a delete function, a move function, etc. The user can select a block for indicating a code block in the visual programming interface through the selection function, and can also adjust the size of the block through the zoom-in function, the zoom-out function, etc., and can also adjust the state of the block in the programming interface through the delete function, the move function, etc. The interactive function is not limited here.

[0054] In addition, the server 106 includes a processing engine, which is used to perform storage or reading operations on the database 108. Specifically, the processing engine reads the target program code sent by each target account from the database 108.

[0055] Assumptions Figure 1 The terminal device 102 in the example is the terminal device used for logging in the current object account. The specific process of this embodiment is as follows: the terminal device 102 executes steps S102 to S106, and in response to the variable object operation received in the visual programming interface, obtains the target variable type indicated by the variable object operation, wherein the visual programming interface is used to receive the interactive operation to generate program content matching the interactive operation, and the interactive operation includes the variable object operation; from the variable operation interface set, at least one target variable operation interface matching the variable object operation is determined, wherein the variable operation interface set includes a plurality of variable operation interfaces; according to the at least one target variable operation interface and the target variable type, at least one object operation is performed on the variable object set, wherein the variable object set is used to store the object information of at least one variable object created according to the visual programming interface, and the variable object is displayed as a variable block style in the visual programming interface; generates and compiles the target program code matching the visual programming operation;

[0056] Next, as in step S110 , the terminal device 102 sends the target program code to the server 106 via the network 104 ; finally, the server 106 executes step S112 to store the target program code.

[0057] It can be understood that the operating system of the above-mentioned object variables can be a programming environment that provides cloud services, and the server 106 can perform real-time cloud storage of the target code program generated by visual programming operations; in another optional implementation, the code generation and compilation operations of the above-mentioned step S108 can also be performed by the above-mentioned server 106.

[0058] Optionally, in this embodiment, the terminal device may be a terminal device configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, a vehicle-mounted terminal, a VR / AR device, etc. The target client may be a client that supports providing shooting game tasks, such as a video client, an instant messaging client, a browser client, an educational client, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network, and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and no limitation is made to this in this embodiment.

[0059] In an embodiment of the present invention, when a variable object operation is received based on a visual programming interface, the target variable type indicated by the variable object operation is obtained; at least one target variable operation interface matching the variable object operation is determined from a variable operation interface set, wherein the variable operation interface set includes multiple variable operation interfaces; and at least one object operation is performed on the variable object set according to the at least one target variable operation interface and the target variable type. Thus, through the operation interface provided by the variable operation interface set, the interactive operations related to the variable object in the visual programming interface are mapped to object operations on the variable object set in real time.

[0060] Since it is necessary to call the variable operation interface based on the variable type of the object variable, it is possible to accurately obtain the type matching results of the object operations on the variable objects in the process of mapping the interactive operations into object operations on the variable object set in real time, thereby achieving real-time acquisition of variable matching results in the process of visual programming, avoiding program failure or unexpected results caused by type errors; in addition, the variable object set can be used to achieve unified and efficient management of the variable objects involved in the visual programming process, thereby improving the efficiency of visual programming and solving the technical problem of low efficiency of existing visual programming methods.

[0061] As an optional implementation, Figure 2 As shown, the operation method of the above object variables includes the following steps:

[0062] S202, in response to a variable object operation received in a visual programming interface, obtaining a target variable type indicated by the variable object operation, wherein the visual programming interface is used to receive an interactive operation to generate program content matching the interactive operation, and the interactive operation includes the variable object operation;

[0063] S204, determining at least one target variable operation interface that matches the variable object operation from the variable operation interface set, wherein the variable operation interface set includes a plurality of variable operation interfaces;

[0064] S206, performing at least one object operation on the variable object set according to at least one target variable operation interface and a target variable type, wherein the variable object set is used to store object information of at least one variable object created according to a visual programming interface, and the variable object is displayed as a variable block style in the visual programming interface.

[0065] It should be noted that the above-mentioned implementation mode of the present application can be applied in a learning and education application, which can provide a visual programming tool for users to place interactive blocks indicating code blocks by dragging to achieve programming operations and learning of programming logic; in addition, the above-mentioned implementation mode can also be applied in a game application, which can provide a UGC editor configured with a visual programming interface to convert complex programming languages ​​into intuitive and interactive blocks, so that users can realize customized configuration of game content through visual interaction. The above application scenarios are only exemplary descriptions and do not limit the specific application scenarios of the above-mentioned implementation modes of the present application.

[0066] In the scenario of learning and education applications, users can access the visual programming tool through the terminal device, and select blocks from the optional blocks provided by the visual programming interface of the above learning and education application, and build a block combination. Since each block can be mapped to a code block or logic block in the program code, the execution logic relationship between multiple code blocks can be indicated through the block combination, and a set of code programs can be obtained.

[0067] In the game development scenario, users can access the UGC editor in the game application through the terminal device, and through the visual programming interface provided by the UGC editor, select the preset interactive blocks used to indicate the preset virtual elements in the game scene, or customize the interactive blocks used to indicate the custom virtual elements in the game scene, and through the connection relationship between the above-mentioned interactive blocks, indicate the association or interaction relationship between different game elements in the custom game content, and then build the custom game content through the editing operation of the interactive blocks. It can be understood that the above-mentioned interactive blocks can be used to indicate the virtual game elements in the game scene on the one hand, and on the other hand, they can also be used to indicate the code blocks corresponding to the implementation or rendering process of the above-mentioned virtual game elements in the terminal device.

[0068] It is understandable that in the process of performing programming operations based on the visual programming interface in the above application scenarios, the processing of different variable objects is usually involved. In this embodiment, the variable object can be used to indicate a data container for storing data values. In the programming process, the corresponding data value can be used in the program logic by calling the corresponding variable object.

[0069] In program code, variable objects of a specific type can usually only be used to store data values ​​of the corresponding type, such as integer type (int), floating point type (float), character type (char), and string type (string). If the processing operation performed on the variable object is different from the data type it stores, it may cause the program to run with an error or crash.

[0070] However, in conventional visual programming scenarios, the variable blocks used to indicate variable objects do not have a block type attribute configured, which means that users can store different types of data, such as strings, numbers, or Boolean values, in the same variable block without type conversion. Therefore, there are significant problems with the untyped variable blocks used to indicate variable objects in conventional visual programming scenarios. First, since there is no clear type restriction on the variable blocks, type errors may occur, such as using a string type variable block in a logical position where a number is required. This type error may cause the application generated based on visual programming to fail to run or produce unexpected results. Secondly, untyped variable blocks may reduce the readability and maintainability of the code, that is, when reading the program code obtained based on the visual programming operation, it is impossible to determine the type and purpose of the variable object obtained based on the mapping of the untyped variable blocks. In other words, in the process of processing variable objects according to the variable blocks in the conventional visual programming method, developers need to spend a lot of energy to confirm the type of the variable blocks to ensure that a correct and executable code program is generated. Therefore, in the conventional visual programming method, there is a technical problem of low operating efficiency.

[0071] exist Figure 2 In the illustrated implementation, through S202, in response to the variable object operation received in the visual programming interface, the target variable type indicated by the variable object operation can be obtained. It should be noted that the variable object operation can be an interactive operation performed on the target variable block used to indicate the target variable object in the visual programming interface, and then the mapping received in the visual programming interface can be mapped to the logical processing operation performed on the target variable object in the program code.

[0072] It should be noted that, in the implementation manner of the present application, the variable type of the target variable corresponding to the above variable object operation may include, but is not limited to, the data type involved in the conventional programming operation process, such as numeric type, string type, vector type, Boolean type, etc. In addition, the target variable type of the above target variable object may also be a data type associated with a specific application scenario.

[0073] For example, in a teaching application scenario, the target variable type of the target variable object may also be a data type that may be involved in the teaching application scenario, such as a geometric element type;

[0074] For another example, in a game editing scene, the target variable type may also be an object type used to indicate a virtual object in a virtual game scene, such as a "player type" used to indicate an operation object that performs the current game operation, a "role type" used to indicate a control object currently controlled by an interactive operation, a "prop type" used to indicate an object that can be interacted with in a virtual scene, a "timer type" used to indicate a trigger node for a specific event in a virtual scene, etc. In this embodiment, the variable type of the target variable object in the above embodiment is not limited.

[0075] Corresponding to variable objects of different variable types, the operation modes of the above variable object operations may also include different types. For example, for variable objects of numerical type, the operation types of variable object operations may include but are not limited to creation operations, editing operations, deletion operations, display operations, assignment operations, etc.; for variable objects of "role type", the operation modes of variable objects may include but are not limited to creation operations, editing operations, deletion operations, display operations, control movement operations, etc.; for variable objects of "prop type", the operation modes of variable objects may include but are not limited to creation operations, editing operations, deletion operations, display operations, picking operations, exchange operations, etc. In this embodiment, the operation types of the above variable object operations are not limited.

[0076] The following combination Figure 3 A specific visual programming interface is described. Figure 3In the visual programming interface shown, a first menu bar 302 is shown, which is used to indicate the object type of the interactive object supported in the current visual programming interface. For example, the "event control" included in the first menu bar 302 can be used to indicate that in the current visual programming interface, the editing and processing of the event object in the virtual scene can be realized by the interactive operation of the event block. Specifically, a secondary menu bar matching the "event control" can be displayed by triggering the "event control" to display interactive event blocks for indicating different virtual events. It is understandable that the event block can be mapped to an event code block in the program code to indicate and describe the event content of the virtual event in the virtual scene. For another example, the "control control" included in the first menu bar 302 can be used to indicate that in the current visual programming interface, the editing and processing of the control logic indicated by the above-mentioned control block can be realized by the interactive operation of the control block.

[0077] Further, when the "variable control" is currently selected from the first menu bar 302, a second menu bar 304 matching the "variable control" can be displayed. Operation controls for selecting variable tiles of different variable types are displayed in the second menu bar 304. For example, when the "Boolean value" control is currently selected, a variable tile of the Boolean value type can be displayed in the second operation area 306, and the variable tile can be used to indicate the created Boolean value type variable object. In addition, a superscript "①" is further displayed on the "Boolean value" control of the second menu bar 304 to indicate that the number of Boolean value type variable objects that have been created is 1. It can be understood that when a touch operation is selected on the "numeric value" control in the second menu bar 304, a created numerical variable tile can be displayed in the second operation area 306 to indicate the created numerical value type variable object (not currently shown). In addition, the second menu bar 304 also shows a "string" control, a "vector" control, a "player" control, a "role" control, a "component" control, a "prop" control, a "logic element" control, a "motion unit" control, a "timer" control, and a "task" control. Each control can trigger the display of a variable tile matching the current control in the second operation area 306 to indicate different variable objects currently created.

[0078] Further, in response to a drag operation on a Boolean variable block in the second operation area 306, when the dragging end point of the drag operation is located in the first operation area 308 and a release operation is detected, a first variable block 310 for indicating a Boolean variable object may be displayed in the first operation area 308. It is understandable that in the first operation area 308, different interactive operations may be performed on the first variable block 310, such as a drag operation or an edit operation. Optionally, as Figure 4As shown, in a case where a first function block 312 is displayed in the first operation area 308, in response to dragging the first variable block 310 to a vacant area of ​​the first function block 312, it is indicated that the first Boolean value object corresponding to the first variable block 310 is input into the first function object indicated by the first function block 312 to obtain the output result of the first function object.

[0079] Furthermore, through the above S204 and S206, a target variable operation interface matching the above variable object operation can be determined from the variable operation interface set, and object operations can be performed on the variable object set based on the above target variable type through the target variable operation interface, thereby achieving real-time management and maintenance of the variable objects in the variable object set in response to the variable object operations performed in the visual programming interface.

[0080] It can be understood that in the above-mentioned implementation manner of the present application, the variable objects processed or operated during the visual programming operation can be managed through the above-mentioned variable object set.

[0081] In an optional embodiment, the above-mentioned variable object set can be specifically represented by a capacity-variable array object, wherein the array elements included in the array object can respectively indicate a variable object; in another optional embodiment, the above-mentioned variable object set can also store the list elements used to represent the variable objects through a list object.

[0082] In addition, when the programming operations performed through the above-mentioned visual programming interface involve variable objects with a hierarchical structure, the leaf nodes used to represent the variable objects can also be stored through tree objects. For example, in the process of performing game development operations through the above-mentioned visual programming interface, multiple objects in the game application can have a hierarchical relationship: specifically, the game scene objects in the game application, the virtual objects included in a game scene, and the interactive text objects corresponding to a virtual object can have a significant hierarchical relationship. In the specific visual programming process, when it is necessary to manage the above-mentioned game scene objects, virtual objects, and interactive text objects, the variable object collection can be stored and managed through the above-mentioned tree structure.

[0083] In an optional embodiment, when the above-mentioned variable object set is specifically an array object, when the variable object operation includes a variable creation operation, the above-mentioned variable operation interface set may include an element adding interface for performing an array element adding operation; when the above-mentioned variable object operation includes a variable editing operation, the above-mentioned variable operation interface set may include an array element editing interface for performing an array element editing operation; when the above-mentioned variable object operation includes a variable deletion operation, the above-mentioned variable operation interface set may include an array element deletion interface for performing an array element deletion operation; when the above-mentioned variable object operation includes a variable viewing operation, the above-mentioned variable operation interface set may include an array element search interface for performing an array element search operation.

[0084] In an optional implementation, the variable operation interface set and the variable object set can be stored and managed by a class data object. On the one hand, the class data object can include an array variable for indicating the variable object set, and on the other hand, the class data object can also provide a create variable interface for creating array elements in the array variable, a delete variable interface, a rename variable interface, and other interfaces, thereby realizing the storage and management of multiple variable objects involved in the visual programming interface.

[0085] Since it is necessary to call the variable operation interface based on the variable type of the object variable, it is possible to accurately obtain the type matching results of the object operations on the variable objects in the process of mapping the interactive operations into object operations on the variable object set in real time, thereby achieving real-time acquisition of variable matching results in the process of visual programming, avoiding program failure or unexpected results caused by type errors; in addition, the variable object set can be used to achieve unified and efficient management of the variable objects involved in the visual programming process, thereby improving the efficiency of visual programming and solving the technical problem of low efficiency of existing visual programming methods.

[0086] In an optional implementation, performing at least one object operation on the variable object set according to at least one target variable operation interface and the target variable type includes:

[0087] S1, when the variable object operation is a variable creation operation, generating a target array element matching the target variable object according to the variable identification information indicated by the variable creation operation and the type description information used to indicate the target variable type;

[0088] S2, adding the target array element to an object array used to indicate a set of variable objects, wherein the array elements in the object array are respectively used to indicate a variable object.

[0089] It can be understood that, in this embodiment, the object array represents a variable object set, and the variable object is indicated by the array element. Further, in this embodiment, the array element includes at least two types of element data, wherein the first type of element data can be type description information indicating the target variable type, and the second type of element data can be variable identification information used to indicate the variable object.

[0090] Optionally, the above-mentioned variable identification information may further include a variable id and a variable name, wherein the variable id is used to uniquely indicate the variable object in the program code determined according to the visual programming interface, and the above-mentioned variable name can be displayed in the above-mentioned visual programming interface to facilitate developers to identify and operate the variable object.

[0091] Specifically, the array elements in the above object array can be represented by the following data structure: {id: string, name: string, type: T};

[0092] In the above array elements, the "id" field is used to store variable id information of string type, the "name" field is used to store variable name information of string type, and the "type" field is used to store variable type, for example, it can be Boolean (Boolean value) type, Number (array) type, String (string) type.

[0093] In an optional embodiment, the above-mentioned determining at least one target variable operation interface that matches the variable object operation from the variable operation interface set includes: determining an array element adding interface that matches the variable creation operation from the variable operation interface set, wherein the variable operation interface set includes an array element adding interface, and the array element adding interface is used to generate an array element that matches the variable object according to the variable identification information and type description information indicated by the variable creation operation.

[0094] It can be understood that in this embodiment, an array element adding interface is provided to synchronize with the variable object creation operation detected in the visual programming interface, and add a target array element for indicating the target variable object in the object array for representing the variable object set.

[0095] In a specific manner, the array element adding interface can be represented by addVariable, and the definition of the array element adding interface is as follows:

[0096] public addVariable(variable:VariableModel){

[0097] this.variables.push(variable);

[0098] };

[0099] The public character is an access modifier, indicating that the array element adding interface addVariable is public and can be accessed outside the class. The character (variable:VariableModel) is the parameter list of the above array element adding interface, indicating that the addVariable method accepts a parameter, the name of the parameter can be the array name variable of the above object array, and its type is the array type VariableModel.

[0100] Furthermore, in the above code field this.variables.push(variable), the this field can be used to indicate the instance of the current object, which is used to access the member variables and methods of the class. variables is a member variable of the current object, which is an array. push is an array method used to add new elements to the end of the array. variable is the parameter passed to the addVariable method, and here it is added to the object array, namely the variables array.

[0101] In the above implementation, a variable array object conforming to the VariableModel type can be added to the current variables array through the externally provided addVariable method.

[0102] In the above-mentioned implementation mode of the present application, since it is necessary to call the variable operation interface based on the variable type of the object variable, it is possible to accurately obtain the type matching result of the object operation on the variable object in the process of mapping the interactive operation into the object operation on the variable object set in real time, thereby achieving real-time acquisition of the variable matching result in the process of visual programming, avoiding program failure or unexpected results caused by type errors; in addition, the variable object set can be used to achieve unified and efficient management of the variable objects involved in the visual programming process, thereby improving the efficiency of visual programming and solving the technical problem of low efficiency in existing visual programming methods.

[0103] In an optional implementation, when the variable object operation is a variable creation operation, before generating a target array element matching the target variable object according to the variable identification information indicated by the variable creation operation and the type description information indicating the target variable type, the method further includes:

[0104] S1, when a variable creation control is displayed on a variable preview page in a visual programming interface, an array element acquisition interface is determined from a variable operation interface set, wherein the variable creation control is used to detect a variable creation operation, the variable preview page is used to display a variable object of a target variable type, and the variable operation interface set includes an array element acquisition interface;

[0105] S2, when at least one first array element is found from the object array according to the array element acquisition interface and the target variable type, obtain first code blocks corresponding to the at least one first array element, wherein the first array element matches the first variable object of the target variable type, and the first code block is used to display a first variable block indicating the first variable object in a visual programming interface.

[0106] It can be understood that in this embodiment, when the variable creation control in the visual programming interface is displayed on the variable preview page, before adding the target array element according to the array element addition interface called by the background, it is also necessary to respond to the display operation of the variable preview page and obtain the array element corresponding to the variable object that needs to be displayed in the preview page through the array element acquisition interface.

[0107] In an optional embodiment, when the variable blocks corresponding to all variable objects need to be displayed in the above-mentioned variable preview page, the variable code blocks corresponding to each array object can be directly obtained based on all array objects included in the object array, and the variable blocks corresponding to each variable object can be displayed in the variable preview page based on the corresponding variable code blocks.

[0108] In another optional implementation, such as step S2 in the above implementation, when it is necessary to display the variable blocks corresponding to the variable objects of a specific variable type in the above variable preview page, a filtering operation can be performed in the object array based on the variable type, and the first array objects filtered out can be used to obtain the variable code blocks corresponding to each first array object, and the variable blocks corresponding to each variable object can be displayed in the variable preview page based on the corresponding variable code blocks.

[0109] The following combination Figure 3 , Figure 5 The preview of a variable block of a variable object executed in a visual programming interface and the interactive operation during the creation of a variable block of a variable object are described. Figure 5As shown, in response to the trigger operation of the "variable" control in the first menu bar 502, the second menu bar 504 matching the "variable" control is displayed, wherein the second menu bar 504 displays the trigger controls corresponding to the variable objects of different variable types that can be created. In response to the trigger operation of the "Boolean value" control in the second menu bar 504, the variable tile preview page matching the Boolean value variable object is displayed in the second operation area 516. As shown in the second operation area 516, the variable tile is not displayed, indicating that the Boolean value variable object has not been created at present. At the same time, the creation control 514 is displayed in the second operation area 516, indicating that the target variable control of the Boolean value type can be created through the creation control 514.

[0110] In response to Figure 5 The trigger operation of the creation control 514 in the interface switching display is as follows Figure 3 As shown, in Figure 3 The variable block corresponding to the currently created Boolean variable object is displayed in the second operation area 306. In addition, a subscript "①" is further displayed on the "Boolean" control in the second menu bar 304 to indicate that the number of Boolean variable objects that have been created is 1.

[0111] The following combination Figure 6 For the above Figure 5 , Figure 3 The implementation process of the interaction process in Figure 6 As shown, in this embodiment, the interactive objects involved include a user interface, a variable controller VariableController for providing variable object management operations, and an object array VariableStore for storing array elements corresponding to the variable objects.

[0112] Before executing the visual programming operation, the object array first executes S600 to initialize the object array Variables;

[0113] Then, in response to Figure 5 In the triggering operation of the "Boolean value" control in the second menu bar 504, the user interface executes S602 to request the variable controller to obtain the Boolean value variable list; the variable controller executes S604 to obtain the array object of the Boolean value type through the getAllVariables('Boolean') method;

[0114] Then, S606 is executed to filter out array objects of Boolean type. It can be understood that, at the current stage in this embodiment, Boolean variable objects have not yet been created, so the object array executes S608 to the variable controller and returns an empty set.

[0115] The user interface receives the return result of the variable controller and executes S610. In response to returning an empty array, the list is displayed as empty. Then, the visual programming interface can display the following: Figure 5 shown.

[0116] Then, in response to Figure 5 The trigger operation of creating control 514 in the user interface executes S611 to create a Boolean variable;

[0117] The variable controller executes S612, calls the method addVariable({id:'1', name:'Boolean variable 1', type:'Boolean'}), and adds an array element; then, the object array executes S614, updates the object array Variables = [{id:'1', name:'Boolean variable 1', type:'Boolean'}]; and executes S616, returning the update result;

[0118] Further, the variable controller executes S618, obtains an array object of the Boolean type through the getAllVariables('Boolean') method; the object array executes S620 and S622, filters out the array objects of the Boolean type; and returns the filtering result ({id:'1', name:'Boolean variable 1', type:'Boolean'});

[0119] The user interface receives the return result from the variable controller and executes S624. In response to returning a new Boolean variable, the interface displays a Boolean variable block. Figure 3 As shown, the variable block corresponding to the created Boolean variable object is displayed in the second operation area 306. At the same time, a superscript "①" is further displayed on the "Boolean" control in the second menu bar 304 to indicate that the number of Boolean variable objects that have been created is 1.

[0120] In an optional implementation, after adding the target array element to the object array for indicating the variable object set, the method further includes:

[0121] S1, in response to receiving a variable editing operation performed on a target variable object in a visual programming interface, determining an array element editing interface matching the variable editing operation from a variable operation interface set, wherein the variable operation interface set includes an array element editing interface;

[0122] S2, performing an element editing operation on the target array element according to the variable editing information carried in the variable editing operation and the array element editing interface to obtain an updated target array element.

[0123] It is understandable that, in this embodiment, an array element editing interface corresponding to the variable editing operation executed in the visual programming interface is further provided to achieve real-time response to the editing operation executed in the visual programming interface and manage the editing content in the object array. In this embodiment, the element information included in the array element in the object array may include: {id: string, name: string, type: T}, that is, when any one of the variable id, variable name, and variable type is edited and changed in the visual programming interface, any of the above information can be synchronously changed in the above object array.

[0124] In a specific editing method, the content that can be edited on the variable object may include the variable name of the variable object. Specifically, the array element editing interface can be represented by renameVariable, and the definition of the above array element editing interface is as follows:

[0125] public renameVariable(id:string,name:string){

[0126] const variable=this.getVariableById(id);

[0127] if(!variable){

[0128] return;

[0129] }

[0130] variable.name = name;

[0131] };

[0132] The public character is an access modifier, indicating that the array element editing interface renameVariable is public and can be accessed from outside the class. The character (variable:VariableModel) is the parameter list of the above array element editing interface, indicating that the addVariable method accepts two parameters, the first of which is the variable id (id:string) and the updated variable name "name:string".

[0133] Furthermore, in the above code field const variable = this.getVariableById(id), a constant named variable is declared, whose value is obtained by calling the getVariableById method of the current object and passing in the id parameter. This method can return a variable object with a given id, or undefined or null if it cannot be found.

[0134] if(!variable){return;} is used to indicate a conditional statement, which checks whether the variable object indicated by the received id exists. If it does not exist, null or undefined is returned. That is, if the array element corresponding to the variable object to be edited does not exist, that is, no matching variable is found, the method will exit early without performing any operation. If the variable object is found, the name attribute of the variable is updated to the value of the passed name parameter.

[0135] In summary, the above code snippet finds a variable with a specific id in the object array and updates its name property to the new name. If a variable with a given id is not found, no action is performed.

[0136] In an optional implementation, after adding the target array element to the object array for indicating the variable object set, the method further includes:

[0137] S1, in response to a variable deletion operation received in a visual programming interface, obtaining a second variable identifier indicated by the variable deletion operation, wherein the variable object operation includes a variable deletion operation;

[0138] S2, determining an array element deletion interface that matches the variable deletion operation from the variable operation interface set, wherein the variable operation interface set includes an array element deletion interface;

[0139] S3. Delete the second array element matching the second variable object from the variable object set according to the second variable identifier and the array element deletion interface, wherein the second variable identifier is used to indicate the second variable object.

[0140] It is understandable that in this embodiment, an array element deletion interface corresponding to the variable deletion operation performed in the visual programming interface is further provided to achieve real-time response to the deletion operation performed in the visual programming interface and delete the corresponding variable in the object array.

[0141] In a specific implementation, the array element deletion interface can be defined by the following code segment:

[0142] public deleteVariable(id:string){

[0143] const index=this.variables.findIndex((v)=>v.id===id);

[0144] if(index === -1){

[0145] return;

[0146] }

[0147] this.variables.splice(index,1);

[0148] In this implementation, the above code block can be used to find and delete the corresponding variable in the variables array according to the variable ID when an interactive operation of deleting a variable object is received in the visual editing interface.

[0149] The field public deleteVariable(id: string) defines a public method deleteVariable, which accepts a parameter id of type string. This ID is used to identify the variable to be deleted. In addition, the field const index = this.variables.findIndex((v)=>v.id===id) indicates that the findIndex method is used to find a variable in the variables array whose id attribute matches the passed id parameter and returns the index of the variable in the array. The findIndex method accepts a callback function that is executed for each array element until a matching element is found.

[0150] Furthermore, the conditional statement if(index === -1) in the above code block is used to check whether index is -1. If index is -1, it means that no matching element is found in the array. If no matching element is found (that is, index is -1), the method will exit early without performing any operation. On the contrary, execute this.variables.splice(index,1), that is, if a matching element is found (that is, index is not -1), this line of code uses the splice method to delete the found element from the variables array. Among them, the first parameter of the splice method is the index to start deleting elements, and the second parameter is the number of elements to be deleted. Here, one element is deleted, so the number is 1.

[0151] In the above implementation, a variable with a specific id can be found in the this.variables array through the above array element deletion interface and deleted. If a variable with a given id cannot be found, no operation is performed.

[0152] The following combination Figure 7 This article describes an operation for editing variable objects in a visual programming interface. Figure 7 As shown, in response to a long press operation on a variable tile 712 indicating a Boolean variable object displayed in the second operation area 706, an editing window 710 may be displayed in the first operation area 708, and the variable name "Boolean variable 1" of the current variable object may be further displayed in the editing window 710. It can be understood that in response to a trigger operation with the "Edit" control, an editing operation may be performed on the variable name "Boolean variable 1", such as a renaming operation; for another example, in response to a trigger operation with the "Delete" control, the currently created Boolean variable "Boolean variable 1" may be deleted.

[0153] The following combination Figure 8 For the above Figure 7 The specific implementation of the editing and deleting operations involved in the description is described below. Figure 7 The editing control of the editing window 710 in the editing window is triggered, and the user interface executes S802 to rename "Boolean variable 1" to "Boolean 1"; the variable controller executes S804 to modify the variable name through the renameVariable('2','Boolean 1') method (i.e., the array element editing interface); the object array executes S806 to search the object array Variables = [{id:'1', name:'Boolean variable 1', type:'Boolean'}]; S808 returns the search result, and the search is successful;

[0154] Then the variable controller executes S810, calling the method getAllVariables('Boolean') (i.e., the array element acquisition interface); the object array executes S812, filtering out array objects of the Boolean value type; after the variable name in the array element is edited, S812, returns the editing result ({id:'1', name:'Boolean 1', type:'Boolean'}); in the user interface, as in step S814, in response to returning a new Boolean variable, the interface displays an edited Boolean variable tile;

[0155] It can be understood that after completing the above Boolean variable name editing operation, you can further Figure 7 The trigger operation of the delete control of the edit window 710 in the execution Figure 8S816 in the code deletes "Boolean 1"; the variable controller executes S818 and calls the method deleteVariable('1') (i.e., the array element deletion interface); after the object array completes the deletion operation, S820 is executed to search the object array Variables = [] (i.e., the current object array has become an empty set); S822 is further executed to return the deletion result [];

[0156] The variable controller continues to execute S824, calling the method getAllVariables('Boolean') (i.e., the array element acquisition interface); the object array executes S826, filtering out variables with type = 'Boolean'; it can be understood that the current object array no longer includes array elements of the Boolean type, so S828 is executed to return the screening result []; the variable controller executes S830 to the user interface, returning an empty array (currently there are no array elements), and the list is displayed as empty.

[0157] Through the above implementation of the present application, a friendly interface is provided to create and manage different types of variables, so that users can clearly identify the types of variables during use, thereby reducing the complexity and difficulty of programming and improving the programming efficiency of visual programming.

[0158] In an optional implementation, after the above-mentioned step of responding to the variable object operation received in the visual programming interface and obtaining the variable type indicated by the variable object operation, further includes:

[0159] S1, when the variable object operation is a variable creation operation, obtaining a first code block matching the target variable type, wherein the first code block is used to describe variable attribute information of the variable object;

[0160] S2, according to the variable description information carried by the variable creation operation, the first code block is updated to the second code block, wherein the second code block is used to display the target variable block matching the target variable object in the visual programming interface, and the variable description information includes the variable identification information.

[0161] It is understandable that, in this embodiment, the above-mentioned visual programming interface can be implemented based on Blockly, and different types of variable blocks (also referred to as variable building blocks) are predefined based on Blockly. It should be noted that Blockly is an open source graphical programming library. Through the Blockly programming library, users can program using building blocks as interactive carriers, and support converting the building blocks dragged by users into different programming languages.

[0162] In this embodiment, corresponding variable blocks may be defined in advance for various variable objects, so that different variable objects can be represented based on different block styles in the above-mentioned visual programming interface.

[0163] In an optional manner, the attribute contents included in the first code block for defining the variable block representing the variable object may include the following aspects:

[0164] The tile type attribute is the unique identifier of the tile, which is used to distinguish the variable tiles corresponding to different types of variable objects;

[0165] Text property, which indicates the display text shown on the variable tile and can contain placeholders to represent fields and inputs;

[0166] Array attributes can be used to indicate the fields and input configurations included in the tile. For example, the field_image field included in the array attributes can be used to indicate the image displayed in the variable tile, the field_label field can be used to indicate the text displayed in the variable tile, and the field_dropdown field can be used to indicate the drop-down menu displayed in the variable tile;

[0167] The output property can be used to indicate the output type of the variable object indicated by the variable block, and is used to indicate what types of variable objects the current variable object can be connected to as inputs.

[0168] The extended attributes can be used to indicate the extended functions of the variable object indicated by the current variable block.

[0169] It should be noted that in the scenario of developing games through a visual programming interface, the special variable types that can be included may include, but are not limited to, "component" variables, "prop" variables, "particle" variables, "sound effect" variables, "logic element" variables, "motion unit" variables, "timer" variables, "task" variables, "trigger box" variables, "role" variables, "animation" variables, and "creature" variables. The extended functions of the above special types of variable objects can be described and defined in the above extended properties.

[0170] For example, the "component" variable can be used to refer to a common component or object in a game task. Its related properties, such as position, size, color, visibility, level, etc., can be defined in the above extended properties.

[0171] For example, the "item" variable can be used to indicate an item that a player can pick up or use in the game. Its properties, such as type, durability, effect, weight, icon, description, etc., can be defined in the above extended properties.

[0172] For example, the "particle" variable can be used to indicate the visual effects created in the game scene, such as smoke, fire, magic effects, etc. Its related properties, such as particle type, speed, life cycle, color, size, emission rate and other information can be defined in the above extended properties.

[0173] For example, the "sound effect" variable can be used to indicate the sound effects in the game, such as background music, character voice, action sound effects, etc. Its properties such as volume, pitch, loop, play status, sound effect file path, etc. can be defined in the above extended attributes.

[0174] For another example, the "Logic Component" variable can be used to indicate components that implement game logic, such as triggers, conditional judgments, etc. Its properties, such as trigger conditions, execution actions, priority, activation status, etc., can be defined in the above-mentioned extended properties.

[0175] For example, a "motion unit" variable can be used to indicate a component that controls the movement of an object in a game. Its properties, such as speed, acceleration, direction, path, movement type (such as linear, curve), etc., can be defined in the above extended properties.

[0176] For example, a "Timer" variable can be used to indicate a component in a game that tracks time intervals and performs timed tasks. Its properties, such as duration, delay, number of repetitions, current state (such as running, paused, stopped), etc., can be defined in the above extended properties.

[0177] For example, a "Task" variable can be used to indicate a task or goal in the game, which the player needs to complete to advance the game. Its attributes such as description, goal, completion status, reward, difficulty, etc. can be defined in the above extended attributes.

[0178] For example, the "Trigger Box" variable can be used to indicate a specific area defined in the game, and events are triggered when the player or object enters these areas. Its properties, such as size, position, trigger event, activation state, etc., can be defined in the above extended properties.

[0179] For example, the "Character" variable can be used to indicate the main character or NPC (non-player controlled character) in the game. Its attributes such as health, energy, attack power, defense power, movement speed, character model and other information can be defined in the above extended attributes.

[0180] For example, the variable "Animation" can be used to indicate visual animations in the game, which are used for characters, objects or interface elements. Its properties such as animation state, frame rate, loop, playback speed, animation file path and other information can be defined in the above extended properties.

[0181] For example, the variable "Creature" can be used to indicate virtual creatures or virtual monsters in the game, which may be aggressive or have specific behaviors. Its attributes such as health, behavior pattern, attack method, reproduction rate, ecological niche, etc. can be defined in the above extended attributes.

[0182] In a specific implementation, the variable tile can be defined through a JSON object. The JSON object describes the appearance, behavior, and properties of the variable tile. Therefore, different JSON objects can be pre-defined for different variable types, and corresponding variable tiles can be created and displayed for each variable type.

[0183] Furthermore, in this embodiment, a function generateVarGetterBlockDefinitionCodeByVarType for generating different types of variable block definitions can be encapsulated, and the function accepts a parameter type representing the variable type of the variable object. The function will define a new building block according to the variable object creation operation in the visual programming interface and the variable type given by the variable creation operation, using the variable block creation method Blockly.defineBlocksWithJsonArray.

[0184] Among them, the definition of the variable block creation method, namely Blockly.defineBlocksW1thJsonArray, can be implemented as follows:

[0185] Blockly.defineBlocksW1thJsonArray([

[0186] {

[0187] type:'Variable_Getter_${type}',

[0188] message0: %1%2',

[0189] args0:[

[0190] {

[0191] type:'field_image',

[0192] src:globalVarIcon,

[0193] width:28,

[0194] height:22,

[0195] name:"varicon,

[0196] },

[0197] {

[0198] type:'field_label',

[0199] name:'varName',

[0200] },

[0201] ],

[0202] output:[type,'${type}_Var'],

[0203] style:'variables_blocks',

[0204] mutator:'var_mutator',

[0205] }, ]);

[0207] The above method Blockly.defineBlocksWithJsonArray can accept a JSON array as a parameter to define a newly created variable block for representing a variable object.

[0208] Among them, the type field defines the type of the building block, in which the template string Variable_Getter_${type} is used, indicating that the block type will be dynamically generated according to the variable type carried in the received creation request; the message0 field defines the message displayed on the block, in which placeholders %1%2 are used, and these placeholders will be replaced when actually used; the args0 array defines the input parameters of the block, including an image field field_image (displaying the variable icon) and a label field field_label (displaying the variable name); the output field defines the output type of the block, in which the template string ${type}_Var is used, indicating that the output type is related to the variable type; the style field specifies the style of the block, 'variables_blocks' may be a predefined style; the mutator field specifies the type of editor that pops up when the block is clicked, 'var_mutator' may be a custom editor for editing variables.

[0209] In the above implementation, a function for creating a variable block can be defined, which can generate corresponding block definition codes according to different variable types, and these codes are then used to create visual blocks in the Blockly editor. These blocks can be used to obtain different types of variables in the Blockly programming environment.

[0210] It is understandable that, since the output connections, the corresponding block display styles, and the corresponding default variable names corresponding to different variable objects may be different, the definition contents corresponding to different types of variable objects may be different. In the above implementation, the first code block corresponding to the variable type indicated by the current variable creation operation can be obtained through the above S1, and then the first code block can be updated to the second code block according to the other creation information obtained, so as to display the variable block in the visual programming interface according to the second code block.

[0211] Specifically, a corresponding relationship between the second code block and the variable block can be as follows: Fig. 9 When the input type is Boolean, the type of the corresponding variable block is Variable_Getter_Boolean. The variable block generated is as follows. Fig. 9 As shown on the right. Fig. 9 In the second code block shown on the left side, the code segment 900 can be determined according to the target variable type (Boolean value type) of the acquired target variable object, and the code segment 900 can be determined according to the preset content in the first code block corresponding to the target variable type. Fig. 9The code segment 901 in it is used to define the icon style of the variable icon displayed in the target variable block. Among them, the corresponding pixel height and width of the icon, as well as the style of the icon are defined. In an optional manner, the style can be used to indicate that the current variable object is a global variable object. In addition, based on the variable description information obtained in the creation request, that is, the variable identification information "Boolean variable 1", the code segment 902 can be determined, that is, the variable name displayed in the variable block is defined. Finally, code segment 903 defines the variable types that the current variable object can be connected to. It can be understood that code segment 903 can be the content carried in the above-mentioned first code block, that is, the variable types of variable objects to which each variable object can be connected can be pre-defined in code segment 903. In Fig. 9 In the code segment 903, the output type can be defined as a "Boolean value" type.

[0212] In another specific implementation, the correspondence between the second code block and the variable block can be as follows: Fig.10 When the input type is a numeric type Number, the type of the corresponding variable block generated is Variable_Getter_Number. The variable block generated is as follows Fig.10 As shown on the right. Fig.10 In the second code block shown on the left side, the code segment 1000 can be determined according to the target variable type (numeric type) of the acquired target variable object, and the code segment 1000 can be determined according to the preset content in the first code block corresponding to the target variable type. Fig.10 The code segment 1001 in it is used to define the icon style of the variable icon displayed in the target variable block. Among them, the corresponding pixel height, width, and style of the icon are defined. In an optional manner, the style can be used to indicate that the current variable object is a global variable object. In addition, based on the variable description information obtained in the creation request, that is, the variable identification information "numeric variable 1", the code segment 1002 can be determined, that is, the variable name displayed in the variable block is defined. Finally, code segment 1003 defines the variable type that the current variable object can be connected to. It can be understood that code segment 1003 can be the content carried in the above-mentioned first code block, that is, the variable type of the variable object to which each variable object can be connected can be pre-defined in code segment 1003. In Fig.10 In the code segment 1003, the output type can be defined as a "numeric" type.

[0213] In addition, in this embodiment, different block styles can be configured for variable blocks used to represent different variable objects, for example Fig. 9In the first code block corresponding to the Boolean value type, the block style of the Boolean variable block used to represent the Boolean variable object can be set to a hexagon through the attributes in the block definition. Fig.10 In the first code block corresponding to the numerical value, the block style of the numerical variable block used to represent the numerical variable object can be set to an ellipse through the attributes in the block definition, so that variable blocks of different variable types can be distinguished and displayed in the visual programming interface.

[0214] Through the above-mentioned implementation mode of the present application, by introducing types for variables during the process of visual programming, it can be ensured that users use the correct variable types during visual programming, thereby avoiding program failure or unexpected results caused by type errors, thereby improving the programming efficiency of visual programming.

[0215] In an optional implementation, after updating the first code block to the second code block according to the variable description information carried by the variable creation operation, the method further includes:

[0216] S1, in response to dragging a target variable tile to a tile area associated with an operation tile in a visual programming interface, obtaining a reference variable type matched with the operation tile, wherein the operation tile is used to generate a variable operation code block associated with a variable object, and the reference variable type is a variable type matched with the variable operation code block;

[0217] S2: Determine a drag result of the drag operation according to a matching relationship between the reference variable type and the second code block.

[0218] It can be understood that in this embodiment, after the target variable block is created in the visual programming interface, in the subsequent visualization operation process, if it further involves variable operations on the target variable object indicated by the target variable block, the matching results related to the interaction will be determined during the interaction process.

[0219] It should be noted that, in this embodiment, the above-mentioned operation block can be used to indicate the operation type of the related object operation performed on the variable object. For example, when the above-mentioned operation block is specifically an assignment block, it can be used to indicate the assignment operation performed on the variable object; for another example, when the operation block is specifically a calculation block, it can be used to indicate the numerical calculation operation performed on the variable object. In this embodiment, the reference variable type matched with the above-mentioned operation block can be determined according to at least one of the multiple block areas included in the operation block. The following is combined with Fig.11 The various optional operation blocks involved in the above-mentioned visual programming interface are described in detail.

[0220] For example Fig.11In the visual programming interface shown, in response to selecting the "action" control from the first menu bar 1102 and selecting the "assignment" control in the second menu bar 1104 corresponding to the "action" control, the operation blocks corresponding to the various assignment controls are displayed in the second operation area 1106. In the case where the first operation block is selected as the target operation block, an operation block 1110 can be displayed in the first operation area 1108, and the operation block 1110 includes two interactive block areas, wherein the first block area is used to fill in the variable block for indicating the variable object, and the second block area is used to fill in the block or value for indicating a specific numerical value. In addition, the first variable block 1112 of the Boolean type and the second variable block 1114 of the numerical type are also displayed in the first operation area 1108. It can be understood that in the operation block 1110, the corresponding tile type in the first tile area needs to match the numerical type in the second tile area. For example, in the case of a variable block of Boolean type in the first tile area, the numerical type in the second tile area should be Boolean; in the case of a variable block of numerical type in the first tile area, the numerical type in the second tile area should be numerical.

[0221] Assume that Fig.11 The first variable block 1112 in the first operation area 1108 is dragged to the first block area in the operation block 1110. Since the second block area in the current operation block 1110 does not include relevant values, it can be directly determined that the reference variable type matching the operation block matches the target variable type corresponding to the first variable block 1112, and then Fig.12 As shown, the operation tile 1200 is updated and displayed as a first operation tile 1206 .

[0222] It should be noted that in Fig.12 In the case where no other tiles are dragged into the first tile area 1202 and the second tile area 1204 of the operation tile 1200, the default ellipse style may be displayed. When the first variable tile corresponding to the Boolean variable 1 is dragged into the first tile area, the operation tile 1200 is updated and displayed as the first operation tile 1206. On the one hand, in the first operation tile 1206, the area styles of the first tile area and the second tile area are adjusted to a style that matches the tile style of the first variable tile, i.e., a hexagonal style, indicating that only Boolean type variable objects or numerical objects can be accepted in the two current tile areas; on the other hand, the content displayed in the second tile area is updated to display the default Boolean value "false" and a drop-down window to select another Boolean value "true";

[0223] When the second variable block corresponding to the numerical variable 1 is dragged into the first block area, the operation block 1200 is updated and displayed as the second operation block 1208. On the one hand, in the first operation block 1208, the area styles of the first block area and the second block area are adjusted to match the block style of the second variable block, that is, the elliptical style, indicating that only variable objects or numerical objects of numerical type can be accepted in the two current block areas; on the other hand, the content displayed in the second block area is updated and displayed as the default "numerical value 0" and the editing window, so as to assign other numerical values ​​to the variable object "numerical variable 1".

[0224] It can be understood that when the variable tile in the first tile area 1202 dragged into the operation tile 1200 is a string tile, correspondingly, the first tile area 1202 will be updated and displayed as the area style corresponding to the string tile, and the second tile area 1204 will also be synchronously updated to the area style corresponding to the string tile to indicate the object type of the variable object allowed by the current assignment operation.

[0225] In an optional implementation manner, the above-mentioned determining the drag result of the drag operation according to the matching relationship between the reference variable type and the second code block includes:

[0226] Case 1: when the target variable object is the variable object to be input in the operation block, the first variable type is obtained from the first field in the second code block, wherein the first field is used to indicate the variable type that allows the target variable object to be obtained as input; when the first variable type does not match the reference variable type, the target prompt information is displayed;

[0227] It is understandable that, when the target variable object is a variable object to be input in the operation block, the first variable type indicating the output type of the target variable object can be obtained from the first field, and whether to display the prompt information is determined according to the matching relationship between the output type of the target variable object and the corresponding reference variable type of the operation block. In a specific implementation, the first field can be specifically Fig.10 Code segment 1003 in the second code block in .

[0228] Case 2: when the target variable object is a variable object that accepts input in the operation block, the target variable type is obtained from the second field in the second code block, wherein the second field is used to indicate the target variable type of the target variable object; when the target variable type does not match the reference variable type, the target prompt information is displayed;

[0229] It is understandable that, when the target variable object is a variable object that accepts input in the operation block, the target variable type of the target variable object can be obtained from the second field, and whether to display the prompt information is determined based on the matching relationship between the target variable type of the target variable object and the reference variable type corresponding to the operation block. In a specific implementation, the second field can be specifically Fig.10 The code segment 1000 in the second code block in .

[0230] Furthermore, in different situations, the corresponding field for type matching can be obtained from the second code block, and the variable type obtained from the corresponding field can be compared with the reference type corresponding to the operation block.

[0231] When a mismatch is determined, the information style of the target prompt information may include but is not limited to one or more of a text style, an image style, a video style, etc., to indicate that the current variable object does not match the variable type corresponding to the operation block.

[0232] In a specific embodiment, when any one of the block areas in the above-mentioned operation block 1200 has been dragged into the corresponding block, the operation block 1200 will require that the types of the two inputs must match, that is, Boolean variables can only be connected to Boolean values, and numerical variables can only be connected to numerical values. Connections with incorrect types are not allowed, that is, values ​​of numerical type cannot be assigned to Boolean variables, and values ​​of Boolean type cannot be assigned to numerical variables.

[0233] For example Fig.13 In the case where the value tile 1304 is dragged to the second tile area in the first operation tile 1302, since the variable type corresponding to the value tile 1302 is "value", and the first operation tile 1302 has been matched with the variable object of the "Boolean value" type, the border of the value tile 1304 can be highlighted as target prompt information, indicating that the current value fails to match and cannot be dragged to the second tile area of ​​the first operation tile 1302;

[0234] Another example Fig.14 As shown, when the Boolean value tile 1404 is dragged to the second tile area in the second operation tile 1402, since the variable type corresponding to the Boolean value tile 1402 is "Boolean value", and the second operation tile 1402 has been matched with the variable object of the "numeric value" type, the border of the Boolean tile 1404 can be highlighted as target prompt information, indicating that the current value matching fails and cannot be dragged to the second tile area of ​​the second operation tile 1402;

[0235] It is understandable that when a certain type of value is dragged into the input of the first block area of ​​the operation block, the "Any variable" input of the "Set variable block" will only accept variable types that match the value type.

[0236] like Fig.15 As shown, when the "Any Value" input of the first tile area of ​​the first operation block 1502 is dragged into a Boolean variable, only the Boolean variable can be connected to the "Any Variable" input again, while the numeric variable and the string variable cannot be connected. For example, when the second variable block 1504 "Numeric Variable 1" is dragged to the first tile area, the second variable block 1504 "Numeric Variable 1" is highlighted, indicating that the current drag operation cannot be completed; when the "Any Value" input of the first tile area of ​​the second operation block 1504 is dragged into a numeric variable, only the numeric variable can be connected to the "Any Variable" input again, while the Boolean variable and the string variable cannot be connected. For example, when the first variable block 1508 "Boolean Variable 1" is dragged to the first tile area, the first variable block 1508 "Numeric Variable 1" is highlighted, indicating that the current drag operation cannot be completed.

[0237] In addition, when the operation block is specifically a calculation block, type matching of the variable object can also be performed according to similar logic in the above implementation, and the operation result of the interactive operation in the visual programming interface can be determined according to the result of the type matching.

[0238] For example Fig.16 In the visual programming interface shown, in response to selecting the "Function" control from the first menu bar 1602 and selecting the "Math" control in the second menu bar 1604 corresponding to the "Function" control, the operation tiles corresponding to the various math calculation controls are displayed in the second operation area 1606. In the case where the first operation tile is selected as the target operation tile, in response to dragging the operation tile to the first operation area 1608, an operation tile 1610 can be displayed in the first operation area 1608, and the operation tile 1610 includes two interactive tile areas, wherein the first tile area is used to fill in the variable tile or value indicating the first calculation object, and the second tile area is used to fill in the variable tile or value indicating the second calculation object.

[0239] Furthermore, if Fig.17As shown, in the third operation block 1302 for indicating addition calculation, the operation nature of its object operation determines that it can only accept variable objects of numerical type. Therefore, in response to dragging the second variable block 1704 to the first block area, the drag result "numerical variable 1" can be displayed in the first block area of ​​the third operation block 1702; the second variable block 1704 cannot accept a Boolean type variable as the object of its addition calculation, therefore, in response to dragging the first variable block 1706 to the second block area, the first variable block 1706 is highlighted, indicating that the Boolean type variable block cannot be dragged to the block area in the third operation block 1702.

[0240] It is understandable that in this embodiment, the mathematical operation block also has mandatory requirements for the input variable type, and can only accept variables of numerical type, and does not accept variables of Boolean value / string type. This can avoid the mistaken use of Boolean value / string type variables where numerical values ​​are required for calculation, thereby avoiding type errors.

[0241] In an optional implementation manner, after determining the drag result of the drag operation according to the matching relationship between the reference variable type and the second code block, the method further includes:

[0242] S1, when the drag operation fails, obtaining a third code block matching the reference variable type, wherein the third code block is used to describe variable attribute information of the candidate variable object;

[0243] S2, displaying a candidate variable block in a visual programming interface according to the third code block.

[0244] It can be understood that in this embodiment, when the drag interaction operation cannot be completed due to type mismatch, the candidate variable block can be displayed in the visual programming interface, wherein the variable type corresponding to the candidate variable block matches the reference variable type corresponding to the operation block.

[0245] Optionally, the third code block may be a code block corresponding to a variable block that has not yet been created; in another optional manner, the third code block may also be a code block corresponding to a variable block that has been created.

[0246] In a visual programming environment, users often construct program logic by dragging and dropping. In this embodiment, if the drag operation fails because the variable type of the block fails to match, a third code block can be searched in a preset code block set according to the reference variable type corresponding to the operation block, wherein the third code block is used to describe the variable block of the variable object that matches the reference variable type. If the search is successful, the candidate variable block can be displayed based on the third code block.

[0247] Optionally, the method of displaying the candidate variable tile may include but is not limited to highlighting, floating prompt or creating a new tile on the interface. Then, the user can view the candidate variable tile and determine whether to use this predicted tile. If the user chooses to accept the current candidate variable tile, the candidate variable tile can be kept displayed in the visual programming interface. If the current candidate variable tile is not selected for use, on the one hand, the display of the candidate variable tile can be canceled; on the other hand, the prediction result can be recorded and the tile prediction algorithm can be improved based on the current prediction result.

[0248] like Fig.18 As shown, when the "Any Value" input in the first tile area of ​​the first operation tile 1802 is dragged into a Boolean variable, only the Boolean variable can be connected to the "Any Variable" input again, while the numeric variable and the string variable cannot be connected. For example, when the second variable tile 1804 "Numeric Variable 1" is dragged to the first tile area, the second variable tile 1804 "Numeric Variable 1" is highlighted, indicating that the current drag operation cannot be completed; at the same time, the first variable tile 1806 as a candidate variable tile is displayed in a dotted line style on the right side of the second variable tile 1804, wherein the first variable tile 1806 can be a variable tile corresponding to a variable object of a Boolean type that has been created in advance;

[0249] Another example Fig.19 As shown, when the "any value" input in the first tile area of ​​the first operation tile 1902 is dragged into a Boolean variable, and when the second variable tile 1904 "numeric variable 1" is dragged to the first tile area, the second variable tile 1904 "numeric variable 1" is highlighted, indicating that the current dragging operation cannot be completed; at the same time, the third variable tile 1906 as a candidate variable tile is displayed in a dotted line style on the right side of the second variable tile 1904, wherein the third variable tile 1906 can be a variable block corresponding to a Boolean type variable object that has not yet been created.

[0250] Through the above-mentioned implementation mode of the present application, when the drag operation fails, a third code block matching the reference variable type is obtained; candidate variable blocks are displayed in the visual programming interface according to the third code block, and when the user fails to drag the block, the accurate block can be predicted and displayed, so as to facilitate the user to quickly select the variable block of the correct type of variable object, thereby improving the programming efficiency of the visual programming operation.

[0251] In an optional implementation manner, after updating the first code block to the second code block according to the variable description information carried by the variable creation operation, the method further includes:

[0252] S1, in response to a variable editing operation on a target variable block in a visual programming interface, obtaining variable editing information indicated by the variable editing operation;

[0253] S2. Update the third field in the second code block according to the variable editing information, wherein the third field is used to indicate the variable identification information of the target variable object.

[0254] The following combination Figure 7 This article describes an operation for editing variable objects in a visual programming interface. Figure 7 As shown, in response to a long press operation on the variable tile 712 for indicating a Boolean variable object displayed in the second operation area 706, an editing window 710 may be displayed in the first operation area 708, and the variable name "Boolean variable 1" of the current variable object may be further displayed in the editing window 710. It is understandable that in response to the triggering operation with the "Edit" control, an editing operation may be performed on the variable name "Boolean variable 1", such as a renaming operation. Correspondingly, as Fig.10 As shown, in the second code block corresponding to "Boolean value variable 1", the "name" field in the code segment 1002 can be modified and adjusted in response to the editing operation.

[0255] In an optional implementation, the updating of the first code block to the second code block according to the variable description information carried by the variable creation operation includes:

[0256] Case 1: when the variable creation operation is a first variable creation operation, the third field in the first code block is updated according to the variable identification information included in the variable description information to obtain a second code block, wherein the variable type corresponding to the first variable creation operation is determined from a plurality of preset variable types;

[0257] It can be understood that the above implementation can be a variable object creation operation performed based on a preset variable type, and then a first code block matching the type can be directly obtained, and the first code block can be updated based on the identification information obtained during the creation operation to obtain a second code block for indicating the target variable object that has been created.

[0258] Case 2: When the variable creation operation is a second variable creation operation, the first code block is updated to a fourth code block according to the variable identification information and variable combination information included in the variable description information, wherein the variable type corresponding to the second variable creation operation is a custom variable type, and the variable combination information is used to indicate at least one data type carried in the target variable.

[0259] In this embodiment, the user may also customize a new variable type, and determine a fourth code block for indicating a variable object of the customized variable type based on the variable combination information and variable identification information included in the customized variable type.

[0260] The following combination Fig. 20 Describes an optional custom variable object. For example Fig. 20 The interface shown creates a variable object of type "custom creature". This variable object has three attribute values ​​represented by value 1 "health", value 2 "energy" and value 3 "speed", and the variable types corresponding to the above three attribute values ​​are all numerical types. In addition, you can also Fig. 20 The variable adding control 2002 in the interface shown in the figure further adds a variable object of a numerical type to the object properties of the currently customized variable object. Fig.10 In the code block shown, the "mutator" (additional attribute) is added with descriptive information corresponding to the object attributes represented by the above variable object.

[0261] It can be understood that in the process of performing variable type matching based on custom variables, it is necessary to determine the respective matching results based on the variable types corresponding to each variable object in the variable combination information corresponding to the custom variables, and determine that the matching operation of the variable object is completed when multiple variable objects in the variable combination information meet the type matching results.

[0262] A complete implementation of the present application is described below. This implementation can be run on hardware devices that support a web browser, such as personal computers, tablet computers, and smart phones. Users can access applications based on the Blockly visual programming library through these devices.

[0263] In the implementation manner of the present application, different types of variable building blocks can be pre-defined based on the Blockly open source graphical programming library to display variable blocks (building blocks) used to represent different variable objects in a visual programming interface; in addition, all variable information can be stored based on the MobX framework to perform real-time judgment and management of variable status and type during variable operations in the visual interface; in addition, an interface display of variable management can be provided based on the React framework.

[0264] It should be noted that Blockly is an open source graphical programming library that allows users to build programs by dragging and dropping graphical programming blocks without writing code directly. These programming blocks represent different programming constructs, such as loops, conditional statements, function calls, etc., which can be combined to create more complex program logic. MobX is a powerful and easy-to-use JavaScript state management library. Based on the principles of responsive programming, it can automatically track state changes and trigger UI updates when the state changes. React is an open source JavaScript library that focuses on building high-performance, composable user interfaces. It uses componentization and virtual DOM technology to make the development and maintenance of single-page applications easier and more efficient. React has a large community support and can be seamlessly integrated with a variety of front-end libraries and frameworks, providing cross-platform application development capabilities.

[0265] In the implementation mode of the present application, Blockly provides the functions of visual programming and variable building blocks, MobX is responsible for managing variable information, and React is responsible for building and rendering the user interface.

[0266] The following is an explanation of how to implement interface rendering based on React. In this implementation, the following key components are created to implement the entire interface:

[0267] VariablePanel (Variable Panel Component): This is the main container component, which is used to display the entire variable panel, which contains all other subcomponents such as VariableTab and VariableList.

[0268] VariableTab (variable menu component): This component represents a secondary menu, which is divided into multiple tabs according to the type of variable. Each tab corresponds to a variable type, such as integer, floating point, string, Boolean, list, etc. Users can view and operate variables of a specific type by clicking different tabs.

[0269] VariableList (variable list component): This component displays a list of variables of the corresponding type in each VariableTab. Each item in the list represents a building block corresponding to a variable, showing the name of the variable.

[0270] VariableBtn (variable control): This component acts as a button to trigger specific actions in the variable management interface, such as creating, editing, or deleting variables.

[0271] VariablePopup: This component is a popup window used to host the editing or deletion of existing variables. When the user clicks a variable block in the VariableList, the VariablePopup will pop up.

[0272] The following combination Figure 3 , the structural relationship of the above components in React is explained. When "variable control" is selected in the first menu bar 302, the area surrounded by the second menu bar 304 and the second operation area 306 is the display area corresponding to the VariablePanel (variable panel component). In the display area corresponding to the VariablePanel (variable panel component), two lists are further included, wherein the first list corresponds to the second menu bar 304, which is used to indicate that various variable objects correspond to the operation controls respectively, so as to trigger the display of the variable lists corresponding to each variable object; the second list corresponds to the second operation area 306, which displays the object list of variable objects under the currently selected variable type, with the variable blocks corresponding to the variable objects. In addition, under the VariablePanel (variable panel component), two VariableBtn (variable controls are further included. The first control in the second operation area 306 is used to create a new Boolean variable object; the second control is used to create a new Boolean group object.

[0273] Furthermore, if Figure 7 In response to the triggering operation on the variable block 712, the editing window 710 corresponds to the above-mentioned VariablePopup (pop-up window) component, which further includes two VariableBtn (variable control) components, which may specifically include an edit control and a delete control.

[0274] Through the above implementation, a convenient and easy-to-use variable management interface can be provided to users, making it easier to create and maintain Blockly-based applications, thereby improving the programming efficiency of Blockly-based visual programming.

[0275] Furthermore, in the process of storing and managing all variable information based on the MobX framework, the object operations performed on variable objects can first be abstracted into at least four types: the first type, creating variables: allows users to create different types of variables, such as integers, floating point numbers, strings, Boolean values, lists, etc. Usually, users need to specify a unique name for the variable in order to reference it in the program; the second type, modifying variables: allows users to change the name of the variable; the third type, deleting variables: allows users to delete variables that are no longer needed from the program; the fourth type, displaying variables: displays all currently created variables and their related information.

[0276] Based on the above abstract results of the object operation performed on the variable object, the basic data structure of the variable object can be further abstracted, that is, the basic data structure of the variable can include the variable id, name, and type. Among them, the "id" field is used to store the variable id information of the string type, the "name" field is used to store the variable name information of the string type, and the "type" field is used to store the variable type, such as Boolean (Boolean value) type, Number (array) type, String (string) type.

[0277] At the same time, a class named VariableStore is created based on MobX, which contains a variables variable (this variable is an array) for storing and managing all variable information. At the same time, this class provides interfaces such as creating variables addVariable, deleting variables deleteVariable, and renaming variables renameVariable. The specific method content corresponding to the above interfaces can refer to the above embodiments.

[0278] Furthermore, the above-mentioned Blockly provides the functions of visual programming and variable building blocks, MobX is responsible for managing variable information, and React is responsible for building and rendering the user interface. The implementation process can further include:

[0279] S1, users create, edit, or delete variables through the interface developed by React components.

[0280] S2, the React component updates the variable information of the user operation to the MobX state management library for storage through the Controller (object manager) logic class.

[0281] S3, the React component automatically updates the interface according to the state changes in the MobX library to display the latest variable information.

[0282] The following combination Fig.21 , Fig. 22 A complete implementation timing process of this application is described.

[0283] The following combination Figure 6 For the above Figure 5 , Figure 3 The implementation process of the interaction process in Figure 6 As shown, in this embodiment, the interactive objects involved include a user interface, a variable controller VariableController for providing variable object management operations, and an object array VariableStore for storing array elements corresponding to the variable objects.

[0284] Before executing the visual programming operation, the object array first executes S2100 to initialize the object array Variables;

[0285] Then, in response to Figure 5 In the triggering operation of the "Boolean value" control in the second menu bar 504, the user interface executes S2102 to request the variable controller to obtain the Boolean value variable list; the variable controller executes S2104 to obtain the array object of the Boolean value type through the getAllVariables('Boolean') method;

[0286] Then, S2106 is executed to filter out array objects of Boolean type. It can be understood that, at the current stage in this embodiment, Boolean variable objects have not yet been created, so the object array executes S2108 to the variable controller and returns an empty set.

[0287] The user interface receives the return result of the variable controller and executes S2110. In response to returning an empty array, the list is displayed as empty. Then, the visual programming interface can display the following: Figure 5 shown.

[0288] Then, in response to Figure 5 The trigger operation of creating control 514 in the user interface executes S2111 to create a Boolean variable;

[0289] The variable controller executes S2112, calls the method addVariable({id:'1', name:'Boolean variable 1', type:'Boolean'}), and adds an array element; then, the object array executes S2114, updates the object array Variables = [{id:'1', name:'Boolean variable 1', type:'Boolean'}]; and executes S2116, returning the updated result;

[0290] Further, the variable controller executes S2118, obtains an array object of the Boolean type through the getAllVariables('Boolean') method; the object array executes S2120 and S2122, filters out the array objects of the Boolean type; and returns the filtering result ({id:'1', name:'Boolean variable 1', type:'Boolean'});

[0291] The user interface receives the return result from the variable controller and executes S2124. In response to returning a new Boolean variable, the interface displays a Boolean variable block. Figure 3As shown, the variable tile corresponding to the created Boolean variable object is displayed in the second operation area 3021. At the same time, a superscript "①" is further displayed on the "Boolean" control in the second menu bar 304 to indicate that the number of created variable objects of the Boolean type is 1.

[0292] Similarly, in the process of creating a new variable object of the numerical type, steps S2126 to S2150 can be executed, and the interaction and processing logic are roughly similar to the processing logic involved in the above steps S2102 to S2124.

[0293] Next, in response to performing an edit and delete operation on "Numerical Variable 1" in the visual programming interface, the corresponding steps are as shown in Fig.21 2202 to 2230.

[0294] In response to the edit operation on "Numerical Variable 1" based on the edit window, the user interface executes S2202 to rename "Numerical Variable 1" to "Numerical 1"; the variable controller executes S2204 to modify the variable name through the renameVariable('2', 'Numerical 1') method (i.e., the array element edit interface); the object array executes S2206 to search for the object array Variables = [{id: '1', name: 'Numerical Variable 1', type: 'Number'}]; S22022 returns the search result, and the search is successful;

[0295] Next, the variable controller executes S2210 to call the method getAllVariables('Number') (i.e., the array element acquisition interface); the object array executes S2212 to filter out the array objects of the numerical type; after the variable name editing in the array elements is completed, S2212 returns the edit result ({id: '1', name: 'Number 1', type: 'Number'}); in the user interface, as in step S2214, in response to returning a new numerical variable, the interface displays an edited numerical variable tile;

[0296] It can be understood that after completing the variable name editing operation of the above numerical variable, further based on the trigger operation of the delete control, execute Fig. 22S2216 in the code deletes "value 1"; the variable controller executes S2218 and calls the method deleteVariable('2') (i.e., the array element deletion interface); after the object array completes the deletion operation, S2220 is executed to search the object array Variables = [{id:'1', name:'Boolean variable 1', type:'Boolean'}] (i.e., only Boolean value variables are left in the current object array); S2222 is further executed to return the deletion result Variables;

[0297] The variable controller continues to execute S2224, calling the method getAllVariables('Number') (i.e., the array element acquisition interface); the object array executes S2226, filtering out variables with type = 'Number'; it can be understood that the current object array no longer includes array elements of numeric types, so S2228 is executed to return the filtering result []; the variable controller executes S2230 to the user interface, returning an empty array (currently there are no array elements), and the list is displayed as empty.

[0298] Through the above implementation of the present application, by introducing types for variable objects, it is possible to ensure that users use the correct variable types when programming, thereby avoiding program failures or unexpected results caused by type errors. This makes Blockly-based applications more robust and reliable; in addition, the introduction of variable types can make the code more readable, so that developers can clearly know the type and purpose of the variables when viewing the code. This helps to improve the maintainability of the code and improve the efficiency of performing programming operations based on the visual programming interface;

[0299] In the above implementation, by providing a friendly interface to create and manage different types of variables, users can clearly identify the types of variables during use. This reduces the complexity and difficulty of programming, allowing users to focus more on implementing program logic; in addition, in the above implementation, by introducing variable types and providing a friendly variable management interface, programming education is made more intuitive and easy to understand, and the readability and comprehensibility of the visual programming process are improved.

[0300] Finally, in the above implementation of the present application, by providing a unified variable management interface, users can quickly create, edit and delete variables. This helps to improve development efficiency and allows users to complete the development of Blockly-based applications more quickly.

[0301] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0302] According to another aspect of the embodiment of the present invention, there is also provided an object variable operation device for implementing the above object variable operation method. Fig.23 As shown, the device comprises:

[0303] An acquisition unit 2302 is used to, in response to a variable object operation received in a visual programming interface, acquire a target variable type indicated by the variable object operation, wherein the visual programming interface is used to receive an interactive operation to generate program content matching the interactive operation, and the interactive operation includes the variable object operation;

[0304] A determining unit 2304 is configured to determine at least one target variable operation interface that matches the variable object operation from a variable operation interface set, wherein the variable operation interface set includes a plurality of variable operation interfaces;

[0305] The operation unit 2306 is used to perform at least one object operation on the variable object set according to at least one of the target variable operation interfaces and the target variable type, wherein the variable object set is used to store object information of at least one variable object created according to the visual programming interface, and the variable object is displayed as a variable block style in the visual programming interface.

[0306] In some embodiments, the above-mentioned operation unit 2306 includes: a generation module, which is used to generate a target array element matching the target variable object according to the variable identification information indicated by the variable creation operation and the type description information indicating the target variable type when the variable object operation is a variable creation operation; an adding module, which is used to add the target array element to the object array used to indicate the variable object set, wherein the array elements in the object array are respectively used to indicate a variable object.

[0307] In some embodiments, the above-mentioned determination unit 2304 includes: a first determination module, used to determine an array element adding interface that matches the variable creation operation from the variable operation interface set, wherein the variable operation interface set includes the array element adding interface, and the array element adding interface is used to generate the array element that matches the variable object according to the variable identification information and type description information indicated by the variable creation operation.

[0308] In some embodiments, the above-mentioned object variable operation device also includes: an editing unit, which is used to respond to receiving a variable editing operation performed on the target variable object in a visual programming interface, and determine an array element editing interface that matches the variable editing operation from the variable operation interface set, wherein the variable operation interface set includes the array element editing interface; according to the variable editing information carried in the variable editing operation and the array element editing interface, perform an element editing operation on the target array element to obtain the updated target array element.

[0309] In some embodiments, the above-mentioned object variable operation device also includes: a display unit, which is used to determine an array element acquisition interface from the variable operation interface set when a variable creation control is displayed on a variable preview page in the visual programming interface, wherein the variable creation control is used to detect the variable creation operation, the variable preview page is used to display a variable object of the target variable type, and the variable operation interface set includes the array element acquisition interface; when at least one first array element is found from the object array according to the array element acquisition interface and the target variable type, a first code block corresponding to the at least one first array element is obtained, wherein the first array element matches the first variable object of the target variable type, and the first code block is used to display a first variable block indicating the first variable object in the visual programming interface.

[0310] In some embodiments, the above-mentioned object variable operation device includes: a deletion unit, used to obtain a second variable identifier indicated by the variable deletion operation when the variable object operation is a variable deletion operation; determine the array element deletion interface matching the variable deletion operation from the variable operation interface set, wherein the variable operation interface set includes the array element deletion interface; and delete the second array element matching the second variable object from the variable object set according to the second variable identifier and the array element deletion interface, wherein the second variable identifier is used to indicate the second variable object.

[0311] In some embodiments, the above-mentioned object variable operation device also includes: a code block generation unit, which is used to obtain a first code block matching the target variable type when the variable object operation is a variable creation operation, wherein the first code block is used to describe the variable attribute information of the variable object; according to the variable description information carried by the variable creation operation, the first code block is updated to a second code block, wherein the second code block is used to display a target variable block matching the target variable object in the visual programming interface, and the variable description information includes the variable identification information.

[0312] In some embodiments, the above-mentioned code block generation unit also includes: a prompt module, which is used to obtain a reference variable type matching the operation block in response to dragging the target variable block to the tile area associated with the operation block in the visual programming interface, wherein the operation block is used to generate a variable operation code block associated with the variable object, and the reference variable type is a variable type matching the variable operation code block; and determine the drag result of the drag operation based on the matching relationship between the reference variable type and the second code block.

[0313] In some embodiments, the prompt module is used to: when the target variable object is a variable object to be input in the operation block, obtain a first variable type from a first field in the second code block, wherein the first field is used to indicate a variable type that allows the target variable object to be obtained as input; when the first variable type and the reference variable type do not match, display target prompt information; when the target variable object is a variable object that accepts input in the operation block, obtain the target variable type from a second field in the second code block, wherein the second field is used to indicate the target variable type of the target variable object; when the target variable type and the reference variable type do not match, display target prompt information; wherein the target prompt information is used to indicate that the drag operation has failed.

[0314] In some embodiments, the above-mentioned code block generation unit is also used to: when the drag operation fails, obtain a third code block that matches the reference variable type, wherein the third code block is used to describe the variable attribute information of the candidate variable object; and display the candidate variable block in the visual programming interface according to the third code block.

[0315] In some embodiments, the above-mentioned code block generation unit is also used to: in response to a variable editing operation on the target variable block in the visual programming interface, obtain variable editing information indicated by the variable editing operation; and update the third field in the second code block according to the variable editing information, wherein the third field is used to indicate the variable identification information of the target variable object.

[0316] In some embodiments, the above-mentioned code block generation unit is used to: when the variable creation operation is a first variable creation operation, update the third field in the first code block according to the variable identification information included in the variable description information to obtain the second code block, wherein the variable type corresponding to the first variable creation operation is determined from multiple preset variable types; when the variable creation operation is a second variable creation operation, update the first code block to a fourth code block according to the variable identification information and variable combination information included in the variable description information, wherein the variable type corresponding to the second variable creation operation is a custom variable type, and the variable combination information is used to indicate at least one data type carried in the target variable.

[0317] Optionally, in this embodiment, the embodiments to be implemented by the above-mentioned various unit modules can refer to the above-mentioned various method embodiments, which will not be repeated here.

[0318] According to another aspect of the embodiment of the present invention, an electronic device for implementing the above object variable operation method is also provided. The electronic device may be Fig.24 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Fig.24 As shown, the electronic device includes a memory 2402 and a processor 2404. The memory 2402 stores a computer program, and the processor 2404 is configured to execute the steps in any of the above method embodiments through the computer program.

[0319] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0320] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0321] S1, in response to a variable object operation received in a visual programming interface, obtaining a target variable type indicated by the variable object operation, wherein the visual programming interface is used to receive an interactive operation to generate program content matching the interactive operation, and the interactive operation includes the variable object operation;

[0322] S2, determining at least one target variable operation interface that matches the variable object operation from a variable operation interface set, wherein the variable operation interface set includes a plurality of variable operation interfaces;

[0323] S3. Perform at least one object operation on a variable object set according to at least one of the target variable operation interfaces and the target variable type, wherein the variable object set is used to store object information of at least one variable object created according to the visual programming interface, and the variable object is displayed as a variable block style in the visual programming interface.

[0324] Alternatively, a person skilled in the art may understand that: Fig.24 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Fig.24 The electronic device and the electronic equipment described above are not limited in structure. Fig.24 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.24 Different configurations shown.

[0325] Among them, the memory 2402 can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for operating the object variables in the embodiments of the present invention. The processor 2404 executes various functional applications and data processing by running the software programs and modules stored in the memory 2402, that is, realizing the above-mentioned method for operating the object variables. The memory 2402 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 2402 may further include a memory remotely arranged relative to the processor 2404, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 2402 may be specifically, but not limited to, used to store information such as each element in the scene screen, the operation information of the object variables, and so on. As an example, such as Fig.24 As shown, the memory 2402 may include but is not limited to the acquisition unit 2302, the determination unit 2304 and the operation unit 2306 in the object variable operation device. In addition, it may also include but is not limited to other module units in the object variable operation device, which will not be repeated in this example.

[0326] Optionally, the transmission device 2406 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 2406 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 2406 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0327] In addition, the electronic device further includes: a display 2408 for displaying a virtual scene in an interface; and a connection bus 2410 for connecting various module components in the electronic device.

[0328] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes in the form of network communication. Among them, a peer-to-peer network may be formed between the nodes, and any form of computing device, such as a server, a terminal or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.

[0329] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.

[0330] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0331] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned object variable operation method.

[0332] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0333] S1, in response to a variable object operation received in a visual programming interface, obtaining a target variable type indicated by the variable object operation, wherein the visual programming interface is used to receive an interactive operation to generate program content matching the interactive operation, and the interactive operation includes the variable object operation;

[0334] S2, determining at least one target variable operation interface that matches the variable object operation from a variable operation interface set, wherein the variable operation interface set includes a plurality of variable operation interfaces;

[0335] S3. Perform at least one object operation on a variable object set according to at least one of the target variable operation interfaces and the target variable type, wherein the variable object set is used to store object information of at least one variable object created according to the visual programming interface, and the variable object is displayed as a variable block style in the visual programming interface.

[0336] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0337] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the above methods of various embodiments of the present invention.

[0338] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0339] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0340] The units described above 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0341] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0342] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for operating an object variable, characterized in that: include: In response to a variable object operation received in a visual programming interface, obtaining a target variable type indicated by the variable object operation, wherein the visual programming interface is used to receive an interactive operation to generate program content matching the interactive operation, the interactive operation including the variable object operation; Determining at least one target variable operation interface that matches the variable object operation from a variable operation interface set, wherein the variable operation interface set includes a plurality of variable operation interfaces; At least one object operation is performed on a variable object set according to at least one of the target variable operation interfaces and the target variable type, wherein the variable object set is used to store object information of at least one variable object created according to the visual programming interface, and the variable object is displayed as a variable block style in the visual programming interface.

2. The method according to claim 1, characterized in that The performing at least one object operation on the variable object set according to at least one of the target variable operation interfaces and the target variable type includes: In the case where the variable object operation is a variable creation operation, generating a target array element matching the target variable object according to the variable identification information indicated by the variable creation operation and the type description information indicating the target variable type; The target array element is added to an object array used to indicate the variable object set, wherein the array elements in the object array are respectively used to indicate a variable object.

3. The method according to claim 2, characterized in that The step of determining, from the variable operation interface set, at least one target variable operation interface that matches the variable object operation comprises: From the variable operation interface set, determine the array element adding interface that matches the variable creation operation, wherein the variable operation interface set includes the array element adding interface, and the array element adding interface is used to generate the array element that matches the variable object according to the variable identification information and type description information indicated by the variable creation operation.

4. The method according to claim 2, characterized in that: After adding the target array element to the object array indicating the variable object set, the method further includes: In response to receiving a variable editing operation performed on the target variable object in the visual programming interface, determining an array element editing interface that matches the variable editing operation from the variable operation interface set, wherein the variable operation interface set includes the array element editing interface; According to the variable editing information carried in the variable editing operation and the array element editing interface, an element editing operation is performed on the target array element to obtain the updated target array element.

5. The method according to claim 2, characterized in that: In the case where the variable object operation is a variable creation operation, before generating a target array element matching the target variable object according to the variable identification information indicated by the variable creation operation and the type description information indicating the target variable type, the method further includes: In the case where a variable creation control is displayed on a variable preview page in the visual programming interface, an array element acquisition interface is determined from the variable operation interface set, wherein the variable creation control is used to detect the variable creation operation, the variable preview page is used to display a variable object of a type of the target variable type, and the variable operation interface set includes the array element acquisition interface; When at least one first array element is found from the object array according to the array element acquisition interface and the target variable type, first code blocks corresponding to the at least one first array element are acquired, wherein the first array element matches a first variable object of the target variable type, and the first code block is used to display a first variable block indicating the first variable object in the visual programming interface.

6. The method according to claim 2, characterized in that After adding the target array element to the object array indicating the variable object set, the method further includes: In response to a variable deletion operation received in the visual programming interface, obtaining a second variable identifier indicated by the variable deletion operation, wherein the variable object operation includes a variable deletion operation; Determining, from the variable operation interface set, an array element deletion interface that matches the variable deletion operation, wherein the variable operation interface set includes the array element deletion interface; According to the second variable identifier and the array element deletion interface, a second array element matching the second variable object is deleted from the variable object set, wherein the second variable identifier is used to indicate the second variable object.

7. The method according to claim 1, characterized in that After the variable type indicated by the variable object operation is obtained in response to the variable object operation received in the visual programming interface, the method further includes: In a case where the variable object operation is a variable creation operation, obtaining a first code block matching the target variable type, wherein the first code block is used to describe variable attribute information of the variable object; According to the variable description information carried by the variable creation operation, the first code block is updated to a second code block, wherein the second code block is used to display a target variable block matching the target variable object in the visual programming interface, and the variable description information includes the variable identification information.

8. The method according to claim 7, characterized in that After the first code block is updated to the second code block according to the variable description information carried by the variable creation operation, the method further includes: In response to dragging the target variable tile to a tile area associated with an operation tile in the visual programming interface, obtaining a reference variable type matched by the operation tile, wherein the operation tile is used to generate a variable operation code block associated with a variable object, and the reference variable type is a variable type matched with the variable operation code block; A drag result of the drag operation is determined according to a matching relationship between the reference variable type and the second code block.

9. The method according to claim 8, characterized in that The determining the drag result of the drag operation according to the matching relationship between the reference variable type and the second code block includes: In the case where the target variable object is a variable object to be input in the operation block, a first variable type is obtained from a first field in the second code block, wherein the first field is used to indicate a variable type that allows the target variable object to be obtained as input; in the case where the first variable type does not match the reference variable type, target prompt information is displayed; When the target variable object is a variable object that accepts input in the operation block, the target variable type is obtained from a second field in the second code block, wherein the second field is used to indicate the target variable type of the target variable object; when the target variable type does not match the reference variable type, target prompt information is displayed; The target prompt information is used to indicate that the drag operation fails.

10. The method according to claim 8, characterized in that After determining the drag result of the drag operation according to the matching relationship between the reference variable type and the second code block, the method further includes: In the case where the drag operation fails to be executed, obtaining a third code block matching the reference variable type, wherein the third code block is used to describe variable attribute information of the candidate variable object; Displaying a candidate variable block in the visual programming interface according to the third code block.

11. The method according to claim 7, characterized in that After the first code block is updated to the second code block according to the variable description information carried by the variable creation operation, the method further includes: In response to a variable editing operation on the target variable block in the visual programming interface, obtaining variable editing information indicated by the variable editing operation; A third field in the second code block is updated according to the variable editing information, wherein the third field is used to indicate variable identification information of the target variable object.

12. The method according to claim 7, characterized in that The updating the first code block to the second code block according to the variable description information carried by the variable creation operation includes: In a case where the variable creation operation is a first variable creation operation, updating a third field in the first code block according to the variable identification information included in the variable description information to obtain the second code block, wherein the variable type corresponding to the first variable creation operation is determined from a plurality of preset variable types; In a case where the variable creation operation is a second variable creation operation, the first code block is updated to a fourth code block according to the variable identification information and the variable combination information included in the variable description information, wherein the variable type corresponding to the second variable creation operation is a custom variable type, and the variable combination information is used to indicate at least one data type carried in the target variable.

13. An object variable operation device, characterized in that: include: an acquisition unit, configured to, in response to a variable object operation received in a visual programming interface, acquire a target variable type indicated by the variable object operation, wherein the visual programming interface is configured to receive an interactive operation to generate program content matching the interactive operation, the interactive operation including the variable object operation; a determining unit, configured to determine at least one target variable operation interface matched by the variable object operation from a variable operation interface set, wherein the variable operation interface set includes a plurality of variable operation interfaces; An operation unit is used to perform at least one object operation on a variable object set according to at least one of the target variable operation interfaces and the target variable type, wherein the variable object set is used to store object information of at least one variable object created according to the visual programming interface, and the variable object is displayed as a variable block style in the visual programming interface.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 12 when executed.

15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

16. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 12 through the computer program.

Citation Information

Patent Citations

  • Variable operation method and device in graphical programming tool

    CN111736822A

  • API visual entity conversion method

    CN113485690A

  • Visual programming method, device, equipment, medium and program product

    CN118444903A

  • Generation of application based on declarative specification

    US11157245B1

Cited By

  • Model code generation method and system based on computational graph

    CN120255872A