Data line processing method and device of spreadsheet based on dynamic step length

By calculating the target sort number within a local range of a dynamic step size, the problem of slow response speed and high system load in data row operations in large-scale spreadsheets is solved, achieving efficient data row insertion and updating and improving system performance.

CN121435941APending Publication Date: 2026-01-30蒲惠智造科技股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202512021751.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-01-30

AI Technical Summary

Technical Problem

Existing technologies suffer from slow response times and high system load when manipulating data rows in large-scale spreadsheets. This is mainly because each adjustment requires recalculating and updating a large amount of data, resulting in high-frequency I/O operations and impacting system performance.

Method used

A data row processing method based on dynamic step size is adopted. By calculating the target sort number within a local range of the dynamic step size, only the sort number of the inserted row needs to be updated, which reduces database write operations and lowers system load.

Benefits of technology

This improved the system's response speed and concurrent processing capabilities, reduced the frequency of I/O operations, and enhanced the overall system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121435941A_ABST
    Figure CN121435941A_ABST
Patent Text Reader

Abstract

The invention discloses a data line processing method and device for a spreadsheet based on a dynamic step size, and the method comprises the steps: obtaining a target data line selected by a user, an insertion position, and the total line number of inserted data lines in response to a data line insertion instruction of an original spreadsheet displayed by an MES system by the user; wherein the sequence numbers between adjacent data rows in the original spreadsheet are discontinuous and have equal differences, and have dynamically adjusted step lengths; determining a reference interval according to the target data row and the insertion position; determining row intervals among the inserted data rows according to the reference interval; calculating a target sorting number of each inserted data line according to a progressive increase mode through the line interval and the total line number; and storing a mapping relationship between the target sorting number of each inserted data row and the row data of each inserted data row. Therefore, by adopting the embodiment of the invention, when the data in the online spreadsheet in the MES system is updated, the normal response speed and performance of the MES system can be kept.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of digital management, in particular to a data row processing method and device for an electronic form based on a dynamic step length. BACKGROUND

[0002] In a modern enterprise resource planning (MES) system, intelligent tabular collaborative management is a key tool for efficient management of production processes. For example, in a production planning and scheduling module, an operator needs to frequently sort data rows in a production task list, including batch copying, cutting, inserting new rows, etc., to adapt to dynamic adjustments of production plans.

[0003] In related technologies, the system assigns a continuous integer to each row of data as a sort number (e.g., 1, 2, 3,...). When a user needs to manipulate a data row, the system first obtains all rows that need to be moved, and then updates the sort numbers of all rows from the target row to the end of the list. For example, if 3 rows are to be inserted after the 2nd row, the sort numbers of all rows after the original 3rd row need to be increased by 3. Then the system assigns new sort numbers to the inserted rows and writes the updated sort numbers back to the database.

[0004] However, each adjustment requires the recalculation and update of a large amount of data, and the performance overhead is proportional to the length of the column in the table. When the amount of data in the table is large (e.g., millions of rows), the response speed of the system is extremely slow. At the same time, due to the need to update the sort field of a large number of records in the database, high-frequency I / O operations are required, resulting in a large system load and severely affecting the performance of the system. SUMMARY

[0005] Embodiments of the present application provide a data row processing method and device for an electronic form based on a dynamic step length. To have a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not a general review, nor is it intended to determine key / important components or delineate the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.

[0006] In a first aspect, the embodiments of the present application provide a data row processing method for an electronic form based on a dynamic step length, the method comprising: In response to a user's data row insertion instruction for an original electronic form displayed by an MES system, obtaining a target data row selected by the user, an insertion position, and a total number of inserted data rows; wherein the sort numbers between adjacent data rows in the original electronic form are not continuous and equidistant, and there is a dynamic adjustment step length; determining a reference interval according to the target data row and the insertion position; and determining the row interval between each inserted data row according to the reference interval; calculating a target order number of each inserted data row in an ascending manner according to the row interval, the total number of rows; storing a mapping relationship between the target order number of each inserted data row and the row data of each inserted data row.

[0007] Optionally, the reference interval is determined according to the target data row and the insertion position, and includes: in a case where the insertion position indicates that each inserted data row is before the target data row, determining a previous data row of the target data row; in a case where the previous data row exists, determining first row data of the previous data row and second row data of the target data row; obtaining an initial order number corresponding to the first row data and an initial order number corresponding to the second row data from a mapping relationship between an initial order number of each data row and initial row data, as the initial order number of the previous data row and the initial order number of the target data row; combining the initial order number of the previous data row and the initial order number of the target data row into the reference interval; or in a case where the previous data row does not exist, combining 0 and the initial order number of the target data row into the reference interval.

[0008] Optionally, the reference interval is determined according to the target data row and the insertion position, and includes: in a case where the insertion position indicates that each inserted data row is after the target data row, determining a next data row of the target data row; in a case where the next data row exists, determining first row data of the next data row and second row data of the target data row; obtaining an initial order number corresponding to the first row data and an initial order number corresponding to the second row data from a mapping relationship between an initial order number of each data row and row data, as the initial order number of the next data row and the initial order number of the target data row; combining the initial order number of the target data row and the initial order number of the next data row into the reference interval; or in a case where the next data row does not exist, summing the initial order number of the target data row and a preset step length to obtain a backup order number; combining the initial order number of the target data row and the backup order number into the reference interval.

[0009] Optionally, the row interval between each inserted data row is determined according to the reference interval, and includes: calculating an absolute value of a difference between two parameters in the reference interval to obtain a space size of the reference interval; calculating a ratio between the space size and the total number of rows plus 1 to obtain the row interval between each inserted data row; wherein the row interval The calculation formula of the reference interval is:

[0010] The calculation formula of the reference interval is: The space size of the reference interval, The total number of rows; the space size The calculation formula of the reference interval is: The calculation formula of the reference interval is: The two parameters in the reference interval are the sorting numbers.

[0011] Optionally, the target sorting number of each inserted data row is calculated in an increasing manner through the row interval and the total number of rows, including: From 1, each inserted data row is marked with a temporary row number in an increasing manner, to obtain the row number of each inserted data row, and the row number of the last inserted data row is the total number of rows; The product value of each inserted data row is obtained by multiplying the row interval and the row number of each inserted data row; The target sorting number of each inserted data row is obtained by summing the smaller value in the reference interval and the product value of each inserted data row; wherein, The target sorting number of each inserted data row The calculation expression of the target sorting number of each inserted data row is:

[0012] The calculation formula of the reference interval is: The smaller value in the reference interval, The row number of the inserted data row, The row interval between the inserted data rows.

[0013] Optionally, before the user inserts the data row of the original electronic table displayed by the MES system, it further includes: Receiving a new electronic table uploaded by the user to the MES system as an original electronic table; Each data row in the original electronic table is assigned an initial sorting number to obtain an initial sorting number of each data row; wherein, the initial sorting numbers between adjacent data rows are discontinuous, equidifferent, and have a dynamically adjusted step; Obtaining the original row data of each data row; Storing the mapping relationship between the initial sorting number and the original row data of each data row; wherein, the initial sorting number of each data row The calculation formula of the reference interval is:

[0014] The calculation formula of the reference interval is: ​​The row number for each data row. The step size is dynamically adjusted.

[0015] Optionally, after storing the mapping between the target sort number of each inserted data row and the row data of each inserted data row, the following is also included: In response to the user's visualization command for the first spreadsheet in the MES system, obtain the current sort number of each current data row in the first spreadsheet; Load the pre-stored mapping between the initial sort number of each data row and the initial row data; From the mapping relationship, retrieve the current row data corresponding to the current sort number of each current data row; The data for each current row is displayed in a table format, arranged in ascending order of the current sort number.

[0016] Optionally, the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row is stored, including: Using the Elasticsearch algorithm, the target sort number of each inserted data row and the row data of each inserted data row are distributed and stored on multiple storage nodes to generate a distributed index; A distributed index is used to establish a mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row.

[0017] Optionally, the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row is stored, including: Use the target sort number of each inserted data row as the key; Use the row data of each inserted data row as the value; Establish a mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row in the database in the form of key-value pairs.

[0018] Secondly, embodiments of this application provide a spreadsheet data row processing apparatus based on dynamic step size, the apparatus comprising: The parameter acquisition module is used to respond to the user's instruction to insert data rows in the original spreadsheet displayed by the MES system, and to obtain the target data row selected by the user, the insertion position, and the total number of data rows to be inserted; wherein, the sort numbers between adjacent data rows in the original spreadsheet are not continuous and are arithmetic progressions with dynamically adjusted step sizes; The parameter determination module is used to determine the reference interval based on the target data row and the insertion position; and to determine the row spacing between each inserted data row based on the reference interval. The target sort number calculation module is used to calculate the target sort number of each inserted data row in an incremental manner based on the row interval and the total number of rows. The storage module is used to store the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row.

[0019] The technical solutions provided in this application embodiment may include the following beneficial effects: In this embodiment, on the one hand, a data row processing method based on dynamic step size is adopted. When inserting a data row, the target sort number only needs to be calculated within a local range of the dynamic step size, with a constant-order computation time of O(1), independent of the total table length. Therefore, the system response speed remains highly efficient regardless of the size of the table data. On the other hand, the data row processing method based on dynamic step size only needs to update the target sort number of the inserted row, without modifying the sort numbers of other existing rows, which significantly reduces the number of database write operations, typically only the number of inserted rows K. Therefore, the system load is significantly reduced, the I / O operation frequency is greatly reduced, thereby improving the system's concurrent processing capability and overall performance.

[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0022] Figure 1 This is a flowchart illustrating a method for processing data rows in a spreadsheet based on dynamic step size, as provided in an embodiment of this application. Figure 2 This is a schematic diagram of an online raw spreadsheet displayed by an MES system provided in an embodiment of this application; Figure 3 This is a schematic diagram of the result displayed by the MES system after a user clicks, provided in an embodiment of this application; Figure 4 This is a flowchart illustrating a method for determining a reference interval provided in an embodiment of this application; Figure 5 This is a schematic diagram illustrating the result of inserting two rows of data according to an embodiment of this application; Figure 6 This is a schematic diagram illustrating the result of a secondary data insertion provided in an embodiment of this application; Figure 7 This is an example diagram illustrating an insertion example provided in an embodiment of this application; Figure 8This is a schematic block diagram illustrating a data row processing procedure for a spreadsheet based on dynamic step size, as provided in an embodiment of this application. Figure 9 This is a schematic diagram of the structure of a data row processing device for a spreadsheet based on dynamic step size, provided in an embodiment of this application. Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0023] The following description and accompanying drawings fully illustrate specific embodiments of this application to enable those skilled in the art to practice them.

[0024] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0025] In the following description, when referring to the accompanying drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0026] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.

[0027] Currently, if three rows are to be inserted after the second row, the sort number of the original third row and all subsequent rows needs to be increased by 3. The system then assigns new sort numbers to the inserted rows and writes the updated sort numbers back to the database.

[0028] The applicant of this application recognized that each adjustment required recalculating and updating a large amount of data, with performance overhead proportional to the length of the columns in the table. When the table contained a large amount of data (such as millions of rows), the system's response speed was extremely slow. Furthermore, the need to update the sorting fields of a large number of records in the database resulted in high-frequency I / O operations, leading to a heavy system load and severely impacting system performance.

[0029] To address the aforementioned problems, this application provides a data row processing method and apparatus for spreadsheets based on dynamic step size, thereby resolving the issues present in the related technologies. In the embodiments of this application, on one hand, the data row processing method based on dynamic step size calculates the target sort number only within a local range of the dynamic step size when inserting a data row. The computational complexity is constant O(1), independent of the total table length. Therefore, regardless of the size of the table data, the system's response speed remains highly efficient. On the other hand, the data row processing method based on dynamic step size only requires updating the target sort number of the inserted row, without modifying the sort numbers of other existing rows, significantly reducing the number of database write operations, typically only the number of inserted rows K. Therefore, the system load is significantly reduced, and the I / O operation frequency is greatly reduced, thereby improving the system's concurrent processing capability and overall performance. Exemplary embodiments are described in detail below.

[0030] The following will be combined with the appendix Figure 1 -Appendix Figure 8 This application provides a detailed description of a data row processing method for spreadsheets based on dynamic step sizes, as provided in its embodiments. This method can be implemented using a computer program and can run on a data row processing device for spreadsheets based on dynamic step sizes using a von Neumann architecture. This computer program can be integrated into an application or run as a standalone utility application.

[0031] Please see Figure 1 This document provides a flowchart illustrating a method for processing data rows in a spreadsheet based on dynamic step sizes, as described in an embodiment of this application. Figure 1 As shown, the method in this application embodiment includes the following steps: S101, in response to the user's instruction to insert data rows into the original spreadsheet displayed by the MES system, obtain the target data row selected by the user, the insertion position, and the total number of data rows to be inserted; wherein, the sort numbers between adjacent data rows in the original spreadsheet are not continuous and are arithmetic progressions with dynamically adjusted step sizes; MES (Manufacturing Execution System) is a real-time information system used to optimize manufacturing processes. It provides functions such as production scheduling, resource allocation, and quality control by monitoring data during the production process. In this application, the MES system displays an online raw spreadsheet where users can perform operations such as inserting data rows. The raw spreadsheet refers to the initial table data displayed in the MES system, containing multiple rows of data, each representing a record or task. These data rows are assigned a sequence number during initialization. A data row insertion command is a command issued by the user through the MES system interface, requesting the insertion of new data rows into the table. The insertion command includes information such as the target position and the number of rows to insert. The target data row refers to the row containing the user-specified insertion position. For example, if the user wants to insert a new row before row 3, then row 3 is the target data row. The insertion position refers to the specific location where the new row is inserted, which can be either before or after the target data row. The total number of data rows to insert refers to the number of new rows the user wants to insert. For example, if the user wants to insert 3 new data rows, then the total number of rows is 3. A sort number is a numerical value assigned to each row of data to determine its order. In this application, the sort numbers are not consecutive and are arithmetic progressions; that is, the difference between the sort numbers of adjacent rows is a fixed step size (e.g., 1000, 2000, etc.). The dynamically adjusted step size refers to the amount of space reserved between the sort numbers to support insertion operations. The step size can be dynamically adjusted as needed to ensure sufficient space for inserting new rows.

[0032] In some embodiments of this application, a user issues a data row insertion instruction through an online raw spreadsheet displayed by the MES system, and the MES system receives the data row insertion instruction. This instruction includes the target data row, the insertion position (before or after), and the total number of data rows to be inserted.

[0033] Specifically, the MES system displays online raw spreadsheets, such as... Figure 2 As shown, if a user wants to insert two rows of data before the second row, the user can click on the second row in the original spreadsheet. After clicking, the MES system will display the following result: Figure 3 As shown, the user is currently... Figure 3 After selecting "Insert before selected rows" and choosing 2 rows to insert, the user clicks "Execute Insert" to generate a data row insertion instruction. The MES system receives the data row insertion instruction, which indicates that the target data row is the second row, and the insertion position is before the target data row, with a total of 2 rows to be inserted.

[0034] In some embodiments of this application, after a new spreadsheet is uploaded to the MES system, the original new spreadsheet needs to be initialized. The initialization process includes: receiving the new spreadsheet uploaded by the user to the MES system as the original spreadsheet; assigning an initial sort number to each data row in the original spreadsheet to obtain the initial sort number of each data row; wherein the initial sort numbers between adjacent data rows are not consecutive, are arithmetic progressions, and have dynamically adjusted step sizes; obtaining the original row data of each data row; and storing the mapping relationship between the initial sort number of each data row and the original row data; wherein the initial sort number of each data row... The calculation formula is:

[0035] in, The row number for each data row. The step size is dynamically adjusted.

[0036] For example, a user uploads a new spreadsheet containing 3 rows of data, as shown in Table 1. The preset dynamic adjustment step size... The initial sort number is set to 1000. At this point, an initial sort number is assigned to each row of data. Line 1: = 1 × 1000 = 1000; Line 2: = 2 × 1000 = 2000; Line 3: = 3 × 1000 = 3000.

[0037] Table 1

[0038] At this point, after initialization, the structure of the spreadsheet is as shown in Table 2.

[0039] Table 2

[0040] S102, determine the reference interval based on the target data row and the insertion position; determine the row spacing between each inserted data row based on the reference interval; The reference interval refers to the range used to calculate the sort number of the newly inserted row, which is determined by the initial sort numbers of the target data row and its adjacent rows. The row interval is calculated using the size of the reference interval and the number of rows to be inserted.

[0041] In some embodiments of this application, the specific process of determining a reference interval based on the target data row and the insertion position includes: when the insertion position indicates that each inserted data row is before the target data row, determining the preceding data row of the target data row; when the preceding data row exists, determining the first row of data of the preceding data row and the second row of data of the target data row; obtaining the initial sorting number corresponding to the first row of data and the initial sorting number corresponding to the second row of data from the pre-stored mapping relationship between the initial sorting number and the initial row data of each data row, and using them as the initial sorting number of the preceding data row and the initial sorting number of the target data row; combining the initial sorting number of the preceding data row and the initial sorting number of the target data row into a reference interval; or, when the preceding data row does not exist, combining 0 with the initial sorting number of the target data row into a reference interval.

[0042] In one possible implementation, if the insertion position is before the target data row: find the row preceding the target data row (if it exists). The reference interval is [the sort number of the previous row, the sort number of the target data row]. If the target data row is the first row, the reference interval is [0, the sort number of the target data row].

[0043] For example, if a user wants to... Figure 2 Insert two rows of data before the second row in the previous row. The previous row already exists, and the reference range is [1000, 2000]. If the user wants to... Figure 2 Insert two rows of data before the first row in the array. At this time, the previous row does not exist, and the reference range is [0, 1000].

[0044] In some embodiments of this application, the specific process of determining a reference interval based on the target data row and the insertion position includes: when the insertion position indicates that each inserted data row is after the target data row, determining the next data row of the target data row; when the next data row exists, determining the first row of data in the next data row and the second row of data in the target data row; obtaining the initial sorting number corresponding to the first row of data and the initial sorting number corresponding to the second row of data from the pre-stored mapping relationship between the initial sorting number and the row data of each data row, and using them as the initial sorting number of the next data row and the initial sorting number of the target data row; combining the initial sorting number of the target data row and the initial sorting number of the next data row into a reference interval; or, when the next data row does not exist, summing the initial sorting number of the target data row with a preset step size to obtain a spare sorting number; combining the initial sorting number of the target data row and the spare sorting number into a reference interval.

[0045] In one possible implementation, if the insertion position is after the target data row: find the next row of the target data row (if it exists). The reference interval is [the sort number of the target data row, the sort number of the next row]. If the target data row is the last row, then the reference interval is [the sort number of the target data row, the sort number of the target data row + ...]. ].

[0046] For example, if a user wants to... Figure 2 Insert two rows of data after the second row in the original data structure. At this point, a second row exists, with a reference range of [2000, 3000]. If the user wants to... Figure 2 Insert two rows of data after the fifth row. At this time, there is no next row. The reference range is [5000, 5000+1000].

[0047] For example Figure 4 As shown, Figure 4 This is a flowchart illustrating a reference interval determination method provided in this application. It determines the insertion position; if the insertion position is before the target data row, it proceeds to the logic preceding the target data row; if the insertion position is after the target data row, it proceeds to the logic following the target data row.

[0048] The logic before entering the target data row is as follows: Determine the preceding data row. Check if the preceding data row exists; if it does, obtain its initial sort number. If it does not exist, use 0 as the starting value of the reference interval. Obtain the initial sort number of the target data row. Finally, the reference intervals can be combined.

[0049] The logic after entering the target data row is as follows: Determine the next data row after the target data row. Check if the next data row exists: if it exists, obtain the initial sort number of the next data row. If it does not exist, calculate the alternative sort number (initial sort number of the target data row + preset step size). Obtain the initial sort number of the target data row. Finally, the reference interval can be combined.

[0050] In some embodiments of this application, the specific process of determining the row spacing between each inserted data row based on a reference interval includes: calculating the absolute value of the difference between two parameters in the reference interval to obtain the spatial size of the reference interval; calculating the ratio between the spatial size and the total number of rows plus 1 to obtain the row spacing between each inserted data row; wherein, the row spacing... The calculation formula is:

[0051] in, The size of the reference interval Total number of rows; space size The calculation formula is: ; in, and These are two parameters within the reference interval, and the two parameters are sort numbers.

[0052] In one possible implementation, it is based on the starting sort number of the reference interval. and end sort number Calculate the space size using the total number of rows. and space size ( ), calculate the row spacing.

[0053] For example, if a user wants to... Figure 2 Insert two rows of data before the second row in the previous row. The previous row already exists, and the reference range is [1000, 2000]. The space size is now 2000 - 1000 = 1000.

[0054] line spacing = .

[0055] It should be noted that in the initial spreadsheet, because the initial sort number between adjacent rows is based on a dynamic step size, the space between adjacent rows is equal to the preset step size. However, as new data is continuously inserted between adjacent rows, the space will no longer be equal to the initial sort number. Figure 2 The result of inserting two rows of data before the second row in the example is as follows: Figure 5 As shown, based on Figure 2 During operation, the space size is set to a preset step size of 1000, but if the user... Figure 5 When inserting a data entry before the second row of data, the space required is 1333.333333 - 1000 = 333.333333, instead of the preset step size of 1000. The result of this insertion would be, for example... Figure 6 As shown, the computational logic set up in this application is not redundant.

[0056] S103, calculate the target sort number for each inserted data row in an incremental manner based on the row interval and the total number of rows; In some embodiments of this application, the specific process of calculating the target sort number of each inserted data row in an incremental manner based on the row interval and the total number of rows includes: starting from 1, marking each inserted data row with a temporary row number in an incremental manner to obtain the row number of each inserted data row, with the row number of the last inserted data row being the total number of rows; multiplying the row interval by the row number of each inserted data row to obtain the product value of each inserted data row; summing the smaller value in the reference interval with the product value of each inserted data row to obtain the target sort number of each inserted data row; wherein, the target sort number of each inserted data row... The calculation expression is as follows:

[0057] in, The smaller value in the reference interval. This refers to the row number where the data will be inserted. This is the row spacing between each inserted data row.

[0058] For example Figure 7 In the insertion example shown, the user in Figure 2 Insert two rows of data before the second row in the reference range. The space size is now 1000, the row spacing is 333.33, and the smaller value in the reference range is used. ) is 1000, temporary line number From 1 to 2, for each inserted row: Insert row 1 = 1000 + 1 × 333.33 = 1333.33; Insert row 2 = 1000 + 2 × 333.33 = 1666.66.

[0059] S104 stores the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row.

[0060] In some embodiments of this application, the specific process of storing the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row includes: using the Elasticsearch algorithm to distribute the target sort number of each inserted data row and the row data of each inserted data row across multiple storage nodes to generate a distributed index; and establishing the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row through the distributed index.

[0061] In other embodiments of this application, the specific process of storing the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row includes: using the target sort number of each inserted data row as a key; using the row data of each inserted data row as a value; and establishing the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row in the database in the form of key-value pairs.

[0062] Furthermore, after storing the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row, when the user views all the online spreadsheets, in response to the user's visualization command for the first spreadsheet in the MES system, the system obtains the current sort number of each current data row in the first spreadsheet; loads the pre-stored mapping relationship between the initial sort number and the initial row data of each data row; obtains the current row data corresponding to the current sort number of each current data row from the mapping relationship; and displays the current row data corresponding to the current sort number of each current data row in the form of a table, in ascending order of the current sort number.

[0063] For example Figure 8 As shown, Figure 8 This application provides a schematic flowchart of a data row processing procedure for a spreadsheet based on dynamic step size. First, the spreadsheet is initialized, assigning an initial sort number to each row of data. Then, the initial sort number of each row is stored along with its corresponding row data, establishing a mapping relationship. Finally, the system waits to receive the user's data row insertion command. Based on the user command, the target data row (i.e., the row where the insertion point is located) and the insertion position (before or after the target data row) are determined. A reference interval is determined based on the insertion position: if the insertion position is before the target data row, the starting point of the reference interval is the sort number of the row preceding the target data row, and the ending point is the sort number of the target data row. If the insertion position is after the target data row, the starting point of the reference interval is the sort number of the target data row, and the ending point is the sort number of the row following the target data row. If the target data row is the first row (the previous row does not exist), the starting point of the reference interval is set to 0, and the ending point is the sort number of the target data row. If the target data row is the last row (the following row does not exist), the ending point of the reference interval is set to the sort number of the target data row plus a preset step size. The difference between the two sort numbers within the reference interval is calculated to obtain the space size Gap. Calculate the interval Delta between each row based on the gap and the number of rows to be inserted (k). Using Delta and the temporary row number (i), calculate the target sort number for each inserted row. Store the calculated target sort numbers and the data of the inserted rows to establish a new mapping. The insertion operation is complete, and the process ends.

[0064] In this embodiment, on the one hand, a data row processing method based on dynamic step size is adopted. When inserting a data row, the target sort number only needs to be calculated within a local range of the dynamic step size, with a constant-order computation time of O(1), independent of the total table length. Therefore, the system response speed remains highly efficient regardless of the size of the table data. On the other hand, the data row processing method based on dynamic step size only needs to update the target sort number of the inserted row, without modifying the sort numbers of other existing rows, which significantly reduces the number of database write operations, typically only the number of inserted rows K. Therefore, the system load is significantly reduced, the I / O operation frequency is greatly reduced, thereby improving the system's concurrent processing capability and overall performance.

[0065] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0066] Please see Figure 9 This illustration shows a schematic diagram of a data row processing device for a spreadsheet based on dynamic step size, provided in an exemplary embodiment of this application. This data row processing device for a spreadsheet based on dynamic step size can be implemented as all or part of an electronic device through software, hardware, or a combination of both. The device 1 includes a parameter acquisition module 10, a parameter determination module 20, a target sequence number calculation module 30, and a storage module 40.

[0067] The parameter acquisition module 10 is used to respond to the user's instruction to insert data rows in the original spreadsheet displayed by the MES system, and to obtain the target data row selected by the user, the insertion position, and the total number of data rows to be inserted; wherein, the sort numbers between adjacent data rows in the original spreadsheet are not continuous and are arithmetic progressions with dynamically adjusted step sizes. The parameter determination module 20 is used to determine the reference interval based on the target data row and the insertion position; and to determine the row spacing between each inserted data row based on the reference interval. The target sort number calculation module 30 is used to calculate the target sort number of each inserted data row in an incremental manner based on the row interval and the total number of rows. Storage module 40 is used to store the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row.

[0068] It should be noted that the data row processing device for spreadsheets based on dynamic step size provided in the above embodiments is only illustrated by the division of the above functional modules when executing the data row processing method for spreadsheets based on dynamic step size. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the data row processing device for spreadsheets based on dynamic step size provided in the above embodiments and the data row processing method embodiments for spreadsheets based on dynamic step size belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.

[0069] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0070] In this embodiment, on the one hand, a data row processing method based on dynamic step size is adopted. When inserting a data row, the target sort number only needs to be calculated within a local range of the dynamic step size, with a constant-order computation time of O(1), independent of the total table length. Therefore, the system response speed remains highly efficient regardless of the size of the table data. On the other hand, the data row processing method based on dynamic step size only needs to update the target sort number of the inserted row, without modifying the sort numbers of other existing rows, which significantly reduces the number of database write operations, typically only the number of inserted rows K. Therefore, the system load is significantly reduced, the I / O operation frequency is greatly reduced, thereby improving the system's concurrent processing capability and overall performance.

[0071] This application also provides a computer-readable medium having program instructions stored thereon, which, when executed by a processor, implement the data row processing method of a spreadsheet based on dynamic step size provided in the above-described method embodiments.

[0072] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the spreadsheet data row processing method based on dynamic step size described in the various method embodiments above.

[0073] Please see Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 10 As shown, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.

[0074] The communication bus 1002 is used to realize the connection and communication between these components.

[0075] The user interface 1003 may include a display screen and a camera. Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.

[0076] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0077] The processor 1001 may include one or more processing cores. The processor 1001 connects to various parts within the electronic device 1000 using various interfaces and lines. It executes various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and by calling data stored in the memory 1005. Optionally, the processor 1001 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 1001 may integrate one or more of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the screen; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip, without being integrated into the processor 1001.

[0078] The memory 1005 may include random access memory (RAM) or read-only memory. Optionally, the memory 1005 may include a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 1005 may also be at least one storage system located remotely from the aforementioned processor 1001. Figure 10 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a spreadsheet data row processing application based on dynamic step size.

[0079] exist Figure 10 In the illustrated electronic device 1000, the user interface 1003 is mainly used to provide an input interface for the user and to acquire user-input data; while the processor 1001 can be used to call the spreadsheet data row processing application based on dynamic step size stored in the memory 1005, and specifically perform the following operations: In response to the user's command to insert data rows into the original spreadsheet displayed by the MES system, the system obtains the target data row selected by the user, the insertion position, and the total number of data rows to be inserted; wherein, the sort numbers between adjacent data rows in the original spreadsheet are not consecutive and are arithmetic progressions with dynamically adjusted step sizes; Determine the reference interval based on the target data row and the insertion position; determine the row spacing between each inserted data row based on the reference interval. Calculate the target sort number for each inserted data row in an incremental manner, based on the row interval and the total number of rows. Store the mapping between the target sort number of each inserted data row and the row data of each inserted data row.

[0080] In one embodiment, when the processor 1001 determines the reference interval based on the target data row and the insertion position, it specifically performs the following operations: If the insertion position indicates that each inserted data row is before the target data row, determine the data row preceding the target data row; If the previous data row exists, determine the first row of data in the previous data row and the second row of data in the target data row; From the pre-stored mapping relationship between the initial sort number of each data row and the initial row data, obtain the initial sort number corresponding to the first row of data and the initial sort number corresponding to the second row of data, and use them as the initial sort number of the previous data row and the initial sort number of the target data row. Combine the initial sort number of the previous data row and the initial sort number of the target data row to form a reference range; or, If the previous data row does not exist, combine 0 with the initial sort number of the target data row to form a reference range.

[0081] In one embodiment, when the processor 1001 determines the reference interval based on the target data row and the insertion position, it specifically performs the following operations: If the insertion position indicates that each inserted data row is after the target data row, determine the next data row after the target data row; If the next data row exists, determine the first row of data in the next data row and the second row of data in the target data row; From the pre-stored mapping relationship between the initial sort number of each data row and the row data, obtain the initial sort number corresponding to the first row of data and the initial sort number corresponding to the second row of data, and use them as the initial sort number of the next data row and the initial sort number of the target data row. Combine the initial sort number of the target data row and the initial sort number of the next data row to form a reference interval; or, If the next data row does not exist, the initial sort number of the target data row is summed with the preset step size to obtain the spare sort number; the initial sort number and spare sort number of the target data row are combined to form a reference interval.

[0082] In one embodiment, when the processor 1001 determines the row interval between each inserted data row based on the reference interval, it specifically performs the following operations: Calculate the absolute value of the difference between two parameters in the reference interval to obtain the spatial size of the reference interval; Calculate the ratio between the space size and the total number of rows plus 1 to obtain the row spacing between each inserted data row; where, the row spacing... The calculation formula is:

[0083] in, The size of the reference interval Total number of rows; space size The calculation formula is: ; in, and These are two parameters within the reference interval, and the two parameters are sort numbers.

[0084] In one embodiment, when the processor 1001 calculates the target sort number for each inserted data row in an incremental manner based on the row interval and the total number of rows, it specifically performs the following operations: Starting from 1, each inserted data row is marked with a temporary row number in an incremental manner to obtain the row number of each inserted data row. The row number of the last inserted data row is the total number of rows. Multiply the row interval by the row number of each inserted data row to obtain the product value of each inserted data row; The target sort number for each inserted data row is obtained by summing the products of the smaller value in the reference interval and each inserted data row; where, The target sort number for each inserted data row The calculation expression is as follows:

[0085] in, The smaller value in the reference interval. This refers to the row number where the data will be inserted. This is the row spacing between each inserted data row.

[0086] In one embodiment, before executing a data row insertion instruction in response to a user's display of a raw spreadsheet to the MES system, the processor 1001 also performs the following operations: Receive new spreadsheets uploaded by users to the MES system as the original spreadsheets; Assign an initial sort number to each data row in the original spreadsheet to obtain the initial sort number of each data row; wherein the initial sort numbers between adjacent data rows are not consecutive and are arithmetic progressions with dynamically adjusted step sizes; Retrieve the raw row data for each data row; Store the mapping relationship between the initial sort number of each data row and the original row data; where the initial sort number of each data row... The calculation formula is:

[0087] in, The row number for each data row. The step size is dynamically adjusted.

[0088] In one embodiment, after executing the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row, the processor 1001 also performs the following operations: In response to the user's visualization command for the first spreadsheet in the MES system, obtain the current sort number of each current data row in the first spreadsheet; Load the pre-stored mapping between the initial sort number of each data row and the initial row data; From the mapping relationship, retrieve the current row data corresponding to the current sort number of each current data row; The data for each current row is displayed in a table format, arranged in ascending order of the current sort number.

[0089] In one embodiment, when the processor 1001 executes the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row, it specifically performs the following operations: Using the Elasticsearch algorithm, the target sort number of each inserted data row and the row data of each inserted data row are distributed and stored on multiple storage nodes to generate a distributed index; A distributed index is used to establish a mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row.

[0090] In one embodiment, when the processor 1001 executes the mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row, it specifically performs the following operations: Use the target sort number of each inserted data row as the key; Use the row data of each inserted data row as the value; Establish a mapping relationship between the target sort number of each inserted data row and the row data of each inserted data row in the database in the form of key-value pairs.

[0091] In this embodiment, on the one hand, a data row processing method based on dynamic step size is adopted. When inserting a data row, the target sort number only needs to be calculated within a local range of the dynamic step size, with a constant-order computation time of O(1), independent of the total table length. Therefore, the system response speed remains highly efficient regardless of the size of the table data. On the other hand, the data row processing method based on dynamic step size only needs to update the target sort number of the inserted row, without modifying the sort numbers of other existing rows, which significantly reduces the number of database write operations, typically only the number of inserted rows K. Therefore, the system load is significantly reduced, the I / O operation frequency is greatly reduced, thereby improving the system's concurrent processing capability and overall performance.

[0092] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program for processing data rows in a spreadsheet based on dynamic step sizes can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The storage medium for the program for processing data rows in a spreadsheet based on dynamic step sizes can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.

[0093] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A method for processing data rows in a spreadsheet based on dynamic step size, characterized in that, The method comprises: In response to a user's data row insertion instruction for an original electronic form displayed by an MES system, obtaining a target data row selected by the user, an insertion position, and a total number of inserted insertion data rows; wherein the order numbers between adjacent data rows in the original electronic form are discontinuous and equidifferent and have a dynamically adjusted step size; According to the target data row and the insertion position, determining a reference interval; according to the reference interval, determining the row interval between each insertion data row; According to the row interval and the total number of rows, calculating the target order number of each insertion data row in an incremental manner; Storing the mapping relationship between the target order number of each insertion data row and the row data of each insertion data row.

2. The method of claim 1, wherein, The reference interval is determined according to the target data row and the insertion position, comprising: In the case that the insertion position indicates that the insertion data rows are before the target data row, determining a previous data row of the target data row; In the case that the previous data row exists, determining the first row data of the previous data row and the second row data of the target data row; From the pre-stored mapping relationship between the initial order number and the initial row data of each data row, obtaining the initial order number corresponding to the first row data and the initial order number corresponding to the second row data as the initial order number of the previous data row and the initial order number of the target data row; The initial order number of the previous data row and the initial order number of the target data row are combined as a reference interval; or, In the case that the previous data row does not exist, 0 and the initial order number of the target data row are combined as a reference interval.

3. The method of claim 1, wherein, The reference interval is determined according to the target data row and the insertion position, comprising: In the case that the insertion position indicates that the insertion data rows are after the target data row, determining a next data row of the target data row; In the case that the next data row exists, determining the first row data of the next data row and the second row data of the target data row; From the pre-stored mapping relationship between the initial order number and the row data of each data row, obtaining the initial order number corresponding to the first row data and the initial order number corresponding to the second row data as the initial order number of the next data row and the initial order number of the target data row; The initial order number of the target data row and the initial order number of the next data row are combined as a reference interval; or, In the case that the next data row does not exist, the initial order number of the target data row is summed with a preset step size to obtain a backup order number; the initial order number of the target data row and the backup order number are combined as a reference interval.

4. The method of claim 1, wherein, The row interval between each insertion data row is determined according to the reference interval, comprising: Calculating the absolute value of the difference between the two parameters in the reference interval to obtain the space size of the reference interval; a ratio between the space size and the total row number plus 1 is calculated to obtain a row interval between each inserted data row; wherein the row interval is calculated by the following formula: wherein, is a space size of the reference interval, is the total number of rows; the space size The calculation formula is: ; wherein and are two parameters in the reference interval, the two parameters being rank numbers.

5. The method of claim 1, wherein, The target order number of each insertion data row is calculated in an incremental manner according to the row interval and the total number of rows, comprising: starting from 1, mark a temporary row number for each inserted data row in an ascending manner to obtain a row number of each inserted data row, and a row number of a last inserted data row is the total number of rows; multiply the row interval and the row number of each inserted data row to obtain a product value of each inserted data row; sum the smaller value in the reference interval and the product value of each inserted data row to obtain a target ranking number of each inserted data row; wherein, the target sequence number of each inserted data row The computational expression is wherein is the smaller value of the reference interval, is the row number of the inserted data row, is the row spacing between the respective inserted data rows.

6. The method according to any one of claims 1 to 5, characterized in that, before the step of responding to the user's data row insertion instruction for the original electronic table displayed by the MES system, the method further comprises: receiving a new electronic table uploaded by the user to the MES system as the original electronic table; assigning an initial ranking number to each data row in the original electronic table to obtain an initial ranking number of each data row; wherein, the initial ranking numbers between adjacent data rows are discontinuous and equidifferent with a dynamically adjusted step size; obtaining the original row data of each data row; store a mapping relationship between the initial sorting number of each data row and the original row data; wherein the initial sorting number of each data row The calculation formula is: wherein is a row number for each data row, is a dynamically adjusted step size.

7. The method according to any one of claims 1 to 5, characterized in that, after the step of storing the mapping relationship between the target ranking number of each inserted data row and the row data of each inserted data row, the method further comprises: in response to the user's visualization instruction for the first electronic table in the MES system, obtaining a current ranking number of each current data row in the first electronic table; loading the pre-stored mapping relationship between the initial ranking number of each data row and the initial row data; from the mapping relationship, obtaining the current row data corresponding to the current ranking number of each current data row; displaying the current row data corresponding to the current ranking number of each current data row in the form of a table in the order from small to large according to the current ranking number.

8. The method according to any one of claims 1 to 5, characterized in that, the step of storing the mapping relationship between the target ranking number of each inserted data row and the row data of each inserted data row comprises: using the Elasticsearch algorithm to store the target ranking number of each inserted data row and the row data of each inserted data row on multiple storage nodes to generate a distributed index; through the distributed index, establishing the mapping relationship between the target ranking number of each inserted data row and the row data of each inserted data row.

9. The method according to any one of claims 1 to 5, characterized in that, the step of storing the mapping relationship between the target ranking number of each inserted data row and the row data of each inserted data row comprises: using the target ranking number of each inserted data row as a key; using the row data of each inserted data row as a value; establishing the mapping relationship between the target ranking number of each inserted data row and the row data of each inserted data row in the form of a binary tuple of key-value pairs in the database.

10. A dynamic step-based spreadsheet data row processing system, comprising: the system comprises: a parameter acquisition module configured to, in response to a user's data row insertion instruction for an original electronic table displayed by an MES system, acquire a target data row, an insertion position, and a total number of inserted data rows selected by the user; wherein, the ranking numbers between adjacent data rows in the original electronic table are discontinuous and equidifferent with a dynamically adjusted step size; A parameter determining module is configured to determine a reference interval according to the target data row and the insertion position, and determine an inter-row interval between each inserted data row according to the reference interval; A target sequence number calculating module is configured to calculate a target sequence number of each inserted data row in an increasing manner according to the inter-row interval and the total number of rows; A storage module is configured to store a mapping relationship between the target sequence number of each inserted data row and the row data of each inserted data row.

Citation Information

Patent Citations

  • Database insertion sorting method

    CN109241064A

  • Number generation method and system after data is inserted into online table and storage medium

    CN117494678A