Programming building block sharing method and device, equipment, medium and program product
By switching the display status of the programming building blocks, creators are allowed to select and share specific programming building blocks, solving the problem of insufficient flexibility in sharing programming building blocks in the existing technology, and improving sharing efficiency and human-computer interaction efficiency.
Patent Information
- Application Number
- CN202510013121.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-01-03
AI Technical Summary
The existing technology lacks flexibility in the sharing of programming building blocks, and cannot achieve fine-grained sharing of programming building blocks, resulting in low human-computer interaction efficiency.
Provide a method of sharing programming building blocks. By switching the display status of programming building blocks, creators can select and share specific programming building blocks, realizing fine-grained sharing of programming building blocks.
This method improves the sharing efficiency of programming building blocks, reduces the complexity and time cost of sharing operations, and enhances the efficiency of human-computer interaction.
Smart Images

Figure CN119938021A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of human-computer interaction, and in particular to a method, device, equipment, medium and program product for sharing programming building blocks. Background Art
[0002] Visual programming is a way of performing programming through a graphical interface. Programming blocks are provided in a code editor based on visual programming. The creator implements the code logic by placing, dragging, splicing or nesting multiple programming blocks in the programming area of the code editor. Among them, a programming block represents a basic unit that constitutes the program code, such as a variable, function, condition, judgment, loop, etc. The code editor determines the program code based on the combination relationship of these programming blocks, and implements the corresponding function through the program code.
[0003] In the related art, the programming blocks in the programming area are saved as templates in the template library to achieve storage, reuse and sharing. However, the related art method can only package all the programming blocks in the programming area and save them as templates in the template library. The creator can only share or import the entire template, resulting in low human-computer interaction efficiency. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment, medium and program product for sharing programming building blocks. The technical solution is as follows:
[0005] In one aspect, a method for sharing programming blocks is provided, the method comprising:
[0006] Displaying N programming blocks in a first state, wherein N is greater than 0;
[0007] In response to entering the sharing mode, controlling the N programming blocks in the first state to switch to a second state, wherein the display styles of the first state and the second state are different;
[0008] In response to a selection operation, selecting M programming blocks from the N programming blocks in the second state, and controlling the M programming blocks to return to the first state, wherein M is greater than 0 and less than or equal to N;
[0009] In response to confirming the sharing operation, the M programming blocks in the first state are shared.
[0010] In some embodiments, the method further comprises:
[0011] Using a zoom field to set a zoom operation of the N programming blocks in the second state;
[0012] The zoom operation is used to indicate viewing the N programming blocks in the second state by zooming;
[0013] or;
[0014] Using a movement field to set a translation operation of the N programming blocks in the second state;
[0015] The moving operation is used to indicate viewing the N programming blocks in the second state by moving.
[0016] In some embodiments, the method further comprises:
[0017] The cascading style sheet styles of the N programming blocks are adjusted to control the N programming blocks in the first state to switch to the second state, and to control the M programming blocks to restore to the first state.
[0018] In some embodiments, adjusting the cascading style sheet styles of the N programming blocks to control the N programming blocks in the first state to switch to the second state, and controlling the M programming blocks to return to the first state, includes at least one of the following:
[0019] reducing the transparency of the N programming blocks in the first state to control the N programming blocks in the first state to switch to the second state; increasing the transparency of the M programming blocks selected from the N programming blocks, and reducing the transparency of the unselected programming blocks from the N programming blocks to control the M programming blocks to return to the first state;
[0020] or;
[0021] Applying a grayscale filter to the N programming blocks in the first state to control the N programming blocks in the first state to switch to the second state; canceling the grayscale filter for the M programming blocks selected from the N programming blocks, and applying the grayscale filter to the unselected programming blocks from the N programming blocks to control the M programming blocks to return to the first state;
[0022] or;
[0023] Adding dotted line strokes to the N programming blocks in the first state to control the N programming blocks in the first state to switch to the second state; canceling the dotted line strokes for the M programming blocks selected from the N programming blocks, and adding the dotted line strokes to the programming blocks not selected from the N programming blocks to control the M programming blocks to return to the first state.
[0024] In some embodiments, the method further comprises:
[0025] After controlling the N programming blocks in the first state to switch to the second state, adding an unselected style name to each of the N programming blocks in the second state;
[0026] After selecting the M programming blocks from the N programming blocks in the second state, removing the unselected style names of the M programming blocks; and adding the M programming blocks to a sharing list of the block combination.
[0027] In some embodiments, converting the block information of each of the M programming blocks into structured data includes:
[0028] Integrating the building block information of each programming building block of the M programming building blocks into a structured data structure to obtain the structured data;
[0029] The structured data structure at least includes a connection field and an input field, the connection field is used to store the block identifiers of the sequentially connected programming blocks among the M programming blocks, and the input field is used to store the block identifier corresponding to the programming block containing at least one sub-programming block among the M programming blocks.
[0030] In some embodiments, the method further comprises:
[0031] Receiving the shared file contents of the Q programming blocks;
[0032] Parsing the file contents of the Q programming blocks and restoring the Q programming blocks;
[0033] or;
[0034] Receiving the sharing links of the Q programming blocks that are shared;
[0035] Obtaining file contents corresponding to the sharing links of the Q programming blocks from the server;
[0036] Parse the file contents of the Q programming building blocks and restore the Q programming building blocks.
[0037] In some embodiments, parsing the file contents of the Q programming building blocks and restoring the Q programming building blocks includes:
[0038] Decrypting the file contents of the Q programming blocks to obtain structured data;
[0039] Parsing the structured data to obtain the building block information of each of the Q programming building blocks;
[0040] The Q programming blocks are restored based on the block information of each of the Q programming blocks.
[0041] In some embodiments, the restoring the Q programming blocks based on the block information of each of the Q programming blocks includes:
[0042] Based on the block type and block parameters in the block information of each of the Q programming blocks, generate Q programming block instances and set corresponding attribute values respectively;
[0043] Based on the block position in the block information of each of the Q programming blocks, determining the positions of the Q programming block instances respectively;
[0044] Based on the connection relationship between each programming building block of the Q programming building blocks and other building blocks in the building block information, the Q programming building blocks instances are connected to restore the Q programming building blocks.
[0045] In some embodiments, the method further comprises:
[0046] Performing integrity check on the Q restored programming building blocks;
[0047] If the result of the integrity check is failure, generating an import prompt text;
[0048] The import prompt text is used to prompt at least one of an import failure, a re-import, and a check on the integrity of the data source.
[0049] In another aspect, a device for sharing programming blocks is provided, the device comprising:
[0050] A display module, used to display N programming blocks in a first state, where N is greater than 0;
[0051] a processing module, configured to control the N programming blocks in the first state to switch to a second state in response to entering a sharing mode, wherein the display styles of the first state and the second state are different;
[0052] The processing module is configured to select M programming blocks from the N programming blocks in the second state in response to a selection operation, and control the M programming blocks to be restored to the first state, wherein M is greater than 0 and less than or equal to N;
[0053] The sharing module is configured to share the M programming blocks in the first state in response to confirming the sharing operation.
[0054] On the other hand, a computer device is provided, comprising: a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the above-mentioned method for sharing programming blocks.
[0055] On the other hand, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the above-mentioned method for sharing programming blocks.
[0056] On the other hand, a computer program product is provided, the computer program product comprising computer instructions, the computer instructions being stored in a computer-readable storage medium, a processor acquiring the computer instructions from the computer-readable storage medium, so that the processor loads and executes the computer instructions to implement the above-mentioned method for sharing programming blocks.
[0057] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0058] A more fine-grained sharing method for programming blocks is provided. When entering the sharing mode, the N programming blocks in the first state are switched to the second state, and M programming blocks are allowed to be selected from the N programming blocks in the second state, so as to realize the rapid sharing of the selected M programming blocks. Compared with the sharing method in the related art that requires saving the N programming blocks as a template in the template library as a whole, there is no need to save and publish the template to the template library, which reduces the complexity and time cost of the sharing operation, improves the sharing efficiency, and improves the efficiency of human-computer interaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0060] Figure 1 is a structural block diagram of a computer system provided by an exemplary embodiment of the present application;
[0061] Figure 2 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0062] Figure 3 is a flow chart of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0063] Figure 4is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0064] Figure 5 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0065] Figure 6 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0066] Figure 7 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0067] Figure 8 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0068] Fig. 9 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0069] Fig.10 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0070] Fig.11 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0071] Fig.12 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0072] Fig.13 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0073] Fig.14 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0074] Fig.15 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0075] Fig.16 is a schematic diagram of structured data of a programming building block provided by an exemplary embodiment of the present application;
[0076] Fig.17 is a schematic diagram of structured data of a programming building block provided by an exemplary embodiment of the present application;
[0077] Fig.18 is a schematic diagram of the file content of a programming building block provided by an exemplary embodiment of the present application;
[0078] Fig.19 is a timing diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0079] Fig. 20 is a timing diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application;
[0080] Fig.21 is a block diagram of a device for sharing programming blocks provided by an exemplary embodiment of the present application;
[0081] Fig. 22 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0082] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0083] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0084] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0085] It should be understood that, although the terms first, second, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0086] It should be noted that before collecting user-related data and during the process of collecting user-related data, for example, user accounts, programming blocks, selection operations, trigger operations, sharing operations, and click operations, this application can display a prompt interface, pop-up window, or output voice prompt information. The prompt interface, pop-up window, or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining user-related data after obtaining the user's confirmation operation on the prompt interface or pop-up window. Otherwise, if the user's confirmation operation on the prompt interface or pop-up window is not obtained, the relevant steps of obtaining user-related data are terminated, that is, no user-related data is obtained. In other words, all user-related data collected by this application are collected with the user's consent and authorization, and the collection, use, and processing of user-related data must comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0087] First, the nouns involved in the embodiments of the present application are briefly introduced:
[0088] Visual Programming: It is a way of performing programming through a graphical interface. Creators implement code logic by placing, dragging, connecting, splicing or nesting graphical modules instead of directly writing program code. These graphical modules can become programming building blocks. The use of visual programming reduces the complexity of programming and is suitable for creators who are not professional programmers.
[0089] Code editor: An editor that supports visual programming, also known as a code editor based on visual programming. Code editors based on visual programming provide programming blocks. Creators implement code logic by placing, dragging, splicing, or nesting multiple programming blocks in the programming area of the code editor. The code editor determines the program code based on the combination relationship of these programming blocks and implements the corresponding functions through the program code.
[0090] Programming blocks (Block): also referred to as blocks, are the basic units that make up program code. Among them, a programming block represents a basic unit that makes up program code, for example, at least one of events, operations, variables, functions, conditions, judgments, and loops. Programming blocks include: shapes, colors, transparency, and borders, so that creators can easily identify and execute combinations to achieve various functions.
[0091] Trigger group: also known as the canvas. In visual programming, the trigger group is a work area for creating and managing the logical operations of a programming block, also known as the programming area. Creators can drag, place and combine programming blocks in the trigger group to construct the code logic of the code program. The trigger group provides a variety of operation functions for programming blocks, such as: adding, deleting, modifying, copying, pasting, dragging, and connecting at least one of them, which facilitates creators to design and adjust the code logic of the code program.
[0092] User Generated Content (UGC): refers to content generated by users. In the game scene, users create levels, maps, characters, items, etc. through the creation tools and code editors provided by the game scene, which increases the personalization and scalability of the game.
[0093] Figure 1 1 is a block diagram of a computer system provided by an exemplary embodiment of the present application. The computer system 100 can be a system architecture for implementing a method for sharing programming building blocks. The computer system 100 includes: a first terminal 120, a server 140 and a second terminal 160.
[0094] The first terminal 120 installs and runs a client of an application that supports visual programming. Optionally, the application includes: a game application, a game development engine, a visual programming tool, a code editor, a map editor, a chart application, and a document application. The game application can be any one of a battle royale shooting game, a virtual reality (VR) game, an augmented reality (AR) program, a three-dimensional map program, a virtual reality game, an augmented reality game, a first-person shooting game (FPS), a third-person shooting game (TPS), a multiplayer online tactical competitive game (MOBA), a strategy game (SLG), and a competitive party game.
[0095] The first terminal 120 is a terminal used by the first user. The first user uses the first terminal 120 to perform visual programming. The first terminal 120 controls the virtual character in the virtual environment based on the program code corresponding to the visual programming or based on the interactive operation performed by the first user. The control includes but is not limited to: adjusting body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, throwing, and building virtual buildings. Optionally, the first user can also use the first terminal 120 to share and be shared with programming blocks.
[0096] The first terminal 120 and the second terminal 160 are connected to the server 140 via a wireless network or a wired network.
[0097] The server 140 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services, cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and cloud servers providing basic cloud computing services such as big data and artificial intelligence platforms. The server 140 includes at least one server, multiple servers, a cloud computing platform, and a virtualization center.
[0098] The server 140 includes a processor 144 and a memory 142, and the memory 142 includes a receiving module 1421, a control module 1422 and a sending module 1423. The receiving module 1421 is used to receive a request sent by the client; the control module 1422 is used to control visual programming and rendering of the virtual environment; the sending module 1423 is used to send a response to the client; the server 140 is used to provide background services for the clients of the first terminal 120 and the second terminal 160.
[0099] Optionally, the server 140 undertakes the main computing work, and the first terminal 120 and the second terminal 160 undertake the secondary computing work; or, the server 140 undertakes the secondary computing work, and the first terminal 120 and the second terminal 160 undertake the main computing work; or, the server 140, the first terminal 120 and the second terminal 160 adopt a distributed computing architecture to perform collaborative computing.
[0100] The second terminal 160 installs and runs a client of an application that supports visual programming. Optionally, the application includes: a game application, a game development engine, a visual programming tool, a code editor, a map editor, a chart application, and a document application. The game application can be any one of a battle royale shooting game, a virtual reality (VR) game, an augmented reality (AR) program, a three-dimensional map program, a virtual reality game, an augmented reality game, a first-person shooting game (FPS), a third-person shooting game (TPS), a multiplayer online tactical competitive game (MOBA), a strategy game (SLG), and a competitive party game.
[0101] The second terminal 160 is a terminal used by the second user. The second user uses the second terminal 160 to perform visual programming. The second terminal 160 controls the virtual character in the virtual environment based on the program code corresponding to the visual programming or based on the interactive operation performed by the second user. The control includes but is not limited to: adjusting body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, throwing, and building virtual buildings. Optionally, the second user can also use the second terminal 160 to share and be shared with programming blocks.
[0102] Optionally, the virtual characters controlled by the first user through the first terminal 120 and the second user through the second terminal 160 are located at different positions in the same virtual environment, that is, the first user and the second user are in the same battle. Or, the virtual characters controlled by the first user through the first terminal 120 and the second user through the second terminal 160 are located at different positions in different virtual environments, that is, the first user and the second user are in different battles.
[0103] Optionally, the client installed on the first terminal 120 and the second terminal 160 is the same, or the client installed on the two terminals is the same type of client for different control system platforms. The embodiment of the present application does not limit the form of the client installed on the first terminal 120 and the second terminal 160, including but not limited to App (Application, client), applet, etc. installed in the first terminal 120 and the second terminal 160, and can also be in the form of a web page. The first terminal 120 can refer to one of multiple terminals, and the second terminal 160 can refer to one of multiple terminals. This embodiment only uses the first terminal 120 and the second terminal 160 as an example. The device type of the first terminal 120 and the second terminal 160 is the same, and the device model can be different. The device type includes at least one of: a smart phone, a tablet computer, a wearable device, a PC (Personal Computer, personal computer), a laptop portable computer, and a desktop computer. The following embodiments are illustrated by taking the terminal including a smart phone as an example.
[0104] Those skilled in the art will appreciate that the number of the first terminal 120 and the second terminal 160 may be more or less. For example, the first terminal 120 and the second terminal 160 may be one each, or the first terminal 120 and the second terminal 160 may be 8 or more in total. The embodiment of the present application does not limit the number and device type of the first terminal 120 and the second terminal 160.
[0105] Visual programming has been widely used in the field of game UGC. Through visual programming, creators in these fields can easily create the logic of program code and realize various functions. Creators refer to users or players who use creation tools or other platforms in game scenes to perform game UGC creation. Creators design and build customized game content through map editors, visual programming tools, code editors, etc., and display and share these game contents with other users or players. For example, in the field of game UGC, visual programming helps players customize character behavior, design level logic, tasks or game modes by placing, dragging, splicing or nesting multiple programming blocks in the programming area without programming experience.
[0106] In the related technology, taking the field of game UGC as an example, creators can realize corresponding game functions by placing, dragging, splicing or nesting multiple programming blocks in the programming area. For example, the game function is "summoning creatures", and the code logic is: "When the player presses the summon button, a fire ring special effect will be played 300cm in front of the player, summoning the specified creature and playing the appearance animation". Creators can save the programming blocks in the programming area as templates in the template library, and publish the templates to the community to achieve storage, reuse and sharing.
[0107] Here are the steps:
[0108] 1. The creator enters the trigger group management panel. In the management panel, the creator can see a list of all trigger groups in the current project, making it easy to find and manage the logic of each trigger group.
[0109] 2. The creator browses the trigger groups in the management panel and finds the trigger group that he wants to save as a template. For example, a trigger group named "Summon Creatures" has the following code logic: "When the player presses the summon button, a fire ring effect will be played 300cm in front of the player, summoning the specified creature and playing the appearance animation."
[0110] 3. The creator clicks the "Save as Template" button and the "Save as Template" interface pops up.
[0111] 4. In the "Save as Template" interface, the creator fills in the name and description for the template. For example, name the template "Summon Creature Template" and add a description as "When the player presses the summon button, the specified creature is summoned 300cm in front of the player and the appearance animation is played" to facilitate subsequent creators or other creators to quickly identify the game function corresponding to the template in the template library.
[0112] 5. Click the "Save as Template" button in the "Save as Template" interface, and the computer device will package all the programming blocks in the entire trigger group into a template, and save the template file of the template to the template library server. The template file includes the logical structure, configuration parameters, related variables and dependencies of all the programming blocks in the trigger group to ensure that the entire code logic can be restored when the template is subsequently imported.
[0113] 6. When subsequent creators or other creators want to use this template, click the "Add Template" button in the management panel of the trigger group to open the template library.
[0114] 7. The creator clicks on the template in the template library, and the "Add to Canvas" button is displayed. Click "Add to Canvas" to import the template.
[0115] 8. The template is loaded into the current trigger group. At the same time, a new trigger group is added to the trigger group management interface, and the programming blocks are automatically laid out and connected as when the template was saved.
[0116] Based on the related technology, the creator can save the programming blocks in the programming area as templates in the template library to achieve storage, reuse and sharing, simplify the process of creators migrating and reusing the same functions between different projects, and reduce repetitive operations. However, the related technology has at least the following problems:
[0117] 1. Lack of flexible modular sharing support: The related technology can only package and save all programming blocks in the programming area as templates in the template library, and save the entire trigger group as a whole, lacking modular sharing support. This method leads to low efficiency of human-computer interaction in reuse and collaboration: when the creator only wants to reuse or share part of the common logic, such as a specific animation or effect, this method causes the saved template to contain a lot of irrelevant content. The creator can only share or import the entire template, and needs to manually delete the redundant programming blocks, which increases the complexity and time cost of the operation, and also increases the storage cost of the server.
[0118] 2. Lack of support for fast sharing: The related technology uses the template library as a storage and management method for programming building blocks, and creators must manage and find templates through the template library. However, as the activity of the game UGC community increases, the number of templates in the template library will continue to increase, and creators will face difficulties in managing and finding templates when using them. As a result, creators cannot instantly share and reuse specific functional logic during team collaboration or project migration, which limits the convenience and real-time nature of code logic sharing.
[0119] 3. Lack of fine-grained permission control: When the template is published to the community through related technologies, all creators can fully access, import and use the template, which cannot meet the creator's protection needs for specific code logic. Especially in the game UGC scenario, creators may want to share programming blocks only internally and not publicly. However, the template library lacks the function of limiting access and controlling permissions, and it is impossible to set the access level and access restrictions of the template, which makes it difficult to control the scope of use of programming blocks after sharing, which is not conducive to protecting the privacy and security of the code logic of programming blocks.
[0120] Based on this, the method for sharing programming blocks provided in the embodiments of the present application can at least solve the following problems:
[0121] 1. Support modular sharing of building block combinations to solve the redundancy and complexity of templates: Allow creators to select and save specific code logic fragments in the programming area as independent modular building block combinations, and save part of the programming building blocks without having to save the entire trigger group. Creators can save and call commonly used functional modules, such as specific special effects, animations, character behaviors, etc., separately, reducing the interference of irrelevant content.
[0122] 2. Support quick sharing to solve the tediousness and inefficiency of the sharing process: The introduction of the quick sharing function allows creators to instantly generate the file content corresponding to the selected part of the programming building blocks. Creators can quickly share the code logic of programming building blocks without relying on the saving, searching and importing processes of the template library to achieve efficient reuse. This sharing method simplifies the operation process and is especially suitable for team collaboration, cross-project migration and real-time sharing scenarios, improving the efficiency of human-computer interaction.
[0123] 3. Support fast sharing within the private domain to solve the problem of insufficient permission control: Creators can send the file content corresponding to a portion of the selected programming building blocks to specific creators or team members without relying on the public release of the template library, and realize fast sharing within the private domain. This method does not need to be publicly displayed in the community, and can effectively limit access rights to internal teams or specific creators, ensuring the privacy and security of the code logic of the programming building blocks.
[0124] Figure 2 1 is an interface diagram of a method for sharing programming blocks provided by an exemplary embodiment of the present application. The method is executed by a computer device, and the computer device is installed and runs a client of an application program supporting visual programming. The computer device may be Figure 1 The first terminal 120 and / or the second terminal 160 shown in the figure are installed with a client that runs an application that supports visual programming. The steps of the method are briefly described as follows:
[0125] 1. Display N programming blocks in a first state, where N is greater than 0; optionally, the first state is a normal state or an editable state, which is a state that allows viewing, selecting, adding, dragging, deleting, connecting, and modifying N programming blocks.
[0126] 2. In response to entering the sharing mode, the N programming blocks in the first state are controlled to switch to the second state, and the display styles of the first state and the second state are different; optionally, the second state is a read-only state or a non-editable state or a virtual state, which allows viewing and selection, but does not allow adding, dragging, deleting, connecting and modifying the N programming blocks. For example, the first state can be displayed in a normal brightness and transparency, solid line border mode, and the second state can be displayed in a reduced brightness and transparency, dotted line border mode.
[0127] 3. In response to the selection operation, select M programming blocks from the N programming blocks in the second state, and control the M programming blocks to return to the first state, where M is greater than 0 and less than or equal to N. Optionally, refer to Figure 2 , control the selected M programming blocks 11 to return to the first state, and the other unselected programming blocks 12 remain in the first state.
[0128] 4. In response to confirming the sharing operation, share the M programming blocks in the first state. Figure 2 , click the confirm sharing button 13 to trigger the confirm sharing operation and share the M programming blocks 11 in the first state.
[0129] In summary, the embodiments of the present application provide a method for sharing programming building blocks, which supports creators to flexibly select programming building blocks and save them as reusable modular units, and supports exporting the selected programming building blocks into standardized file content or sharing links for sharing, aiming to optimize and simplify the way of sharing programming building blocks, improve the efficiency and flexibility of sharing programming building blocks, and improve the efficiency of human-computer interaction.
[0130] It should also be noted that in response to: used to indicate the conditions or states on which the executed operations depend, when the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay, which is not limited here.
[0131] Figure 3 1 is a flowchart of a method for sharing programming blocks provided by an exemplary embodiment of the present application. The method is executed by a computer device, and the computer device is installed with a client that runs an application that supports visual programming. The computer device may be Figure 1 The first terminal 120 and / or the second terminal 160 shown in the figure are installed with a client that runs an application that supports visual programming. The method includes at least some of steps 220, 240, 260, and 280:
[0132] Step 220 , displaying N programming blocks in a first state, where N is greater than 0.
[0133] Programming blocks are the basic units that make up program code. A programming block represents a basic unit that makes up program code, such as at least one of an event, operation, variable, function, condition, judgment, and loop. Programming blocks include: shape, color, transparency, and border, so that creators can easily identify and execute combinations to achieve various functions.
[0134] The first state is a normal state or an editable state, which is a state that allows viewing, selecting, adding, dragging, deleting, connecting, and modifying N programming blocks. The N programming blocks refer to all programming blocks in the programming area, or they may be N programming blocks out of X programming blocks in the programming area, and the N programming blocks may be N programming blocks that can be shared or have sharing permissions determined by a computer device or indicated by a creator. X is greater than or equal to N, and N is greater than 0. The N programming blocks in the first state may be displayed in at least one of normal brightness and transparency, and a solid border.
[0135] Optionally, the computer device displays N programming blocks in a first state in the programming area.
[0136] Step 240 , in response to entering the sharing mode, controlling the N programming blocks in the first state to switch to the second state, wherein the display styles of the first state and the second state are different.
[0137] The sharing mode allows the creator to share all or part of the N programming blocks. The sharing mode can be triggered by the sharing control. The sharing control can be implemented as at least one of the following: an entry, a button, an element, an icon, a key, a key in an external input device, and the external input device includes at least one of an external mouse, a keyboard, and a handle. The sharing control can be triggered by at least one of the following methods: click, double-click, slide, long press, gesture input, text input, and voice input.
[0138] The second state is a read-only state or a non-editable state or a virtual state, which allows viewing and selection, but does not allow adding, dragging, deleting, connecting and modifying N programming blocks. The N programming blocks refer to all programming blocks in the programming area, or they can be N programming blocks out of the X programming blocks in the programming area. The N programming blocks can be N programming blocks that can be shared or have sharing permissions determined by a computer device or indicated by the creator. X is greater than or equal to N, and N is greater than 0. The N programming blocks in the second state can be displayed in at least one of the following ways: reducing brightness and transparency, dotted borders, and adding grayscale filters. In this embodiment, the display styles of the first state and the second state are different, so that the creator can distinguish between the first state and the second state.
[0139] Optionally, in response to entering the sharing mode, the computer device controls the N programming blocks in the first state to switch to the second state, and the N programming blocks in the second state are displayed in the programming area.
[0140] Step 260 , in response to the selection operation, select M programming blocks from the N programming blocks in the second state, and control the M programming blocks to return to the first state, where M is greater than 0 and less than or equal to N.
[0141] The selection operation is an operation of selecting M programming blocks from N programming blocks, that is, an operation of selecting M programming blocks from N programming blocks in the second state, where M is greater than 0 and less than or equal to N. The selection operation can be triggered by at least one of the following methods: click, double-click, box selection, gesture input, text input, and voice input. Here, the selection operation allows at least a portion of the programming blocks to be selected from the N programming blocks, so as to subsequently implement the saving, sharing, and reuse of the selected at least a portion of the programming blocks.
[0142] The M programming building blocks may also be referred to as building block combinations. In some embodiments, the programming building blocks in the programming area may be placed in rows. Optionally, the M programming building blocks may be any one of the following programming building blocks: a continuous row of programming building blocks, continuous at least two rows of programming building blocks, evenly spaced at least two rows of programming building blocks, unevenly spaced at least two rows of programming building blocks, continuous programming building blocks in the same row, evenly spaced programming building blocks in the same row, unevenly spaced programming building blocks in the same row, discretely distributed programming building blocks in different rows. Assuming that there are 5 rows in the programming area and each row includes 5 programming blocks, the M programming blocks can specifically be any one of the following programming blocks: the 1st row of programming blocks, the consecutive 1st, 2nd and 3rd rows of programming blocks, the 1st, 3rd and 5th rows of programming blocks, the 1st, 2nd and 5th rows of programming blocks, 5 programming blocks in the 1st row, the 1st, 3rd and 5th programming blocks in the 1st row, the 1st, 2nd and 5th programming blocks in the 1st row, the 1st programming block in the 1st row, the 5th programming block in the 3rd row and 3 programming blocks in the 5th row.
[0143] In other embodiments, the programming blocks in the programming area may also be placed in columns. Optionally, the M programming blocks may be any one of the following programming blocks: a continuous column of programming blocks, at least two continuous columns of programming blocks, at least two columns of programming blocks spaced evenly, at least two columns of programming blocks spaced unevenly, continuous programming blocks in the same column, programming blocks spaced evenly in the same column, programming blocks spaced unevenly in the same column, and discretely distributed programming blocks in different columns.
[0144] In response to the selection operation, the computer device selects M programming blocks from the N programming blocks in the second state, and controls the M programming blocks to return to the first state to indicate that the M programming blocks are selected or selected programming blocks. M is greater than 0 and less than or equal to N. It is understandable that after selecting the M programming blocks, NM programming blocks in the N programming blocks in the second state are still in the second state to indicate that the NM programming blocks are unselected or unselected programming blocks. This step can also be repeated multiple times and executed in a loop to eventually select the M programming blocks that you want to share.
[0145] Step 280 , in response to confirming the sharing operation, sharing the M programming blocks in the first state.
[0146] The confirmation sharing operation is an operation of confirming the sharing of the M programming blocks in the first state, that is, an operation of confirming the sharing of the selected M programming blocks. The confirmation sharing operation can be triggered by confirming the sharing control. The confirmation sharing control can be implemented as at least one of the following: an entry, a button, an element, an icon, a key, a key in an external input device, and the external input device includes at least one of an external mouse, a keyboard, and a handle. The confirmation sharing control can be triggered by at least one of the following methods: click, double-click, slide, long press, gesture input, text input, and voice input.
[0147] Optionally, the computer device shares the M programming blocks in the first state in response to confirming the sharing operation. Here, setting an access range and sharing permissions is supported to share the M programming blocks in the first state with accounts or friend accounts within the set access range.
[0148] In summary, the sharing method of programming blocks provided in the embodiment of the present application, the computer device displays N programming blocks in the first state, N is greater than 0; in response to entering the sharing mode, the N programming blocks in the first state are controlled to switch to the second state, and the display styles of the first state and the second state are different; in response to the selection operation, M programming blocks are selected from the N programming blocks in the second state, and the M programming blocks are controlled to be restored to the first state, M is greater than 0 and less than or equal to N; in response to confirming the sharing operation, the M programming blocks in the first state are shared. Accordingly, a more fine-grained sharing method of programming blocks is provided. When entering the sharing mode, the N programming blocks in the first state are switched to the second state, and M programming blocks are allowed to be selected from the N programming blocks in the second state, so as to realize the rapid sharing of the selected M programming blocks. Compared with the sharing method in the related art that requires the N programming blocks to be saved as a template in the template library as a whole, there is no need to save and publish the template to the template library, which reduces the complexity and time cost of the sharing operation, improves the sharing efficiency, and improves the human-computer interaction efficiency.
[0149] Share operation:
[0150] In some embodiments, a quick share function is provided, and the creator can select the programming building blocks to be shared and perform sharing through the quick share function. Step 280 is implemented as steps 282 and 284:
[0151] Step 282, in response to a triggering operation on a confirmation sharing control, displaying at least two sharing options;
[0152] Step 284 , in response to a selection operation of a target sharing option among the at least two sharing options, sharing the M programming blocks in the first state based on a sharing method indicated by the target sharing option.
[0153] The confirmation sharing control can be implemented as at least one of the following: an entry, a button, an element, an icon, a key, a key in an external input device, and the external input device includes at least one of an external mouse, a keyboard, and a handle. The confirmation sharing control can be triggered by at least one of the following methods: click, double-click, slide, long press, gesture input, text input, and voice input.
[0154] The sharing option is used to indicate the sharing method, and the at least two sharing options are used to indicate at least two sharing methods. The selection operation is an operation of selecting a sharing option from at least two sharing options. The target sharing option is a sharing option selected by the selection operation. Each sharing option of the at least two sharing options can be implemented as: an entry, a button, an element, an icon, a key, a key in an external input device, and the external input device includes at least one of an external mouse, a keyboard, and a handle. The selection operation can be triggered by at least one of the following methods: click, double-click, slide, long press, gesture input, text input, and voice input.
[0155] Optionally, the computer device displays at least two sharing options in response to a trigger operation on the confirmation sharing control. In response to a selection operation on a target sharing option among the at least two sharing options, the M programming building blocks in the first state are shared based on a sharing method indicated by the target sharing option.
[0156] In this embodiment, at least two sharing options are provided, and the creator can choose the desired sharing method by himself, which can meet the sharing needs of multiple scenarios and improve the flexibility and compatibility of sharing operations.
[0157] The following embodiments provide several sharing methods. In practical applications, one of the sharing methods may be selected to perform sharing, or at least two sharing methods may be used to perform sharing respectively, which is not limited here.
[0158] Sharing method 1:
[0159] In some embodiments, the target sharing option includes: copying a building block combination file. The selected M programming building blocks may also be referred to as a building block combination. Step 284 is specifically implemented as step 284A:
[0160] Step 284A, in response to the selection operation of copying the building block combination file, converting the M programming building blocks in the first state into file content, and copying the file content to a clipboard, and pasting the file content in the clipboard into a target application; wherein the file content includes at least one of text, numbers, letters, symbols, and codes.
[0161] The file content is the content corresponding to the selected M programming blocks, which can be text content expressed in the form of text. The file content includes at least one of text, numbers, letters, symbols, and codes. The file content can be readable by the creator, for example, at least one of text and numbers, or readable by a computer device, for example, at least one of numbers, symbols, and codes. In this case, the file content can be: encrypted ciphertext or non-encrypted ciphertext.
[0162] The target application can be an application that supports visual programming and is installed and run on a computer device, or it can be other cross-platform applications, such as at least one of instant messaging tools, chat applications, game applications, text editors, collaboration tools, note-taking software, email, and social platforms.
[0163] Optionally, in response to the selection operation of copying the block combination file, the computer device converts the M programming blocks in the first state into file content, and copies the file content to a clipboard, and pastes the file content in the clipboard into a target application. The target application may be automatically popped up, or may be automatically switched to the target application. In the target application, the file content may be displayed as the file content itself, or in the form of a small program, depending on the settings in the target application.
[0164] In this embodiment, a sharing method of copying a building block file combination is provided. By copying the file content to the clipboard, the creator can paste the file content in the clipboard into the target application, thereby realizing cross-platform sharing and improving the flexibility of sharing.
[0165] Sharing method 2:
[0166] In some embodiments, the target sharing option includes: copying a building block combination link. The selected M programming building blocks may also be referred to as a building block combination. Step 284 is specifically implemented as step 284B:
[0167] Step 284B, in response to the selection operation of copying the building block combination link, generating a sharing link of the M programming building blocks in the first state, and copying the sharing link to the clipboard, and sending the sharing link in the clipboard to the first account; wherein the first account is an account within the set access range or a friend account.
[0168] The sharing link is a link in the form of a web address or a Uniform Resource Locator (URL) corresponding to the M programming blocks. The first account is an account within the set access scope or a friend account of the user account corresponding to the creator. The set access scope is a preset range of user accounts that have been authorized for access. A friend account refers to a user account corresponding to the creator that has added the other party as a friend. The friend account includes a friend account in an application that supports visual programming and is installed and run on a computer device, and can also be a friend account in other cross-platform applications.
[0169] Optionally, in response to the selection operation of copying the building block combination link, the computer device generates a sharing link of the M programming building blocks in the first state, and copies the sharing link to the clipboard, and sends the sharing link in the clipboard to the first account. Specifically, switch to the chat window of the first account, and send the sharing link in the clipboard to the first account.
[0170] In this embodiment, a sharing method of copying a building block file link is provided. By copying the sharing link to the clipboard, the creator can send the sharing link in the clipboard to the first account, which improves the flexibility of sharing. In addition, the creator can also set the user account range by himself to achieve fast sharing within the private domain, ensuring privacy and security.
[0171] Sharing method three:
[0172] In some embodiments, the target sharing option includes: sharing to a second account. The selected M programming building blocks may also be referred to as a building block combination. Step 284 is specifically implemented as step 284C:
[0173] Step 284C, in response to the selection operation of sharing to a second account, the file content or sharing link corresponding to the M programming blocks in the first state is copied to the clipboard, and an account list is popped up, and the file content or sharing link in the clipboard is sent to the second account in the account list; wherein the second account is an account within the set access range or a friend account.
[0174] The file content is the content corresponding to the selected M programming blocks, which can be text content expressed in the form of text. The file content includes at least one of text, numbers, letters, symbols, and codes. The file content can be readable by the creator, for example, at least one of text and numbers, or readable by a computer device, for example, at least one of numbers, symbols, and codes. In this case, the file content can be: encrypted ciphertext or non-encrypted ciphertext.
[0175] The sharing link is a link in the form of a web address or a uniform resource locator (URL) corresponding to the M programming blocks. The second account is an account within the set access range or a friend account of the user account corresponding to the creator. The set access range is a preset range of user accounts that have been authorized for access. A friend account means that the user account corresponding to the creator has added the other party as a friend. The friend account includes a friend account in an application that supports visual programming installed and run on a computer device, and can also be a friend account in other cross-platform applications. The first account and the second account can be the same or different accounts. In some embodiments, the second account is an in-game friend account.
[0176] Optionally, in response to a selection operation to share with a second account, the computer device copies the file content or sharing link corresponding to the M programming blocks in the first state to the clipboard, and pops up an account list to send the file content or sharing link in the clipboard to the second account in the account list.
[0177] In this embodiment, a sharing method for sharing with a second account is provided. By copying the file content or sharing link to the clipboard, the creator can send the file content or sharing link in the clipboard to the second account, which improves the flexibility of sharing. In addition, the creator can also set the user account range by himself to achieve fast sharing within the private domain, ensuring privacy and security.
[0178] Sharing method 4:
[0179] In some embodiments, the target sharing option also includes: sending a building block combination file. The selected M programming building blocks may also be referred to as a building block combination. Step 284 is specifically implemented as step 284D:
[0180] Step 284D, in response to the selection operation of sending the building block combination file, converting the M programming building blocks in the first state into a file, sending the file to a third account, and storing the file in a designated storage area; wherein the file includes at least one of a text file, an image file, a program file, and a database file, and the third account is an account within the set access range or a friend account.
[0181] The file is a file formed by the file contents corresponding to the selected M programming blocks, wherein the file may be at least one of a text file, an image file, a program file, and a database file, and different types of files have corresponding file suffixes. The designated storage area may be the memory of a computer device or a computer-readable storage medium. The third account is an account within the set access range or a friend account of the user account corresponding to the creator. The set access range is a preset range of user accounts with access authorization. A friend account refers to a user account corresponding to the creator that has added the other party as a friend. The friend account includes a friend account in an application that supports visual programming installed and run by the computer device, and may also be a friend account in other cross-platform applications. The first account, the second account, and the third account may be the same or different accounts.
[0182] Optionally, in response to the selection operation of sending the building block combination file, the computer device converts the M programming building blocks in the first state into a file, sends the file to a third account, and stores the file in a designated storage area.
[0183] In this embodiment, a sharing method for sending building block combination files is provided. The creator can send the files to a third account and store the files, which improves the flexibility of sharing and the long-term storage of files and avoids the loss of files as much as possible.
[0184] Selection method:
[0185] This embodiment provides a block selection function. The following embodiments provide a selection method provided by the block selection function to select M programming blocks from N programming blocks in the second state. In practical applications, one of the selection methods can be selected, or at least two selection methods can be combined to perform the selection, which is not limited here.
[0186] Selection method 1:
[0187] Specifically, step 260 is implemented as step 260A:
[0188] Step 260A: In response to M click operations, display one programming block in the N programming blocks in the second state indicated by each click operation of the M click operations to select M programming blocks from the N programming blocks in the second state.
[0189] The selection operation includes M click operations, each click operation of the M click operations is used to select a programming block from the N programming blocks in the second state, and the M click operations are used to select M programming blocks from the N programming blocks in the second state.
[0190] Optionally, in response to the M click operations, the computer device displays one programming block in the N programming blocks in the second state indicated by each click operation of the M click operations, so as to select M programming blocks from the N programming blocks in the second state.
[0191] In this embodiment, a method of selecting M programming blocks through multiple click operations is provided, which improves the diversity of selection operations and further improves the flexibility of sharing operations.
[0192] Option 2:
[0193] Specifically, step 260 is implemented as step 260B:
[0194] Step 260B, in response to at least one frame selection operation, displaying a frame selection area of each frame selection operation of the at least one frame selection operation, and determining the programming blocks in the second state located in the frame selection area as M programming blocks selected from the N programming blocks in the second state.
[0195] The selection operation includes at least one selection operation, each selection operation of at least one selection operation corresponds to a selection area, and the programming building block in the second state located in the selection area is the selected programming building block. The selection operation is triggered by clicking the mouse button in a blank area of the programming area, dragging in one direction to form a selection window, and clicking the mouse button again to complete the selection operation. Among them, the size of the selection area corresponding to each selection operation of at least one selection operation can be the same or different, and there is no limitation here.
[0196] Optionally, the computer device displays a selection area of each selection operation of the at least one selection operation in response to at least one selection operation, and determines the programming blocks in the second state located in the selection area as M programming blocks selected from the N programming blocks in the second state.
[0197] In this embodiment, a method of selecting M programming blocks through at least one frame selection operation is provided, which improves the diversity of selection operations and further improves the flexibility of sharing operations.
[0198] Selection method three:
[0199] Specifically, step 260 is implemented as step 260C:
[0200] Step 260C, displaying an option list of the building block information; in response to a selection operation on a target option in the option list of the building block information, determining the M programming blocks that match the target option as the M programming blocks selected from the N programming blocks in the second state; wherein the option list of the building block information includes at least one of a building block type option, a building block identification option, a building block parameter option, a building block position option, and a connection relationship option with other building blocks.
[0201] The building block information is used to uniquely characterize the programming building block. Optionally, the building block information includes at least one of the building block type, building block identification, building block parameters, building block position, and connection relationship with other building blocks. The building block type includes at least one of events, operations, variables, functions, conditions, judgments, loops, special effects, sound effects, and animations. Building block parameters are specific attribute values, including at least one of numerical parameters, text parameters, and Boolean parameters. The building block identification can be at least one of letters, numbers, and codes. The building block position includes at least one of row numbers, column numbers, and coordinates. The connection relationship with other building blocks includes at least one of sequential connection, nested connection, and loop connection.
[0202] Correspondingly, the option list of the building block information includes at least one of the building block type option, the building block identification option, the building block parameter option, the building block position option, and the connection relationship option with other building blocks. Sub-options are also included in each option. Optionally, the building block type sub-option also includes at least one of the event sub-option, the operation sub-option, the variable sub-option, the function sub-option, the condition sub-option, the judgment sub-option, the loop sub-option, the special effect sub-option, the sound effect sub-option, and the animation sub-option. The building block parameter sub-option also includes at least one of the numerical parameter sub-option, the text parameter sub-option, and the Boolean parameter sub-option. The building block identification sub-option also includes at least one of the letter sub-option, the number sub-option, and the encoding sub-option. The building block position sub-option also includes at least one of the row number sub-option, the column number sub-option, and the coordinate sub-option. The connection relationship sub-option with other building blocks also includes at least one of the sequential connection sub-option, the nested connection sub-option, and the loop connection sub-option. The target option can be one of the aforementioned options, or one of the sub-options in the aforementioned options.
[0203] Optionally, the computer device displays an option list of the building block information; in response to a selection operation on a target option in the option list of the building block information, the M programming blocks matching the target option are determined as the M programming blocks selected from the N programming blocks in the second state.
[0204] In this embodiment, an option list based on building block information is provided, and a method of selecting M programming building blocks by checking them is used, thereby improving the diversity of selection operations and further improving the flexibility of sharing operations.
[0205] Selection method 4:
[0206] Specifically, step 260 is implemented as step 260D:
[0207] Step 260D, displaying candidate building block combinations; in response to a selection operation on a target building block combination in the candidate building block combination, determining the M programming blocks in the target building block combination as M programming blocks selected from the N programming blocks in the second state; wherein the candidate building block combination is obtained by executing a combination based on at least a portion of the N programming blocks in the second state.
[0208] The candidate building block combination is obtained by combining at least a portion of the N programming building blocks in the second state, and can be determined based on at least one of the functions implemented by the at least a portion of the programming building blocks, the building block type, the building block identifier, the building block parameter, the building block position, and the connection relationship with other building blocks. For example, based on the functions implemented by at least a portion of the N programming building blocks in the second state, the programming building blocks corresponding to each function are combined to obtain the candidate building block combination.
[0209] In other embodiments, the candidate building block combination is obtained by combining at least a portion of the N programming building blocks in the second state using the neural network model. The neural network model is used to perform clustering based on the building block information of at least a portion of the N programming building blocks in the second state, clustering the programming building blocks whose building block information similarity is greater than a threshold into a group, and determining the programming building blocks in each cluster cluster obtained based on the clustering as the candidate building block combination.
[0210] The candidate building block combination includes at least one, and the target building block combination is at least one of the candidate building block combinations. Optionally, the computer device displays the candidate building block combinations; in response to a selection operation of the target building block combination in the candidate building block combination, the M programming building blocks in the target building block combination are determined to be the M programming building blocks selected from the N programming building blocks in the second state.
[0211] In this embodiment, candidate building block combinations are displayed in advance, and a method for selecting a target building block combination to select M programming building blocks is provided, thereby improving the diversity of selection operations and further improving the flexibility of sharing operations.
[0212] Other displays:
[0213] In some embodiments, step 240 is implemented as step 242 and step 244:
[0214] Step 242, in response to a triggering operation on a sharing control, entering a sharing mode;
[0215] Step 244, in response to entering the sharing mode, control the N programming blocks in the first state to switch to the second state; wherein the first state is a state that allows viewing, selecting, adding, dragging, deleting, connecting and modifying the N programming blocks, and the second state is a state that allows viewing and selecting, but does not allow adding, dragging, deleting, connecting and modifying the N programming blocks.
[0216] The sharing mode allows the creator to share all or part of the N programming blocks. The sharing mode can be triggered by the sharing control. The sharing control can be implemented as at least one of the following: an entry, a button, an element, an icon, a key, a key in an external input device, and the external input device includes at least one of an external mouse, a keyboard, and a handle. The sharing control can be triggered by at least one of the following methods: click, double-click, slide, long press, gesture input, text input, and voice input.
[0217] The first state is a normal state or an editable state, which is a state in which N programming blocks can be viewed, selected, added, dragged, deleted, connected, and modified. The N programming blocks in the first state can be displayed in at least one of normal brightness and transparency, and a solid border. The second state is a read-only state or a non-editable state or a virtual state, which is a state in which viewing and selection are allowed, but adding, dragging, deleting, connecting, and modifying N programming blocks are not allowed. The N programming blocks in the second state can be displayed in at least one of reduced brightness and transparency, dotted borders, and adding grayscale filters.
[0218] Optionally, the computer device enters a sharing mode in response to a triggering operation on the sharing control; in response to entering the sharing mode, the N programming blocks in the first state are controlled to switch to the second state.
[0219] In this embodiment, a method for entering the sharing mode and controlling the state switching of the programming blocks is provided, which can prompt the creator in a visual manner, and the creator can select the programming blocks they want to share and execute the sharing, thereby improving the sharing efficiency of the programming blocks.
[0220] In some embodiments, simultaneously with or after step 244, step 246 is further included:
[0221] Step 246, in response to entering the sharing mode, displaying a sharing prompt text and a confirmation sharing control; wherein the sharing prompt text is used to prompt the selection of M programming blocks, and the confirmation sharing control is used to display at least two sharing options after being triggered.
[0222] The sharing prompt text is used to prompt the creator to select M programming blocks, that is, to guide the creator to select M programming blocks to share. For example, the sharing prompt text is "Please select the programming blocks to be shared quickly" or "Please click the combination of blocks to be shared quickly". The confirmation sharing control is used to display at least two sharing options after being triggered. Optionally, the sharing prompt text and the confirmation sharing control are displayed in the same row or in the same column.
[0223] The sharing prompt text and the confirmation sharing control may be displayed in a blank space or an upper area in the programming area. Optionally, the computer device displays the sharing prompt text and the confirmation sharing control in response to entering the sharing mode.
[0224] In this embodiment, the creator can be promptly prompted through the sharing prompt text, can select the programming building blocks he wants to share, and can also execute the sharing by confirming the sharing control, thereby improving the accuracy of the sharing operation.
[0225] As an example, the quick share function is generally described below in conjunction with a specific schematic diagram.
[0226] refer to Figure 4 , add a quick share button 20 to the management interface of the trigger group. The quick share button 20 is used to enter the share mode after being triggered. When the share mode is not entered, all programming blocks in the programming area are in normal state. When the creator clicks the quick share button 20 to enter the share mode, refer to Figure 5 , all programming blocks in the block combination 21 composed of several programming blocks and the block combination 22 composed of several programming blocks in the programming area are switched to a read-only state. In the read-only state, all programming blocks in the block combination 21 and the block combination 22 have reduced transparency, and / or added grayscale filters, and / or added dotted line strokes. For example, referring to Figure 8 , the programming blocks are in normal state. Fig. 9 , the programming blocks have reduced transparency. Fig.10 , the programming block adds a grayscale filter. Fig.11 , the programming block reduces transparency and adds a grayscale filter. Fig.12 , the programming blocks have added dotted line strokes. At the same time, continue to refer to Figure 5 , the programming area also displays a sharing prompt text "Please click the building block combination you want to share quickly" and a confirmation sharing button 24.
[0227] The creator clicks on several programming blocks in the building block combination 22 one by one to select the building block combination 22 that he wants to share. After clicking, several programming blocks in the selected building block combination 22 are restored from the read-only state to the normal state. Figure 6, block combination 22 is now displayed as block combination 23. Under normal conditions, all programming blocks in block combination 23 have restored transparency, or canceled the grayscale filter, or canceled the dotted line stroke. After the creator completes the selection, click the confirm sharing button 24, and all programming blocks in block combination 23 are fixed. Figure 7 , displaying a sharing interface 25, including 3 sharing options: copying the building block combination file, copying the building block combination link, and sharing with game friends. Clicking a target sharing option among the 3 sharing options executes sharing based on the sharing method indicated by the target sharing option.
[0228] (1) For copying a building block combination file: Generate the file content corresponding to the selected building block combination 23 and copy it to the clipboard for direct pasting into the target application. The target application can be at least one of an instant messaging tool, a chat application, a game application, a text editor, a collaboration tool, a note-taking software, an email, and a social platform to achieve flexible cross-platform use and storage. This method also allows creators to save and share building blocks without a network, ensuring that the convenience and operability of the building block combination are not restricted by network conditions. (2) For copying a building block combination link: Generate a sharing link for the selected building block combination 23 and copy it to the clipboard for direct sending to the first account. (3) Share with game friends: A game friend list pops up, and the creator can select one or more game friends to send the file content or sharing link corresponding to the building block combination 23 to the game friends, facilitating direct in-game collaboration and sharing.
[0229] In this embodiment, it is possible to accurately select the building block combination composed of the programming building blocks that you want to share, avoiding the export and sharing of redundant programming building blocks. By copying the building block combination link and forwarding it to game friends, it is possible to set the access scope during the sharing process and control the shared user account. In team collaboration or game UGC communities, it not only improves the convenience of sharing building block combinations, but also takes into account privacy and security, ensuring that the creator's user-generated content is shared within the set access scope.
[0230] Import operation:
[0231] In some embodiments, a quick import function is provided, and after receiving the programming building blocks shared by other creators, the creator can perform the import through the quick import function. After step 280, or before step 220, steps 320 and 340 are also included:
[0232] Step 320, receiving the file contents or sharing links of Q shared programming blocks, where Q is greater than 0;
[0233] Step 340 , in response to the import operation of the file contents or sharing links of the Q programming blocks, display the Q programming blocks.
[0234] Q programming blocks are shared to the creator by other creators through sharing operations, and Q is greater than 0. When other creators share by copying the block combination file, they receive the file content of the Q programming blocks shared; when other creators share by copying the block combination link, they receive the sharing link of the Q programming blocks shared; when other creators share by sharing to a second account, they receive the file content or sharing link of the Q programming blocks shared.
[0235] The import operation can be triggered by an import control. The import control can be implemented as at least one of the following: an entry, a button, an element, an icon, a key, a key in an external input device, and the external input device includes at least one of an external mouse, a keyboard, and a handle. The import control can be triggered by at least one of the following methods: click, double-click, slide, long press, gesture input, text input, and voice input.
[0236] Optionally, the computer device receives the file content or sharing link of Q programming blocks being shared, Q is greater than 0, and in response to the import operation of the file content or sharing link of Q programming blocks, displays the Q programming blocks. Specifically, the display mode of the Q programming blocks includes at least one of the following, which can be designed and selected according to actual technical needs.
[0237] Display mode 1: The computer device displays Q programming blocks in the blank space of the programming area in response to the import operation of the file content or sharing link of Q programming blocks. The mode of this embodiment does not change the layout, connection relationship and code logic of the original programming blocks in the programming area, so that the creator can use and edit the original programming blocks in the programming area and the Q programming blocks imported this time respectively.
[0238] Display mode 2: In response to the import operation of the file content or sharing link of Q programming blocks, the computer device connects the Q programming blocks with the P programming blocks in the programming area based on the functions implemented by the Q programming blocks, and displays the Q programming blocks in the programming area, where P is greater than 0. The method of this embodiment re-arranges and re-connects the original programming blocks in the programming area and the Q programming blocks imported this time according to the functions, and implements the corresponding code logic, thereby improving the processing efficiency of various programming blocks in the programming area.
[0239] In this embodiment, the creator can import the file content or sharing link of the Q shared programming blocks by himself, which can meet the import requirements of multiple scenarios, improve the flexibility and compatibility of the import operation, realize the rapid reuse of the functions implemented by the Q programming blocks, and improve the import efficiency.
[0240] Import method 1:
[0241] Specifically, step 340 is implemented as step 342 and step 344:
[0242] Step 342, in response to the triggering operation of the import control, displaying the import input box;
[0243] Step 344 , in response to pasting the file content or sharing link of the Q programming blocks in the import input box, displaying the Q programming blocks.
[0244] The import input box is an input box for pasting the file content or sharing link of Q programming blocks. Optionally, a paste prompt text is also displayed in the import input box, and the paste prompt text is used to prompt the pasting of the file content or sharing link of Q programming blocks. For example, the paste prompt text is "Please enter the building block combination file content or link". A confirmation import control is also displayed on the outside of the import input box. The confirmation import control is used to confirm the import of Q programming blocks after triggering. The confirmation import control can be implemented as at least one of the following: an entry, a button, an element, an icon, a button, a button in an external input device, and the external input device includes at least one of an external mouse, a keyboard, and a handle. The confirmation import control can be triggered by at least one of the following methods: click, double-click, slide, long press, gesture input, text input, and voice input.
[0245] Optionally, the computer device displays an import input box in response to a trigger operation on an import control; and displays Q programming blocks in response to pasting the file content or sharing link of Q programming blocks in the import input box. Specifically, in response to a trigger operation on a confirmation import control, Q programming blocks are displayed.
[0246] In this embodiment, the creator can paste the file content or sharing link of the Q shared programming blocks in the import input box to achieve rapid reuse of the functions implemented by the Q programming blocks, improve import efficiency, and also help improve data processing efficiency.
[0247] Import method 2:
[0248] Specifically, step 340 is implemented as step 346 and step 348:
[0249] Step 346, in response to the triggering operation of the import control, displaying the import upload window;
[0250] Step 348 , in response to uploading the file of Q programming blocks in the import upload window, displaying the Q programming blocks.
[0251] The import upload window is a window for uploading files of Q programming blocks. You can drag and drop the files of Q programming blocks into the import upload window, or select the storage path corresponding to the files of Q programming blocks through the import upload window.
[0252] Optionally, the computer device displays an import upload window in response to a trigger operation on an import control; and displays Q programming blocks in response to uploading a file of Q programming blocks in the import upload window.
[0253] In this embodiment, the creator can upload the files of the shared Q programming blocks in the import upload window by himself, so as to realize the rapid reuse of the functions realized by the Q programming blocks, improve the import efficiency, and also help to improve the data processing efficiency.
[0254] As an example, the quick import function is generally described below with reference to a specific schematic diagram.
[0255] refer to Fig.13 , a new quick import button 30 is added to the management interface of the trigger group. The quick import button 30 is used to enter the import interface after being triggered. The programming area originally includes a building block combination 31 composed of several programming building blocks. After receiving the shared building block combination, the creator clicks the quick import button 30, and Fig.14 , the import input box 32 is displayed, and the import prompt text in the import input box 32 is "Please enter the building block combination file content or link". After the creator pastes the corresponding content in the import input box 32, refer to Fig.15 As shown, the building block combination 33 is imported into the programming area, and the layout and connection relationship of the original building block combination 31 in the programming area remain unchanged. The creator can continue to edit several programming building blocks of the building block combination 33 later.
[0256] In this embodiment, the building block combination composed of shared programming building blocks is quickly imported without carrying redundant building block combinations and without changing the layout and connection relationship of the original programming building blocks in the programming area, thereby improving the convenience of importing the building block combination.
[0257] Technical implementation:
[0258] In some embodiments, a technical implementation of the quick share function is provided.
[0259] Read-only mode:
[0260] In some embodiments, when the computer device responds to entering the sharing mode, it is necessary to switch the N programming blocks in the first state to the second state, which is implemented based on the read-only mode. Specifically, the method further includes step 420:
[0261] Step 420: Set the N programming blocks in the first state to a read-only mode using the read-only field; wherein the read-only mode is used to indicate that the N programming blocks in the first state are switched to a second state.
[0262] The read only field is used to set the trigger group or programming area to read-only mode. In read-only mode, the N programming blocks in the first state are switched to the second state, and the creator can only view and select, but cannot add, drag, delete, connect, or modify the N programming blocks.
[0263] Optionally, the computer device sets the N programming blocks in the first state to a read-only mode using the read-only field; wherein the read-only mode is used to indicate that the N programming blocks in the first state are switched to a second state.
[0264] In this embodiment, the computer device uses the configuration of the read-only field to enter the sharing mode and switch N programming blocks in the first state to the second state, which is beneficial for the creator to select the programming blocks he wants to share, ensures that the programming blocks will not be edited and modified during the selection process, and improves the accuracy of the selection operation.
[0265] In some embodiments, in read-only mode, in order to allow the creator to view the N programming blocks in the second state, the creator is also allowed to perform a zoom operation or a pan operation to facilitate the selection of M programming blocks. After step 420, the method may further optionally include step 431 and / or step 432:
[0266] Step 431, using a zoom field to set a zoom operation of the N programming blocks in the second state; wherein the zoom operation is used to indicate viewing the N programming blocks in the second state by zooming;
[0267] Step 432, using the move field to set a translation operation of the N programming blocks in the second state; wherein the move operation is used to indicate viewing the N programming blocks in the second state by moving.
[0268] The zoom field is used to set the zoom operation configuration of the trigger group or programming area, allowing the creator to zoom the entire trigger group or programming area through the scroll wheel to view the N programming blocks in the second state through zooming. Optionally, the computer device uses the zoom field to set the zoom operation of the N programming blocks in the second state; wherein the zoom operation is used to indicate viewing the N programming blocks in the second state through zooming.
[0269] The move field is used to set the move operation configuration of the trigger group or programming area, allowing the creator to move the entire trigger group or programming area by dragging or scrolling to view the N programming blocks in the second state by moving. Optionally, the computer device uses the move field to set the translation operation of the N programming blocks in the second state; wherein the move operation is used to indicate viewing the N programming blocks in the second state by moving.
[0270] In this embodiment, the computer device also utilizes the configuration of the zoom field and the move field to maintain good viewing and browsing functions in read-only mode, allowing the creator to flexibly adjust the canvas perspective and ratio, making it easier for the creator to view the full picture of the programming blocks and quickly select the programming blocks they want to share.
[0271] As an example, the configuration code ideas for read-only fields, zoom fields, and move fields are as follows: Step 1, hide the toolbox to avoid accidentally adding blocks in read-only mode; Step 2, enable read-only mode, and all blocks are not editable; Step 3, allow users to use the scroll wheel to zoom the view; Step 4, set the initial zoom ratio to 1.0; Step 5, set the maximum zoom ratio, and the user can zoom in to 3 times; Step 6, set the minimum zoom ratio, and the user can reduce the view to 0.3 times; Step 7, set the zoom speed ratio, and adjust it proportionally each time you zoom; Step 8, enable the scroll bar to facilitate users to pan and view the entire canvas; Step 9, allow users to drag the canvas to pan the view; Step 10, disable scroll wheel panning to avoid conflicts with the zoom function.
[0272] Blur effect:
[0273] In some embodiments, when N programming blocks in the first state are switched to the second state, or when M programming blocks are selected to be restored to the first state, the computer device needs to perform display based on different display styles of the first state and the second state. Since the programming blocks are rendered using Scalable Vector Graphics (SVG), they can be controlled by adjusting the Cascading Style Sheets (CSS) style of the programming blocks. Optionally, after step 420, step 440 is also included:
[0274] Step 440, adjusting the cascading style sheet styles of the N programming blocks to control the N programming blocks in the first state to switch to the second state, and to control the M programming blocks to return to the first state.
[0275] Optionally, the computer device adjusts the cascading style sheet styles of the N programming blocks, specifically, adjusts at least one attribute in the cascading style sheet styles of the N programming blocks to control the N programming blocks in the first state to switch to the second state, and control the M programming blocks to return to the first state.
[0276] In this embodiment, by adjusting the cascading style sheet style, the state switching of the programming block can be realized visually, prompting the creator whether the programming block is selected, thereby improving the execution efficiency and accuracy of the selection operation.
[0277] In some embodiments, at least one attribute in the cascading style sheet style includes at least one of the following: an opacity attribute for controlling transparency, a filter attribute for controlling a filter effect, a stroke attribute for controlling a dashed stroke effect, and a stroke-dasharray attribute.
[0278] Specifically, step 440 is implemented as at least one of step 440A, step 440B, and step 440C. One or more of them can be selected for use according to actual technical needs:
[0279] Step 440A, reducing the transparency of the N programming blocks in the first state to control the N programming blocks in the first state to switch to the second state; increasing the transparency of the M programming blocks selected from the N programming blocks, and reducing the transparency of the unselected programming blocks from the N programming blocks to control the M programming blocks to return to the first state.
[0280] Optionally, the computer device reduces the transparency of N programming blocks in the first state by modifying the transparency attribute in the cascading style sheet style, so as to control the N programming blocks in the first state to switch to the second state; increases the transparency of M programming blocks selected from the N programming blocks, and reduces the transparency of unselected programming blocks from the N programming blocks, so as to control the M programming blocks to return to the first state.
[0281] The value range of the transparency attribute is 0 to 1. 0 means completely transparent, and 1 means completely opaque. Figure 8 , the programming blocks are in normal state. Fig. 9 , the transparency of the programming block is reduced. When a programming block is selected, the transparency of the programming block is increased.
[0282] Step 440B, using a grayscale filter on the N programming blocks in the first state to control the N programming blocks in the first state to switch to the second state; canceling the use of the grayscale filter on the M programming blocks selected from the N programming blocks, and using the grayscale filter on the unselected programming blocks from the N programming blocks to control the M programming blocks to return to the first state.
[0283] Optionally, the computer device modifies the filter properties in the cascading style sheet style and uses a grayscale filter on the N programming blocks in the first state to control the N programming blocks in the first state to switch to the second state; cancels the use of the grayscale filter on the M programming blocks selected from the N programming blocks, and uses the grayscale filter on the programming blocks not selected from the N programming blocks to control the M programming blocks to return to the first state.
[0284] The grayscale property in the filter properties is used to adjust the grayscale, and the grayscale property value range is 0 to 100%. 0 means there is no grayscale and the original color is displayed, and 100% means the original color is converted to black and white. Figure 8 , the programming blocks are in normal state. Fig.10 , the programming block adds a grayscale filter. And, reference Fig.11 , the programming block reduces transparency and adds a grayscale filter. When a programming block is selected, the grayscale filter of the programming block is cancelled.
[0285] Step 440C, adding dotted line strokes to the N programming blocks in the first state to control the N programming blocks in the first state to switch to the second state; canceling the dotted line strokes for the M programming blocks selected from the N programming blocks, and adding dotted line strokes to the programming blocks not selected from the N programming blocks to control the M programming blocks to return to the first state.
[0286] Optionally, the computer device modifies the stroke attribute and the dashed line stroke attribute in the cascading style sheet style, adds dashed line strokes to the N programming blocks in the first state, so as to control the N programming blocks in the first state to switch to the second state; cancels the dashed line strokes for the M programming blocks selected from the N programming blocks, and adds dashed line strokes to the programming blocks not selected from the N programming blocks, so as to control the M programming blocks to return to the first state. Figure 8 , the programming blocks are in normal state. Fig.12 , the programming block adds a dotted line stroke. When a programming block is selected, the dotted line stroke of the programming block is cancelled.
[0287] In this embodiment, a variety of methods are provided by adjusting the style of the cascading style sheet, which can adapt to the display requirements of multiple scenarios, improve the diversity and flexibility of the display, and are also conducive to visually realizing the state switching of programming blocks, prompting the creator whether the programming block is selected, and improving the execution efficiency and accuracy of the selection operation.
[0288] As an example, the idea of the configuration code for reducing the transparency of unselected programming blocks is as follows: set the transparency to 50% to make the blocks semi-transparent. The idea of the configuration code for using a grayscale filter for unselected programming blocks is as follows: apply a 50% grayscale filter to partially decolorize the blocks. The idea of the configuration code for using a grayscale filter and reducing the transparency for unselected programming blocks is as follows: Step 1, reduce the transparency to 50% to make the blocks semi-transparent; Step 2, apply a 50% grayscale filter to partially decolorize the blocks. The idea of the configuration code for adding a dotted stroke to an unselected programming block is as follows: Step 1, reduce the transparency to 50% to make the blocks semi-transparent; Step 2, apply a 50% grayscale filter to partially decolorize the blocks; Step 3, set the stroke color to green; Step 4, set the dotted line style, 4px solid line, 2px blank.
[0289] In some embodiments, in order to ensure that N programming blocks in the first state are switched to the second state after entering the sharing mode and to ensure that the M programming blocks are restored to the first state after the creator selects M programming blocks, steps 451 and 452 are further included after step 440:
[0290] Step 451, after controlling the N programming blocks in the first state to switch to the second state, adding an unselected style name to each of the N programming blocks in the second state;
[0291] Step 452, after selecting M programming blocks from the N programming blocks in the second state, remove the unselected style names of the M programming blocks; and add the M programming blocks to the sharing list of the block combination.
[0292] The unselected style name (blockly-block-unselected) is used to indicate that the current programming block is not selected. In another understanding, it is also used to indicate that the transparency of the current programming block is reduced, a grayscale filter is added, or a dashed line stroke is added. When the current programming block is selected, the unselected style name is removed.
[0293] Optionally, after controlling the N programming blocks in the first state to switch to the second state, the computer device adds an unselected style name to each of the N programming blocks in the second state; after selecting M programming blocks from the N programming blocks in the second state, removes the unselected style names of the M programming blocks; and adds the M programming blocks to a sharing list (shareList) of the block combination to facilitate subsequent operation management. For example, before generating the file content corresponding to the M programming blocks, traverse all the programming blocks in the sharing list to avoid omissions.
[0294] In this embodiment, by adding or removing unselected style names for programming blocks, it is possible to accurately indicate whether a programming block is selected, thereby improving the execution efficiency and accuracy of the selection operation, avoiding omissions, and improving data processing efficiency.
[0295] Conversion of file contents:
[0296] In some embodiments, when the creator chooses to share by copying the building block combination file, the selected M programming building blocks need to be converted into corresponding file contents. Exemplarily, for converting the M programming building blocks in the first state into file contents, it is implemented as steps 510, 520 and 530:
[0297] Step 510, extracting the building block information of each programming building block of the M programming building blocks;
[0298] Step 520, converting the building block information of each programming building block of the M programming building blocks into structured data;
[0299] Step 530, encrypt the structured data to obtain file contents corresponding to the M programming building blocks; wherein the building block information includes at least one of building block type, building block identification, building block parameters, building block position, and connection relationship with other building blocks.
[0300] The building block information is used to uniquely characterize the programming building block. Optionally, the building block information includes at least one of the building block type, building block identification, building block parameters, building block position, and connection relationship with other building blocks. The building block type includes at least one of events, operations, variables, functions, conditions, judgments, loops, special effects, sound effects, and animations. Building block parameters are specific attribute values, including at least one of numerical parameters, text parameters, and Boolean parameters. The building block identification can be at least one of letters, numbers, and codes. The building block position includes at least one of row numbers, column numbers, and coordinates. The connection relationship with other building blocks includes at least one of sequential connection, nested connection, and loop connection.
[0301] Structured data is data with fixed data formats and fields, usually presented in the form of a table, a tree structure or a relational model. In this embodiment, the structured data is JSON data represented in text form. Encryption is a means to ensure the security of the data transmission process. The encryption method can be a symmetric encryption algorithm or an asymmetric encryption algorithm, which is selected according to actual technical needs. For example, the symmetric encryption algorithm can be the Advanced Encryption Standard algorithm (AES), and the asymmetric encryption algorithm can be a public key encryption algorithm (RSA algorithm). It should also be noted that the encryption step is an optional step, and whether to perform encryption is selected according to actual technical needs.
[0302] Optionally, the computer device extracts the building block information of each of the M programming blocks; converts the building block information of each of the M programming blocks into structured data; encrypts the structured data to obtain file content corresponding to the M programming blocks, and the file content may be encrypted text.
[0303] In this embodiment, a method of converting the selected M programming blocks into corresponding file contents is provided. When the creator chooses to copy the block combination file to perform sharing, the corresponding file contents can be sent to the target application, so that these programming blocks can be shared and saved across platforms, thereby improving the data processing efficiency and sharing efficiency of these programming blocks. In addition, by performing encryption, the privacy and security of the data are also ensured.
[0304] Exemplarily, step 520 is specifically implemented as step 522:
[0305] Step 522: Integrate the block information of each of the M programming blocks into a structured data structure to obtain structured data; wherein the structured data structure at least includes a connection field and an input field, the connection field is used to store the block identifiers of the sequentially connected programming blocks in the M programming blocks, and the input field is used to store the block identifier corresponding to the programming block containing at least one sub-programming block in the M programming blocks.
[0306] The structured data structure includes at least a connection (next) field and an input (inputs) field. The connection field is used to point to the block identifier of the next sequentially connected programming block. The input field is used to record the block identifiers corresponding to the sub-programming blocks contained in the programming block that has at least one sub-programming block. Among them, the programming block that has at least one sub-programming block can have a block type of: loop, condition, and judgment.
[0307] Optionally, the computer device integrates the building block information of each programming building block of the M programming building blocks into a structured data structure to obtain structured data; wherein the structured data structure includes at least a connection field and an input field, the connection field is used to store the building block identifiers of the programming building blocks connected in sequence among the M programming building blocks, and the input field is used to store the building block identifier corresponding to the programming building block containing at least one sub-programming building block among the M programming building blocks.
[0308] In this embodiment, a method for converting the selected M programming blocks into corresponding structured data is provided, so that the computer device can subsequently restore and rebuild the programming blocks based on the structured data, thereby improving the accuracy of sharing and importing.
[0309] Generation of sharing link:
[0310] In some embodiments, when the creator chooses to share by copying the building block combination link, after converting the M programming building blocks in the first state into file content, it is necessary to upload the file content to the server and return the corresponding sharing link. Exemplarily, for generating the sharing link of the M programming building blocks in the first state, it is implemented as steps 540 and 550:
[0311] Step 540, uploading the file contents corresponding to the M programming blocks to the server;
[0312] Step 550, obtaining the sharing links of the M programming building blocks returned by the server; wherein the sharing link is composed of a protocol, a domain name, a port, a sharing identifier and an encryption identifier, and the encryption identifier points to the file content in the server.
[0313] The sharing link is a link in the form of a web address or a Uniform Resource Locator (URL) corresponding to the M programming blocks. The sharing link consists of a protocol (http), a domain name (.com), a port, a sharing identifier (share), and an encryption identifier (id=uniqueIdentifier), and the encryption identifier points to the file content in the server. The encryption identifier can be the file identifier or resource path of the file content in the server.
[0314] Optionally, the computer device uploads the file contents corresponding to the M programming blocks to the server, and obtains the sharing links of the M programming blocks returned by the server. In one example, the sharing link can be represented as: "https: / / code.xxx.com / share?id=uniqueIdentifier".
[0315] In this embodiment, a method for converting the selected M programming blocks into corresponding sharing links is provided. When the creator chooses to copy the block combination link to perform sharing, the corresponding sharing link can be sent to the first account, so that these programming blocks can be shared, thereby improving the data processing efficiency and sharing efficiency of these programming blocks.
[0316] As an example, the steps for converting, encrypting, and sharing JSON data are as follows:
[0317] 1. Traverse the selected building block combination: traverse each programming building block in the selected building block combination in a tree structure, and extract building block information of each programming building block, where the building block information includes at least one of building block type, building block identification, building block parameters, building block position, and connection relationship with other building blocks.
[0318] 2. Extract key attributes and connection relationships: For each programming building block, extract the following key attributes and connection relationships: Building block ID: unique identifier, used to distinguish each programming building block. Building block type: is the function type, such as event, operation, etc. Building block parameter: is the specific attribute value, such as event type, operation target, etc. Building block position: is the coordinate in the programming area, which is convenient for restoring the layout when importing. Connection relationship: is the connection between each programming building block and other building blocks, including post-position, sub-building blocks, etc.
[0319] 3. Construct JSON data: Integrate the building block information of each programming building block into the JSON data structure to organize the building block information of each programming building block so that the building block information is easy to read, store and transmit. Specifically, the JSON data includes at least a connection (next) field and an input (inputs) field, which are respectively used to record the order, connection relationship and nested relationship between programming building blocks. The connection field is used to point to the building block identifier of the next sequentially connected programming building block. The input field is used to record the building block identifier corresponding to the sub-programming building block contained in the programming building block that has at least one sub-programming building block. Among them, for a programming building block that has at least one sub-programming building block, the building block type can be: loop, condition, judgment.
[0320] refer to Fig.16 As shown in (1), the creator selects the building block combination, and the corresponding JSON data reference Fig.16 As shown in (2), the connection field in the JSON data records the building block identifier, for example, represented as: "id": "IQ*{me$$A!*AbF-vv=j / .", and the input field records the connection relationship between each programming building block. Fig.17 As shown in (1), the creator selects the building block combination, and the corresponding JSON data reference Fig.17As shown in (2), the connection field in the JSON data records the building block identifier, for example, represented as: "id": "ihXX4*7No-a*v=DcaY$f", and the input field records the connection relationship between each programming building block.
[0321] 4. Encrypt the JSON data to obtain the file content. In order to ensure the security of data transmission, a symmetric encryption algorithm or an asymmetric encryption algorithm is selected based on actual technical needs, such as the AES algorithm or the RSA algorithm, to encrypt the JSON data to obtain the file content. In an example, the encrypted file content is referenced Fig.18 As shown, the content of the file is similar to garbled code, which is used to ensure the privacy and security of JSON data and avoid tampering during data transmission.
[0322] 5-1. When the creator chooses to share by copying the building block combination file, the file content will be copied to the clipboard so that the file content can be pasted into the target application, such as instant messaging tools, chat applications, game applications, text editors, collaboration tools, note-taking software, email, and at least one of social platforms, to achieve flexible cross-platform sharing and saving.
[0323] 5-2. When the creator chooses to share by copying the building block combination link, the file content is uploaded to the server, and the server returns a unique sharing link. The encrypted identifier in the sharing link points to the file content in the server, and the sharing link is copied to the clipboard so that the sharing link can be shared with the first account.
[0324] Data analysis and restoration:
[0325] In some embodiments, a technical implementation of a quick import function is provided.
[0326] After receiving the file content or sharing link of Q programming blocks shared by other creators, data parsing and restoration need to be performed to restore the code logic of Q programming blocks and display Q programming blocks. Exemplarily, the method further includes step 610, step 640, and / or the method further includes step 620, step 630, step 640:
[0327] Step 610, receiving the file contents of the Q shared programming blocks;
[0328] Step 640, parsing the file contents of the Q programming blocks and restoring the Q programming blocks;
[0329] Optionally, when other creators share by copying the building block combination file, the computer device receives the file content of the Q shared programming building blocks, parses the file content of the Q programming building blocks, and restores the Q programming building blocks.
[0330] Step 620, receiving the sharing links of the Q shared programming blocks;
[0331] Step 630, obtaining the file contents corresponding to the sharing links of the Q programming blocks from the server;
[0332] Step 640: parse the file contents of the Q programming blocks and restore the Q programming blocks.
[0333] Optionally, when other creators use the method of copying the building block combination link to perform sharing, the computer device receives the sharing link of the Q programming blocks being shared; obtains the file content corresponding to the sharing link of the Q programming blocks from the server, wherein the data acquisition interface of the server is automatically requested to obtain the corresponding file content based on the encrypted identifier in the sharing link; parses the file content of the Q programming blocks, and restores the Q programming blocks.
[0334] In this embodiment, a method for performing data parsing and restoration after receiving the sharing link or file content of Q programming blocks is provided, which can accurately restore and display the Q programming blocks, improve the convenience and accuracy of sharing, and improve the efficiency of human-computer interaction.
[0335] In some embodiments, step 640 is implemented as step 642, step 644, and step 646:
[0336] Step 642, decrypt the file contents of the Q programming blocks to obtain structured data;
[0337] Step 644, parsing the structured data to obtain the building block information of each of the Q programming building blocks;
[0338] Step 646: restore the Q programming blocks based on the block information of each of the Q programming blocks.
[0339] Since the file contents of the Q programming blocks are obtained by encrypting the structured data of the Q programming blocks, and the structured data is obtained by integrating the block information of each of the Q programming blocks into the structured data structure, the computer device needs to decrypt the file contents of the Q programming blocks according to the decryption method corresponding to the encryption method to obtain the structured data; parse the structured data to obtain the block information of each of the Q programming blocks; and restore the Q programming blocks based on the block information of each of the Q programming blocks.
[0340] In this embodiment, a method for parsing the file contents of Q programming blocks is provided, which can restore the Q programming blocks according to the structured data corresponding to the Q programming blocks, thereby improving data processing efficiency.
[0341] In some embodiments, step 646 is specifically implemented as step 6461, step 6462, and step 6463:
[0342] Step 6461, based on the block type and block parameters in the block information of each of the Q programming blocks, generate Q programming block instances and set corresponding attribute values respectively;
[0343] Step 6462, based on the block position in the block information of each of the Q programming blocks, determine the positions of the Q programming block instances respectively;
[0344] Step 6463: Based on the connection relationship between each programming building block of the Q programming building blocks and other building blocks in the building block information of each programming building block of the Q programming building blocks, connect the Q programming building block instances to restore the Q programming building blocks.
[0345] The process of restoring Q programming blocks includes: creating and laying out programming block instances, restoring positions, and restoring connection relationships. Specifically, by parsing the block type and block parameters in the block information, the corresponding programming block instance is generated and its corresponding attributes are set. By parsing the block position, the programming block instance is placed in the corresponding position. The connection relationship is rebuilt using the connection field and the input field, and the programming block instances are connected together according to the connection relationship to ensure the integrity and accuracy of the entire code logic.
[0346] Optionally, the computer device generates Q programming block instances and sets corresponding attribute values based on the block type and block parameters in the block information of each of the Q programming blocks; determines the locations of the Q programming block instances based on the block position in the block information of each of the Q programming blocks; and connects the Q programming block instances based on the connection relationship between each of the Q programming blocks and other blocks in the block information of each of the Q programming blocks to restore the Q programming blocks.
[0347] In this embodiment, a specific method for restoring Q programming blocks according to structured data corresponding to the Q programming blocks is provided, which can improve data processing efficiency and achieve accurate restoration of the Q programming blocks.
[0348] As an example, the steps for performing data parsing and restoration are as follows:
[0349] 1. Data reception: When other creators share by copying the building block combination file, paste the file content into the import input box and perform data decryption. When other creators share by copying the building block combination link, paste the sharing link into the import input box, automatically request the server's data acquisition interface, obtain the corresponding file content through the encryption identifier in the sharing link, and continue to perform data decryption.
[0350] 2. Data decryption: The file content is decrypted using a preset decryption algorithm, such as AES or RSA. During the decryption process, a pre-agreed key is used to ensure the security and privacy of the decryption process. After data decryption, the corresponding JSON data is obtained. The JSON data contains the block type, block attributes, block position, connection relationship and other block information of each programming block in the shared block combination.
[0351] 3. Parsing and restoration: Parse the JSON data layer by layer, and gradually restore the shared building block combination to the canvas according to the building block type, building block position and connection relationship in the building block information of the JSON data. Specifically including: (1) Building block creation and layout: parse the building block type and building block parameters of each programming building block, generate the corresponding programming building block instance, and set its initial attribute value. (2) Position restoration: According to the building block position recorded in the JSON data, accurately place the programming building block instance at the corresponding position of the canvas to maintain the original logical layout of the creator. (3) Connection relationship restoration: Use the connection (next) field and input (inputs) field in the JSON data to reconstruct the connection relationship, connect the programming building block instances according to the connection relationship, and ensure the integrity and accuracy of the corresponding code logic.
[0352] Integrity check:
[0353] In some embodiments, after restoring the Q programming blocks, the computer device may optionally perform an integrity check to ensure that each of the Q programming blocks is correctly decrypted and restored, while checking the integrity of the entire code logic. Optionally, the method further includes steps 652 and 654:
[0354] Step 652, performing integrity check on the restored Q programming blocks;
[0355] Step 654, when the result of the integrity check is failure, generate an import prompt text; wherein the import prompt text is used to prompt at least one of import failure, re-import, and check the integrity of the data source.
[0356] The integrity check includes checking the block information of each of the Q programming blocks restored, and checking the integrity and correctness of the code logic of the Q programming blocks. If Q programming blocks are missing or there are errors in the code logic, the result of the integrity check is failure.
[0357] Optionally, the computer device performs integrity check on the Q programming blocks restored; if the result of the integrity check is successful, the Q programming blocks are displayed; if the result of the integrity check is failed, an import prompt text is generated, and the import prompt text is displayed. The import prompt text is used to prompt at least one of import failure, re-import, and check the integrity of the data source.
[0358] In this embodiment, by performing integrity verification, the accuracy of the restored Q programming blocks can be improved, thereby improving the accuracy of the import operation and improving data processing efficiency.
[0359] As an example, the idea of the configuration code for performing integrity verification is as follows: Step 1, decrypt the data; Step 2, parse the JSON data; Step 3, convert the data into building blocks, including: setting parameters and attributes; processing connection relationships; using the "next" and "inputs" fields to connect the building blocks according to logical relationships; prompting "import successful" or "import failed".
[0360] As an example, refer to Fig.19 The timing diagram involves: the creator of the sharing end, the client of the application that supports visual editing, the canvas, and the server. The overall steps of the quick sharing function include:
[0361] 1. The creator on the sharing end clicks "Quick Share" and proceeds to step 2;
[0362] 2. The canvas enters read-only mode; continue with step 3;
[0363] 3. The canvas renders all programming blocks into a blurred state; for example, the blurred state includes: reducing transparency, adding a grayscale filter, adding a dotted line stroke, etc.; continue to loop and execute 4, 5, and 6 in sequence;
[0364] 4. The creators on the sharing end select the building block combinations they want to share one by one;
[0365] 5. The canvas renders the selected building block combination into a normal state; for example, the normal state includes: restoring transparency, canceling grayscale filter, canceling dotted line stroke at least one of the following;
[0366] 6. The client saves these selected building block combinations to the sharing list;
[0367] When the creator on the sharing end has finished selecting the building block combination he wants to share, proceed to step 7;
[0368] 7. The creator on the sharing end clicks "Confirm Sharing" and proceeds to step 8;
[0369] 8. The client traverses the sharing list and continues to execute 9;
[0370] 9. The client converts the building block combination into JSON data; then proceed to step 10;
[0371] 10. The client uses AES / RSA to encrypt JSON data; proceed to step 11;
[0372] 11. The client generates encrypted ciphertext;
[0373] If the creator on the sharing end chooses to share by copying the block combination file, proceed to step 12;
[0374] 12. The client copies the encrypted ciphertext to the clipboard, so that the creator on the sharing end can send it;
[0375] When the creator on the sharing end chooses to share by copying the building block combination link, continue to execute 13, 14, 15 and 16;
[0376] 13. The client uploads the encrypted ciphertext to the server;
[0377] 14. The server stores the encrypted ciphertext and generates a unique identifier;
[0378] 15. The client receives the unique sharing link (URL) returned by the server;
[0379] 16. The client copies the sharing link to the clipboard, so that the creator on the sharing end can send it.
[0380] As an example, refer to Fig. 20 The timing diagram involves: the creator at the receiving end, the client of the application that supports visual editing, the canvas, and the server. The overall steps of the quick import function include:
[0381] 1. The creator on the receiving end clicks "Quick Import";
[0382] When the creator on the receiving end imports the content by pasting the file, proceed to step 2.
[0383] 2. The creator at the receiving end pastes the encrypted ciphertext and proceeds to step 6;
[0384] When the creator on the receiving end imports the content by sharing the link, continue with steps 3, 4, and 5.
[0385] 3. The creator on the receiving end pastes the sharing link;
[0386] 4. The client requests the server to share the encrypted ciphertext in the link;
[0387] 5. The server returns the encrypted ciphertext to the client; proceed to step 6;
[0388] 6. The client decrypts the encrypted ciphertext and proceeds to step 7;
[0389] 7. The client gets the JSON data and continues to execute 8;
[0390] 8. The client parses the JSON data into a building block combination and continues to execute 9;
[0391] 9. The client displays the blocks on the canvas; continue with step 10;
[0392] 10. The client performs integrity check on the building block combination.
[0393] In summary, the embodiments of the present application reduce the reliance on template libraries and repeated operation steps through the quick sharing and quick import functions of modular building blocks, and realize quick sharing and import operations. The technical effects brought include at least the following aspects:
[0394] (1) Modular sharing of building block combinations: Creators can select specific building block combinations to share, rather than the entire canvas or trigger group. This modular sharing supports more fine-grained reuse of code logic for programming blocks, making it easier for creators to reuse the functions of specific building block combinations, thereby improving human-computer interaction efficiency and data processing efficiency.
[0395] (2) Improve sharing efficiency: Through the quick sharing function, you can instantly generate file content or sharing links for building block combinations and share them directly to user accounts without having to enter the template library to perform complex saving and searching. This is suitable for instant collaboration. In team projects or cross-team projects, it reduces the complexity and time cost of sharing operations and significantly improves sharing efficiency.
[0396] (3) Support multiple sharing methods: By copying the building block combination file, copying the building block combination link and sharing with friends, it meets the sharing needs of multiple scenarios. You can flexibly choose the appropriate sharing method and it has stronger compatibility.
[0397] (4) Controlled access: The building block combinations selected by the creator can be shared without having to be saved or published to the template library. This can prevent the building block combinations that are only used internally from being accessed and used by unauthorized creators in the community, thus ensuring the privacy and security of the data.
[0398] (5) Support offline saving: The file content generated by the selected building block combination can be saved as an offline file, which can still be stored and shared without a network, ensuring the availability of the building block combination in an offline environment.
[0399] Fig.218 is a block diagram of a device for sharing programming blocks provided by an exemplary embodiment of the present application. The device for sharing programming blocks 800 includes at least some of the following modules: a display module 820, a processing module 840, and a sharing module 860:
[0400] Display module 820, used to display N programming blocks in a first state, where N is greater than 0;
[0401] The processing module 840 is used for controlling the N programming blocks in the first state to switch to a second state in response to entering the sharing mode, wherein the display styles of the first state and the second state are different;
[0402] A processing module 840 is used for selecting M programming blocks from the N programming blocks in the second state in response to a selection operation, and controlling the M programming blocks to be restored to the first state, wherein M is greater than 0 and less than or equal to N;
[0403] The sharing module 860 is configured to share the M programming blocks in the first state in response to confirming the sharing operation.
[0404] In some embodiments, the sharing module 860 is used to:
[0405] In response to a triggering operation on a confirm sharing control, displaying at least two sharing options;
[0406] In response to a selection operation of a target sharing option among the at least two sharing options, the M programming blocks in the first state are shared based on a sharing method indicated by the target sharing option.
[0407] In some embodiments, the target sharing options include: copying a building block combination file;
[0408] The sharing module 860 is used to:
[0409] In response to the selection operation on the copy block combination file, converting the M programming blocks in the first state into file contents, and copying the file contents to a clipboard, and pasting the file contents in the clipboard into a target application;
[0410] The file content includes at least one of text, numbers, letters, symbols, and codes.
[0411] In some embodiments, the target sharing options include: copying a brick combination link;
[0412] The sharing module 860 is used to:
[0413] In response to a selection operation on the copy block combination link, generating a sharing link of the M programming blocks in the first state, and copying the sharing link to a clipboard, and sending the sharing link in the clipboard to a first account;
[0414] The first account is an account within the set access range or a friend account.
[0415] In some embodiments, the target sharing options include: sharing to a second account;
[0416] The sharing module 860 is used to:
[0417] In response to the selection operation of sharing with a second account, the file content or the sharing link corresponding to the M programming blocks in the first state is copied to a clipboard, and an account list is popped up, and the file content or the sharing link in the clipboard is sent to the second account in the account list;
[0418] The second account is an account within the set access range or a friend account.
[0419] In some embodiments, the processing module 840 is configured to:
[0420] In response to M click operations, one of the N programming blocks in the second state indicated by each click operation of the M click operations is displayed to select the M programming blocks from the N programming blocks in the second state.
[0421] In some embodiments, the processing module 840 is configured to:
[0422] In response to at least one frame selection operation, a frame selection area of each frame selection operation of the at least one frame selection operation is displayed, and programming blocks in the second state located in the frame selection area are determined as the M programming blocks selected from the N programming blocks in the second state.
[0423] In some embodiments, the processing module 840 is configured to:
[0424] A list of options showing information about a brick;
[0425] In response to a selection operation of a target option in the option list of the building block information, determining the M programming building blocks that match the target option as the M programming building blocks selected from the N programming building blocks in the second state;
[0426] The option list of the building block information includes at least one of a building block type option, a building block identification option, a building block parameter option, a building block position option, and a connection relationship option with other building blocks.
[0427] In some embodiments, the processing module 840 is configured to:
[0428] Display candidate building block combinations;
[0429] In response to a selection operation on a target building block combination in the candidate building block combination, determining the M programming building blocks in the target building block combination as the M programming building blocks selected from the N programming building blocks in the second state;
[0430] The candidate building block combination is obtained by executing a combination based on at least a part of the N programming building blocks in the second state.
[0431] In some embodiments, the processing module 840 is configured to:
[0432] In response to a triggering operation on a sharing control, entering the sharing mode;
[0433] In response to entering the sharing mode, controlling the N programming blocks in the first state to switch to a second state;
[0434] The first state is a state that allows viewing, selecting, adding, dragging, deleting, connecting and modifying the N programming blocks, and the second state is a state that allows viewing and selecting, but does not allow adding, dragging, deleting, connecting and modifying the N programming blocks.
[0435] In some embodiments, the display module 820 is further configured to:
[0436] In response to entering the sharing mode, displaying sharing prompt text and a confirmation sharing control;
[0437] The sharing prompt text is used to prompt the user to select the M programming blocks, and the confirmation sharing control is used to display the at least two sharing options after being triggered.
[0438] In some embodiments, the display module 820 is used to:
[0439] Receive the file contents or sharing links of Q shared programming blocks, where Q is greater than 0;
[0440] In response to an import operation on the file contents or the sharing links of the Q programming blocks, the Q programming blocks are displayed.
[0441] In some embodiments, the display module 820 is used to:
[0442] In response to a trigger operation on the import control, an import input box is displayed;
[0443] In response to pasting the file content or the sharing link of the Q programming blocks in the import input box, the Q programming blocks are displayed.
[0444] In some embodiments, the processing module 840 is configured to:
[0445] Using a read-only field, setting the N programming blocks in the first state to a read-only mode;
[0446] The read-only mode is used to instruct the N programming blocks in the first state to switch to the second state.
[0447] In some embodiments, the processing module 840 is configured to:
[0448] Using a zoom field to set a zoom operation of the N programming blocks in the second state;
[0449] The zoom operation is used to indicate viewing the N programming blocks in the second state by zooming;
[0450] or;
[0451] Using a movement field to set a translation operation of the N programming blocks in the second state;
[0452] The moving operation is used to indicate viewing the N programming blocks in the second state by moving.
[0453] In some embodiments, the processing module 840 is configured to:
[0454] The cascading style sheet styles of the N programming blocks are adjusted to control the N programming blocks in the first state to switch to the second state, and to control the M programming blocks to restore to the first state.
[0455] In some embodiments, the processing module 840 is configured to:
[0456] reducing the transparency of the N programming blocks in the first state to control the N programming blocks in the first state to switch to the second state; increasing the transparency of the M programming blocks selected from the N programming blocks, and reducing the transparency of the unselected programming blocks from the N programming blocks to control the M programming blocks to return to the first state;
[0457] or;
[0458] Applying a grayscale filter to the N programming blocks in the first state to control the N programming blocks in the first state to switch to the second state; canceling the grayscale filter for the M programming blocks selected from the N programming blocks, and applying the grayscale filter to the unselected programming blocks from the N programming blocks to control the M programming blocks to return to the first state;
[0459] or;
[0460] Adding dotted line strokes to the N programming blocks in the first state to control the N programming blocks in the first state to switch to the second state; canceling the dotted line strokes for the M programming blocks selected from the N programming blocks, and adding the dotted line strokes to the programming blocks not selected from the N programming blocks to control the M programming blocks to return to the first state.
[0461] In some embodiments, the processing module 840 is configured to:
[0462] After controlling the N programming blocks in the first state to switch to the second state, adding an unselected style name to each of the N programming blocks in the second state;
[0463] After selecting the M programming blocks from the N programming blocks in the second state, removing the unselected style names of the M programming blocks; and adding the M programming blocks to a sharing list of the block combination.
[0464] In some embodiments, the processing module 840 is configured to:
[0465] Extracting the building block information of each of the M programming building blocks;
[0466] Convert the building block information of each of the M programming building blocks into structured data;
[0467] Encrypting the structured data to obtain the file content corresponding to the M programming blocks;
[0468] The building block information includes at least one of a building block type, a building block identifier, a building block parameter, a building block position, and a connection relationship with other building blocks.
[0469] In some embodiments, the processing module 840 is configured to:
[0470] Integrating the building block information of each programming building block of the M programming building blocks into a structured data structure to obtain the structured data;
[0471] The structured data structure at least includes a connection field and an input field, the connection field is used to store the block identifiers of the sequentially connected programming blocks among the M programming blocks, and the input field is used to store the block identifier corresponding to the programming block containing at least one sub-programming block among the M programming blocks.
[0472] In some embodiments, the processing module 840 is configured to:
[0473] Upload the file contents corresponding to the M programming blocks to a server;
[0474] Obtain the sharing links of the M programming blocks returned by the server;
[0475] The sharing link is composed of a protocol, a domain name, a port, a sharing identifier and an encryption identifier, and the encryption identifier points to the file content in the server.
[0476] In some embodiments, the processing module 840 is configured to:
[0477] Receiving the shared file contents of the Q programming blocks;
[0478] Parsing the file contents of the Q programming blocks and restoring the Q programming blocks;
[0479] or;
[0480] Receiving the sharing links of the Q programming blocks that are shared;
[0481] Obtaining file contents corresponding to the sharing links of the Q programming blocks from the server;
[0482] Parse the file contents of the Q programming building blocks and restore the Q programming building blocks.
[0483] In some embodiments, the processing module 840 is configured to:
[0484] Decrypting the file contents of the Q programming blocks to obtain structured data;
[0485] Parsing the structured data to obtain the building block information of each of the Q programming building blocks;
[0486] The Q programming blocks are restored based on the block information of each of the Q programming blocks.
[0487] In some embodiments, the processing module 840 is configured to:
[0488] Based on the block type and block parameters in the block information of each of the Q programming blocks, generate Q programming block instances and set corresponding attribute values respectively;
[0489] Based on the block position in the block information of each of the Q programming blocks, determining the positions of the Q programming block instances respectively;
[0490] Based on the connection relationship between each programming building block of the Q programming building blocks and other building blocks in the building block information, the Q programming building blocks instances are connected to restore the Q programming building blocks.
[0491] In some embodiments, the processing module 840 is configured to:
[0492] Performing integrity check on the Q restored programming building blocks;
[0493] If the result of the integrity check is failure, generating an import prompt text;
[0494] The import prompt text is used to prompt at least one of an import failure, a re-import, and a check on the integrity of the data source.
[0495] It should be noted that the specific limitations in the embodiments of the one or more programming building blocks sharing device 800 provided in the above embodiments can refer to the specific limitations in the embodiments of the programming building blocks sharing method described above, and will not be repeated here. Each module of the above device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor of a computer device in the form of hardware, or can be stored in a memory of a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0496] An embodiment of the present application further provides a computer device, which includes: a processor and a memory, wherein a computer program is stored in the memory; and the processor is used to execute the computer program in the memory to implement the programming building block sharing method provided by the above-mentioned method embodiments.
[0497] Fig. 22 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application.
[0498] The computer device 1000 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), or an MP4 player (Moving Picture Experts Group Audio Layer IV). The computer device 1000 may also be called a user device, a portable terminal, or other names.
[0499] Typically, the computer device 1000 includes a processor 1001 and a memory 1002 .
[0500] The processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1001 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1001 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1001 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1001 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0501] The memory 1002 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 1002 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1002 is used to store at least one instruction, which is used to be executed by the processor 1001 to implement the sharing method of the programming building blocks provided in each method embodiment of the present application.
[0502] In some embodiments, the computer device 1000 may further include: a peripheral device interface 1003 and at least one peripheral device. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1004 , a touch display screen 1005 , a camera assembly 1006 , an audio circuit 1007 and a power supply 1008 .
[0503] The peripheral device interface 1003 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1001 and the memory 1002. In some embodiments, the processor 1001, the memory 1002, and the peripheral device interface 1003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1001, the memory 1002, and the peripheral device interface 1003 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0504] The radio frequency circuit 1004 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1004 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1004 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1004 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 1004 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1004 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0505] The touch display screen 1005 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. The touch display screen 1005 also has the ability to collect touch signals on the surface or above the surface of the touch display screen 1005. The touch signal may be input to the processor 1001 as a control signal for processing. The touch display screen 1005 is used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the touch display screen 1005 may be one, and the front panel of the computer device 1000 is set; in other embodiments, the touch display screen 1005 may be at least two, which are respectively set on different surfaces of the computer device 1000 or are folded; in some embodiments, the touch display screen 1005 may be a flexible display screen, which is set on a curved surface or a folded surface of the computer device 1000. Even, the touch display screen 1005 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The touch display screen 1005 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
[0506] The camera assembly 1006 is used to capture images or videos. Optionally, the camera assembly 1006 includes a front camera and a rear camera. Typically, the front camera is used to realize video calls or selfies, and the rear camera is used to realize the shooting of photos or videos. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, and a wide-angle camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, and the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting functions. In some embodiments, the camera assembly 1006 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0507] The audio circuit 1007 is used to provide an audio interface between the user and the computer device 1000. The audio circuit 1007 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1001 for processing, or input them into the radio frequency circuit 1004 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the computer device 1000. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1001 or the radio frequency circuit 1004 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as distance measurement. In some embodiments, the audio circuit 1007 may also include a headphone jack.
[0508] The power supply 1008 is used to power various components in the computer device 1000. The power supply 1008 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1008 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged through a wired line, and a wireless rechargeable battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0509] In some embodiments, the computer device 1000 further includes one or more sensors 1009 , including but not limited to: an acceleration sensor 1010 , a gyroscope sensor 1011 , a pressure sensor 1012 , an optical sensor 1013 , and a proximity sensor 1014 .
[0510] The acceleration sensor 1010 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the computer device 1000. For example, the acceleration sensor 1010 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 1001 can control the touch display screen 1005 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 1010. The acceleration sensor 1010 can also be used for collecting game or user motion data.
[0511] The gyro sensor 1011 can detect the body direction and rotation angle of the computer device 1000, and the gyro sensor 1011 can cooperate with the acceleration sensor 1010 to collect the user's 3D actions on the computer device 1000. The processor 1001 can implement the following functions based on the data collected by the gyro sensor 1011: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0512] The pressure sensor 1012 can be set on the side frame of the computer device 1000 and / or the lower layer of the touch display screen 1005. When the pressure sensor 1012 is set on the side frame of the computer device 1000, it can detect the user's grip signal of the computer device 1000, and perform left and right hand recognition or quick operation according to the grip signal. When the pressure sensor 1012 is set on the lower layer of the touch display screen 1005, it can control the operability control on the UI interface according to the user's pressure operation on the touch display screen 1005. The operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0513] The optical sensor 1013 is used to collect the ambient light intensity. In one embodiment, the processor 1001 can control the display brightness of the touch display screen 1005 according to the ambient light intensity collected by the optical sensor 1013. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 1005 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 1005 is reduced. In another embodiment, the processor 1001 can also dynamically adjust the shooting parameters of the camera assembly 1006 according to the ambient light intensity collected by the optical sensor 1013.
[0514] The proximity sensor 1014, also called a distance sensor, is usually arranged on the front of the computer device 1000. The proximity sensor 1014 is used to collect the distance between the user and the front of the computer device 1000. In one embodiment, when the proximity sensor 1014 detects that the distance between the user and the front of the computer device 1000 is gradually decreasing, the processor 1001 controls the touch display screen 1005 to switch from the screen-on state to the screen-off state; when the proximity sensor 1014 detects that the distance between the user and the front of the computer device 1000 is gradually increasing, the processor 1001 controls the touch display screen 1005 to switch from the screen-off state to the screen-on state.
[0515] Those skilled in the art will understand that Fig. 22 The structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine some components, or adopt a different component arrangement.
[0516] In an exemplary embodiment, the embodiment of the present application further provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip runs on a computer device, it is used to implement the sharing method of the programming building blocks provided by the above method embodiment.
[0517] The embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the method for sharing programming blocks provided in the above method embodiment.
[0518] The embodiment of the present application also provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the processor of the computer device loads and executes to implement the sharing method of the programming building blocks provided in the above method embodiment.
[0519] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0520] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned computer-readable storage medium may be a read-only memory, a disk or an optical disk, etc.
[0521] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0522] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for sharing programming building blocks, characterized in that: The method comprises: Displaying N programming blocks in a first state, wherein N is greater than 0; In response to entering the sharing mode, controlling the N programming blocks in the first state to switch to a second state, wherein the display styles of the first state and the second state are different; In response to a selection operation, selecting M programming blocks from the N programming blocks in the second state, and controlling the M programming blocks to return to the first state, wherein M is greater than 0 and less than or equal to N; In response to confirming the sharing operation, the M programming blocks in the first state are shared.
2. The method according to claim 1, characterized in that: In response to confirming the sharing operation, sharing the M programming blocks in the first state includes: In response to a triggering operation on a confirm sharing control, displaying at least two sharing options; In response to a selection operation of a target sharing option among the at least two sharing options, the M programming blocks in the first state are shared based on a sharing method indicated by the target sharing option.
3. The method according to claim 2, characterized in that The target sharing options include: copying the building block combination file; In response to a selection operation of a target sharing option among the at least two sharing options, sharing the M programming blocks in the first state based on a sharing method indicated by the target sharing option includes: In response to the selection operation on the copy block combination file, converting the M programming blocks in the first state into file contents, and copying the file contents to a clipboard, and pasting the file contents in the clipboard into a target application; The file content includes at least one of text, numbers, letters, symbols, and codes.
4. The method according to claim 2, characterized in that: The target sharing options include: copying the building block combination link; In response to a selection operation of a target sharing option among the at least two sharing options, sharing the M programming blocks in the first state based on a sharing method indicated by the target sharing option includes: In response to a selection operation on the copy block combination link, generating a sharing link of the M programming blocks in the first state, and copying the sharing link to a clipboard, and sending the sharing link in the clipboard to a first account; The first account is an account within the set access range or a friend account.
5. The method according to any one of claims 2 to 4, characterized in that: The target sharing options include: sharing to a second account; In response to a selection operation of a target sharing option among the at least two sharing options, sharing the M programming blocks in the first state based on a sharing method indicated by the target sharing option includes: In response to the selection operation of sharing with a second account, the file content or the sharing link corresponding to the M programming blocks in the first state is copied to a clipboard, and an account list is popped up, and the file content or the sharing link in the clipboard is sent to the second account in the account list; The second account is an account within the set access range or a friend account.
6. The method according to any one of claims 1 to 5, characterized in that: In response to the selection operation, selecting M programming blocks from the N programming blocks in the second state comprises: In response to M click operations, one of the N programming blocks in the second state indicated by each click operation of the M click operations is displayed to select the M programming blocks from the N programming blocks in the second state.
7. The method according to any one of claims 1 to 5, characterized in that: In response to the selection operation, selecting M programming blocks from the N programming blocks in the second state comprises: In response to at least one frame selection operation, a frame selection area of each frame selection operation of the at least one frame selection operation is displayed, and programming blocks in the second state located in the frame selection area are determined as the M programming blocks selected from the N programming blocks in the second state.
8. The method according to any one of claims 1 to 5, characterized in that: In response to the selection operation, selecting M programming blocks from the N programming blocks in the second state comprises: A list of options showing information about a brick; In response to a selection operation of a target option in the option list of the building block information, determining the M programming building blocks that match the target option as the M programming building blocks selected from the N programming building blocks in the second state; The option list of the building block information includes at least one of a building block type option, a building block identification option, a building block parameter option, a building block position option, and a connection relationship option with other building blocks.
9. The method according to any one of claims 1 to 5, characterized in that: In response to the selection operation, selecting M programming blocks from the N programming blocks in the second state comprises: Display candidate building block combinations; In response to a selection operation on a target building block combination in the candidate building block combination, determining the M programming building blocks in the target building block combination as the M programming building blocks selected from the N programming building blocks in the second state; The candidate building block combination is obtained by executing a combination based on at least a part of the N programming building blocks in the second state.
10. The method according to any one of claims 1 to 9, characterized in that: In response to entering the sharing mode, controlling the N programming blocks in the first state to switch to the second state includes: In response to a triggering operation on a sharing control, entering the sharing mode; In response to entering the sharing mode, controlling the N programming blocks in the first state to switch to a second state; The first state is a state that allows viewing, selecting, adding, dragging, deleting, connecting and modifying the N programming blocks, and the second state is a state that allows viewing and selecting, but does not allow adding, dragging, deleting, connecting and modifying the N programming blocks.
11. The method according to claim 10, characterized in that The method further comprises: In response to entering the sharing mode, displaying sharing prompt text and a confirmation sharing control; The sharing prompt text is used to prompt the user to select the M programming blocks, and the confirmation sharing control is used to display the at least two sharing options after being triggered.
12. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: Receive the file content or sharing link of Q shared programming blocks, where Q is greater than 0; In response to an import operation on the file contents or the sharing links of the Q programming blocks, the Q programming blocks are displayed.
13. The method according to claim 9, characterized in that In response to the import operation of the file content or the sharing link of the Q programming building blocks, displaying the Q programming building blocks includes: In response to a trigger operation on the import control, an import input box is displayed; In response to pasting the file content or the sharing link of the Q programming blocks in the import input box, the Q programming blocks are displayed.
14. The method according to any one of claims 1 to 13, characterized in that: The method further comprises: Using a read-only field, setting the N programming blocks in the first state to a read-only mode; The read-only mode is used to instruct the N programming blocks in the first state to switch to the second state.
15. The method according to any one of claims 1 to 13, characterized in that: The converting the M programming blocks in the first state into file content includes: Extracting the building block information of each of the M programming building blocks; Convert the building block information of each of the M programming building blocks into structured data; Encrypting the structured data to obtain the file content corresponding to the M programming blocks; The building block information includes at least one of a building block type, a building block identifier, a building block parameter, a building block position, and a connection relationship with other building blocks.
16. The method according to claim 15, characterized in that The generating sharing links of the M programming blocks in the first state includes: Upload the file contents corresponding to the M programming blocks to a server; Obtain the sharing links of the M programming blocks returned by the server; The sharing link is composed of a protocol, a domain name, a port, a sharing identifier and an encryption identifier, and the encryption identifier points to the file content in the server.
17. A device for sharing programming blocks, characterized in that: The device comprises: A display module, used to display N programming blocks in a first state, where N is greater than 0; a processing module, configured to control the N programming blocks in the first state to switch to a second state in response to entering a sharing mode, wherein the display styles of the first state and the second state are different; The processing module is configured to select M programming blocks from the N programming blocks in the second state in response to a selection operation, and control the M programming blocks to be restored to the first state, wherein M is greater than 0 and less than or equal to N; The sharing module is configured to share the M programming blocks in the first state in response to confirming the sharing operation.
18. A computer device, characterized in that: The computer device comprises: a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the method for sharing programming blocks as claimed in any one of claims 1 to 16.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the method for sharing programming blocks as claimed in any one of claims 1 to 16.
20. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. The processor obtains the computer instructions from the computer-readable storage medium, so that the processor loads and executes them to implement the method for sharing programming blocks as described in any one of claims 1 to 16.
Citation Information
Patent Citations
Document block sharing method, device and system and storage medium
CN116820635A
Visual programming operation method and device, equipment, medium and program product
CN118838586A
System and methods for end-users to graphically program and manage computers and devices
US20140359558A1
Code block element for integrated graphic design system
WO2023069561A1
Cited By
RoboBuilder model building method and device, terminal equipment and storage medium
CN121074337A
A RoboBuilder model building method and device, terminal equipment and storage medium
CN121074337B