CN109101473B - Method and apparatus for processing two-dimensional data table - Google Patents

Method and apparatus for processing two-dimensional data table Download PDF

Info

Publication number
CN109101473B
CN109101473B CN201810904854.0A CN201810904854A CN109101473B CN 109101473 B CN109101473 B CN 109101473B CN 201810904854 A CN201810904854 A CN 201810904854A CN 109101473 B CN109101473 B CN 109101473B
Authority
CN
China
Prior art keywords
operation information
target
data table
dimensional data
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810904854.0A
Other languages
Chinese (zh)
Other versions
CN109101473A (en
Inventor
赵沐为
程荣
郝郁
袁闻骞
钟姿艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810904854.0A priority Critical patent/CN109101473B/en
Publication of CN109101473A publication Critical patent/CN109101473A/en
Application granted granted Critical
Publication of CN109101473B publication Critical patent/CN109101473B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/183Tabulation, i.e. one-dimensional positioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets

Abstract

The embodiment of the application discloses a method and a device for processing a two-dimensional data table. One embodiment of the method comprises: receiving an operation information processing instruction related to a target two-dimensional data table; if the operation information processing instruction belongs to a deleting instruction or a modifying instruction, executing the following processing steps: based on the operation information processing instruction, correspondingly processing target operation information in an operation information sequence associated with the target two-dimensional data table, wherein the target operation information is operation information pointed by the operation information processing instruction; and determining the processed operation information sequence as a new sequence, and editing the target two-dimensional data table based on the new sequence. According to the implementation mode, the client side is used for editing the target two-dimensional data table in real time based on the operation information sequence by adopting a mode of associating the target two-dimensional data table with the operation information sequence, so that the editing efficiency is improved, and the waiting time of a user for an editing result is effectively shortened.

Description

Method and apparatus for processing two-dimensional data table
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for processing a two-dimensional data table.
Background
The two-dimensional data table is a data table consisting of rows and columns. In a two-dimensional data table, each column may be referred to as a field and each row may be referred to as a record.
The existing method for processing the two-dimensional data table is generally applied to a server side. For example, when a user needs to perform a transformation operation on a two-dimensional data table displayed on a web page (for example, create a new column/row, display/hide a column, etc.), the user generally needs to send a corresponding request to a server through a browser, so that the server performs corresponding processing on the two-dimensional data table. Since network transmission is required for processing the two-dimensional data table at the server, the user generally needs to spend a long time waiting for the processing result.
Disclosure of Invention
The embodiment of the application provides a method and a device for processing a two-dimensional data table.
In a first aspect, an embodiment of the present application provides a method for processing a two-dimensional data table, where the method is applied to a client, and the method includes: receiving an operation information processing instruction related to a target two-dimensional data table, wherein the category of the operation information processing instruction comprises a deleting instruction and a modifying instruction; if the received operation information processing instruction belongs to a deleting instruction or a modifying instruction, executing the following processing steps: based on the received operation information processing instruction, correspondingly processing target operation information in an operation information sequence associated with the target two-dimensional data table, wherein the target operation information is operation information pointed by the received operation information processing instruction; and determining the processed operation information sequence as a new sequence, and editing the target two-dimensional data table based on the new sequence.
In some embodiments, the target operation information is not located at the head and tail of the operation information sequence; and performing editing operation on the target two-dimensional data table based on the new sequence, wherein the editing operation comprises the following steps: restoring the target two-dimensional data table to a state after the operation indicated by the last piece of operation information of the target operation information is executed; selecting the next operation information of the previous operation information as the operation information to be executed in the new sequence, and executing the following judgment sub-operations: determining whether the operation information to be executed meets corresponding preset execution conditions; if yes, executing the operation indicated by the operation information to be executed on the target two-dimensional data table, determining whether the operation information in the sequence order of the operation information to be executed exists in the new sequence, and if not, ending the judgment sub-operation; if the operation information exists, the next piece of operation information of the operation information to be executed is selected in the new sequence to serve as the operation information to be executed, and the judgment sub-operation is continuously executed.
In some embodiments, the editing operation is performed on the target two-dimensional data table based on the new sequence, further comprising: and responding to the fact that the operation information to be executed does not meet the corresponding preset execution condition, generating prompt information, and outputting the prompt information to prompt a user to modify the operation information to be executed.
In some embodiments, based on the new sequence, an editing operation is performed on the target two-dimensional data table, including: and if the new sequence is a null sequence, restoring the target two-dimensional data table to the initial state.
In some embodiments, the category further includes a new instruction; and the above method further comprises: and if the received operation information processing instruction belongs to the new instruction, generating operation information based on the received operation information processing instruction, and executing the operation indicated by the generated operation information on the target two-dimensional data table.
In some embodiments, the above method further comprises: and in response to receiving a data display instruction which is related to the target two-dimensional data table and comprises a display mode identifier, displaying the data in the target two-dimensional data table in a display mode indicated by the display mode identifier.
In a second aspect, an embodiment of the present application provides an apparatus for processing a two-dimensional data table, where the apparatus is applied to a client, and the apparatus includes: a receiving unit configured to receive an operation information processing instruction related to a target two-dimensional data table, wherein a category of the operation information processing instruction includes a deletion instruction and a modification instruction; a first processing unit configured to execute the following processing steps if the received operation information processing instruction belongs to a delete instruction or a modify instruction: based on the received operation information processing instruction, correspondingly processing target operation information in an operation information sequence associated with the target two-dimensional data table, wherein the target operation information is operation information pointed by the received operation information processing instruction; and determining the processed operation information sequence as a new sequence, and editing the target two-dimensional data table based on the new sequence.
In some embodiments, the target operation information is not located at the head and tail of the operation information sequence; and the first processing unit is further configured to: restoring the target two-dimensional data table to a state after the operation indicated by the last piece of operation information of the target operation information is executed; selecting the next operation information of the previous operation information as the operation information to be executed in the new sequence, and executing the following judgment sub-operations: determining whether the operation information to be executed meets corresponding preset execution conditions; if yes, executing the operation indicated by the operation information to be executed on the target two-dimensional data table, determining whether the operation information in the sequence order of the operation information to be executed exists in the new sequence, and if not, ending the judgment sub-operation; if the operation information exists, the next operation information of the operation information to be executed is selected from the new sequence as the operation information to be executed, and the judgment sub-operation is continuously executed.
In some embodiments, the first processing unit is further configured to: and generating prompt information in response to the fact that the to-be-executed operation information does not meet the corresponding preset execution condition, and outputting the prompt information to prompt a user to modify the to-be-executed operation information.
In some embodiments, the first processing unit is further configured to: and if the new sequence is a null sequence, restoring the target two-dimensional data table to the initial state.
In some embodiments, the category further includes a new instruction; and the above apparatus further comprises: and a second processing unit configured to generate operation information based on the received operation information processing instruction and execute an operation indicated by the generated operation information on the target two-dimensional data table if the received operation information processing instruction belongs to the new instruction.
In some embodiments, the above apparatus further comprises: and the display unit is configured to respond to the received data display instruction which is related to the target two-dimensional data table and comprises a display mode identifier, and display the data in the target two-dimensional data table in a display mode indicated by the display mode identifier.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon; when executed by the one or more processors, cause the one or more processors to implement a method as described in any implementation of the first aspect.
In a fourth aspect, the present application provides a computer-readable medium, on which a computer program is stored, which when executed by a processor implements the method described in any implementation manner of the first aspect.
According to the method and the device for processing the two-dimensional data table, the operation information processing instruction related to the target two-dimensional data table is received, so that when the received operation information processing instruction belongs to a deleting instruction or a modifying instruction, the following processing steps are executed: based on the received operation information processing instruction, correspondingly processing the target operation information (the operation information pointed by the received operation information processing instruction) in the operation information sequence associated with the target two-dimensional data table; and determining the processed operation information sequence as a new sequence, and editing the target two-dimensional data table based on the new sequence. The method effectively utilizes the mode of associating the target two-dimensional data table with the operation information sequence at the client, so that the client can edit the target two-dimensional data table in real time based on the operation information sequence, the editing efficiency is improved, and the waiting time of a user for an editing result is effectively shortened.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram for one embodiment of a method for processing a two-dimensional data table according to the present application;
FIG. 3 is a schematic illustration of an application scenario of a method for processing a two-dimensional data table according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for processing a two-dimensional data table according to the present application;
FIG. 5 is a block diagram illustrating one embodiment of an apparatus for processing a two-dimensional data table according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the present method for processing a two-dimensional data table or apparatus for processing a two-dimensional data table may be applied.
As shown in fig. 1, the system architecture 100 may include a user 101 and a client 102.
The user 101 may perform a preset operation on the web page provided by the client 102 to trigger a corresponding instruction, for example, an operation information processing instruction related to the target two-dimensional data table.
The client 102 may receive the operation information processing instruction, and perform processing such as analysis on the operation information processing instruction. The client 102 may have various communication client applications installed thereon, such as a web browser application.
The client may be hardware or software. When the client is hardware, it can be various electronic devices including, but not limited to, a smart phone, a tablet computer, a laptop portable computer, a desktop computer, and the like. When the client is software, it may be a web browser application or the like, which may be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the method for processing the two-dimensional data table provided in the embodiment of the present application is generally performed by the client 102, and accordingly, the apparatus for processing the two-dimensional data table is generally disposed in the information client 102.
It should be understood that the number of clients in fig. 1 is merely illustrative. There may be any number of clients, as desired for the implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for processing a two-dimensional data table in accordance with the present application is shown. The process 200 of the method for processing a two-dimensional data table comprises the following steps:
step 201, receiving an operation information processing instruction related to a target two-dimensional data table.
In the present embodiment, an execution subject (e.g., the client 102 shown in fig. 1) of the method for processing a two-dimensional data table may receive, in real time, an operation information processing instruction related to a target two-dimensional data table, which is triggered by a user.
The category of the operation information processing instruction may include a deletion instruction and a modification instruction. The operation information processing instruction may include, for example, an identification of the operation information to which it points. If the operation information processing instruction belongs to the modification instruction, the operation information processing instruction can also comprise new content for replacing the content in the operation information while comprising the identification of the pointed operation information. Here, the operation information may be information for instructing a corresponding operation to be performed on the target two-dimensional data table. For example, the operation information is used to instruct operations such as new row creation, new column creation, hiding/displaying a row, hiding/displaying a column, deleting/modifying a row, deleting/modifying a column, or sorting the target two-dimensional data table.
It should be noted that the target two-dimensional data table may be a two-dimensional data table displayed on a web page provided by the execution subject to the user. The target two-dimensional data table is generally a light-weight (relatively small data amount, relatively simple deformation operation) two-dimensional data table. In practice, the user may configure the data source on a web page provided by the execution body as described above. The execution body may obtain data from the data source, and display the obtained data in a form of a two-dimensional data table.
It should be noted that, if the operation information processing instruction received by the execution main body belongs to a delete instruction or a modify instruction, it may indicate that the target two-dimensional data table is associated with an operation information sequence including at least one piece of operation information. The operation information sequence may be a sequence formed by the operation information generated for the target two-dimensional data table according to the generation time sequence.
In practice, the execution main body may display the operation information in the operation information sequence, and the deletion option and the modification option corresponding to the operation information on the web page, so that the user may select the deletion option to trigger a deletion instruction for the operation information, and select the modification option to trigger a modification instruction for the operation information.
In some optional implementations of this embodiment, the category may further include a new instruction. In practice, the execution body may present different types of operation options to the user on the web page, such as a new create row/column option, a delete row/column option, a sort option, a hide/show option, and so on. The execution main body can pop up a corresponding form in response to the detection that the operation option is selected, so that a user can configure corresponding information on the form, and trigger an operation information new instruction by submitting the form. Taking the sorting option as an example, the execution main body may pop up a form corresponding to the sorting option in response to detecting that the sorting option is selected, and the user may select a name of a row or a column on which sorting is based and a name of a sorting manner in the form, and then perform a form submission operation to send an operation information new instruction for the sorting operation to the execution main body. The sorting manner may include ascending and descending.
Step 202, if the received operation information processing instruction belongs to a delete instruction or a modify instruction, performing corresponding processing on the target operation information in the operation information sequence associated with the target two-dimensional data table based on the received operation information processing instruction.
In this embodiment, if the received operation information processing instruction belongs to a delete instruction or a modify instruction, the execution main body may perform corresponding processing on the target operation information in the operation information sequence associated with the target two-dimensional data table based on the received operation information processing instruction. The execution agent may then perform step 203. Wherein the target operation information is operation information to which the received operation information processing instruction points.
As an example, if the received operation information processing instruction belongs to a deletion instruction, the execution subject may delete the target operation information. If the received operation information processing instruction belongs to a modification instruction, the execution main body may modify the target operation information based on the received operation information processing instruction. For example, the new content included in the received operation information processing instruction is used to replace the corresponding content in the target operation information.
It should be noted that the operation information processing instruction may further include a category identifier of a category to which the operation information processing instruction belongs. The execution body may determine the category to which the operation information processing instruction belongs, based on the category identifier in the received operation information processing instruction.
And step 203, determining the processed operation information sequence as a new sequence, and editing the target two-dimensional data table based on the new sequence.
In this embodiment, the execution subject may determine the processed operation information sequence as a new sequence, and perform an editing operation on the target two-dimensional data table based on the new sequence.
For example, it is assumed that the operation information sequence includes at least two pieces of operation information, and the target operation information is located at the end of the operation information sequence. If the operation information processing instruction received by the execution main body belongs to a delete instruction, the operation information at the tail part of the new sequence is the last operation information of the target operation information. The executing body may cancel the operation indicated by the target operation information on the target two-dimensional data table, so as to restore the target two-dimensional data table to a state after the operation indicated by the previous operation information is executed. If the operation information processing instruction belongs to the modification instruction, the operation information at the tail part of the new sequence is the modified target operation information. The executing body may restore the target two-dimensional data table to a state after the execution of the operation indicated by the previous piece of operation information of the target operation information, and then execute the operation indicated by the modified target operation information on the target two-dimensional data table.
In some optional implementations of this embodiment, if the operation information sequence only includes the target operation information, and the operation information processing instruction received by the execution main body belongs to a delete instruction, the new sequence is a null sequence. At this time, the execution body may restore the target two-dimensional data table to an initial state (a state in which any deformation operation is not performed) in response to a determination that the new sequence is an empty sequence.
As an example, it is assumed that the initial state of the target two-dimensional data table is as shown in table 1. The target two-dimensional data table after the new total sorting operation is performed is shown in table 2. Wherein, the total score value is the sum of the scores of Chinese, English and mathematics. If the current target two-dimensional data table is the target two-dimensional data table shown in table 2, the target operation information is operation information indicating the new total sorting operation, and the new sequence is a null sequence, the execution subject may cancel the execution of the new total sorting operation on the target two-dimensional data table shown in table 2 to restore the target two-dimensional data table to the initial state shown in table 1.
Number learning Name(s) Chinese language English language Mathematics, and
001 king a certain medicine 90 85 70
002 A certain plum 85 90 80
TABLE 1
Number learning Name (I) Chinese language English language Mathematics, and total score
001 King a certain 90 85 70 245
002 Something in plum 85 90 80 255
TABLE 2
In some optional implementations of this embodiment, if the operation information sequence only includes target operation information, and the operation information processing instruction received by the execution main body belongs to a modification instruction, the new sequence only includes the modified target operation information. At this time, the executing entity may restore the target two-dimensional data table to the initial state, and then execute the operation indicated by the modified target operation information on the target two-dimensional data table.
For example, assume that the current target two-dimensional data table is as shown in table 2 above, and the initial state of the target two-dimensional data table is as shown in table 1 above. The target operation information is operation information for instructing the above-described new total sorting operation. The modified target operation information is operation information for indicating a newly created literal overall division operation, where the value of the literal overall division is the sum of the scores in the languages and english. If the new sequence only includes the modified target operation information, the executing agent may undo the execution of the new total sorting operation on the current target two-dimensional data table (as shown in table 2) to restore the target two-dimensional data table to the original state as shown in table 1. Then, the execution body may execute a new literature total ranking operation indicated by the modified target operation information on the target two-dimensional data table (as shown in table 1 above). The target two-dimensional data table after the new liberal art general sorting operation is performed is shown in table 3:
number learning Name (I) Chinese language English language Mathematics, knowledge and knowledge General score of literal arts
001 King a certain 90 85 70 175
002 A certain plum 85 90 80 175
TABLE 3
In some optional implementation manners of this embodiment, after the executing body performs an editing operation on the target two-dimensional data table, the edited target two-dimensional data table may be displayed.
In some optional implementations of this embodiment, if the operation information processing instruction received by the execution main body belongs to a new instruction, the execution main body may generate operation information based on the operation information processing instruction, and execute the operation indicated by the operation information on the target two-dimensional data table.
The operation information processing instruction may include configuration information of a user (for example, information configured in a corresponding form), and the execution main body may extract the configuration information from the operation information processing instruction to generate operation information including the configuration information. In addition, the execution main body can also allocate a corresponding identifier for the operation information, and add the operation information to the tail part of the operation information sequence associated with the target two-dimensional data table.
In some optional implementation manners of this embodiment, the execution subject may, in response to receiving a data display instruction that is related to the target two-dimensional data table and includes a display manner identifier, display data in the target two-dimensional data table in a display manner indicated by the display manner identifier. The presentation manners may include, but are not limited to, a bar graph, a pie graph, a two-dimensional data table, a line graph, a ring graph, a bar graph, and the like.
In some optional implementation manners of this embodiment, the execution main body may adopt an HTML (HyperText Markup Language) 5 Web Workers technology to implement multithread parallel processing, so that normal operation of other functions of the browser is not blocked, and user interface operation is not affected. The Web Workers is a technology added in HTML5 and used for implementing background processing in a Web application program. A web application is an application that can be accessed through a web page.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for processing a two-dimensional data table according to the present embodiment. In the application scenario of fig. 3, the target two-dimensional data table is associated with an operation information sequence [ a1, a2, A3], where a1, a2, and A3 are operation information arranged in chronological order. The target two-dimensional data table is a target two-dimensional data table in which the operations indicated by a1, a2, and A3 have been sequentially executed. If the user 301 wants to modify the operation information A3, the user 301 may perform a preset operation on the web page provided by the client 302 to trigger a modification instruction for the operation information A3. The client 302 may modify A3 in the operation information sequence a1, a2, A3 based on the modification instruction in response to receiving the modification instruction, as shown by reference numeral 303. Wherein the modified A3 can be represented as A3'. The client 302 may then determine the modified sequence of operation information as a new sequence [ A1, A2, A3' ], as represented by reference numeral 304. Then, as indicated by reference numeral 305, the client 302 may restore the target two-dimensional data table to a state after the operation indicated by a2 in the new sequence is performed. Finally, as indicated by reference numeral 306, the client 302 may perform the operation indicated by a3' in the new sequence on the target two-dimensional data table (the target two-dimensional data table after performing the steps indicated by reference numeral 305).
The method provided by the embodiment of the application effectively utilizes the mode of associating the target two-dimensional data table with the operation information sequence at the client, so that the client can edit the target two-dimensional data table in real time based on the operation information sequence, the editing efficiency is improved, and the waiting time of a user for an editing result is effectively shortened.
With further reference to FIG. 4, a flow 400 of yet another embodiment of a method for processing a two-dimensional data table is shown. The process 400 of the method for processing a two-dimensional data table includes the steps of:
step 401, receiving an operation information processing instruction related to a target two-dimensional data table.
In the present embodiment, an execution subject (e.g., the client 102 shown in fig. 1) of the method for processing a two-dimensional data table may receive, in real time, an operation information processing instruction related to a target two-dimensional data table, which is triggered by a user. The category of the operation information processing instruction may include a delete instruction, a modify instruction, and a new instruction. If the received operation information processing instruction belongs to a delete instruction or a modify instruction, the execution subject may execute step 402.
The target two-dimensional data table is generally a lightweight (relatively small data amount, relatively simple deformation operation) two-dimensional data table.
Step 402, if the received operation information processing instruction belongs to a delete instruction or a modify instruction, performing corresponding processing on the target operation information in the operation information sequence associated with the target two-dimensional data table, and determining the processed operation information sequence as a new sequence.
In this embodiment, if the received operation information processing instruction belongs to a delete instruction or a modify instruction, the execution main body may perform corresponding processing on the target operation information in the operation information sequence associated with the target two-dimensional data table, and determine the processed operation information sequence as a new sequence. The target operation information may be operation information to which the received operation information processing instruction points.
It should be noted that, if the target operation information is not located at the head and the tail of the operation information sequence, the execution body may execute step 403.
And step 403, restoring the target two-dimensional data table to a state after the operation indicated by the last piece of operation information of the target operation information is executed.
In this embodiment, if the target operation information is not located at the head and the tail of the operation information sequence, the execution body may restore the target two-dimensional data table to a state after the operation indicated by the previous operation information of the target operation information is executed. For example, if the operation information sequence is [ a1, a2, A3] and the target operation information is a2, the last operation information of the target operation information is a 1. The execution agent may restore the target two-dimensional data table to a state after the operation indicated by a1 is executed.
And step 404, selecting the next operation information of the previous operation information from the new sequence as the operation information to be executed.
In this embodiment, the executing entity may select a next piece of operation information of the previous piece of operation information from the new sequence as the operation information to be executed.
In addition, if the operation information processing instruction received by the execution main body belongs to a delete instruction, the next operation information of the previous operation information is actually the next operation information of the target operation information in the new sequence. For example, assume that the operation information sequence is [ a1, a2, A3], the target operation information is a2, and the new sequence is [ a1, A3 ]. The last piece of operation information of a2 is a1, and the next piece of operation information of a2 is A3. In the above new sequence, the next piece of operation information of a1 is A3.
If the operation information processing instruction received by the execution main body belongs to a modification instruction, in the new sequence, the next operation information of the previous operation information is actually the modified target operation information.
Step 405, determining whether the operation information to be executed meets corresponding preset execution conditions.
In this embodiment, the execution main body may determine whether the to-be-executed operation information satisfies a corresponding preset execution condition. If so, the executive agent may perform step 406; otherwise, the executing agent may execute step 407.
Here, each kind of operation information may be associated with a corresponding preset execution condition. Taking the operation information for indicating the operation of creating a new column as an example, such operation information may include the column name, value of the new column. The value of the new column may be represented by an expression within which the column name of an existing column in the target two-dimensional data table may be present. The preset execution condition corresponding to such operation information may include, for example: the column name in the new column value is the column name of the existing column in the target two-dimensional data table.
Further, taking the operation information for indicating the sorting operation as an example, such operation information may include the name of the row or column on which the sorting is based, and sorting manner information. The preset execution condition corresponding to such operation information may include, for example: the name of the row or column on which the sorting is based is the name of the existing row or column in the target two-dimensional data table.
It should be emphasized that the preset execution condition may be set according to actual needs, and this embodiment does not limit this aspect at all.
And step 406, in response to determining that the operation information to be executed meets the corresponding preset execution condition, executing the operation indicated by the operation information to be executed on the target two-dimensional data table.
In this embodiment, the executing body may execute the operation indicated by the to-be-executed operation information on the target two-dimensional data table in response to determining that the to-be-executed operation information satisfies the corresponding preset execution condition. The execution agent may then perform step 408.
Step 407, in response to determining that the operation information to be executed does not satisfy the corresponding preset execution condition, generating a prompt message, and outputting the prompt message.
In this embodiment, the executing body may generate a prompt message and output the prompt message in response to determining that the to-be-executed operation information does not satisfy the corresponding preset execution condition. Therefore, the user can be reminded to modify the operation information to be executed. The prompt message may be in the form of text, voice, or graphics.
Step 408, determining whether the operation information in the order of the operation information to be executed exists in the new sequence.
In this embodiment, after the execution of step 406, the execution main body may determine whether there is any operation information in the new sequence, which is in order of the operation information to be executed. If so, the executing agent may execute step 410; otherwise, the executing agent may execute step 409.
It should be noted that each piece of operation information in the new sequence may correspond to an index number. The execution main body may determine whether the operation information sequentially following the operation information to be executed exists in the new sequence by comparing the index number corresponding to the operation information to be executed with the index numbers corresponding to the other operation information in the new sequence or comparing the index number corresponding to the operation information to be executed with the length of the new sequence.
And step 409, in response to determining that the operation information in the order of the operation information to be executed does not exist in the new sequence, executing an ending operation.
In this embodiment, the executing body may execute an ending operation to end the editing operation on the target two-dimensional data table in response to determining that there is no operation information in the new sequence that is in order after the operation information to be executed.
Step 410, in response to determining that the operation information in the order of the operation information to be executed exists in the new sequence, selecting the next operation information of the operation information to be executed from the new sequence as the operation information to be executed.
In this embodiment, the executing body may select, in response to determining that there is operation information in the new sequence that is in order of the operation information to be executed, the next operation information of the operation information to be executed from the new sequence as the operation information to be executed. The execution body may then go to perform step 405.
In some optional implementation manners of this embodiment, if the operation information sequence includes at least two pieces of operation information, and the target operation information is located at a header of the operation information sequence, after the execution of the step 402, the execution main body may restore the target two-dimensional data table to an initial state. Then, the executing body may select the next piece of operation information of the target operation information or the modified target operation information in the new sequence as the operation information to be executed. The execution agent may then proceed to perform step 405.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for processing a two-dimensional data table in the present embodiment highlights that after the target two-dimensional data table is restored to the state after the operation indicated by the previous piece of operation information of the target operation information is executed, the operation information sequentially following the previous piece of operation information in the new sequence is executed in order to perform a series of editing operations on the target two-dimensional data table. In addition, when the operation information to be executed is determined not to meet the corresponding preset execution condition, prompt information is generated and output, so that a user can be reminded to modify the operation information to be executed in time. Therefore, the scheme described by the embodiment can realize the lightweight two-dimensional data table processing process based on the pipeline mode and running on the client.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present application provides an embodiment of an apparatus for processing a two-dimensional data table, which corresponds to the embodiment of the method shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the apparatus 500 for processing a two-dimensional data table of the present embodiment includes: the receiving unit 501 is configured to receive an operation information processing instruction related to a target two-dimensional data table, wherein the category of the operation information processing instruction may include a deletion instruction and a modification instruction; the first processing unit 502 is configured to, if the received operation information processing instruction belongs to a delete instruction or a modify instruction, perform the following processing steps: based on the received operation information processing instruction, correspondingly processing target operation information in an operation information sequence associated with the target two-dimensional data table, wherein the target operation information can be operation information pointed by the received operation information processing instruction; and determining the processed operation information sequence as a new sequence, and editing the target two-dimensional data table based on the new sequence.
In the present embodiment, in the apparatus 500 for processing a two-dimensional data table: the specific processing of the receiving unit 501 and the technical effect thereof can refer to the related description of step 201 in the embodiment corresponding to fig. 2, and the specific processing of the first processing unit 502 and the technical effect thereof can refer to the related descriptions of steps 202 and 203 in the embodiment corresponding to fig. 2, which are not repeated herein.
In some optional implementations of this embodiment, the target operation information is not located at the head and the tail of the operation information sequence; and the first processing unit 502 may be further configured to: restoring the target two-dimensional data table to a state after the operation indicated by the last piece of operation information of the target operation information is executed; selecting the next operation information of the previous operation information as the operation information to be executed in the new sequence, and executing the following judgment sub-operation: determining whether the operation information to be executed meets corresponding preset execution conditions; if yes, executing the operation indicated by the operation information to be executed on the target two-dimensional data table, determining whether the operation information in the sequence order of the operation information to be executed exists in the new sequence, and if not, ending the judgment sub-operation; if the operation information exists, the next operation information of the operation information to be executed is selected from the new sequence as the operation information to be executed, and the judgment sub-operation is continuously executed.
In some optional implementations of this embodiment, the first processing unit 502 may be further configured to: and generating prompt information in response to the fact that the to-be-executed operation information does not meet the corresponding preset execution condition, and outputting the prompt information to prompt a user to modify the to-be-executed operation information.
In some optional implementations of this embodiment, the first processing unit 502 may be further configured to: and if the new sequence is a null sequence, restoring the target two-dimensional data table to the initial state.
In some optional implementations of this embodiment, the category may further include a new instruction; and the apparatus 500 may further include: and a second processing unit (not shown in the figure) configured to generate operation information based on the received operation information processing instruction and execute an operation indicated by the generated operation information on the target two-dimensional data table if the received operation information processing instruction belongs to the new instruction.
In some optional implementations of this embodiment, the apparatus 500 may further include: and the display unit (not shown in the figure) is configured to respond to the received data display instruction which is related to the target two-dimensional data table and comprises a display mode identifier, and display the data in the target two-dimensional data table in a display mode indicated by the display mode identifier.
According to the device provided by the embodiment of the application, the mode that the target two-dimensional data table is associated with the operation information sequence is effectively utilized at the client, so that the client can edit the target two-dimensional data table in real time based on the operation information sequence, the editing efficiency is improved, and the waiting time of the user for the editing result of the target two-dimensional data table is effectively shortened.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use in implementing an electronic device (e.g., client 102 of FIG. 1) of an embodiment of the present application is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the use range of the embodiment of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. A driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or information storage device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit and a first processing unit. Here, the names of these units do not constitute a limitation on the unit itself in some cases, and for example, the receiving unit may also be described as a "unit that receives an operation information processing instruction relating to a target two-dimensional data table".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to: receiving an operation information processing instruction related to the target two-dimensional data table, wherein the category of the operation information processing instruction can comprise a deleting instruction and a modifying instruction; if the received operation information processing instruction belongs to a deleting instruction or a modifying instruction, executing the following processing steps: based on the received operation information processing instruction, correspondingly processing target operation information in an operation information sequence associated with the target two-dimensional data table, wherein the target operation information can be operation information pointed by the received operation information processing instruction; and determining the processed operation information sequence as a new sequence, and editing the target two-dimensional data table based on the new sequence.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (14)

1. A method for processing a two-dimensional data table, applied to a client, the method comprising:
receiving an operation information processing instruction related to a target two-dimensional data table, wherein the category of the operation information processing instruction comprises a deleting instruction and a modifying instruction;
if the received operation information processing instruction belongs to a deleting instruction or a modifying instruction, executing the following processing steps:
based on the received operation information processing instruction, correspondingly processing target operation information in an operation information sequence associated with a target two-dimensional data table, wherein the target operation information is operation information pointed by the received operation information processing instruction, and the operation information is information for indicating corresponding operation on the target two-dimensional data table;
and determining the processed operation information sequence as a new sequence, and editing the target two-dimensional data table based on the new sequence.
2. The method of claim 1, wherein the target operation information is not located at a head and a tail of the operation information sequence; and
and editing the target two-dimensional data table based on the new sequence, wherein the editing operation comprises the following steps:
restoring the target two-dimensional data table to a state after the operation indicated by the last piece of operation information of the target operation information is executed;
selecting the next operation information of the previous operation information in the new sequence as the operation information to be executed, and executing the following judgment sub-operation: determining whether the operation information to be executed meets corresponding preset execution conditions or not; if yes, executing the operation indicated by the operation information to be executed on the target two-dimensional data table, determining whether the operation information in the sequence order of the operation information to be executed exists in the new sequence, and if not, ending the judgment sub-operation;
and if so, selecting the next piece of operation information of the operation information to be executed in the new sequence as the operation information to be executed, and continuing to execute the judgment sub-operation.
3. The method of claim 2, wherein the editing the target two-dimensional data table based on the new sequence further comprises:
and generating prompt information in response to the fact that the operation information to be executed does not meet the corresponding preset execution condition, and outputting the prompt information to prompt a user to modify the operation information to be executed.
4. The method of claim 1, wherein the editing the target two-dimensional data table based on the new sequence comprises:
and if the new sequence is a null sequence, restoring the target two-dimensional data table to the initial state.
5. The method of claim 1, wherein the categories further include new instructions; and
the method further comprises the following steps:
and if the received operation information processing instruction belongs to the new instruction, generating operation information based on the received operation information processing instruction, and executing the operation indicated by the generated operation information on the target two-dimensional data table.
6. The method according to one of claims 1-5, wherein the method further comprises:
and in response to receiving a data display instruction which is related to the target two-dimensional data table and comprises a display mode identifier, displaying the data in the target two-dimensional data table by adopting the display mode indicated by the display mode identifier.
7. An apparatus for processing a two-dimensional data table, applied to a client, the apparatus comprising:
a receiving unit configured to receive an operation information processing instruction related to a target two-dimensional data table, wherein a category of the operation information processing instruction includes a deletion instruction and a modification instruction;
a first processing unit configured to execute the following processing steps if the received operation information processing instruction belongs to a delete instruction or a modify instruction:
based on the received operation information processing instruction, correspondingly processing target operation information in an operation information sequence associated with a target two-dimensional data table, wherein the target operation information is operation information pointed by the received operation information processing instruction, and the operation information is information for indicating corresponding operation on the target two-dimensional data table;
and determining the processed operation information sequence as a new sequence, and editing the target two-dimensional data table based on the new sequence.
8. The apparatus of claim 7, wherein the target operation information is not located at a head and a tail of the operation information sequence; and
the first processing unit is further configured to:
restoring the target two-dimensional data table to a state after the operation indicated by the last piece of operation information of the target operation information is executed;
selecting the next operation information of the previous operation information in the new sequence as the operation information to be executed, and executing the following judgment sub-operation: determining whether the operation information to be executed meets corresponding preset execution conditions; if yes, executing the operation indicated by the operation information to be executed on the target two-dimensional data table, determining whether the operation information sequentially following the operation information to be executed exists in the new sequence, and if not, ending the judgment sub-operation;
and if so, selecting the next piece of operation information of the operation information to be executed in the new sequence as the operation information to be executed, and continuing to execute the judgment sub-operation.
9. The apparatus of claim 8, wherein the first processing unit is further configured to:
and generating prompt information in response to the fact that the to-be-executed operation information does not meet the corresponding preset execution condition, and outputting the prompt information to prompt a user to modify the to-be-executed operation information.
10. The apparatus of claim 7, wherein the first processing unit is further configured to:
and if the new sequence is a null sequence, restoring the target two-dimensional data table to the initial state.
11. The apparatus of claim 7, wherein the categories further include new instructions; and
the device further comprises:
and a second processing unit configured to generate operation information based on the received operation information processing instruction and execute an operation indicated by the generated operation information on the target two-dimensional data table if the received operation information processing instruction belongs to the new instruction.
12. The apparatus according to one of claims 7-11, wherein the apparatus further comprises:
and the display unit is configured to respond to the received data display instruction which is related to the target two-dimensional data table and comprises a display mode identifier, and display the data in the target two-dimensional data table in a display mode indicated by the display mode identifier.
13. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
14. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN201810904854.0A 2018-08-09 2018-08-09 Method and apparatus for processing two-dimensional data table Active CN109101473B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810904854.0A CN109101473B (en) 2018-08-09 2018-08-09 Method and apparatus for processing two-dimensional data table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810904854.0A CN109101473B (en) 2018-08-09 2018-08-09 Method and apparatus for processing two-dimensional data table

Publications (2)

Publication Number Publication Date
CN109101473A CN109101473A (en) 2018-12-28
CN109101473B true CN109101473B (en) 2022-07-19

Family

ID=64849089

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810904854.0A Active CN109101473B (en) 2018-08-09 2018-08-09 Method and apparatus for processing two-dimensional data table

Country Status (1)

Country Link
CN (1) CN109101473B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4538225A (en) * 1982-03-15 1985-08-27 Banks Edwin R Table-driven apparatus for data display and modification
CN103281798A (en) * 2013-05-30 2013-09-04 腾讯科技(深圳)有限公司 Method, device and system for achieving modification synchronization
CN104317963A (en) * 2014-11-14 2015-01-28 中国建设银行股份有限公司 Method and device for processing data
CN104407846A (en) * 2014-10-29 2015-03-11 中国建设银行股份有限公司 Information processing method and device
CN104881813A (en) * 2015-04-30 2015-09-02 努比亚技术有限公司 Information processing method, terminal, server and system
CN106484892A (en) * 2016-10-19 2017-03-08 凌云天博光电科技股份有限公司 Data manipulation method and device
CN107239467A (en) * 2016-03-29 2017-10-10 北京神州泰岳软件股份有限公司 Data processing method and device based on database
CN107609011A (en) * 2017-07-28 2018-01-19 北京百分点信息科技有限公司 The maintaining method and device of a kind of data-base recording
CN107766310A (en) * 2017-09-26 2018-03-06 杭州迪普科技股份有限公司 A kind of grid cell lattice edit methods and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4538225A (en) * 1982-03-15 1985-08-27 Banks Edwin R Table-driven apparatus for data display and modification
CN103281798A (en) * 2013-05-30 2013-09-04 腾讯科技(深圳)有限公司 Method, device and system for achieving modification synchronization
CN104407846A (en) * 2014-10-29 2015-03-11 中国建设银行股份有限公司 Information processing method and device
CN104317963A (en) * 2014-11-14 2015-01-28 中国建设银行股份有限公司 Method and device for processing data
CN104881813A (en) * 2015-04-30 2015-09-02 努比亚技术有限公司 Information processing method, terminal, server and system
CN107239467A (en) * 2016-03-29 2017-10-10 北京神州泰岳软件股份有限公司 Data processing method and device based on database
CN106484892A (en) * 2016-10-19 2017-03-08 凌云天博光电科技股份有限公司 Data manipulation method and device
CN107609011A (en) * 2017-07-28 2018-01-19 北京百分点信息科技有限公司 The maintaining method and device of a kind of data-base recording
CN107766310A (en) * 2017-09-26 2018-03-06 杭州迪普科技股份有限公司 A kind of grid cell lattice edit methods and device

Also Published As

Publication number Publication date
CN109101473A (en) 2018-12-28

Similar Documents

Publication Publication Date Title
US20210318851A1 (en) Systems and Methods for Dataset Merging using Flow Structures
CN105573966B (en) Adaptive modification of content presented in a spreadsheet
US9977770B2 (en) Conversion of a presentation to Darwin Information Typing Architecture (DITA)
CN109359194B (en) Method and apparatus for predicting information categories
US20190121669A1 (en) Executing tasks using modular and intelligent code and data containers
CN111159220B (en) Method and apparatus for outputting structured query statement
AU2009238294A1 (en) Data transformation based on a technical design document
US20200034481A1 (en) Language agnostic data insight handling for user application data
CN112463154A (en) Page generation method, device and system and electronic equipment
CN113076104A (en) Page generation method, device, equipment and storage medium
US9208142B2 (en) Analyzing documents corresponding to demographics
CN114265657A (en) Method and device for displaying page of applet
CN114003818A (en) Page recommendation method, device, server and storage medium
US20140108906A1 (en) Providing user-friendly table handling
US20140351708A1 (en) Customizing a dashboard responsive to usage activity
CN109101473B (en) Method and apparatus for processing two-dimensional data table
US20220284371A1 (en) Method, device and medium for a business function page
CN110881056A (en) Method and device for pushing information
US20140143645A1 (en) Preserving formatting of content selection through snippets
CN113760317A (en) Page display method, device, equipment and storage medium
CN110888583A (en) Page display method, system and device and electronic equipment
CN112784195A (en) Page data publishing method and system
CN108073643B (en) Task processing method and device
JP2020035427A (en) Method and apparatus for updating information
CN112131287A (en) Method and device for reading data

Legal Events

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
GR01 Patent grant
GR01 Patent grant