Building block statistics method, device, system and medium based on graphical programming
By detecting and recording the building block types and attribute identification codes on the graphical programming interface, combined with preset statistical strategies, the problem of insufficient statistics on the use of building blocks in existing tools is solved, and an accurate analysis of programming behavior is achieved.
Patent Information
- Application Number
- CN202111444024.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2041-11-30
AI Technical Summary
Existing graphical programming tools cannot conduct objective and accurate quantitative statistics on the use of building blocks during programming, and lack analysis data support for programming behavior.
By detecting the building blocks and their types entered on the target programming interface, entering the attribute identification code of the preset database, and extracting the target identification code based on the preset statistical strategy, determining the type and number of building blocks within the statistical range, and achieving accurate statistics on the usage of building blocks.
It realizes objective and accurate statistics on the use of building blocks during graphical programming, provides a reliable data basis for analyzing user programming behaviors, and improves the objectivity and accuracy of programming behavior analysis.
Smart Images

Figure CN114416062B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a building block statistics method, device, system and medium based on graphical programming. Background Art
[0002] Currently, graphical programming cultivates users' computational thinking and logical abilities through programming game enlightenment and visual graphical programming. Most graphical programming uses building blocks encapsulated with corresponding codes to implement programming, thus meeting the needs and interests of children's programming learning.
[0003] However, existing graphical programming tools only execute and display the programming results of edited building blocks, lack statistics on the usage of building blocks during the programming process, and cannot provide objective and accurate quantitative statistical data for analyzing programming behavior, which is not conducive to objective and accurate analysis of programming behavior. Summary of the Invention
[0004] The purpose of the present invention is to provide a building block statistics method, device, system and medium based on graphical programming, aiming to achieve objective and accurate building block usage statistics and improve the objectivity of analyzing user programming behavior.
[0005] The technical solutions of the present invention are as follows:
[0006] A building block statistical method based on graphical programming, comprising:
[0007] Detecting a building block input on a target programming interface and the building block type of the building block;
[0008] Entering the attribute identification code of the building block into a preset database according to the building block type;
[0009] Extracting target identification codes from the preset database according to a preset statistical strategy, wherein the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted;
[0010] Based on the target identification code, statistical information of target building blocks of the target type within the statistical range is determined.
[0011] In one embodiment, before detecting the building block input on the target programming interface and the building block type, the method further includes:
[0012] The preset database is constructed according to a preset structure, wherein the preset structure includes a time field, a work field, a course field, and a plurality of compilation fields for mapping the building block types.
[0013] In one embodiment, the step of entering the attribute identification code of the building block into a preset database according to the building block type includes:
[0014] Confirm whether the building block type is the same as the building block type corresponding to each compilation field;
[0015] If they are the same, then enter the first identification code in the compiled field;
[0016] If they are not the same, a second identification code is entered in the compilation field to obtain the attribute identification code of the building block in each compilation field.
[0017] In one embodiment, the target identification code is extracted from the preset database according to a preset statistical strategy, wherein the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted, including:
[0018] Obtaining a preset statistical strategy, wherein the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted;
[0019] Determining the fields to be extracted in the preset database according to the statistical range, the fields to be extracted include compiled fields corresponding to the target type within the statistical range, and the statistical range includes at least one of a target time range, a target work range, or a target course range;
[0020] The attribute identification codes in the to-be-extracted fields are extracted and sequentially connected to obtain the target identification code.
[0021] In one embodiment, determining, based on the target identification code, statistical information of target building blocks of the target type within the statistical range includes:
[0022] Counting the number of first identification codes in the target identification codes, where the first identification code is used to identify the target building block of the building block type as the target type;
[0023] Counting the number of second identification codes in the target identification code, where the second identification code is used to identify other building blocks of a building block type that is not the target type;
[0024] The usage ratio of the target building blocks within the statistical range is determined according to the number of the first identification codes and the number of the second identification codes.
[0025] In one embodiment, when the first identification code is 1 and the second identification code is 0, counting the number of first identification codes in the target identification code includes:
[0026] Initialize the number of the first identification codes to 0;
[0027] Performing a cyclic iterative calculation on the target identification code according to a first preset algorithm, and updating the number of the first identification code during each cyclic iterative calculation;
[0028] The loop iterative calculation is stopped until all the target identification codes are 0, and the number of the first identification codes in the target identification code is obtained.
[0029] In one embodiment, when the first identification code is 1 and the second identification code is 0, counting the number of second identification codes in the target identification code includes:
[0030] Initialize the number of the second identification codes to 0;
[0031] Performing a cyclic iterative calculation on the target identification code according to a second preset algorithm, and updating the number of the second identification code during each cyclic iterative calculation;
[0032] The loop iterative calculation is stopped until all the target identification codes are 1, and the number of the second identification codes in the target identification code is obtained.
[0033] A building block statistical device based on graphical programming, comprising:
[0034] A detection module, configured to detect a building block input on a target programming interface and the building block type of the building block;
[0035] An input module, configured to input the attribute identification code of the building block into a preset database according to the type of the building block;
[0036] an extraction module, configured to extract target identification codes from the preset database according to a preset statistical strategy, wherein the statistical strategy is configured to control the target type and statistical range of the target building blocks to be counted;
[0037] The statistical module is configured to determine statistical information of target building blocks of the target type within the statistical range based on the target identification code.
[0038] A building block statistics system based on graphical programming, the system comprising at least one processor; and
[0039] a memory communicatively connected to the at least one processor; wherein,
[0040] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned building block statistics method based on graphical programming.
[0041] Another embodiment of the present invention further provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned building block statistics method based on graphical programming.
[0042] Beneficial effects: The present invention discloses a building block statistics method, device, system and medium based on graphical programming. Compared with the existing technology, by detecting the building blocks and building block types input in graphical programming, entering corresponding identification codes for each building block according to the building block type, and objectively and accurately performing quantitative statistics on the building blocks of the target type within the statistical range according to the corresponding statistical strategy, it realizes accurate statistics on the usage of various building blocks in the graphical programming process, and provides an objective and reliable data basis for analyzing user programming behavior. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0044] Figure 1 A flowchart of a building block statistics method based on graphical programming provided by an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of a target programming interface in the building block statistics method based on graphical programming provided by an embodiment of the present invention;
[0046] Figure 3 A schematic diagram of the functional modules of a building block statistics device based on graphical programming provided by an embodiment of the present invention;
[0047] Figure 4 A schematic diagram of the hardware structure of a building block statistics system based on graphical programming provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] To make the objectives, technical solutions, and effects of the present invention more clear and distinct, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below with reference to the accompanying drawings.
[0049] An embodiment of the present invention provides a building block statistics method based on graphical programming applied to a system consisting of a terminal device, a network and a server, wherein the network is a medium that provides a communication link between the terminal device and the server, which may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.; the operating system on the terminal device may include a handheld device operating system (iPhone operating system, iOS system), Android system or other operating systems, and the terminal device is connected to the server through the network to achieve interaction, thereby performing operations such as receiving or sending data, and specifically can be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, portable computers and desktop servers, etc.
[0050] Please refer to the following for details: Figure 1 , Figure 1 The flowchart of an embodiment of the building block statistics method based on graphical programming provided by the present invention. Figure 1 As shown, the method includes:
[0051] S101: Detecting building blocks input on a target programming interface and the types of the building blocks.
[0052] In this embodiment, the user can perform programming operations through the graphical programming software pre-installed on the PC or mobile terminal, or can also perform programming operations after jumping to a designated link through a web browser. Taking the web browser as an example, the user can perform building block programming operations after jumping into the target programming interface through the designated link. The target programming interface is provided with at least a building block editing area and a stage display area, wherein the building block editing area is used to display the editing results of the building block according to the editing operation input by the user, and the stage display area is used to display the execution results of the building block in the current building block editing area. Among them, the building block is encapsulated with code that implements the corresponding function, specifically, JavaScript code can be used, for example. JavaScript is a programming language on the web browser. When it is used as the programming language code of the building block, graphical programming can be implemented on the web browser, and the building block code block can be run directly on the web page without the user downloading the client, which is more convenient and efficient. Of course, other programming languages can also be used in other embodiments, and this embodiment does not limit this.
[0053] In specific implementation, users can directly select packaged building blocks from the preset building block library to perform programming operations in the building block editing area. By inputting building block editing operations such as dragging, splicing, and combining, flexible and diverse graphical programming is achieved. When the user performs programming operations, the input building blocks and the building block types of the building blocks are detected in real time to obtain the user's building block usage data during the graphical programming process. That is, the preset building block library classifies each building block to distinguish different functions. For example, the building block type can include parameter blocks (such as Figure 2 ), event blocks (such as start events, stop events, etc.), control blocks (such as loop control, conditional control, etc.), etc. Of course, other types of building blocks may also be included in other embodiments, and this embodiment does not limit this. By real-time detection of the building blocks and building block types input during the programming process, timely and accurate building block usage data is obtained as the basis for data processing.
[0054] In one embodiment, before detecting the building block input on the target programming interface and the building block type, the method further includes:
[0055] A preset database is constructed according to a preset structure, which includes a time field, a work field, a course field, and several compilation fields for mapping building block types.
[0056] In this embodiment, before the front end detects the building blocks and building block types input by the user, a preset database is pre-built on the back end according to a preset structure. The preset database is used to store the usage data of the building blocks corresponding to the user during the programming process, as shown in Table 1. Specifically, the preset structure includes a time field, a work field, a course field, and a compilation field. The time field is used to record the time of the programming operation, the work field is used to record the programming work to which the current programming operation belongs, the course field is used to record the course name corresponding to the programming work to which the current programming operation belongs, and the compilation field is used to map the detected building block type. The specific number of compilation fields can be determined according to the number of all building block types in the building block library (for example, the first compilation code field in Table 1 is used to map parameter blocks, the second compilation code field is used to map event blocks, and so on). The user can perform programming operations for programming assignments in a specified course at a certain time, and the corresponding usage data during the programming process is recorded in the preset database, thereby realizing the application scenario of recording classroom assignment data. The preset database with a preset structure realizes clear data storage of categories, so that accurate and efficient data calls can be made later.
[0057] Table 1
[0058] time work course First compile code Second compiled code … 1 1 10110101… 00001010… 2 2 110101… 001000… 3 3 1101… 0000… … … … …
[0059] S102: Enter the property identification code of the building block into a preset database according to the building block type.
[0060] During the user's graphical programming process, based on the building blocks and building block types detected in real time, the attribute identification code of the currently input building block is entered into the preset database constructed in advance on the back end. That is, by entering the attribute identification code into the preset database to distinguish and record the building block types input on the target programming interface, accurate classification and recording of the building block types input by the user during the programming process is achieved, thereby knowing the usage of building blocks of different building block types in each programming work, and providing a reliable data basis for the classification statistics of building blocks.
[0061] In one embodiment, the attribute identification code of the building block is entered into a preset database according to the building block type, including:
[0062] Confirm whether the building block type is the same as the building block type corresponding to each compilation field;
[0063] If they are the same, enter the first identification code in the compilation field;
[0064] If they are not the same, the second identification code is entered in the compilation field to obtain the attribute identification code of the building block in each compilation field.
[0065] In this embodiment, when the identification code of the building block is entered specifically according to the building block type, the building block type of the currently input building block is compared and judged based on the building block type mapped by each compiled field in the preset database, and it is confirmed in turn whether the building block type of the currently input building block is the same as the building block type corresponding to each compiled field. According to the confirmation result, the first identification code or the second identification code is entered in the corresponding compiled field, so that after the user enters the building block, the identification code of the input building block in each compiled field can be accurately recorded. Specifically, the first identification code is 1 and the second identification code is 0, so that the identification code obtained in each compiled field is a string of binary codes. The binary code method is more convenient for subsequent statistical calculations to improve statistical efficiency. Of course, in other embodiments, the first identification code can also be 0 and the second identification code can be 1. This is not limited to this embodiment.
[0066] For example, if the building block currently input by the user is a parameter building block, when entering the identification code of the building block, it is compared with the building block type mapped by each compilation field in turn. Taking the first compilation code field mapping the parameter building block and the second compilation code field mapping the event building block in Table 1 as an example, at this time, the first identification code 1 is entered in the first compilation code field, and the second identification code 0 is entered in the second compilation code field. Similarly, when the user enters other building blocks, the building block types are compared in turn and an identification code of 1 or 0 is entered in the corresponding compilation field, thereby forming a string of binary codes recorded by building block type for the building blocks used by the user at different times, in different courses, and in different works as shown in Table 1, thereby achieving objective and accurate recording of the building block types of the building blocks involved in the programming process.
[0067] S103 , extracting target identification codes from a preset database according to a preset statistical strategy, where the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted.
[0068] After detecting the user's programming behavior and recording the building block types used in the user's programming process through identification codes in a preset database, in order to improve the analyzability of the data, data is extracted from the preset database according to a preset statistical strategy to obtain the corresponding target identification code. Specifically, the target type and statistical range of the target building blocks to be counted can be controlled through the statistical strategy. In other words, according to the needs of statistical analysis, the corresponding statistical strategy can be flexibly set to adjust the extraction range of the identification code to obtain the corresponding target identification code, thereby realizing targeted identification code extraction to adapt to different data extraction needs and improving the flexibility of building block statistics.
[0069] In one embodiment, the target identification code is extracted from a preset database according to a preset statistical strategy. The statistical strategy is used to control the target type and statistical range of the target building blocks to be counted, including:
[0070] Get the preset statistical strategy, which is used to control the target type and statistical range of the target building blocks to be counted;
[0071] Determine, based on the statistical range, fields to be extracted from a preset database, wherein the fields to be extracted include compiled fields corresponding to the target type within the statistical range, and the statistical range includes at least one of a target time range, a target work range, or a target course range;
[0072] The attribute identification codes in the fields to be extracted are extracted and sequentially connected to obtain a target identification code.
[0073] In this embodiment, when extracting the attribute identification code stored in the preset database, the preset statistical strategy is first obtained. The statistical strategy can be a preset default statistical strategy. Of course, the default statistical strategy can also be modified according to actual needs during the programming process or the statistical process to adapt to the statistical needs of different programming behavior analysis situations. The target type and statistical range of the target building block to be counted are controlled by the corresponding statistical strategy, where the target type refers to the building block type that needs to be counted, and the statistical range includes one or more of the target time range, target work range and target course range. That is, when extracting data, you can first confirm the target time range, and / or target work range, and / or target course range that need to be counted according to the statistical range in the statistical strategy, and then determine the corresponding statistical range in the confirmed statistical range. The fields to be extracted include all compiled fields corresponding to the target type in the statistical scope, and then the attribute identification codes stored in the fields to be extracted are extracted. Since the statistical scope can be used to perform statistics on multiple time periods, multiple works, multiple courses, and multiple building block types, the attribute identification codes extracted from the fields to be extracted in the statistical scope may be multiple separated binary codes. Therefore, the target identification codes corresponding to this statistics can be obtained by connecting the extracted identification codes in sequence. For example, the attribute identification codes extracted according to the statistical scope and target type are 100011 and 01100 respectively, which are 10001101100 after being connected in sequence. The target identification codes are extracted through flexible and controllable statistical strategies, thereby providing more flexible and targeted statistical data for building block statistics based on graphical programming.
[0074] S104: Determine statistical information of target building blocks whose building block type is the target type within the statistical range based on the target identification code.
[0075] After the target identification code is extracted from the preset database according to the statistical strategy, statistical information of the target building blocks of the target type within the statistical range is determined based on the target identification code, that is, the target identification code obtained by statistics is further statistically calculated to obtain statistical information of the target building blocks of the target type within the statistical range. Specifically, the statistical information may include the number, proportion, frequency, etc. of the building blocks. This embodiment is not limited to this. The target identification code obtained by extraction can be further statistically calculated efficiently and accurately to obtain more intuitive statistical analysis data, so as to achieve objective and accurate quantitative statistics on the usage of various building blocks by users in the graphical programming process. Since the usage of different types of building blocks can represent the complexity, logical rigor, etc. of the programming works to a certain extent, the statistical information obtained through objective quantitative statistics provides a reliable data basis for further analysis of user programming behavior, which is conducive to improving the accuracy of user programming behavior analysis.
[0076] In one embodiment, based on the target identification code, determining statistical information of target building blocks of a target type within a statistical range includes:
[0077] Counting the number of first identification codes in the target identification codes, where the first identification code is used to identify a target building block of a target type;
[0078] Counting the number of second identification codes in the target identification code, where the second identification code is used to identify other building blocks that are not of the target type;
[0079] The usage ratio of the target building blocks within the statistical range is determined according to the number of the first identification codes and the number of the second identification codes.
[0080] In this embodiment, since the first identification code or the second identification code is entered by comparing the building block type with the building block type mapped to each compiled field when entering the attribute identification code, after the target identification code in the field to be extracted within the statistical range is extracted, the target identification code will include the first identification code and the second identification code, wherein the first identification code is used to identify that the building block type is the target type, and the second identification code is used to identify that the building block type is not the target type. When calculating the statistical information, the number of the first identification code in the target identification code and the number of the second identification code in the target identification code are calculated respectively, so as to obtain the target belonging to the target type within the statistical range. The number of building blocks, and the number of other building blocks that do not belong to the target type within the statistical range, are then further calculated based on the number of first identification codes and the number of second identification codes. Specifically, the ratio of the target building blocks within the statistical range to all building blocks within the statistical range can be calculated, or the ratio of the target building blocks within the statistical range to other building blocks within the statistical range can be calculated. In addition, the frequency of use of the target building blocks can be calculated based on the calculated number of first identification codes and the duration corresponding to the statistical range, thereby obtaining objective and accurate statistical information for subsequent analysis of the user's programming behavior, thereby improving the data richness and objectivity of the user programming behavior analysis.
[0081] In one embodiment, when the first identification code is 1 and the second identification code is 0, counting the number of the first identification code in the target identification code includes:
[0082] Initialize the number of first identification codes to 0;
[0083] Performing a cyclic iterative calculation on the target identification code according to a first preset algorithm, and updating the number of the first identification code during each cyclic iterative calculation;
[0084] The loop iterative calculation is stopped until all the target identification codes are 0, and the number of the first identification codes in the target identification code is obtained.
[0085] In this embodiment, the calculation method of the number of first identification codes is explained with the first identification code being 1 and the second identification code being 0. During the calculation, the number of first identification codes is first initialized to 0, and then the target identification code is iteratively calculated using a first preset algorithm. The number of first identification codes is updated in each iterative calculation until all target identification codes are 0, at which time the iterative calculation is stopped. The latest number of first identification codes obtained at this time is the number of all first identification codes contained in the target identification code. By performing iterative calculation on the target identification code, the number of first identification codes contained therein is efficiently counted, thereby achieving accurate and fast counting of the number of building blocks.
[0086] In specific implementation, the first preset algorithm can adopt the following two methods. The first method is a minus-one algorithm. Specifically, when the loop iteration starts, the original target identification code n is first subtracted by 1 to obtain n-1, and n-1 is ANDed with the original n to obtain the updated target identification code, that is, n=n&(n-1). Each time the AND operation is performed, the number of first identification codes is increased by 1 until the target identification code n is equal to 0, then the calculation is stopped. At this time, the final number of first identification codes is obtained, that is, the process of cyclically performing the target identification code n minus 1 and the original digit AND operation, and the number of times the target identification code is finally iterated to 0 is the first identification code. The number of; the second is a bitwise right shift algorithm, specifically, at the beginning of the loop iteration, the original target identification code n is ANDed with 1, if the last bit of the operation result is 1, the number of the first identification code is increased by 1, otherwise the number of the first identification code remains unchanged, then the original target identification code n is right-shifted by one bit, and the high bit is filled with 0 to obtain the updated target identification code, the above process is repeated until the target identification code n is equal to 0, then the calculation is stopped, at this time the final number of the first identification code is obtained, that is, each data bit in the target identification code is judged bit by bit whether it is 1 and recorded as the number of 1, thereby obtaining the accurate number of the first identification code. Of course, in other embodiments, other methods that can effectively calculate the number of 1s in the binary code can also be used, and this embodiment does not limit this. It can be understood that in other embodiments, if the first identification code is 0 and the second identification code is 1, the target identification code can be first inverted and then the number of the first identification code can be obtained according to the above calculation method, which will not be elaborated here.
[0087] In one embodiment, when the first identification code is 1 and the second identification code is 0, counting the number of the second identification code in the target identification code includes:
[0088] Initialize the number of second identification codes to 0;
[0089] Performing a cyclic iterative calculation on the target identification code according to a second preset algorithm, and updating the number of second identification codes during each cyclic iterative calculation;
[0090] The loop iterative calculation is stopped until all the target identification codes are 1, and the number of second identification codes in the target identification code is obtained.
[0091] In this embodiment, the calculation method of the number of second identification codes is explained with the first identification code being 1 and the second identification code being 0. During the calculation, the number of second identification codes is first initialized to 0, and then the target identification code is iteratively calculated using the second preset algorithm. The number of second identification codes is updated in each iteration until the values of the target identification codes are all 1, at which time the iterative calculation is stopped. The number of the latest second identification codes obtained at this time is the number of all second identification codes contained in the target identification code. By performing iterative calculations on the target identification code, the number of second identification codes contained therein is efficiently counted, thereby achieving accurate and rapid counting of the number of building blocks. Of course, in other embodiments, the target identification code can also be inverted first, and then the target identification code after the inversion operation is calculated according to the calculation process of the number of first identification codes described above, and the number of second identification codes can also be obtained. This embodiment does not limit this.
[0092] In specific implementation, the second preset algorithm can adopt the following two methods. The second method is an addition algorithm. Specifically, when the loop iteration starts, the original target identification code n is first increased by 1 to obtain n+1, and n+1 is ORed with the original n to obtain the updated target identification code, that is, n=n│(n+1). Each time the OR operation is performed, the number of second identification codes is increased by 1 until the target identification code n is equal to 1, then the calculation is stopped. At this time, the final number of second identification codes is obtained, that is, the process of increasing the target identification code n by 1 and then performing the OR operation with the original digit is cyclically performed. The number of times the target identification code is finally iterated to 1 is the second identification code. The number of; the second is a bitwise right shift algorithm, specifically, at the beginning of the loop iteration, the original target identification code n is ANDed with 1, if the last bit of the operation result is 0, the number of the second identification code is increased by 1, otherwise the number of the second identification code remains unchanged, then the original target identification code n is right-shifted by one bit, the high bit is padded with 1 to obtain the updated target identification code, the above process is repeated until the target identification code n is equal to 1, then the calculation is stopped, at this time the final number of the second identification code is obtained, that is, each data bit in the target identification code is judged bit by bit whether it is 0 and recorded as the number of 0, thereby obtaining the accurate number of the second identification code. Of course, in other embodiments, other methods that can effectively calculate the number of 0s in the binary code can also be used, and this embodiment does not limit this. It can be understood that in other embodiments, if the first identification code is 0 and the second identification code is 1, the target identification code can be first inverted and then the number of the second identification code can be obtained according to the above calculation method, which will not be elaborated here.
[0093] It can be seen from the above method embodiments that the building block statistics method based on graphical programming provided by the present invention detects the building blocks and building block types input in graphical programming, enters corresponding identification codes for each building block according to the building block type, and can objectively and accurately quantify the target building blocks of the target type within the statistical range according to the corresponding statistical strategy, thereby realizing accurate statistics on the usage of various building blocks in the graphical programming process, and providing an objective and reliable data basis for analyzing user programming behavior.
[0094] It should be noted that there is not necessarily a certain order between the above steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above steps may have different execution orders, that is, they may be executed in parallel, or may be executed interchangeably, etc.
[0095] Another embodiment of the present invention provides a building block statistics device based on graphical programming, such as Figure 3 As shown, the apparatus 300 includes:
[0096] A detection module 301 is used to detect a building block input on a target programming interface and the building block type of the building block;
[0097] An input module 302 is used to input the attribute identification code of the building block into a preset database according to the building block type;
[0098] An extraction module 303 is used to estimate a preset statistical strategy to extract target identification codes from a preset database, where the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted;
[0099] The statistics module 304 is configured to determine statistical information of target building blocks of a target type within a statistical range based on the target identification code.
[0100] The detection module 301, the entry module 302, the extraction module 303 and the statistical module 304 are connected in sequence. The module referred to in the present invention refers to a series of computer program instruction segments that can complete specific functions. It is more suitable for describing the execution process of building block statistics based on graphical programming than a program. For the specific implementation of each module, please refer to the corresponding method embodiment above, which will not be repeated here.
[0101] In one embodiment, the apparatus further comprises:
[0102] The construction module is used to build a preset database according to the preset structure. The preset structure includes a time field, a work field, a course field, and several compilation fields for mapping building block types.
[0103] In one embodiment, the entry module 302 includes:
[0104] A confirmation unit, used to confirm whether the building block type is the same as the building block type corresponding to each compilation field;
[0105] The entry unit is configured to enter the first identification code in the compilation field if the two blocks are identical, and to enter the second identification code in the compilation field if the two blocks are different, so as to obtain the identification code of the building block in each compilation field.
[0106] In one embodiment, the extraction module 303 includes:
[0107] An acquisition unit, used for acquiring a preset statistical strategy, wherein the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted;
[0108] an extraction unit, configured to determine, based on a statistical range, fields to be extracted in a preset database, the fields to be extracted comprising compiled fields corresponding to the target type within the statistical range, the statistical range comprising at least one of a target time range, a target work range, or a target course range;
[0109] The connection unit is used to extract the attribute identification codes in the fields to be extracted and connect them in sequence to obtain the target identification code.
[0110] In one embodiment, the statistics module 304 includes:
[0111] a first counting unit, configured to count the number of first identification codes in the target identification codes, wherein the first identification code is used to identify a target building block of a target type;
[0112] a second counting unit, configured to count the number of second identification codes in the target identification code, wherein the second identification code is used to identify other building blocks of a type other than the target type;
[0113] The third statistical unit is configured to determine a usage ratio of the target building blocks within a statistical range according to the number of the first identification codes and the number of the second identification codes.
[0114] In one embodiment, the first statistical unit includes:
[0115] A first initialization unit, configured to initialize the number of first identification codes to 0;
[0116] a first loop iteration unit, configured to perform loop iterative calculation on the target identification code according to a first preset algorithm, and update the number of first identification codes during each loop iterative calculation;
[0117] The first output unit is used to stop the loop iterative calculation when all the target identification codes are 0, and obtain the number of first identification codes in the target identification code.
[0118] In one embodiment, the second statistical unit includes:
[0119] A second initialization unit, configured to initialize the number of second identification codes to 0;
[0120] a second loop iteration unit, configured to perform loop iterative calculation on the target identification code according to a second preset algorithm, and update the number of second identification codes during each loop iterative calculation;
[0121] The second output unit is used to stop the loop iterative calculation when all the target identification codes are 1, and obtain the number of second identification codes in the target identification code.
[0122] Another embodiment of the present invention provides a building block statistics system based on graphical programming, such as Figure 4 As shown, the system 400 includes:
[0123] One or more processors 401 and memory 402, Figure 4 In the description, a processor 401 is used as an example. The processor 401 and the memory 402 may be connected via a bus or other means. Figure 4 The bus connection is taken as an example.
[0124] Processor 401 is used to complete various control logics of system 400. It can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. In addition, processor 401 can also be any traditional processor, microprocessor or state machine. Processor 401 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.
[0125] Memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions corresponding to the graphical programming-based building block statistics method in the embodiments of the present invention. Processor 401 executes the non-volatile software programs, instructions, and modules stored in memory 402 to execute various functional applications and data processing of system 400, thereby implementing the graphical programming-based building block statistics method in the above-mentioned method embodiments.
[0126] Memory 402 may include a program storage area and a data storage area. The program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of system 400, etc. In addition, memory 402 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some embodiments, memory 402 may optionally include memory remotely located relative to processor 401, and such remote memory may be connected to system 400 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0127] One or more units are stored in the memory 402, and when executed by one or more processors 401, execute the building block statistical method based on graphical programming in any of the above method embodiments, for example, execute the above described Figure 1 Steps S101 to S104 of the method.
[0128] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which are executed by one or more processors, for example, to execute the above-described Figure 1 Steps S101 to S104 of the method.
[0129] As examples, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.
[0130] In summary, the present invention discloses a building block statistics method, device, system and medium based on graphical programming. The method detects the building blocks input on the target programming interface and the building block type of the building block; enters the property identification code of the building block in a preset database according to the building block type; extracts the target identification code from the preset database according to a preset statistical strategy, and the statistical strategy is used to control the target type and statistical range of the target building block to be counted; based on the target identification code, determines the statistical information of the target building block whose building block type is the target type within the statistical range. By detecting the building blocks and the building block type input in the graphical programming, and entering the corresponding identification code for each building block according to the building block type, the target building block belonging to the target type within the statistical range can be objectively and accurately quantitatively counted according to the corresponding statistical strategy, thereby achieving accurate statistics on the usage of various building blocks in the graphical programming process, and providing an objective and reliable data basis for analyzing user programming behavior.
[0131] Of course, those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware (such as a processor, controller, etc.) through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes in the above-described method embodiments. The storage medium can be a memory, a magnetic disk, a floppy disk, a flash memory, an optical storage device, etc.
[0132] It should be understood that the application of the present invention is not limited to the above examples. For those skilled in the art, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A building block statistical method based on graphical programming, characterized in that: include: Detecting a building block input on a target programming interface and the building block type of the building block; Entering the attribute identification code of the building block into a preset database according to the building block type; Extracting target identification codes from the preset database according to a preset statistical strategy, wherein the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted; Determining statistical information of target building blocks of the target type within the statistical range based on the target identification code; Before detecting the building blocks input on the target programming interface and the building block types of the building blocks, the method further includes: Constructing the preset database according to a preset structure, wherein the preset structure includes a time field, a work field, a course field, and a plurality of compilation fields for mapping the building block types; The target identification code is extracted from the preset database according to a preset statistical strategy, and the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted, including: Obtaining a preset statistical strategy, wherein the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted; Determining the fields to be extracted in the preset database according to the statistical range, the fields to be extracted include compiled fields corresponding to the target type within the statistical range, and the statistical range includes at least one of a target time range, a target work range, or a target course range; The attribute identification codes in the to-be-extracted fields are extracted and sequentially connected to obtain the target identification code.
2. The building block statistical method based on graphical programming according to claim 1, characterized in that: The step of entering the attribute identification code of the building block into a preset database according to the building block type includes: Confirm whether the building block type is the same as the building block type corresponding to each compilation field; If they are the same, then enter the first identification code in the compiled field; If they are not the same, a second identification code is entered in the compilation field to obtain the attribute identification code of the building block in each compilation field.
3. The building block statistical method based on graphical programming according to claim 1, characterized in that: The determining, based on the target identification code, statistical information of the target building blocks of the target type within the statistical range includes: Counting the number of first identification codes in the target identification codes, where the first identification code is used to identify the target building block of the building block type as the target type; Counting the number of second identification codes in the target identification code, where the second identification code is used to identify other building blocks of a building block type that is not the target type; The usage ratio of the target building blocks within the statistical range is determined according to the number of the first identification codes and the number of the second identification codes.
4. The building block statistical method based on graphical programming according to claim 3, characterized in that: When the first identification code is 1 and the second identification code is 0, counting the number of first identification codes in the target identification codes includes: Initialize the number of the first identification codes to 0; Performing a cyclic iterative calculation on the target identification code according to a first preset algorithm, and updating the number of the first identification code during each cyclic iterative calculation; The loop iterative calculation is stopped until all the target identification codes are 0, and the number of the first identification codes in the target identification code is obtained.
5. The building block statistics method based on graphical programming according to claim 4, characterized in that: When the first identification code is 1 and the second identification code is 0, counting the number of second identification codes in the target identification code includes: Initialize the number of the second identification codes to 0; Performing a cyclic iterative calculation on the target identification code according to a second preset algorithm, and updating the number of the second identification code during each cyclic iterative calculation; The loop iterative calculation is stopped until all the target identification codes are 1, and the number of the second identification codes in the target identification code is obtained.
6. A building block statistics device based on graphical programming, characterized in that: The device comprises: A detection module, configured to detect a building block input on a target programming interface and the building block type of the building block; An input module, configured to input the attribute identification code of the building block into a preset database according to the type of the building block; an extraction module, configured to extract a target identification code from the preset database according to a preset statistical strategy, wherein the statistical strategy is configured to control a statistical range of the building blocks and a target type of the target building blocks; A statistics module, configured to determine statistical information of target building blocks of the target type within the statistical range based on the target identification code; Before detecting the building blocks input on the target programming interface and the building block types of the building blocks, the method further includes: Constructing the preset database according to a preset structure, wherein the preset structure includes a time field, a work field, a course field, and a plurality of compilation fields for mapping the building block types; The target identification code is extracted from the preset database according to a preset statistical strategy, and the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted, including: Obtaining a preset statistical strategy, wherein the statistical strategy is used to control the target type and statistical range of the target building blocks to be counted; Determining the fields to be extracted in the preset database according to the statistical range, the fields to be extracted include compiled fields corresponding to the target type within the statistical range, and the statistical range includes at least one of a target time range, a target work range, or a target course range; The attribute identification codes in the to-be-extracted fields are extracted and sequentially connected to obtain the target identification code.
7. A building block statistics system based on graphical programming, characterized in that: The system includes at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the building block statistics method based on graphical programming according to any one of claims 1 to 5.
8. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the building block statistics method based on graphical programming according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and apparatus for performing visual programming
CN109992263A
Building block adjusting method in graphical programming tool and related device
CN113031939A