















技术领域technical field
本发明涉及一种批量配置寄存器的方法、装置及计算机可读存储介质。The present invention relates to a method, a device and a computer-readable storage medium for configuring registers in batches.
背景技术Background technique
当前市场上的批量快速配置寄存器地址和点变量名的方法及装置软件,绝大多数没有批量修改功能,部分软件提供了导入导出功能,借助外部Excel进行批量修改,个别软件提供了界面入口,但操作比较繁杂。Most of the methods and device software for batch quick configuration of register addresses and variable names on the market currently do not have batch modification functions. Some software provides import and export functions, and external Excel is used for batch modification. The operation is more complicated.
例如,中国专利申请号为CN201910447596.2的文献,公开了一种配置寄存器的装置、方法及系统,但其也并未公开如何能够对寄存器地址或寄存器变量名进行批量的快速配置的方法。For example, the Chinese patent application number CN201910447596.2 discloses a device, method and system for configuring registers, but it also does not disclose how to quickly configure register addresses or register variable names in batches.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明的主要目的在于提供一种批量配置寄存器的方法、装置及计算机可读存储介质,以能使用户在寄存器的表格式配置界面批量快速的配置寄存器信息。In view of this, the main purpose of the present invention is to provide a method, device and computer-readable storage medium for batch configuration of registers, so as to enable users to quickly configure register information in batches in a tabular configuration interface of registers.
本发明提供的批量配置寄存器的方法,应用于寄存器的表格式配置界面,包括:The method for batch configuration registers provided by the present invention is applied to the tabular configuration interface of registers, including:
A、获取用户在表格式配置界面的一单元格中编辑的表示寄存器地址的第一数字或包含第一数字的寄存器变量名,及与该第一数字相邻的字符串;A. Obtain the first digit representing the register address or the register variable name containing the first digit edited by the user in a cell of the tabular configuration interface, and a character string adjacent to the first digit;
B、在所述字符串中:B. In the string:
判断具有用于标识递加或递减方式步进的第一子字符串时,据此确定出步进方式;When it is judged that there is a first substring for identifying the increment or decrement mode stepping, the stepping mode is determined accordingly;
判断具有与第一子字符串相邻的第二数字时,将第二数字确定为步进值;When judging that there is a second number adjacent to the first substring, the second number is determined as the step value;
判断具有用于标识表格修改范围的第二子字符串,且具有与第二子字符串相邻的第三数字时,将第三数字确定为所述字符串所指示的表格修改范围值;When it is judged that there is a second substring for identifying the table modification range, and there is a third number adjacent to the second substring, the third number is determined as the table modification range value indicated by the string;
C、对所述第三数字对应的表格范围内的各个单元格,以所述第一数字为起始,以所述第二数字为步进值,按确定出的递加或递减的步进方式依次对各个单元格中的寄存器地址的值或寄存器变量名中对应第一数字位置的数字格式的字符串的值进行配置。C. For each cell in the table range corresponding to the third number, start with the first number, take the second number as the step value, and follow the determined increment or decrement step. The method sequentially configures the value of the register address in each cell or the value of the string in the digital format corresponding to the first number position in the register variable name.
由上,本发明在涉及寄存器地址及变量名的表格式配置界面,提供通过输入字符串,即操作符的方式,实现快速批量修改、输入,极大提高工程人员的工作效率。From the above, the present invention provides fast batch modification and input by inputting character strings, ie operators, in a tabular configuration interface involving register addresses and variable names, which greatly improves the work efficiency of engineers.
可选的,所述第一数字及与其相邻的字符串采用第一数字、第一子字符串、第二数字、第二子字符串、第三数字的顺序构成。Optionally, the first number and its adjacent character string are formed in the order of the first number, the first substring, the second number, the second substring, and the third number.
由上,可根据需要将字符串设置为上述顺序。From the above, the strings can be set to the above order as needed.
可选的,步骤B还包括:判断未具有相邻所述第一子字符串的第二数字时,步骤C所述步进值设置为1。Optionally, step B further includes: when it is determined that there is no second number adjacent to the first substring, the step value in step C is set to 1.
由上,通过默认该步进值方式,使得对于这种步进值时,用户输入更便捷。From the above, by defaulting the step value method, the user input is more convenient for this step value.
可选的,所述配置为配置寄存器变量名,所述单元格为对应寄存器变量名项的单元格,Optionally, the configuration is to configure a register variable name, and the cell is a cell corresponding to a register variable name item,
步骤A还包括:所述单元格中编辑的寄存器变量名中还具有成对配合出现的符号,相邻的所述第一数字和字符串位于该对符号内;Step A also includes: the register variable name edited in the cell also has symbols that appear in pairs, and the adjacent first numbers and character strings are located in the pair of symbols;
步骤C所述配置时还包括:删除所述成对配合出现的符号。The configuration in step C further includes: deleting the paired symbols.
由上,可以更好的区分寄存器变量名中要修改的第一数字。From the above, the first number to be modified in the register variable name can be better distinguished.
可选的,所述单元格中编辑的寄存器变量名中具有多对所述成对配合出现的符号,多组相同或不同的所述第一数字和字符串对应的位于多对所述符号内;Optionally, the name of the register variable edited in the cell has multiple pairs of symbols that appear in pairs, and multiple sets of the same or different first numbers and strings corresponding to the symbols are located in multiple pairs of the symbols. ;
步骤B为对每组字符串的判断;Step B is to judge each group of strings;
步骤B和步骤C之间还包括:以各组的字符串中的各第三数字的相乘结果作为总的表格修改范围值;Between step B and step C, also include: using the multiplication result of each third number in the character string of each group as the total table modification range value;
步骤C所述配置时还包括:以各组构成嵌套循环的计算方式针对各组依次执行步骤C,对所述总的表格的修改范围内的各个单元格中的寄存器变量名中对应各组第一数字位置的数字格式的子字符串的值进行配置。The configuration in step C also includes: performing step C in turn for each group in a calculation method in which each group forms a nested loop, and corresponding to each group in the register variable name in each cell in the modification range of the general table. Configure the value of the substring in the numeric format of the first digit position.
由上,针对寄存器变量名,当该寄存器变量名在其多个位置都具有数字时,本发明还可对变量名中的这多个位置的数字进行批量配置。From the above, for the register variable name, when the register variable name has numbers in multiple positions, the present invention can also perform batch configuration of the numbers in the multiple positions in the variable name.
可选的,步骤A所述各组的字符串中还包括表示优先级的第三子字符串;步骤C所述配置时,还以所述第三子字符串对应的优先级作为嵌套循环中的循环的优先级。Optionally, the strings in each group described in step A further include a third substring representing a priority; when configuring in step C, the priority corresponding to the third substring is also used as a nested loop. The priority of the loop in .
由上,针对寄存器变量名中多个位置的数字进行批量配置时,通过表示优先级的第三字符串,可以灵活的配置这多个位置的数字被批量修改的顺序。From the above, when the numbers in multiple positions in the register variable name are configured in batches, the order in which the numbers in the multiple positions are modified in batches can be flexibly configured through the third string representing the priority.
本发明还相应提供了一种用于批量配置寄存器的装置,包括:The present invention also provides a device for configuring registers in batches, comprising:
单元格内容获取模块,用于获取用户在表格式配置界面的一单元格中编辑的表示寄存器地址的第一数字或包含第一数字的寄存器变量名,及与该第一数字相邻的字符串;The cell content acquisition module is used to acquire the first number representing the register address or the register variable name containing the first number edited by the user in a cell of the tabular configuration interface, and the string adjacent to the first number ;
步进方式确定模块,用于在所述字符串中判断具有用于标识递加或递减方式步进的第一子字符串时,据此确定出步进方式;a step-by-step mode determination module, configured to determine the step-by-step mode according to the first sub-string for identifying the step-by-step or step-by-step mode in the character string;
步进值确定模块,用于在所述字符串中,判断具有与第一子字符串相邻的第二数字时,将第二数字确定为步进值;a step value determination module, configured to determine the second number as a step value when judging that there is a second number adjacent to the first substring in the character string;
表格修改范围确定模块,用于判断具有用于标识表格修改范围的第二子字符串,且具有与第二子字符串相邻的第三数字时,将第三数字确定为所述字符串所指示的表格修改范围值;The table modification range determination module is used to determine that when there is a second substring for identifying the table modification range and a third number adjacent to the second substring, the third number is determined as the character string. Indicated table modification range value;
批量配置模块,用于对所述第三数字对应的表格范围内的各个单元格,以所述第一数字为起始,以所述第二数字为步进值,按确定出的递加或递减的步进方式依次对各个单元格中的寄存器地址的值或寄存器变量名中对应第一数字位置的数字格式的字符串的值进行配置。The batch configuration module is used for each cell in the table range corresponding to the third number, starting with the first number, and using the second number as the step value, according to the determined increment or The decrementing step mode sequentially configures the value of the register address in each cell or the value of the character string in the digital format corresponding to the first number position in the register variable name.
可选的,当所述配置为配置寄存器变量名,所述单元格为对应寄存器变量名项的单元格时,单元格内容获取模块获取的单元格中编辑的寄存器变量名中还具有成对配合出现的符号,相邻的所述第一数字和字符串位于该对符号内时,Optionally, when the configuration is to configure a register variable name, and the cell is a cell corresponding to a register variable name item, the edited register variable name in the cell obtained by the cell content acquisition module also has paired matching. A symbol that appears adjacent to the first digit and character string is located within the pair of symbols,
批量配置模块还用于在配置时删除所述成对配合出现的符号。The batch configuration module is also used for deleting the paired symbols during configuration.
可选的,当单元格内容获取模块获取的所述单元格中编辑的寄存器变量名中具有多对所述成对配合出现的符号,多组相同或不同的所述第一数字和字符串对应的位于多对所述符号内时,Optionally, when the name of the register variable edited in the cell obtained by the cell content obtaining module has multiple pairs of the symbols that appear in pairs, the multiple sets of the same or different first numbers correspond to the character strings. is located within more than one pair of said symbols,
步进方式确定模块还用于对每组字符串对应的步进方式进行确定;The step mode determination module is also used to determine the step mode corresponding to each group of character strings;
步进值确定模块还用于以各组的字符串中的各第三数字的相乘结果作为总的表格修改范围值;The step value determination module is also used for modifying the range value by using the multiplication result of each third number in the character string of each group as the total table;
批量配置模块进行批量配置时还用于以各组构成嵌套循环的计算方式针对各组依次执行批量配置,且,对总的表格的修改范围内的各个单元格中的寄存器变量名中对应各组第一数字位置的数字格式的子字符串的值进行配置。When the batch configuration module performs batch configuration, it is also used to perform batch configuration for each group in turn in the calculation method that each group forms a nested loop, and the register variable name in each cell in the modification range of the total table corresponds to each group. Sets the value of the substring in the numeric format of the first digit position to configure.
本发明还相应提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述各技术方案中所述批量配置寄存器的方法的步骤。The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the method for configuring registers in batches in the above technical solutions.
附图说明Description of drawings
图1为批量配置寄存器的流程图;Fig. 1 is the flow chart of batch configuration register;
图2为表格式配置界面第一操作的示意图;图2-A为选中寄存器地址项一单元格示意图;图2-B是对该单元格编辑的示意图;图2-C是执行配置后的示意图;Fig. 2 is the schematic diagram of the first operation of the tabular configuration interface; Fig. 2-A is the schematic diagram of the selected register address item one cell; Fig. 2-B is the schematic diagram of editing the cell; Fig. 2-C is the schematic diagram after the execution configuration ;
图3为表格式配置界面第二操作的示意图;图3-A为选中寄存器变量名项一单元格示意图;图3-B是对该单元格编辑的示意图;图3-C是执行配置后的示意图;Fig. 3 is the schematic diagram of the second operation of the tabular configuration interface; Fig. 3-A is the schematic diagram of the selected register variable name item one cell; Fig. 3-B is the schematic diagram of this cell editing; Fig. 3-C is after the execution configuration schematic diagram;
图4为表格式配置界面第三操作的示意图;图4-A为选中寄存器变量名项一单元格示意图;图4-B是对该单元格编辑的示意图;图4-C是执行配置后的示意图;Fig. 4 is the schematic diagram of the third operation of the tabular configuration interface; Fig. 4-A is the schematic diagram of the selected register variable name item one cell; Fig. 4-B is the schematic diagram of editing the cell; Fig. 4-C is after the execution configuration schematic diagram;
图5为表格式配置界面第四操作的示意图;图5-A为选中寄存器变量名项一单元格示意图;图5-B是对该单元格编辑的示意图;图5-C是执行配置后的示意图;Fig. 5 is the schematic diagram of the fourth operation of the tabular configuration interface; Fig. 5-A is the schematic diagram of the selected register variable name item one cell; Fig. 5-B is the schematic diagram of editing the cell; Fig. 5-C is after the execution configuration schematic diagram;
图6为表格式配置界面第五操作的示意图;图6-A为选中寄存器变量名项一单元格示意图;图6-B是对该单元格编辑的示意图;图6-C是执行配置后的示意图。Fig. 6 is the schematic diagram of the fifth operation of the tabular configuration interface; Fig. 6-A is the schematic diagram of the selected register variable name item one cell; Fig. 6-B is the schematic diagram of this cell editing; Fig. 6-C is after the execution configuration Schematic.
具体实施方式Detailed ways
本发明可应用于寄存器的表格式配置界面,即通过一配置软件将寄存器的信息读取,并通过表格式的配置界面进行显示,并可接收用户对该配置界面所显示的寄存器信息的编辑,并在用户通过该配置界面点击某提交控件(如虚拟按键)后,该配置界面上面的配置信息更新至寄存器。下面对本发明的批量配置寄存器的方法进行详细说明,参见图1示出的批量配置寄存器的流程图,包括以下步骤:The present invention can be applied to the tabular configuration interface of the register, that is, the information of the register is read through a configuration software, and displayed through the tabular configuration interface, and the editing of the register information displayed on the configuration interface can be received by the user, And after the user clicks a certain submission control (such as a virtual button) through the configuration interface, the configuration information on the configuration interface is updated to the register. The method for configuring registers in batches of the present invention is described in detail below, referring to the flowchart of configuring registers in batches shown in FIG. 1 , including the following steps:
S100:由表格式配置界面通过表格样式显示寄存器的信息,用户点击选择该表格式配置界面显示的表格中的一单元格,通过输入或修改的方式,编辑该单元格内的信息。S100 : The information of the register is displayed in a table style on the tabular configuration interface. The user clicks to select a cell in the table displayed on the tabular configuration interface, and edits the information in the cell by inputting or modifying.
其中,如图2-图5所示的表格样式中,各列为要配置的寄存器的各项信息,其中包括了寄存器地址项(Address)、寄存器变量名项(Variable Name)等,还可以包括备注信息项(Remarks)等。后续例子中,将以用户分别批量修改寄存器地址项(Address)和寄存器变量名项(Variable Name)为例进行说明。Among them, in the table style shown in Figure 2-Figure 5, each column is the information of the register to be configured, including the register address item (Address), the register variable name item (Variable Name), etc., and can also include Remarks information items (Remarks) and so on. In the following examples, the user will be used as an example to modify the register address item (Address) and the register variable name item (Variable Name) in batches as an example.
其中,当用户选择的是寄存器地址项的一单元格时,该单元格被编辑后的内容可以是寄存器地址(如图2-B加粗框的单元格中“10”)及与其连接的一字符串。其中该字符串包括:第一子字符串,如图2-B加粗框的单元格中的“++”;第二数字,如图2-B加粗框的单元格中的“2”;第二子字符串,如图2-B加粗框的单元格中的“:”;第三数字,如图2-B加粗框的单元格中的“4”。即,该单元格被编辑后的内容为如图2-B中所示的“10++2:4”。Among them, when the user selects a cell of the register address item, the edited content of the cell can be the register address ("10" in the cell with the bold box in Figure 2-B) and a cell connected to it. string. The string includes: the first substring, such as "++" in the cell with the bold box in Figure 2-B; the second number, such as "2" in the cell with the bold box in Figure 2-B ; The second substring, as shown in Figure 2-B, is the ":" in the bolded cell; the third number, as shown in Figure 2-B, is the "4" in the bolded cell. That is, the edited content of the cell is "10++2:4" as shown in Fig. 2-B.
需要说明的是,当用户点击该单元格时,可以向用户提示应输入的格式,已便于该单元格的编辑后的内容可被后续正确解析。该字符串中也可包括并不影响后续解析的其他子字符串,例如为“10++2,:4”、“10++2&:4”、“10,RE++2:4”或“10++2:4”(“++”前后分别增加了一空格),即后续解析过程中支持一定的容错性。It should be noted that, when the user clicks on the cell, the user can be prompted for the format to be input, which facilitates the subsequent correct analysis of the edited content of the cell. The string may also include other substrings that do not affect subsequent parsing, such as "10++2, :4", "10++2&:4", "10, RE++2:4" or "10++2:4" (a space is added before and after "++"), that is, a certain fault tolerance is supported in the subsequent parsing process.
其中,当用户选择的是寄存器变量名项的一单元格时,该单元格被编辑后的内容可以是包含第一数字的寄存器变量名(如图3-B加粗框的单元格中的“IO1”)及与该第一数字相邻的字符串,其中该字符串包括:第一子字符串,如图3-B加粗框的单元格中的“++”;第二数字,如图3-B加粗框的单元格中的“2”;第二子字符串,如图3-B加粗框的单元格中的“:”;第三数字,如图3-B加粗框的单元格中的“3”。即,该单元格被编辑后的内容为如图3-B中所示的“IO1++2:3”。Among them, when the user selects a cell of the register variable name item, the edited content of the cell can be the register variable name containing the first number (as shown in Figure 3-B, "" in the cell with the bold box" IO1") and a string adjacent to the first number, wherein the string includes: the first substring, such as "++" in the cell with the bold box in Figure 3-B; the second number, such as The "2" in the cell with the bold box in Figure 3-B; the second substring, like the ":" in the cell with the bold box in Figure 3-B; the third number, in bold in Figure 3-B "3" in the cell of the box. That is, the edited content of the cell is "IO1++2:3" as shown in Figure 3-B.
另外为了更好的区分寄存器变量名中要修改的第一数字,还可以设置成对配合出现的符号,并将第一数字及字符串置入该对符号内,本例中,采用成对的“()”,即该单元格被编辑后的内容也可为“IO(1++2:3)”。采用成对配合出现的符号的优点是,可以更明确的确定要修改的寄存器变量名中第一数字的位置,例如对于“IO4(1++2:3)”、“4IO(1++2:3)”、“IO(1++2:3)_4”、“IO(1++2:3)_OUT4”或“(1++2:3)IO_4”,其中的“4”对应位置在批量修改中不会被误修改,仅修改其中“1”对应位置的数字。In addition, in order to better distinguish the first number to be modified in the register variable name, you can also set the symbols that appear in pairs, and put the first number and the string into the pair of symbols. In this example, the paired symbols are used. "()", that is, the edited content of the cell can also be "IO(1++2:3)". The advantage of using symbols that appear in pairs is that the position of the first digit in the name of the register variable to be modified can be determined more clearly, for example, for "IO4(1++2:3)", "4IO(1++2" :3)", "IO(1++2:3)_4", "IO(1++2:3)_OUT4" or "(1++2:3)IO_4", where "4" corresponds to the position In batch editing, it will not be modified by mistake, only the number corresponding to "1" is modified.
与上述寄存器地址项单元格一样,当用户点击寄存器变量名项的单元格时,也可向用户提示应输入的格式,以及字符串中也可包括并不影响后续解析的其他子字符串,其中为了避免将字符串中的该其他子字符串误认为是寄存器变量名,这种情况下,应采用上述使用成对配合出现的符号的格式,如,“IO(1++2,:3)_4”。Similar to the above register address item cell, when the user clicks the register variable name item cell, the user can also be prompted for the format to be entered, and the string can also include other substrings that do not affect subsequent parsing, among which In order to avoid mistaking this other substring in the string as a register variable name, in this case, the above format using symbols that appear in pairs should be used, for example, "IO(1++2,:3) _4".
S200:由表格式配置界面获取用户编辑的所述单元格内的信息,判断是否与该单元格对应项的类型匹配,当匹配时,则继续后续步骤。S200: Acquire the information in the cell edited by the user through the tabular configuration interface, determine whether it matches the type of the corresponding item of the cell, and if it matches, continue the subsequent steps.
例如,当该单元格为寄存器地址项的一单元格时,判断该单元格内的信息中所述字符串外的内容是否是数字格式。For example, when the cell is a cell of the register address item, it is determined whether the content other than the character string in the information in the cell is in a digital format.
S300:对所述单元格内的内容进行解析,并将解析出的指令缓存,其中所述解析的步骤具体包括如下子步骤:S300: Parse the content in the cell, and cache the parsed instruction, wherein the parsing step specifically includes the following sub-steps:
S3001:判断所述字符串中是否具有用于标识递加或递减方式步进的第一子字符串,若有,并据此确定出步进方式,并执行下一子步骤,否则退出本流程,按照修改单条数据方式来修改该单元格内的数据。其中,第一字符串也可称作操作符。S3001: Determine whether the character string has a first substring for identifying the incrementing or decrementing mode stepping, and if so, determine the stepping mode and execute the next substep, otherwise exit the process , modify the data in the cell according to the method of modifying a single data. Wherein, the first string can also be called an operator.
本例中,分别使用“++”或“--”作为第一子字符串来标识递加或递减方式的步进。In this example, use "++" or "--" as the first substring to identify incrementing or decrementing steps, respectively.
S3002:判断所述字符串中具有与第一子字符串相邻的第二数字时,将第二数字确定为步进值;若判断未具有相邻所述第一子字符串的第二数字时,则该步进值设置为1。S3002: When it is determined that the character string has a second number adjacent to the first substring, determine the second number as a step value; if it is determined that there is no second number adjacent to the first substring , the step value is set to 1.
例如,对应寄存器地址项的一单元格内为“10++2:4”时,所述字符串为“++2:4”,据此步进值被确定为2。For example, when a cell corresponding to a register address item is "10++2:4", the character string is "++2:4", and the step value is determined to be 2 accordingly.
又如,对应寄存器变量名项的一单元格内为“IO1++2:3”或“IO(1++2:3)”时,所述字符串为“++2:3”,据此步进值被确定为2。For another example, when a cell corresponding to a register variable name item is "IO1++2:3" or "IO(1++2:3)", the string is "++2:3", according to This step value is determined to be 2.
又如,对应寄存器地址项的一单元格内为“10++:4”时,或对应寄存器变量名项的一单元格内为“IO1++:4”时,所述字符串均为“++:4”,字符串中的第一子字符串“++”相邻未具有第二数字,据此步进值被设置为1。For another example, when the cell corresponding to the register address item is "10++:4", or the cell corresponding to the register variable name item is "IO1++:4", the strings are all "++". :4", the first substring "++" in the string does not have a second number adjacent to it, so the step value is set to 1.
S3003:判断所述字符串中具有用于标识表格修改范围的第二子字符串,且具有与第二子字符串相邻的第三数字时,将第三数字确定为所述字符串所指示的表格修改范围值;判断未具有第二子字符串及第三数字时,所述表格范围设置为该项对应的单元格到具有数据的末尾单元格的范围,通过默认修改范围的方式,对于需要这种修改时使得用户输入较为简便。S3003: When judging that the character string has a second substring for identifying the table modification range and has a third number adjacent to the second substring, determine the third number as indicated by the character string When it is judged that there is no second substring and third number, the table range is set to the range from the cell corresponding to the item to the end cell with data, and by default modifying the range, for This modification is required to make user input easier.
本例中,使用“:”作为第二子字符串。In this example, use ":" as the second substring.
例如,对应寄存器地址项的一单元格内为“10++2:4”时,所述字符串为“++2:4”,据此表格范围为该寄存器地址项下的该单元格至其后的共4个单元格。For example, when a cell corresponding to a register address item is "10++2:4", the string is "++2:4", and accordingly the table range is from the cell under the register address item to Then there are 4 cells in total.
又如,对应寄存器变量名项的一单元格内为“IO1++2:3”或“IO(1++2:3)”时,所述字符串为“++2:3”,据此表格范围为该寄存器变量名项下的该单元格至其后的共3个单元格。For another example, when a cell corresponding to a register variable name item is "IO1++2:3" or "IO(1++2:3)", the string is "++2:3", according to The range of this table is from the cell under the variable name of the register to the following 3 cells.
又如,如图6-B所示,对应寄存器地址项的一单元格内为“10++2”时,所述字符串为“++2”,并未出现第二子字符串“:”以及其后的数字,据此,如图6-C所示被修改的表格范围为该寄存器地址项下的该单元格至具有数据的末尾单元格,即如图6-C中所示,修改到寄存器地址项的最后一行的单元格。For another example, as shown in Figure 6-B, when the cell corresponding to the register address item is "10++2", the string is "++2", and the second substring ": ” and the numbers after it, according to which, the modified table range as shown in Figure 6-C is the cell under the register address item to the end cell with data, that is, as shown in Figure 6-C, Modify to the cell of the last row of the register address entry.
S400:根据缓存的所述指令,对对应的各个单元格进行配置。其中,该配置动作的触发,可以是在用户编辑完上述单元格按下回车键时,或者编辑完上述单元格,点击表格式配置界面显示的某配置控件时。S400: Configure each corresponding cell according to the cached instruction. The triggering of the configuration action may be when the user presses the Enter key after editing the above cell, or when the user clicks a configuration control displayed on the tabular configuration interface after editing the above cell.
配置过程为:对所述第三数字对应的表格范围内的各个单元格,以所述第一数字为起始,以所述第二数字为步进值,按确定出的递加或递减的步进方式依次对各个单元格中的寄存器地址的值或寄存器变量名中对应第一数字位置的数字格式的字符串的值进行配置。The configuration process is: for each cell in the table range corresponding to the third number, starting with the first number, using the second number as the step value, and incrementing or decrementing the determined increment or decrement. The step-by-step mode configures the value of the register address in each cell or the value of the character string in the digital format corresponding to the first digital position in the register variable name.
如图2-C、图3-C分别示出了对图2-B、图3-B对应单元格进行解析、并据此配置后的各个单元格的结果。Figures 2-C and 3-C respectively show the results of each cell after analyzing and configuring the corresponding cells in Figures 2-B and 3-B.
S500:用户在表格式配置界面点击某提交控件,提交指令后,将所配置的内容更新至寄存器。S500: The user clicks a certain submit control on the tabular configuration interface, and after submitting the instruction, the configured content is updated to the register.
另外,用户也可以在表格式配置界面提供的菜单选择另存为或保存,将所述配置信息以文件的方式存储在计算机内,以便于需要的时候从计算机读取出来,并使用提交控件将配置的内容更新至寄存器。In addition, the user can also select Save As or Save in the menu provided in the tabular configuration interface, and store the configuration information in the computer in the form of a file, so that it can be read from the computer when needed, and the configuration information can be saved using the submit control. The contents are updated to the register.
由上,本发明可以实现寄存器地址和寄存器变量名的批量配置,并且上述步骤S300对字符串进行解析时,具有一定容错性,例如出现空格、其他标点符号都可以通过上述步骤被过滤掉,被正常解析。From the above, the present invention can realize batch configuration of register addresses and register variable names, and when the above-mentioned step S300 parses the character string, it has a certain error tolerance, for example, spaces and other punctuation marks can be filtered out through the above-mentioned steps. Parse normally.
当所述单元格为对应寄存器变量名项的单元格,所述配置为配置寄存器变量名时,由于寄存器变量名的不同位置可以出现相同或不同的多个第一数字,例如寄存器变量名为“BP1_IO1_VAR”,因此在配置寄存器变量名时,可以对这多个第一数字进行配置,下面进行详述:When the cell is a cell corresponding to a register variable name item, and the configuration is to configure a register variable name, the same or different first numbers may appear in different positions of the register variable name, for example, the register variable name is "" BP1_IO1_VAR", so when configuring the register variable name, you can configure these multiple first numbers, as detailed below:
如上所述,对于具有多个第一数字的寄存器变量名,需要明确要修改的寄存器变量名中第一数字的位置,因此需要使用上述多对成对配合出现的符号,并将多组相同或不同的所述第一数字和字符串对应的设置于多对所述符号内。对应上述步骤S100,对寄存器变量名项的一单元格进行编辑时,该单元格内被编辑为:“BP(1++:2)_IO(1++:3)_VAR”,可参见图4-B所示示意图。As mentioned above, for a register variable name with multiple first numbers, it is necessary to specify the position of the first number in the register variable name to be modified. Therefore, it is necessary to use the above-mentioned symbols that appear in pairs in pairs, and combine multiple groups of the same or The different first numbers and character strings are correspondingly arranged in multiple pairs of the symbols. Corresponding to the above step S100, when editing a cell of the register variable name item, the cell is edited as: "BP(1++:2)_IO(1++:3)_VAR", see Fig. 4 -B shows the schematic diagram.
对所述单元格内的内容进行解析时,判断有多对成对配合出现的符号后,分别各对所述符号内的每组字符串采用上述步骤S300的描述步骤进行解析。并且,以各组的字符串中的各第三数字的相乘结果作为总的表格修改范围值,即本例中将2*3=6作为总的表格修改范围值。When analyzing the content in the cell, after judging that there are multiple pairs of symbols that appear in pairs, each pair of character strings in the symbols is analyzed using the description steps of step S300 above. In addition, the multiplication result of each third number in the character string of each group is used as the total table modification range value, that is, 2*3=6 is used as the total table modification range value in this example.
对涉及的各单元格进行配置时,以各组构成嵌套循环的计算方式针对各组依次执行上述步骤S400,以对所述总的表格的修改范围内的各个单元格中的寄存器变量名中对应各组第一数字位置的数字格式的子字符串的值进行配置。When configuring each cell involved, the above step S400 is sequentially performed for each group in a calculation method in which each group forms a nested loop, so as to modify the name of the register variable in each cell within the modification range of the total table. Configure the value of the substring in the numeric format corresponding to the first numeric position of each group.
例如图4-B加粗框的单元格中的“BP(1++:2)_IO(1++:3)_VAR”,其具有两组第一数字和字符串,第一组为“1++:2”,第二组为“1++:3”,两组构成嵌套循环的计算方式指:以对应第一组所进行的表格修改操作作为外循环,其表格修改范围值2为外循环次数,对应第二组所进行的表格修改操作作为内循环,其表格修改范围值3为内循环次数,据此构成嵌套循环,以该方式对两组的各自第一数字位置的数字进行计算和修改。For example, "BP(1++:2)_IO(1++:3)_VAR" in the cell with the bold box in Figure 4-B has two sets of first numbers and strings, and the first set is "1" ++:2", the second group is "1++:3", the calculation method of the two groups constituting the nested loop refers to: the table modification operation corresponding to the first group is used as the outer loop, and the table modification range value is 2 is the number of outer loops, the table modification operation corresponding to the second group is regarded as the inner loop, and the table modification range value of 3 is the number of inner loops, which constitutes a nested loop. Numbers are calculated and modified.
该嵌套循环的计算过程以“BP(1++:2)_IO(1++:3)_VAR”进行具体说明,其构成的嵌套循环为:外循环对应“BP”:步进值为1、外循环次数为2;内循环对应“IO”:步进值为1内循环次数为3,按照该嵌套循环修改过程如下:The calculation process of the nested loop is described in detail by "BP(1++:2)_IO(1++:3)_VAR", and the nested loop formed by it is: the outer loop corresponds to "BP": the step value is 1. The number of outer loops is 2; the inner loop corresponds to "IO": the step value is 1, and the number of inner loops is 3. According to the nested loop, the modification process is as follows:
外循环中的参数被设置为第一个值,即BP1,内循环执行三次循环计算,内循环中的每次循环是将IO对应的第一数字加1(首次循环默认加0),据此,三次内循环后,生成IO1、IO2、IO3,对应的完整的寄存器变量名也即为BP1_IO1_VAR、BP1_IO2_VAR、BP1_IO3_VAR;The parameter in the outer loop is set to the first value, namely BP1, the inner loop performs three loop calculations, and each loop in the inner loop is to add 1 to the first number corresponding to IO (the first loop defaults to 0), according to this , after three inner loops, IO1, IO2, IO3 are generated, and the corresponding complete register variable names are BP1_IO1_VAR, BP1_IO2_VAR, BP1_IO3_VAR;
外循环中的参数被设置为第二个值,依照步进值1为BP2,内循环重新执行三次循环计算,生成IO1、IO2、IO3,对应的完整的寄存器变量名也即为BP2_IO1_VAR、BP2_IO2_VAR、BP2_IO3_VAR;The parameter in the outer loop is set to the second value, and according to the
所计算出的上述BP1_IO1_VAR、BP1_IO2_VAR、BP1_IO3_VAR、BP2_IO1_VAR、BP2_IO2_VAR、BP2_IO3_VAR被依次配置入该寄存器变量名项对应的6个单元格内,配置结果可参见图4-C。The calculated BP1_IO1_VAR, BP1_IO2_VAR, BP1_IO3_VAR, BP2_IO1_VAR, BP2_IO2_VAR, BP2_IO3_VAR are sequentially configured into the 6 cells corresponding to the variable name item of the register, and the configuration result can be seen in Figure 4-C.
另外,所述各组的字符串中还可编辑有表示优先级的第三子字符串;这样在对涉及的单元格进行配置时,还以所述第三子字符串的优先级作为嵌套循环中的循环的优先级。例如以“;数字”表示第三字符串;则可以使用例如图5-B加粗框的单元格中的“BP(1++:2;1)_IO(1++:3;2)_VAR”表示第一组循环的优先级低于第二组循环的优先级,即第一组作为内循环,第二组作为外循环。In addition, a third substring representing the priority can also be edited in the strings of each group; in this way, when configuring the involved cells, the priority of the third substring is also used as the nesting The priority of the loops within the loop. For example, "; number" is used to represent the third string; for example, "BP(1++:2;1)_IO(1++:3;2)_VAR in the cell with the bold box in Figure 5-B can be used. ” indicates that the priority of the first group of loops is lower than the priority of the second group of loops, that is, the first group is used as an inner loop, and the second group is used as an outer loop.
该嵌套循环的计算过程以“BP(1++:2;1)_IO(1++:3;2)_VAR”进行具体说明,其构成的嵌套循环基于优先级为:外循环对应“IO”:步进值为1、外循环次数为3;内循环对应“BP”:步进值为1内循环次数为2,按照该嵌套循环修改过程如下:The calculation process of the nested loop is described in detail with "BP(1++:2; 1)_IO(1++:3; 2)_VAR", and the nested loop formed by it is based on the priority: the outer loop corresponds to " IO": the step value is 1, the number of outer loops is 3; the inner loop corresponds to "BP": the step value is 1, the number of inner loops is 2, and the modification process according to the nested loop is as follows:
外循环中的参数被设置为第一个值,即IO1,内循环执行两次循环计算,内循环中的每次循环是将BP对应的第一数字加1(首次循环默认加0),据此,两次内循环后,生成BP1、BP2,对应的完整的寄存器变量名也即为BP1_IO1_VAR、BP2_IO1_VAR;The parameter in the outer loop is set to the first value, i.e. IO1, and the inner loop executes two loop calculations. Each loop in the inner loop is to add 1 to the first number corresponding to BP (the first cycle defaults to 0), according to Therefore, after two inner loops, BP1 and BP2 are generated, and the corresponding complete register variable names are BP1_IO1_VAR and BP2_IO1_VAR;
外循环中的参数被设置为第二个值,依照步进值1为IO2,内循环重新执行两次循环计算,生成BP1、BP2,对应的完整的寄存器变量名也即为BP1_IO2_VAR、BP2_IO2_VAR;The parameter in the outer loop is set to the second value, according to the
外循环中的参数被设置为第三个值,依照步进值1为IO3,内循环重新执行两次循环计算,生成BP1、BP2,对应的完整的寄存器变量名也即为BP1_IO3_VAR、BP2_IO3_VAR;The parameter in the outer loop is set to the third value, and according to the
所计算出的上述BP1_IO1_VAR、BP2_IO1_VAR、BP1_IO2_VAR、BP2_IO2_VAR、BP1_IO3_VAR、BP2_IO3_VAR被依次配置入该寄存器变量名项对应的6个单元格内,对应的配置结果可参见图5-C。The calculated BP1_IO1_VAR, BP2_IO1_VAR, BP1_IO2_VAR, BP2_IO2_VAR, BP1_IO3_VAR, BP2_IO3_VAR are sequentially configured into the 6 cells corresponding to the variable name item of the register, and the corresponding configuration result can be seen in Figure 5-C.
如上,针对寄存器变量名,本发明还可对变量名中的多个位置的数字进行批量配置,并且,通过表示优先级的第三字符串,可以灵活的配置变量名中多个位置的数字被批量修改的顺序。As above, for register variable names, the present invention can also perform batch configuration of numbers in multiple positions in the variable name, and, through the third string representing the priority, the numbers in multiple positions in the variable name can be flexibly configured to be configured. The order of batch modification.
本发明还相应的提供了一种用于用批量配置寄存器的装置,包括:The present invention also correspondingly provides a device for configuring registers in batches, comprising:
单元格内容获取模块,用于获取用户在表格式配置界面的一单元格中编辑的表示寄存器地址的第一数字或包含第一数字的寄存器变量名,及与该第一数字相邻的字符串;The cell content acquisition module is used to acquire the first number representing the register address or the register variable name containing the first number edited by the user in a cell of the tabular configuration interface, and the string adjacent to the first number ;
步进方式确定模块,用于在所述字符串中判断具有用于标识递加或递减方式步进的第一子字符串时,据此确定出步进方式;a step-by-step mode determination module, configured to determine the step-by-step mode according to the first sub-string for identifying the step-by-step or step-by-step mode in the character string;
步进值确定模块,用于在所述字符串中,判断具有与第一子字符串相邻的第二数字时,将第二数字确定为步进值;判断未具有相邻所述第一子字符串的第二数字时,将步进值设置为1;a step value determination module, configured to determine the second number as a step value when it is judged that there is a second number adjacent to the first substring in the character string; When the second digit of the substring, set the step value to 1;
表格修改范围确定模块,用于判断具有用于标识表格修改范围的第二子字符串,且具有与第二子字符串相邻的第三数字时,将第三数字确定为所述字符串所指示的表格修改范围值;The table modification range determination module is used to determine that when there is a second substring for identifying the table modification range and a third number adjacent to the second substring, the third number is determined as the character string. Indicated table modification range value;
批量配置模块,用于对所述第三数字对应的表格范围内的各个单元格,以所述第一数字为起始,以所述第二数字为步进值,按确定出的递加或递减的步进方式依次对各个单元格中的寄存器地址的值或寄存器变量名中对应第一数字位置的数字格式的字符串的值进行配置。The batch configuration module is used for each cell in the table range corresponding to the third number, starting with the first number, and using the second number as the step value, according to the determined increment or The decrementing step mode sequentially configures the value of the register address in each cell or the value of the character string in the digital format corresponding to the first number position in the register variable name.
当所述配置为配置寄存器变量名,所述单元格为对应寄存器变量名项的单元格时,单元格内容获取模块获取的单元格中编辑的寄存器变量名中还具有成对配合出现的符号,相邻的所述第一数字和字符串位于该对符号内时,对应的,批量配置模块还用于在配置时删除所述成对配合出现的符号。When the configuration is to configure a register variable name, and the cell is a cell corresponding to a register variable name item, the edited register variable name in the cell obtained by the cell content acquisition module also has symbols that appear in pairs. When the adjacent first numbers and character strings are located in the pair of symbols, correspondingly, the batch configuration module is further configured to delete the symbols that appear in the pair during configuration.
当单元格内容获取模块获取的所述单元格中编辑的寄存器变量名中具有多对所述成对配合出现的符号,多组相同或不同的所述第一数字和字符串对应的位于多对所述符号内时,对应的,When the name of the edited register variable in the cell acquired by the cell content acquisition module has multiple pairs of symbols that appear in pairs, the multiple sets of the same or different first numbers and strings corresponding to multiple pairs are located in multiple pairs. When inside the symbol, the corresponding,
步进方式确定模块是对每组字符串对应的步进方式进行确定;The step mode determination module determines the step mode corresponding to each group of strings;
步进值确定模块,还用于以各组的字符串中的各第三数字的相乘结果作为总的表格修改范围值;The step value determination module is also used to modify the range value by taking the multiplication result of each third number in the strings of each group as the total table;
批量配置模块进行批量配置时还用于:以各组构成嵌套循环的计算方式针对各组依次执行批量配置,且,对所述总的表格的修改范围内的各个单元格中的寄存器变量名中对应各组第一数字位置的数字格式的子字符串的值进行配置。When the batch configuration module performs batch configuration, it is also used for: performing batch configuration sequentially for each group in a calculation method in which each group forms a nested loop, and, for the register variable name in each cell within the modification range of the general table Configure the value of the substring in the digital format corresponding to the first digital position of each group.
当单元格内容获取模块获取的所述单元格中的所述各组的字符串中还包括表示优先级的第三子字符串时,还包括:When the strings of the respective groups in the cell acquired by the cell content acquisition module further include a third substring representing the priority, it further includes:
优先级确定模块,用于确定出各组字符串的优先级;The priority determination module is used to determine the priority of each group of strings;
批量配置模块进行批量配置时还用于:以所述第三子字符串对应的优先级作为嵌套循环中的循环的优先级。When the batch configuration module performs batch configuration, it is further used for: taking the priority corresponding to the third substring as the priority of the loop in the nested loop.
还包括配置提交模块,用于获取用户提交指令后,将所配置的内容更新至寄存器。It also includes a configuration submission module, which is used to update the configured content to the register after obtaining the user submission instruction.
本发明还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述批量配置寄存器的方法中的步骤S100-S500所述的步骤。The present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps described in steps S100-S500 in the above method for configuring registers in batches.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,例如上述表示递加或递减方式步进的第一子字符串也可以分别为“>>”,“<<”,或“+++”“---”等;上述第二子字符串也可以为“#”、“^”等;上述成对配合出现的符号也可以是“[]”、“<>”、“{}”等,或者上述第一子字符串与第二子字符串位置的变化,或者上述相邻设置时前后位置的变化,均应包含在本发明的保护范围之内。另外,本发明的实施例并不表示对本发明各步骤执行的先后次序进行了限定,例如上述步骤3001至3003这三个步骤的先后顺序可以任意调整。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention, for example, the above-mentioned first substring representing the step of increment or decrement can also be respectively ">>", "<< ", or "+++", "---", etc.; the second substring above can also be "#", "^", etc.; the symbols that appear in pairs can also be "[]", "< >", "{}", etc., or the change of the position of the first substring and the second substring, or the change of the position before and after the adjacent setting, shall all be included in the protection scope of the present invention. In addition, the embodiment of the present invention does not mean that the order of execution of the steps of the present invention is limited. For example, the order of the above-mentioned three
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911063076.8ACN112748954B (en) | 2019-10-31 | 2019-10-31 | Method and device for configuring registers in batches and computer-readable storage medium |
| CN202210704206.7ACN115080118B (en) | 2019-10-31 | 2019-10-31 | Method, device and computer-readable storage medium for batch configuration of registers |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911063076.8ACN112748954B (en) | 2019-10-31 | 2019-10-31 | Method and device for configuring registers in batches and computer-readable storage medium |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210704206.7ADivisionCN115080118B (en) | 2019-10-31 | 2019-10-31 | Method, device and computer-readable storage medium for batch configuration of registers |
| Publication Number | Publication Date |
|---|---|
| CN112748954A CN112748954A (en) | 2021-05-04 |
| CN112748954Btrue CN112748954B (en) | 2022-08-23 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201911063076.8AActiveCN112748954B (en) | 2019-10-31 | 2019-10-31 | Method and device for configuring registers in batches and computer-readable storage medium |
| CN202210704206.7AActiveCN115080118B (en) | 2019-10-31 | 2019-10-31 | Method, device and computer-readable storage medium for batch configuration of registers |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210704206.7AActiveCN115080118B (en) | 2019-10-31 | 2019-10-31 | Method, device and computer-readable storage medium for batch configuration of registers |
| Country | Link |
|---|---|
| CN (2) | CN112748954B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110287459A (en)* | 2019-05-30 | 2019-09-27 | 平安科技(深圳)有限公司 | Table batch processing method, system, device and can storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9183124B2 (en)* | 2011-04-18 | 2015-11-10 | Accenture Global Services Limited | Automation controller for next generation testing system |
| US9753965B2 (en)* | 2013-03-15 | 2017-09-05 | Factual Inc. | Apparatus, systems, and methods for providing location information |
| GB2549511B (en)* | 2016-04-20 | 2019-02-13 | Advanced Risc Mach Ltd | An apparatus and method for performing operations on capability metadata |
| CN109597654B (en)* | 2018-12-07 | 2022-01-11 | 湖南国科微电子股份有限公司 | Register initialization method, basic configuration table generation method and embedded system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110287459A (en)* | 2019-05-30 | 2019-09-27 | 平安科技(深圳)有限公司 | Table batch processing method, system, device and can storage medium |
| Publication number | Publication date |
|---|---|
| CN115080118A (en) | 2022-09-20 |
| CN112748954A (en) | 2021-05-04 |
| CN115080118B (en) | 2025-08-26 |
| Publication | Publication Date | Title |
|---|---|---|
| Russo et al. | Bootstrap and rogue identification tests for phylogenetic analyses | |
| Ronquist et al. | Draft MrBayes version 3.2 manual: tutorials and model summaries | |
| US10353882B2 (en) | Packaging data science operations | |
| CN112364024B (en) | Control method and device for automatic comparison of table data in batches | |
| CN109710631A (en) | Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code | |
| CN111291560B (en) | Sample expansion method, terminal, device and readable storage medium | |
| CN105224455B (en) | A kind of method for automatically generating character string type test case | |
| CN109683881B (en) | Code format adjusting method and device | |
| CN111881664A (en) | An information extraction method, device, device and medium combining RPA and AI | |
| CN112748954B (en) | Method and device for configuring registers in batches and computer-readable storage medium | |
| US20140101533A1 (en) | Lossless application of new information architecture to existing websites, web pages, and online content | |
| US8082381B2 (en) | Connecting a plurality of peripherals | |
| CN110534157B (en) | Method for extracting genome gene information in batches and translating and comparing analysis sequences | |
| CN112860699A (en) | Database management method and device, storage medium and electronic device | |
| CN109255106A (en) | A kind of text handling method and terminal | |
| CN102033863B (en) | Formula manipulation method and system | |
| CN110929100B (en) | Method and device for acquiring value taking path, storage medium and electronic equipment | |
| CN114385764A (en) | Reverse analysis method and device for relational database table structure | |
| CN108829969A (en) | A kind of new and old circuit meshwork list comparison method and system based on circuit layout verifying | |
| CN112380879A (en) | Intelligent translation method and device, computer equipment and storage medium | |
| CN102855230A (en) | Method and device for editing organic chemical structural formula | |
| CN110554860A (en) | Construction method and code generation method of software project natural language programming interface (NLI) | |
| CN109840110A (en) | For handling the method, apparatus, equipment and readable storage medium storing program for executing of code message | |
| CN115794101A (en) | Robot flow automation system based on recursive descent analyzer | |
| CN114840412A (en) | Method for operating test tool, electronic device, and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| EE01 | Entry into force of recordation of patent licensing contract | ||
| EE01 | Entry into force of recordation of patent licensing contract | Application publication date:20210504 Assignee:Beijing Shuili Intelligent Building Technology Co.,Ltd. Assignor:KYLAND TECHNOLOGY Co.,Ltd. Contract record no.:X2022990000047 Denomination of invention:Method, device and computer-readable storage medium for batch configuration of registers License type:Common License Record date:20220121 | |
| GR01 | Patent grant | ||
| GR01 | Patent grant |