Programming data processing method, apparatus, medium, and electronic device

By combining expression blocks and behavior blocks in graphical programming, the problem of uncontrollable newly created objects is solved, enabling precise control and memory management of newly created objects and improving programming flexibility.

CN114968215BActive Publication Date: 2026-02-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110220058.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-26
Publication Date
2026-02-06
Estimated Expiration
2041-02-26

AI Technical Summary

Technical Problem

In existing technologies, when creating new program objects by cloning existing program objects, the newly created objects cannot be effectively controlled, leading to problems such as the inability to realize program scenarios or memory leaks.

Method used

The program uses expression blocks in graphical programming to create program objects and return object identifiers. Combined with behavior blocks, it executes control commands based on the object identifiers to achieve precise control over newly created objects.

Benefits of technology

It enables effective control over newly created objects, avoiding problems such as uncontrollable program scenarios and memory leaks, and improves the flexibility of graphical programming.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968215B_ABST
    Figure CN114968215B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of computers, and particularly relates to a programming data processing method, a programming data processing device, a computer readable medium and an electronic device. The programming data processing method in the application embodiment comprises the following steps: acquiring a building block module set used for graphical programming, the building block module set comprising an expression building block used for executing a logic command and having a return value and a behavior building block used for executing a logic command and not having a return value; in response to a selection operation on the expression building block, adding an object creation building block used for creating a program object and returning an object identifier of the program object in a programming interface; and in response to a selection operation on the behavior building block, adding an object control building block used for executing a control command on the program object according to an input object identifier in the programming interface. The application embodiment can realize effective control on a newly created object.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of computer, and particularly relates to a programming data processing method, a programming data processing device, a computer readable medium and an electronic device. BACKGROUND

[0002] Creating a new object is a common scenario in programming, and a new program object can generally be created by cloning an existing program object, i.e., creating a new program object with the same initial state as the existing program object based on the existing program object.

[0003] However, the new program object created by cloning the existing program object is in a free state and cannot be effectively controlled.

[0004] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present application, and can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0005] The present application aims to provide a programming data processing method, a programming data processing device, a computer readable medium and an electronic device, which at least partially overcome the technical problem of poor controllability of program objects in the related art.

[0006] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.

[0007] According to an aspect of an embodiment of the present application, a programming data processing method is provided, which includes: acquiring a set of building block modules for graphical programming, the set of building block modules including an expression building block for executing a logical command with a return value and a behavior building block for executing a logical command without a return value; in response to a selection operation on the expression building block, adding an object creation building block for creating a program object and returning an object identifier of the program object in a programming interface; and in response to a selection operation on the behavior building block, adding an object control building block for executing a control command on the program object according to a transmitted object identifier in the programming interface.

[0008] According to an aspect of an embodiment of the present application, a programming data processing method is provided, which includes:

[0009] obtain a program configuration file generated based on graphical programming; parse instruction code in the program configuration file, and determine a to-be-executed block corresponding to the instruction code; when the to-be-executed block is an object creation block, create a program object and return an object identifier of the program object; and when the to-be-executed block is an object control block, execute a control command on the program object according to an incoming object identifier.

[0010] According to an aspect of some embodiments of the present application, a programming data processing apparatus is provided, which includes: a block obtaining unit configured to obtain a set of block modules for graphical programming, the set of block modules including an expression block for executing a logical command with a return value and a behavior block for executing a logical command without a return value; a first block adding unit configured to, in response to a selection operation on the expression block, add an object creation block for creating a program object and returning an object identifier of the program object in a programming interface; and a second block adding unit configured to, in response to a selection operation on the behavior block, add an object control block for executing a control command on the program object according to an incoming object identifier in the programming interface.

[0011] In some embodiments of the present application, based on the above technical solutions, the programming data processing apparatus further includes: a block editing unit configured to perform editing processing on a target block in the programming interface; a code generating unit configured to generate instruction code corresponding to the target block according to a block editing result; and a code combining unit configured to combine instruction code corresponding to each block in the programming interface to obtain a program configuration file.

[0012] In some embodiments of the present application, based on the above technical solutions, the target block includes a block frame for describing a function of the block and a parameter input control embedded in the block frame, and the block editing unit includes: a position adjusting unit configured to, in response to a moving operation on the block frame, adjust a display position of the target block in the programming interface; and a parameter input unit configured to, in response to a triggering operation on the parameter input control, input a parameter to the target block, the parameter including one or more of an object identifier of a program object and a custom parameter.

[0013] In some embodiments of the present application, based on the above technical solutions, the parameter input unit includes: a list display unit configured to display an object list on the programming interface, the object list including created program objects; and an object selection unit configured to, in response to a selection operation on a target object in the object list, input an object identifier of the target object to the target block.

[0014] In some embodiments of the present application, based on the above technical solutions, the list display unit comprises: a search box display unit configured to display an object search box on the programming interface; a keyword input unit configured to receive a search keyword input by a user through the object search box; an object query unit configured to query candidate objects matching the search keyword in an object database; and an object display unit configured to display an object list composed of the candidate objects on the programming interface.

[0015] In some embodiments of the present application, based on the above technical solutions, the parameter passing-in unit comprises: a third block adding unit configured to add a variable block for performing a parameter read-write operation on a program variable in the programming interface in response to a selection operation on the expression block; and a variable block embedding unit configured to embed the variable block into a parameter input control of the target block to pass a variable parameter corresponding to the variable block into the target block.

[0016] In some embodiments of the present application, based on the above technical solutions, the code generation unit comprises: an instruction template acquisition unit configured to acquire an instruction template corresponding to the target block, the instruction template comprising text information for describing a block function of the target block, a target function for implementing the block function, and a call parameter of the target function; a parameter field assignment unit configured to perform assignment processing on each field of the call parameter according to the block editing result; and an instruction code generation unit configured to generate an instruction code corresponding to the target block according to the field assignment result.

[0017] In some embodiments of the present application, based on the above technical solutions, the block module set further comprises an event block, the event block being used to trigger execution of a script when an event occurs; and the programming data processing apparatus further comprises: a fourth block adding unit configured to add an initialization event block for providing a program object with a life cycle event in response to a selection operation on the event block.

[0018] In some embodiments of the present application, based on the above technical solutions, the programming data processing apparatus further comprises: a fifth block adding unit configured to add an object destruction block for deleting a program object in response to a selection operation on the behavior block.

[0019] According to an aspect of some embodiments of the present application, a programmed data processing apparatus is provided, comprising: a file obtaining unit configured to obtain a program configuration file generated based on graphical programming; a code analyzing unit configured to analyze instruction code in the program configuration file and determine a to-be-executed block corresponding to the instruction code; an object creating unit configured to, when the to-be-executed block is an object creating block, create a program object and return an object identifier of the program object; and an object controlling unit configured to, when the to-be-executed block is an object controlling block, execute a control command on the program object according to the input object identifier.

[0020] In some embodiments of the present application, based on the above technical solution, the programmed data processing apparatus further comprises: an event registering unit configured to, when the to-be-executed block is an initialization event block, register a life cycle event for the program object according to the input object identifier; and an object destroying unit configured to, when the to-be-executed block is an object destroying block, delete the program object according to the input object identifier.

[0021] According to an aspect of some embodiments of the present application, a computer readable medium having stored thereon a computer program is provided, the computer program being executed by a processor to implement the method in the above technical solution.

[0022] According to an aspect of some embodiments of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method in the above technical solution via executing the executable instructions.

[0023] According to an aspect of some embodiments of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the method in the above technical solution.

[0024] In the technical solution provided in the embodiments of the present application, a new program object can be created and an object identifier of the program object is returned by using the expression block, and a control command can be executed on the newly created program object according to the input object identifier by using the behavior block, so that effective control of the newly created object can be achieved, and problems such as program scene unavailability or program memory leakage caused by uncontrollable program objects can be avoided, and the flexibility of graphical programming is improved.

[0025] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. Attached Figure Description

[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0027] Figure 1 An exemplary system architecture block diagram illustrating the application of the technical solution of this application is shown schematically.

[0028] Figure 2 A schematic diagram of the programming interface for creating and controlling new objects in the related art of this application is shown.

[0029] Figure 3 A schematic diagram of the programming interface in one embodiment of this application is shown.

[0030] Figure 4 A flowchart illustrating the steps of a programming method in one embodiment of this application is shown.

[0031] Figure 5 A schematic diagram showing the display effect of the building block module in an embodiment of this application is shown.

[0032] Figure 6 A flowchart illustrating the steps of generating a program configuration file based on block editing results in one embodiment of this application is shown.

[0033] Figure 7 This illustration shows the effect of passing the object identifier of a created program object to the target block based on an object list in one embodiment of this application.

[0034] Figure 8 This illustration shows the effect of input parameters based on variable blocks in one embodiment of this application.

[0035] Figure 9 This illustration shows a schematic diagram of the process of writing and executing a program in an application scenario according to an embodiment of this application.

[0036] Figure 10 A schematic block diagram of a programming data processing apparatus for program writing provided in an embodiment of this application is shown.

[0037] Figure 11 A schematic block diagram of a programming data processing apparatus for program execution provided in an embodiment of this application is shown.

[0038] Figure 12A computer system structure block diagram of an electronic device suitable for implementing embodiments of the present application is shown schematically. DETAILED DESCRIPTION

[0039] Example implementations are now described with reference to the drawings; however, these descriptions are not intended to limit the scope of the present application, but are intended to provide example examples of implementing the present application. The descriptions as set forth herein are not intended to be exhaustive or otherwise limit the present application to the precise forms disclosed. Many modifications and variations are possible in light of this disclosure.

[0040] Moreover, described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the

[0041] The block diagrams in the drawings show only the functionality of the various examples, and do not necessarily imply a particular physical or logical arrangement. For example, functions can be performed in the sequence presented in the figures, but also can be performed in parallel or in some other order. Additionally, the symbols in the drawings represent some of the possible

[0042] The flow diagrams in the drawings show example examples of operations that can be performed in the context of the various examples. It should be understood that each operation within the flow diagrams can be implemented, individually and / or collectively, by a wide range of hardware, software, firmware, or any combination thereof.

[0043] Figure 1 An example system architecture block diagram to which the present application is applied is shown schematically.

[0044] As shown in Figure 1 The system architecture 100 can include a terminal device 110, a network 120, and a server 130. The terminal device 110 can include various electronic devices such as a smartphone, a tablet, a notebook computer, a desktop computer, etc. The server 130 can be a physical server, a server cluster composed of a plurality of physical servers, or a distributed system, and can also be a cloud server providing cloud computing services. The network 120 can be a communication medium of various connection types capable of providing a communication link between the terminal device 110 and the server 130, and can be a wired communication link or a wireless communication link.

[0045] According to implementation requirements, the system architecture in the embodiments of the present application can have any number of terminal devices, networks and servers. For example, the server 130 can be a server group composed of multiple server devices. In addition, the technical solutions provided by the embodiments of the present application can be applied to the terminal device 110, can be applied to the server 130, or can be jointly implemented by the terminal device 110 and the server 130, and the present application does not make special limitations on this.

[0046] A programming tool client providing a graphical programming function can be installed on the terminal device 110. The programming tool client can be a standalone client program or a hosted program on other application programs. For example, a user can open and run a small program for graphical programming through a social application program installed on the terminal device 110, and perform graphical programming based on the small program. The program file obtained after graphical programming can be saved in the local database of the terminal device 110 or uploaded to the server 130 through the network 120. After completing the program file, the user can also debug and run the program file through the terminal device 110. The program file can be run in the form of a program or a hosted program on the terminal device 110, can be run by internal system components of the terminal device 110, and can also be run based on a service program or a cloud program on the server 130.

[0047] Graphical programming refers to a way in which a programming user creates an application program by manipulating graphical elements. The core is to convert a text programming language in the form of code into graphical elements, which can be represented as building block modules with different shapes and contents. The program is written by moving and splicing the building block modules, which has the advantages of easy understanding and easy writing.

[0048] Figure 2 A programming interface schematic diagram for creating and controlling a new object in the related technology of the present application is shown. In the application scenario shown in the figure, a new object is created in the form of cloning, which refers to creating a new program object based on an existing program object, so that the newly created program object has the same object initial state as the existing program object. As shown in the figure, Figure 2 As shown in the figure, the combination of multiple building block modules can achieve the effect of creating and controlling a new object. Specifically, when the scene is started, cloning "(scene 1) yellow bullet" completes the creation of a new object "yellow bullet". The newly created "yellow bullet" has the same attribute state as the existing yellow bullet of scene 1. The newly created program object is controlled through the event "when started as a clone". The corresponding context "myself" in the event represents the current clone, that is, the yellow bullet created based on cloning. Figure 2

[0049] ​However, the program object created in a cloning manner can only be controlled through the cloning body starting event, and the program object will be in a free state and lose control in the subsequent program, resulting in that many business scenarios cannot be implemented. For example, in a programming scenario of a shooting game, the plane object in the game is newly created, and the user can control the flight movement of the plane object based on the programming content. At the same time, each plane also creates its own bullet object. If the plane needs to be destroyed, the bullet object created by the plane also needs to be destroyed. However, because the newly created program object cannot be reliably controlled, the newly created bullet object in the game cannot be located, and therefore the problem of the plane being destroyed but the bullet object not being destroyed occurs. In addition, because the created program object is uncontrollable, the specified program object cannot be accurately destroyed and deleted, which also easily causes the problem of memory leakage of the program.

[0050] In view of the problems in the above scenarios, the embodiments of the present application provide a technical solution capable of accurately controlling a newly created dynamic program object. The programming data processing method, the programming data processing apparatus, the computer readable medium, and the electronic device provided by the present application will be described in detail below in combination with specific embodiments.

[0051] Figure 3 An interface display schematic diagram of a programming interface in an embodiment of the present application is shown, and the programming interface can be an interactive interface presented by a graphical programming tool on a terminal device. As shown in Figure 3 The programming interface 300 mainly includes a scene display area 301, a program editing area 302, and a block selection area 303, and the like. The layout position and the area size of each functional area in the programming interface can be configured according to actual needs, and the embodiments of the present application do not make special limitations on this.

[0052] The scene display area 301 is used to display the program running effect after graphical programming, and the specific display content of the scene display area 301 is determined by the actual application scenario. For example, in a game scenario, a preselected game character can be displayed in the scene display area 301, and the game character can be a virtual person or a virtual object, and the control of the game character can be implemented through graphical programming.

[0053] The program editing area 302 is an area for editing operation of the block module of graphical programming. According to the pre-set rules or according to the real-time operation of the user, various block modules with different functions can be added in the program editing area 302. At the same time, in response to the editing instruction triggered by the user through the interactive operation, each block module in the program editing area 302 can be adjusted in real time, for example, the placement position of each block module, the splicing form between each other, and the input parameter of the block can also be adjusted.

[0054] The building block selection area 303 is used to display various building block modules available for selection, including expression building blocks and behavior building blocks. An expression building block is a building block module used to execute a logical command with a return value, for example, an object creation module that returns an object identifier of a program object after creating a new program object. A behavior building block is a building block module used to execute a logical command without a return value, for example, an object control module that controls a corresponding program object according to a transmitted object identifier. The building block modules displayed in the building block selection area 303 can include basic building block modules pre-configured by the graphical programming tool, or custom modules added by the user.

[0055] Figure 4 A flowchart of steps of a program writing method in an embodiment of the present application is shown, which can be executed on the terminal device 110, on the server 130, or by the terminal device 110 and the server 130 together. Figure 1 The program writing method can be executed on the terminal device 110, on the server 130, or by the terminal device 110 and the server 130 together. Figure 1 The program writing method can be executed on the terminal device 110, on the server 130, or by the terminal device 110 and the server 130 together. Figure 4 The program writing method can include the following steps S410-S430.

[0056] Step S410: Obtain a set of building block modules for graphical programming, including expression building blocks used to execute a logical command with a return value and behavior building blocks used to execute a logical command without a return value.

[0057] The set of building block modules is a set of various building block modules available for user selection. When starting the graphical programming tool and displaying the programming interface on the terminal device, the set of building block modules can be obtained, and each building block module in the set of building block modules can be displayed in the building block selection area 303 according to the building block type. Figure 3

[0058] Step S420: In response to a selection operation on an expression building block, add an object creation building block for creating a program object and returning an object identifier of the program object in the programming interface.

[0059] In an embodiment of the present application, the user can select an expression building block to be added in the building block selection area 303, and the selection operation can be to add the displayed expression building block to a specified position in the program editing area 302 by dragging. The object creation building block is an expression building block used to create a new program object, which can return an object identifier of the program object after completing the program object creation, and the object identifier can uniquely determine a program object.

[0060] ​Step S430: in response to the selection operation on the behavior block, adding an object control block for executing a control command on the program object according to the input object identifier in the programming interface.

[0061] In an embodiment of the present application, the user can select the behavior block to be added in the block selection area 303, and the selection operation can be to add the displayed behavior block to a specified position in the program editing area 302 by dragging. The object control block is a block module for executing a control command on a program object, and the object identifier of the program object to be controlled can be input to the object control block by parameter input. The control command executed by the object control block can include, for example, movement, rotation, and the like of the object.

[0062] In the program writing method provided in the embodiments of the present application, the expression block can be used to create a new program object and return the object identifier of the program object, and the behavior block can be used to execute a control command on the newly created program object according to the input object identifier, so that effective control of the newly created object can be achieved, and problems such as program scene implementation failure or program memory leakage caused by uncontrollable program objects can be avoided, thereby improving the flexibility of graphical programming.

[0063] In an embodiment of the present application, the block module set can further include an event block for triggering execution of a script when an event occurs. For example, the event block can include: when the game starts, when the character is clicked, when the screen is clicked, and the like. On this basis, the program writing method in the above embodiments can further include: in response to a selection operation on the event block, adding an initialization event block for providing a life cycle event for the newly created program object according to the input object identifier in the programming interface.

[0064] In an embodiment of the present application, in addition to the object creation block in the above embodiments, the expression block can further include a variable block for performing parameter read-write operations on a program variable. The variable block can be used to write parameters to the program variable and read the parameters of the program variable when needed. On this basis, the program writing method in the above embodiments can further include: in response to a selection operation on the expression block, adding a variable block for performing parameter read-write operations on a program variable in the programming interface.

[0065] In an embodiment of the present application, in addition to the object control block in the above embodiment, the behavior block can further include an object destruction block for deleting a program object. By passing an object identifier to the object destruction block, an operation of deleting a program object corresponding to the object identifier can be performed. On this basis, the program writing method in the above embodiment can further include: in response to a selection operation on the behavior block, adding an object destruction block for deleting a program object according to a passed object identifier in the programming interface.

[0066] Figure 5 A display effect schematic diagram of the block module in an embodiment of the present application is shown.

[0067] The object creation block 501 can be used to create a new program object and return an object identifier of the created program object. For example, in a game scenario, a game character is a plane object in the game, and the object creation block 501 can be used to create a bullet effect for the plane object. For example, a new “yellow bullet” can be created by the object creation block 501, and an object ID of the yellow bullet is returned.

[0068] The object control block 502 can execute a control command on a corresponding program object according to a passed object identifier. For example, in a game scenario, the program object is a “yellow bullet” created by the object creation block 501, and by passing the object ID of the “yellow bullet” to the object control block 502 shown in the figure, the “yellow bullet” can be controlled to move a certain number of steps, and the specific number of steps is related to the passed parameter. Figure 5

[0069] The initialization event block 503 can provide a life cycle event for a newly created program object. By cooperating with the object creation block and the object control block, the initialization event block 503 can provide a unified life cycle event for a newly created program object, so as to perform a unified control operation on the program object. For example, when the yellow bullet is created, the newly created yellow bullet can be directly controlled to rotate 45 degrees, so that each newly created yellow bullet can automatically adjust the angle of bullet firing.

[0070] The variable block 504 can be used to perform parameter read-write operations on a program variable, and realize parameter assignment for the program variable. By the variable block 504, a parameter can be written to a certain preset program variable, for example, set to a specified value. When other block modules need to use the program variable later, the parameter previously written to the program variable can be read.

[0071] ​The object destruction block 505 is used to delete a program object. When a newly created program object needs to be deleted, the object ID of the program object can be transmitted as a parameter into the object destruction block 505, and the object destruction block 505 can find the corresponding program object according to the transmitted object ID and delete it.

[0072] After adding the block module in the programming interface, the user can edit each block module displayed on the programming interface by applying an interactive instruction, and a program configuration file can be generated after the editing is completed. Figure 6 A flowchart of steps of generating a program configuration file based on a block editing result in an embodiment of the present application is shown. As shown in Figure 6 Based on the above embodiment, the program writing method can further include the following steps S610 to S630.

[0073] Step S610: editing a target block in the programming interface.

[0074] Step S620: generating instruction code corresponding to the target block according to the block editing result.

[0075] Step S630: combining the instruction code corresponding to each block in the programming interface to obtain a program configuration file.

[0076] In an embodiment of the present application, the target block includes a block framework for describing the function of the block and a parameter input control embedded in the block framework. On this basis, the method of editing the target block in the programming interface in step S610 can include: in response to a moving operation on the block framework, adjusting the display position of the target block in the programming interface; in response to a triggering operation on the parameter input control, transmitting a parameter to the target block, the parameter including one or more of an object identifier of a program object and a custom parameter.

[0077] As shown in Figure 5 Taking the object control block 502 as an example, the rectangular framework on the outer side of the object control block 502 is a block framework for describing the function of the block, and the function of the object control block 502 is to control a certain program object to move a certain number of steps. Two parameter input controls are embedded in the inside of the block framework, of which the first parameter input control is used to transmit the object identifier of the program object, and the second parameter input control is used to transmit a custom parameter. For example, the object identifier of the program object is the object ID of the yellow bullet, and the user transmits a custom parameter of 10 to the object control block 502, so as to realize the effect of controlling the yellow bullet to move 10 steps.

[0078] In an embodiment of the present application, the method of passing parameters to the target block can include: displaying an object list on the programming interface, the object list including the created program objects; in response to a selection operation on a target object in the object list, passing the object identifier of the target object to the target block.

[0079] Figure 7 An effect diagram of passing the object identifier of the created program object to the target block based on the object list in an embodiment of the present application is shown. As shown in Figure 7 When the user triggers the parameter input control of the target block 701, the object list 702 can be displayed on the programming interface, and the currently created program objects such as “collider”, “creator”, “container-1”, “yellow bullet”, etc. are listed in the object list 702. In an optional implementation, some program objects can include multiple selectable sub-objects, and in response to a selection operation on a program object in the object list 702, the object identifier of the program object can be passed to the target block (not including the case of sub-objects), or a sub-object list corresponding to the program object can be opened (including the case of sub-objects).

[0080] In an embodiment of the present application, the programming interface can provide an object search box 703 as shown in Figure 7 to facilitate the user to search and filter the program objects. On this basis, the method of displaying the object list on the programming interface can include: displaying the object search box on the programming interface; receiving the search keyword input by the user through the object search box; querying the candidate objects matching the search keyword in the object database; displaying the object list composed of the candidate objects on the programming interface.

[0081] In an embodiment of the present application, the variable block can also be used as a parameter and passed to other behavior blocks, so that the behavior block can control the program variable assigned by the variable block. On this basis, the method of passing parameters to the target block can include: in response to a selection operation on the expression block, adding a variable block for performing parameter read-write operations on the program variable in the programming interface; embedding the variable block in the parameter input control of the target block to pass the variable parameter corresponding to the variable block to the target block.

[0082] Figure 8 An effect diagram of passing parameters based on the variable block in an embodiment of the present application is shown. As shown in Figure 8As shown, first, an object creation block 801 is added in the programming interface, a "yellow bullet" can be created and the object ID of the created yellow bullet is returned. Then, a variable block 802 is added in the programming interface, and the object creation block 801 is embedded into the parameter input control of the variable block 802, so that the object ID returned by the object creation block 801 is input as a dynamically created parameter variable block 802, and the parameter assignment from the variable block 802 to the program variable "new bullet" is implemented. Finally, an object control block 803 is added in the programming interface, and the "new bullet" assigned by the variable block 802 is embedded into the object control block 803, so that the "new bullet" after being created and parameter assigned is controlled by the object control block 803 to move 10 steps.

[0083] Based on the combination of the object creation block, the variable block and the object control block, the reliable control of any newly created program object can be implemented.

[0084] In an embodiment of the present application, the method of generating the instruction code corresponding to the target block according to the block editing result in step S620 can include: obtaining an instruction template corresponding to the target block, the instruction template including text information for describing the block function of the target block, a target function for implementing the block function and a calling parameter of the target function; performing the assignment processing on each field of the calling parameter according to the block editing result; and generating the instruction code corresponding to the target block according to the field assignment result.

[0085] After the addition and editing processing of the blocks in the programming interface are completed, the combination of the instruction codes corresponding to the blocks can obtain the program configuration file. By loading the program configuration file, performing the parsing and running, the corresponding program content can be executed.

[0086] In an embodiment of the present application, the method of running the program can include: obtaining the program configuration file generated based on the graphical programming; parsing the instruction code in the program configuration file and determining the to-be-executed block corresponding to the instruction code; when the to-be-executed block is an object creation block, creating a program object and returning the object identification of the program object; when the to-be-executed block is an object control block, executing the control command on the program object according to the input object identification. In addition, it can also include: when the to-be-executed block is an initialization event block, registering the life cycle event for the program object according to the input object identification; and when the to-be-executed block is an object destruction block, deleting the program object according to the input object identification.

[0087] The program functions and implementation manners of various blocks in the embodiments of the present application have been described in the above embodiments, and will not be described here.

[0088] Figure 9A process diagram of program writing and execution of an embodiment of the present application in an application scenario is shown.

[0089] As shown in Figure 9 In an integrated development environment (IDE), a user can define a building block through graphical programming, and the definition content can include a building block description msg, parameters args, and a calling function fun, wherein the parameter part can include a list of object IDs obtained, used to input parameters to the building block.

[0090] In the application scenario of the embodiment of the present application, four kinds of building blocks can be defined, which are an object creation building block for creating a new object and returning an object ID, an object control building block for moving an object by N steps, an object destruction building block for destroying and deleting an object, and an initialization event building block for providing a life cycle event for an object, each of which corresponds to a unique instruction code OPCODE.

[0091] The program written by a user using a graphical building block finally outputs a program configuration file containing object IDs and building block instruction OPCODEs and the like.

[0092] The runtime Runtime of the program can parse the program configuration file to execute corresponding program content. When the corresponding OPCODE is parsed, the real operation is to call the function defined by the building block to complete the specific logic. Figure 9 As shown in

[0093] Step S901: When the "object creation building block" is parsed, the object ID is parsed first, and the queried object is passed to the method of creating an object to instantiate an object. At this time, it is queried whether the object has registered the life cycle event corresponding to the "initialization event building block", i.e. the "when the object is created event", and if the configuration is found in the configuration, the event registration is performed.

[0094] Step S902: After the object is created, the creation event is triggered, and the object ID of the newly created object is fed back.

[0095] Step S903: The "object control building block" is parsed, the parameters of the building block are parsed, the object ID just obtained is passed in, the object instance is queried in the object library, if the object instance is not found, the execution process of the building block is skipped, and the next step is directly executed. If the object instance is found, the remaining parameters are obtained.

[0096] Step S904: Obtain the "10" step number parameter of the block input box, call the function of the block, and change the coordinates of the object. The current block is called. Execute the next block.

[0097] Step S905: If the "object destruction block" is encountered in the program, call the method of Runtime, query the object according to the object ID, delete the queried object from the program, and release the memory.

[0098] Based on the above program writing and running process, the control of the newly created object can be met, including the read and write operation of the object attribute. The created object is fully controllable, and the method of deleting the specified object and the clone is provided, and the memory of the program can be released in time, so as to avoid the memory leakage. The present application can improve the logical reusability of the program object, and reduce the redundant block.

[0099] It should be noted that although the steps of the method in the present application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired result. In addition or alternatively, some steps can be omitted, a plurality of steps can be combined into one step, and / or one step can be divided into a plurality of steps, etc.

[0100] The device embodiment of the present application is introduced below, which can be used to execute the program writing method and the program running method in the above-mentioned embodiments of the present application.

[0101] Figure 10 The structural block diagram of the programming data processing device applied to program writing provided by the embodiment of the present application is schematically shown. As shown in Figure 10 The programming data processing device 1000 can mainly include: a block acquisition unit 1010 configured to acquire a block module set for graphical programming, the block module set including an expression block for executing a logical command with a return value and a behavior block for executing a logical command without a return value; a first block adding unit 1020 configured to add an object creation block for creating a program object and returning an object identification of the program object in a programming interface in response to a selection operation on the expression block; and a second block adding unit 1030 configured to add an object control block for executing a control command on the program object according to a transmitted object identification in the programming interface in response to a selection operation on the behavior block.

[0102] In some embodiments of the present application, based on the above technical solutions, the programming data processing apparatus 1000 further comprises: a block editing unit configured to perform editing processing on a target block in the programming interface; a code generation unit configured to generate instruction code corresponding to the target block according to the block editing result; and a code combination unit configured to combine the instruction code corresponding to each block in the programming interface to obtain a program configuration file.

[0103] In some embodiments of the present application, based on the above technical solutions, the target block comprises a block framework for describing the function of the block and a parameter input control embedded in the block framework, and the block editing unit comprises: a position adjustment unit configured to adjust the display position of the target block in the programming interface in response to a moving operation on the block framework; and a parameter transmission unit configured to transmit parameters to the target block in response to a triggering operation on the parameter input control, the parameters comprising one or more of an object identifier of a program object and a custom parameter.

[0104] In some embodiments of the present application, based on the above technical solutions, the parameter transmission unit comprises: a list display unit configured to display an object list on the programming interface, the object list comprising created program objects; and an object selection unit configured to transmit the object identifier of a target object in the object list to the target block in response to a selection operation on the target object.

[0105] In some embodiments of the present application, based on the above technical solutions, the list display unit comprises: a search box display unit configured to display an object search box on the programming interface; a keyword input unit configured to receive a search keyword input by a user through the object search box; an object query unit configured to query candidate objects matching the search keyword in an object database; and an object display unit configured to display an object list composed of the candidate objects on the programming interface.

[0106] In some embodiments of the present application, based on the above technical solutions, the parameter transmission unit comprises: a third block adding unit configured to add a variable block for performing parameter read-write operations on a program variable in the programming interface in response to a selection operation on the expression block; and a variable block embedding unit configured to embed the variable block in the parameter input control of the target block to transmit a variable parameter corresponding to the variable block to the target block.

[0107] In some embodiments of the present application, based on the above technical solutions, the code generation unit comprises: an instruction template acquisition unit configured to acquire an instruction template corresponding to the target block, the instruction template comprising text information for describing a block function of the target block, a target function for implementing the block function, and a calling parameter of the target function; a parameter field assignment unit configured to perform assignment processing on each field of the calling parameter according to the block editing result; and an instruction code generation unit configured to generate the instruction code corresponding to the target block according to the field assignment result.

[0108] In some embodiments of the present application, based on the above technical solutions, the block module set further comprises an event block, the event block being used to trigger execution of a script when an event occurs; and the programming data processing apparatus further comprises a fourth block adding unit configured to, in response to a selection operation on the event block, add an initialization event block for providing a life cycle event for a newly created program object according to an incoming object identifier in the programming interface.

[0109] In some embodiments of the present application, based on the above technical solutions, the programming data processing apparatus further comprises a fifth block adding unit configured to, in response to a selection operation on the behavior block, add an object destruction block for deleting a program object according to an incoming object identifier in the programming interface.

[0110] Figure 11 A structural block diagram of a programming data processing apparatus applied to program running provided by an embodiment of the present application is schematically shown. As shown in Figure 11 the programming data processing apparatus 1100 mainly comprises: a file acquisition unit 1110 configured to acquire a program configuration file generated based on graphical programming; a code analysis unit 1120 configured to analyze instruction code in the program configuration file and determine a to-be-executed block corresponding to the instruction code; an object creation unit 1130 configured to, when the to-be-executed block is an object creation block, create a program object and return an object identifier of the program object; and an object control unit 1140 configured to, when the to-be-executed block is an object control block, execute a control command on the program object according to an incoming object identifier.

[0111] In some embodiments of the present application, based on the above technical solutions, the programming data processing apparatus 1100 further comprises: an event registration unit configured to, when the to-be-executed block is an initialization event block, register a life cycle event for the program object according to an incoming object identifier; and an object destruction unit configured to, when the to-be-executed block is an object destruction block, delete the program object according to an incoming object identifier.

[0112] The specific details of the programming data processing apparatus provided in the embodiments of the present application have been described in detail in the corresponding method embodiments, and will not be repeated here.

[0113] Figure 12 The computer system structure block diagram of the electronic device for implementing the embodiments of the present application is schematically shown.

[0114] It should be noted that, Figure 12 The computer system 1200 of the electronic device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0115] As Figure 12 shown, the computer system 1200 includes a central processing unit 1201 (CPU), which can perform various appropriate actions and processes according to programs stored in a read-only memory 1202 (ROM) or loaded from a storage portion 1208 into a random access memory 1203 (RAM). Various programs and data required for system operation are also stored in the random access memory 1203. The central processing unit 1201, the read-only memory 1202, and the random access memory 1203 are connected to each other through a bus 1204. An input / output interface 1205 (I / O interface) is also connected to the bus 1204.

[0116] The following components are connected to the input / output interface 1205: an input portion 1206 including a keyboard, a mouse, and the like; an output portion 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage portion 1208 including a hard disk, and the like; and a communication portion 1209 including a network interface card such as a local area network card, a modem, and the like. The communication portion 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the input / output interface 1205 as necessary. A removable recording medium 1211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 1210 as necessary, so that a computer program read therefrom is installed in the storage portion 1208 as necessary.

[0117] In particular, according to embodiments of the present application, the processes described in the various method flowcharts can be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 1209, and / or installed from the removable medium 1211. When the computer program is executed by the central processing unit 1201, various functions defined in the system of the present application are executed.

[0118] It should be noted that the computer readable medium shown in the embodiments of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present application, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program code. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination of the above.

[0119] The computer program product of the present application can be a storage medium or a computer program product storing computer instructions. This storage medium or computer program product can be realized in many ways, such as computer data storage, magnetic storage means, optical storage means, all- optical technologies, hybrid magnetic and optical technologies (in particular, DVD), electronic circuits, semiconductor memories, etc. The computer program product can contain either, or both, of these elements.

[0120] It should be noted that, although several modules or units of the device for action execution are mentioned in the foregoing detailed description, such a division is not mandatory. Indeed, according to an embodiment of the application, the features and functionalities of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functionalities of one module or unit described above can be further divided into several modules or units embodied.

[0121] From the above description of the embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be realized by software, or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or network, and includes several instructions to make a computing device (which can be a personal computer, server, touch terminal, or network device, etc.) execute the methods according to the embodiments of the present application.

[0122] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the present application cover any and all variations of the application that come within the scope of the present application, along with all of the equivalents thereof. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims.

[0123] It should be understood that the present application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the present application. The scope of the present application is limited only by the appended claims.

Claims

1. A programming data processing method, characterized in that, include: Obtain a set of building block modules for graphical programming, the set of building block modules including expression blocks for executing logical commands and having return values ​​and behavior blocks for executing logical commands and not having return values; In response to the selection operation of the expression block, an object creation block is added to the programming interface to create a program object and return the object identifier of the program object; In response to the selection operation of the behavior block, an object control block for executing control commands on the program object according to the passed object identifier is added to the programming interface; In response to the selection operation of the expression block, a variable block for performing parameter read and write operations on program variables is added to the programming interface; The object creation block is embedded in the parameter input control of the variable block, and the variable block is embedded in the parameter input control of the object control block, so as to pass the variable parameter corresponding to the variable block to the object control block. The variable block embedded in the object creation block is used to indicate that the program variable is set as the object identifier of the program object and the program object is returned. Parse the object identifier of the object to create the building blocks, pass the retrieved object identifier to the object creation method, and instantiate a program object; Check whether the program object has registered the lifecycle event corresponding to the initialization event block, and register the event if it exists in the program configuration file; Trigger a creation event and return the object identifier of the newly created object; Parse the parameters of the object control block, pass in the object identifier of the newly created object, and query the object instance of the newly created object in the object library; When the program encounters an object destruction block, it calls the runtime method to query the newly created object based on the object identifier, deletes the newly created object from the program, and releases the memory.

2. The programming data processing method according to claim 1, characterized in that, The method further includes: Edit the target blocks in the programming interface; Generate the instruction code corresponding to the target block based on the block editing results; The instruction codes corresponding to each block in the programming interface are combined to obtain the program configuration file.

3. The programming data processing method according to claim 2, characterized in that, The target building block includes a building block frame for describing the building block's function and a parameter input control embedded in the building block frame. The editing process of the target building block in the programming interface includes: In response to a movement operation on the block frame, the display position of the target block in the programming interface is adjusted; In response to a trigger operation on the parameter input control, parameters are passed to the target block, the parameters including one or more of the program object's object identifier and custom parameters.

4. The programming data processing method according to claim 3, characterized in that, The parameters passed to the target block include: The programming interface displays a list of objects, which includes created program objects. In response to a selection operation of a target object in the object list, the object identifier of the target object is passed to the target block.

5. The programming data processing method according to claim 4, characterized in that, The display of the object list on the programming interface includes: An object search box is displayed on the programming interface; The search box receives search keywords input by the user. Search the object database for candidate objects that match the search keywords; The programming interface displays a list of objects consisting of the candidate objects.

6. The programming data processing method according to claim 3, characterized in that, The parameters passed to the target block include: In response to the selection operation of the expression block, a variable block for performing parameter read and write operations on program variables is added to the programming interface; The variable block is embedded into the parameter input control of the target block to pass the variable parameter corresponding to the variable block to the target block.

7. The programming data processing method according to claim 2, characterized in that, The step of generating the instruction code corresponding to the target block based on the block editing result includes: Obtain the instruction template corresponding to the target block. The instruction template includes text information describing the block function of the target block, a target function for implementing the block function, and calling parameters of the target function. The values ​​of each field of the calling parameters are assigned based on the block editing results; Generate the instruction code corresponding to the target building block based on the field assignment results.

8. The programming data processing method according to any one of claims 1 to 7, characterized in that, The block module set also includes an event block, which is used to trigger the execution of a script when an event occurs; the method further includes: In response to the selection operation of the event block, an initialization event block is added to the programming interface to provide lifecycle events for the newly created program object based on the passed object identifier.

9. The programming data processing method according to any one of claims 1 to 7, characterized in that, The method further includes: In response to the selection operation of the behavior block, an object destruction block for deleting program objects based on the passed object identifier is added to the programming interface.

10. The programming data processing method according to claim 1, characterized in that, The method further includes: Obtain the program configuration file generated based on graphical programming; Parse the instruction code in the program configuration file and determine the block to be executed corresponding to the instruction code; When the block to be executed creates a block for the object, a program object is created and the object identifier of the program object is returned; When the block to be executed is the object control block, control commands are executed on the program object according to the passed object identifier.

11. The programming data processing method according to claim 10, characterized in that, The method further includes: When the block to be executed is an initialization event block, register a lifecycle event for the program object according to the passed object identifier; When the block to be executed is the object destruction block, the program object is deleted according to the passed object identifier.

12. A programming data processing device, characterized in that, include: The block acquisition unit is configured to acquire a set of block modules for graphical programming, the set of block modules including expression blocks for executing logical commands and having return values ​​and behavior blocks for executing logical commands and not having return values; The first block adding unit is configured to add an object creation block in the programming interface in response to a selection operation on the expression block, for creating a program object and returning the object identifier of the program object; The second block adding unit is configured to add an object control block in the programming interface in response to a selection operation of the behavior block, for executing control commands on the program object based on the passed object identifier. The third block adding unit is configured to add a variable block for performing parameter read and write operations on program variables in the programming interface in response to the selection operation of the expression block; The variable block embedding unit is configured to embed the object creation block into the parameter input control of the variable block, and to embed the variable block into the parameter input control of the object control block, so as to pass the variable parameters corresponding to the variable block into the object control block. The variable block embedded in the object creation block is used to indicate that the program variable is set to create a program object and return the object identifier of the program object; parse the object identifier of the object creation block, pass the queried object identifier to the object creation method, and instantiate a program object; query whether the program object has registered the lifecycle event corresponding to the initialization event block, and register the event if it exists in the program configuration file; trigger the creation event and return the object identifier of the newly created object; parse the parameters of the object control block, pass the object identifier of the newly created object, and query the object instance of the newly created object in the object library; when the program encounters the object destruction block, call the runtime method, query the newly created object according to the object identifier, delete the queried newly created object from the program, and release memory.

13. The programming data processing apparatus according to claim 12, characterized in that, The device further includes: The file acquisition unit is configured to acquire program configuration files generated based on graphical programming. The code parsing unit is configured to parse the instruction code in the program configuration file and determine the executable block corresponding to the instruction code; The object creation unit is configured to create a program object and return the object identifier of the program object when the block to be executed creates a block for the object. The object control unit is configured to execute control commands on the program object based on the passed object identifier when the block to be executed is the object control block.

14. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method of any one of claims 1 to 11.

15. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 11 by executing the executable instructions.

16. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method as described in any one of claims 1 to 11.