CN111427882A - Data editing method and system, data processing device and storage medium - Google Patents

Data editing method and system, data processing device and storage medium Download PDF

Info

Publication number
CN111427882A
CN111427882A CN201910021935.0A CN201910021935A CN111427882A CN 111427882 A CN111427882 A CN 111427882A CN 201910021935 A CN201910021935 A CN 201910021935A CN 111427882 A CN111427882 A CN 111427882A
Authority
CN
China
Prior art keywords
data
field
user
type
added
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.)
Pending
Application number
CN201910021935.0A
Other languages
Chinese (zh)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201910021935.0A priority Critical patent/CN111427882A/en
Publication of CN111427882A publication Critical patent/CN111427882A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2291User-Defined Types; Storage management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database

Abstract

The embodiment of the invention provides a data editing method and system, data processing equipment and a storage medium, wherein the method comprises the following steps: acquiring and recording a structure selection operation result of a user through a data editing interface; determining a JSON data structure according to the structure selection operation result; acquiring and recording field data input by a user through a data editing interface; and combining the determined JSON data structure and the input field data to generate corresponding JSON data. By adopting the scheme, the operability of data editing can be enhanced and the error probability can be reduced.

Description

Data editing method and system, data processing device and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a data editing method and system, data processing equipment and a storage medium.
Background
Data editing is the process of verifying, examining, modifying, rearranging, processing, cleansing, organizing the data entered into the system into a format that facilitates internal processing.
JSON (JavaScript Object Notation) is a lightweight data exchange format. It stores and represents data in a text format completely independent of the programming language, based on a subset of ECMAScript (JS specification set by the european computer association). The simple and clear hierarchical structure enables JSON to become an ideal data exchange language, is easy to read and write by people, is easy to analyze and generate by machines, and effectively improves the network transmission efficiency.
The JSON format is widely used and is simple, and the condition of describing and storing by using the JSON format, which is similar to service interface parameters, is that an input box is directly provided at present so that a user can input complete JSON data contents.
However, the above JSON data editing method for allowing the user to input complete JSON data content has a high requirement on an editor and is prone to generate input errors.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data editing method and system, a data processing device, and a storage medium, so as to enhance operability and reduce error probability.
The embodiment of the invention provides a data editing method, which comprises the following steps: acquiring and recording a structure selection operation result of a user through a data editing interface; determining a JSON data structure according to the structure selection operation result; acquiring and recording field data input by a user through a data editing interface; and combining the determined JSON data structure and the input field data to generate corresponding JSON data.
Optionally, after generating the corresponding JSON data, the method further includes: and generating a corresponding data editing interface of the next step according to the determined JSON data structure.
Optionally, the determining, according to the selection operation result of the user, the JSON data structure includes at least one of: determining the hierarchical relationship between the added field and the parent field thereof according to the parent field of the added field selected by the user; and determining the syntactic structure of the added field according to the data type of the added field selected by the user.
Optionally, the data type of the added field includes: array type, object type, and base type.
Optionally, the generating a data editing interface corresponding to the next step according to the determined JSON data structure includes: when the data type of the added field is an object type, generating a corresponding field adding interface to receive the sub-level field corresponding to the object added by the user when the editing field operation selected by the user is obtained; and when the data type of the added field is received as the array type, generating a corresponding data editing interface according to the array element type selected by the user.
Optionally, the generating a corresponding data editing interface according to the array element type selected by the user includes: when the array element type selected by the user is a basic type, acquiring field data input by the user through a corresponding field data input area in a field editing interface; and when the array element type selected by the user is the object type, adding a null object to the array, and generating a field editing interface to acquire the sub-level field added to the null object by the user based on the field adding operation.
Optionally, the determining, according to the data type of the added field selected by the user, a syntax structure of the added field includes: the data type of the added field selected by the user is received through a drop down list or an optional control.
The embodiment of the invention also provides a data editing system, which comprises: the data editing unit is suitable for acquiring a structure selection operation result of a user and field data input by the user through a data editing interface; the recording unit is suitable for recording the structure selection operation result of the user and the input field data; the data structure determining unit is suitable for determining a JSON data structure according to the structure selection operation result of the user recorded by the recording unit; and the first generation unit is suitable for combining the JSON data structure determined by the data structure determination unit and the input field data recorded by the recording unit to generate corresponding JSON data.
Optionally, the system further comprises: and the second generation unit is suitable for generating a corresponding data editing interface of the next step according to the JSON data structure determined by the data structure determination unit.
Optionally, the data structure determining unit includes at least one of:
the first determining subunit is suitable for determining the hierarchical relationship between the added field and the parent field thereof according to the parent field of the added field selected by the user;
and the second determining subunit is suitable for determining the syntactic structure of the added field according to the data type of the added field selected by the user.
The embodiment of the present invention further provides a data processing device, which includes a memory and a processor, where the memory stores computer instructions executable on the processor, and the processor executes the computer instructions to perform the steps of the method according to any one of the above embodiments.
The embodiment of the present invention further provides a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed, the steps of the method described in any of the above embodiments are performed.
By adopting the embodiment of the invention, the structure selection operation result of the user is obtained and recorded through the data editing interface, the JSON data structure is determined according to the structure selection operation result, the field data input by the user is obtained and recorded through the data editing interface, and then the determined JSON data structure and the input field data can be combined to generate the corresponding JSON data.
Furthermore, after the corresponding JSON data is generated, a corresponding data editing interface of the next step is generated according to the determined JSON data structure, so that the user can be automatically guided to perform the data editing of the next step according to the determined JSON data structure, and the user does not need to consider the specific grammar format of each JSON data in the whole data editing process, thereby further enhancing the operability of data editing, improving the data editing efficiency, reducing the difficulty and error probability of writing the JSON data by the user, and further reducing the use threshold of the user.
Furthermore, the hierarchical relationship between the added field and the parent field thereof can be determined according to the parent field of the added field selected by the user, the syntactic structure of the added field can be determined according to the data type of the added field selected by the user, and JSON data with various complex structures can be generated by determining the hierarchical relationship among the fields and the syntactic structure of the fields, so that the JSON data editing difficulty can be reduced, the probability of errors caused by manual input can be reduced, and the data editing efficiency can be improved.
Further, when the data type of the added field is determined to be an object type or an array type, a corresponding data editing interface is automatically generated according to the selection operation of the user to guide the user to input corresponding field data, and the method is convenient, rapid and easy to operate.
Furthermore, the data types of the added fields selected by the user are received through the drop-down list or the selectable control piece, and the user does not need to know the specific grammar rules of various data types, so that the difficulty and the error probability of writing JSON data by the user can be reduced, the operability is high, and the use threshold of the user can also be reduced.
Drawings
FIG. 1 is a flow chart illustrating a method of editing data in an embodiment of the invention;
FIG. 2 is a flow diagram illustrating another method of data editing in an embodiment of the present invention;
3-9 illustrate data editing interfaces in embodiments of the invention;
fig. 10 shows a schematic structural diagram of the data editing system in the embodiment of the present invention.
Detailed Description
JSON is used as a relatively general data format in many service scenarios. For example, when the card dragging platform provides the user design service interface parameters, the structure of the service interface parameters conforms to the JSON data format, and the card dragging platform is very suitable for writing and expressing the JSON data format. For example, the service interface has two parameters, the names of which are p1 and p2, respectively, the parameter p1 is an object structure and also contains two fields, name and age, the values of which are "li qiang" and 20, respectively; the parameter P2 is also an object structure, and includes two fields tel and address, which are "18812112188" and "10 on the mon street of the morning district, beijing city", respectively. Then the JSON format is used for expressing the complete parameter form of the service interface as follows:
Figure BDA0001941067830000041
as mentioned above, currently, when editing JSON data, a user needs to input complete JSON data content in an input interface, such as the above service interface parameters p1 and p2, and the user needs to input the following content:
Figure BDA0001941067830000051
this approach is highly demanding for editors and prone to input errors.
In order to solve the above problems, embodiments of the present invention provide a data editing method, in the editing process, a user does not need to know a detailed syntax format of JSON, and also does not need to memorize and input various corresponding symbols, and only needs to perform some structure selection operations and input a field data part through a visual data editing interface, so that the difficulty and error probability of writing JSON data by the user can be reduced, the operability is high, and the user threshold can be reduced.
In order to make the aforementioned objects, features and advantages of the embodiments of the present invention more comprehensible, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
Referring to the flowchart of the data editing method shown in fig. 1, in the embodiment of the present invention, the following steps may be adopted to edit JSON data.
And S101, acquiring and recording the structure selection operation of the user through a data editing interface.
In a specific implementation, the structure selection operation of the user may be one or more of a hierarchical selection of fields, a type selection of fields, and the like.
And S102, determining a JSON data structure according to the structure selection operation.
In particular implementations, the hierarchical relationship of an added field to its parent field may be determined according to the parent field of the added field selected by the user.
In a specific implementation, the syntax structure of the added field can be determined according to the data type of the added field selected by the user. The data type of the added field may be an array type, an object type, a base type, and the like. The basic types may be: numbers, character strings, boolean, and the like. In particular implementations, a drop down list or selectable control may be provided to receive the data type of the added field selected by the user.
And S103, acquiring and recording field data input by a user through a data editing interface.
In a specific implementation, the field data entered by the user may include: field names, field values, etc. For example, when the data type of the added field selected by the user is a number, character, boolean, or the like type, the user may directly input the corresponding field name, field value, or the like.
And S104, combining the determined JSON data structure and the input field data to generate corresponding JSON data.
In the concrete implementation, the structure of the JSON data to be edited, including the data hierarchy, which fields, the names of the fields, the data types, the values and the like exist under each hierarchy, is obtained by obtaining the input and selection operations (such as click operations) of the user, and after the structure information and the field data of the JSON data exist, the corresponding JSON data can be assembled and generated.
By adopting the embodiment, in the whole data editing process, a user does not need to know the detailed syntax format of JSON and memorize and input various corresponding symbols, and only needs to perform some structure selection operations and input the field data part through a visual data editing interface, so that the difficulty and the error probability of writing JSON data by the user can be reduced, the operation is easy, and the user threshold is low.
In the specific implementation, in order to further improve the efficiency of JSON data editing and enhance the operability of data editing, the above scheme may be further expanded, and the following detailed description is provided through specific embodiments and application scenarios.
In the embodiment of the invention, after the corresponding JSON data is generated, a corresponding data editing interface of the next step can be generated according to the determined JSON data structure.
For example, when the data type receiving the added field is an object type, when an edit field operation selected by a user is obtained, a corresponding field adding interface may be generated to receive a sub-level field corresponding to the object added by the user. When the data type of the added field is an array type, a corresponding data editing interface can be generated according to the array element type selected by the user.
More specifically, when the array element type selected by the user is the basic type, the field data input by the user can be acquired through a corresponding field data input area in the field editing interface; when the array element type selected by the user is the object type, a null object can be added to the array, a field editing interface is generated based on field adding operation to obtain the sub-level fields added to the null field by the user, the user can further edit the sub-level fields, and each level of fields can adopt the method in the embodiment of the invention to edit data.
By adopting the embodiment, after the corresponding JSON data is generated, the corresponding data editing interface of the next step is generated according to the determined JSON data structure, so that the user can be automatically guided to perform the data editing of the next step according to the determined JSON data structure, and the user does not need to consider the specific syntactic format of each JSON data in the whole data editing process, thereby further enhancing the operability of the data editing.
In order to make those skilled in the art better understand and implement the embodiments of the present invention, a specific application scenario is illustrated below, which is described in detail through an editing process of a user.
Referring to the flowchart of the data editing method described in fig. 2, in the embodiment of the present invention, JSON data editing may be performed in the following manner.
S201, adding fields.
Adding a field is the most basic operation for constructing JSON data, which is hierarchical, and each node in the hierarchy can be considered as a field, and the field has a name, and the name can be customized by a user.
Upon receiving a user-selected add field operation, a data editing interface diagram as shown in fig. 3 or fig. 4 may be generated.
At the data editing interface 30 or the data editing interface 40, the user can perform data editing operations for any field.
Specifically, as shown in fig. 3, in the data editing interface 30, the user can select the data type of the field by clicking the pull-down mark 321 in the type input area 32, for example, as shown in fig. 3, the data type is selected as the basic type String. The user can input a field name, such as renderType shown in fig. 3, in the key field input area 31 and can input a corresponding value initState of the field in the initial value input area 33. After completing the selection or input operation of each input region, the user can click the determination button 35 to complete the editing of the field renderType. When an editing error is found, the cancel button 34 or the close button 36 may be directly clicked to close the field.
For another example, in the data editing interface 40, the user clicks the drop-down mark 421 in the type input area 42 to obtain the expanded data type list 422, where the expanded data type list includes a String type String, a Number type Number, a Boolean type Boolean, an Array type Array, and an Object type Object, and the data type of the field selected by the user is the Array, as shown in the selected area 423 in fig. 4, and then the user clicks the ok button 44 to complete the editing of the field list.
As shown in fig. 5, after the user operates the data editing interfaces 30 and 40 and clicks the determination buttons 35 and 44, respectively, the data editing interface 50 shown in fig. 5 can be automatically generated, which includes the fields renderType and list that the user has added, and the values (attribute values) and data types (types) corresponding to the two fields, and the following operations that the user can perform: editing or deleting. The user may click on the "edit" option to further edit the field, or click on the "delete" option, i.e., delete the corresponding added field.
As can be seen from the field adding processes shown in fig. 3 and 4, the data editing system may obtain and record the data type selection operation of the user through the data editing interface, then determine the syntactic structure of the field according to the selected structure type, obtain and record the field data (key field data, initial value field data) input by the user through the data editing interface, and then combine the determined syntactic structure of the field and the input field value to generate the corresponding JSON data.
As the corresponding input data of fig. 3, the following JSON data can be automatically generated:
{
"renderType":"initState"
}
namely: and filling the field name renderType and the value data initState input by the user into a syntactic structure in a character string form, so that complete field data can be generated.
After the editing operation shown in fig. 3 and 4, the following JSON data can be automatically generated:
{
"renderType":"initState",
"list":[]
}
as can be seen from the above, the system can automatically generate the corresponding JSON data by the above-mentioned data type selection operation performed by the user and inputting the corresponding field data. Further, after the corresponding JSON data is generated, a data editing interface 50 as shown in fig. 5 may be generated, so that the user can be guided to the next operation.
S202, selecting the parent field of the added field.
In particular implementations, a hierarchical relationship may exist between fields. When the editing of a field is completed, if there is a child field, the field can be further selected as a parent field of a field to be edited next.
In a specific implementation, which field is the parent of the field when the field is added requires the user to decide himself. Almost all fields in the JSON data have a hierarchical relationship, the hierarchical structure is a tree structure, and each field is used as a node in the tree structure. In an embodiment of the present invention, the user can select a node in the tree structure as the parent field of the added field by mouse.
As shown in fig. 5, if the user selects the field list as the parent field of the next added field, the data editing interface 60 shown in fig. 6 can be automatically generated when the user clicks the "edit" option. In order to improve the universality of the data editing interface, the layout and the content of the data editing interface of any field can be set to be the same, and the data editing interfaces shown in fig. 3, 4 and 6 are the same.
S203, selecting the data type of the added field.
The type of the field when the field is added needs to be determined by a user, the data type can be provided for the user to select, for example, a drop-down list or a selectable control can be provided to list all the selectable data types, and the user can check one data type by a mouse or a touch mode. As mentioned above, the data types in JSON include arrays, objects, and basic types, where the basic types may specifically be numbers, character strings, boolean, and the like.
Referring to the data editing interface 60 shown in fig. 6 and the data editing interface 70 shown in fig. 7, the user can select the data type in the same manner as the foregoing steps, for example, the data type with the added field selected by the user in the data type input area 62 is String, and the data type with the added field selected by the user in the data type input area 72 is Number.
S204, judging whether the added field is of a basic type, if so, executing the step S205; if not, step S206 is performed.
After the user selects the data type of the added field, it needs to determine whether the selected data type is the basic type, if so, step S205 is executed, otherwise, the flow goes to the subsequent step S206.
With continued reference to fig. 6, it may be determined that the added field is of the basic type, so step S205 may be performed. With continued reference to fig. 7, it can be determined that the added field is of the basic type, so step S205 can be performed as well.
S205, the name and value of the added field are input.
In particular implementations, different input boxes may be provided to allow the user to enter the name and value of the field separately. The value of the field may be a number, such as 1000, or a character string, such as "zhang san", or a boolean type, such as true, false.
Continuing to refer to fig. 6, field data input by a user are received through an input area 61 of a key field and an input area 63 of a value field respectively, a name of the key field data and three times of the value field data are obtained, the editing of the fields can be completed by clicking a determination button 65, and after the steps, the following JSON data are automatically generated:
Figure BDA0001941067830000101
with reference to fig. 7, the field data input by the user is received through the input area 71 of the key field and the input area 73 of the value field, so that the field data age and the value field data 21 can be acquired and recorded, the editing of the field added in fig. 7 can be completed by clicking the determination button 75, and the following JSON data can be automatically generated after the two sub-level fields name and age in the list field are added:
Figure BDA0001941067830000102
s206, judging whether the added field is an array type or an object type, and if the added field is the array type, executing the step S208; otherwise, step S207 is executed.
When the field added in step S204 is not of the basic type, the flow goes to step S206, where it is determined whether the field is of the array or the object type. It is understood that, in the specific implementation, the determination of the added field type is not necessarily performed in the above order, and it may also be determined whether the field type is an array type first, and then determined whether the field type is a basic type or an object type, or determined whether the field type is an object type first, and then determined whether the field type is an array type or a basic type.
It should be noted that, because the object type and the array type exist, the JSON data generates a hierarchical structure, and the basic type does not include a sub-level field, it is determined whether the JSON data is the basic type, and then it is determined whether the JSON data is the array type or the object type, and a data editing interface of a next step is generated according to different types.
S207, adding fields for the object.
When the added field is an object type, the user may continue to add a field to the object, and if it is necessary to continue to add a field to the field, the step S203 may be continued.
S208, judging whether the added field is an object type or a basic type, and if the added field is the basic type, executing the step S209; if it is the object type, step S210 is performed.
In the specific implementation, if the added field selected by the user is an array type, the user needs to select an object type or a basic type when the element type in the array is selected, and if the element type is selected by the user, the flow goes to the subsequent step S209; if the user selects the object type, the flow goes to the subsequent step S210.
S209, inputs the array value.
When a base type array is added to the field type (i.e., the elements in the array are base types), an input box may be provided directly for the user to input the value of the array, such as 1, 2, 3, or "zhang san", "lie quad", etc.
When the user completes the operation of step S209, if the user wants to continue to add new fields, the flow can go to the previous step S201 to add new fields again.
S210, adding a null object to the array.
If the added field is the object array type, the flow goes to the current step S210, at this time, the system automatically creates an empty object, then allows the user to add a new field for the object, i.e., step S207 can be automatically executed, next, the user can execute step S203, and continue the subsequent judgment and input, completing the process of adding and editing the sub-level field whose data type is the object type.
Referring to fig. 7-9, in the data editing interface 70 shown in fig. 7, after the user clicks the confirm button 75, a user editing interface 80 as shown in fig. 8 can be generated, which can see the two word-level fields name and age that have been added for the list field. If the sub-level fields need to be added to the list field, the user can continue to click the add button 81, i.e. the next field can be added, and the specific editing method of the next field can continue to execute the step S203 and the subsequent steps; if the addition of the list field sublevel field has been completed, the user may click the confirm button 82, which may end the editing operation of the list field. If the user wants to modify the added sub-level fields of the list field, the user can click the editing or deleting operation buttons corresponding to the corresponding fields in the data editing interface 80 to modify the information of the corresponding fields or delete the corresponding fields, and the system can automatically modify the generated JSON data according to the editing or deleting operation.
As described above, if the user clicks the determination button 82 in the data editing interface 80, the system may automatically generate a data editing interface of the next step, and referring to the data editing interface 90 shown in fig. 9, the user may continue to edit or delete the added field, or click the addition button to further generate a new field, and after the new field is added, step S203 and subsequent steps may be continued to be executed, which is not described again.
As can be seen from the above, any field can be edited by the above method, wherein the JSON data structure can be determined according to the structure selection operation of the user, and the complete JSON data can be automatically generated by combining the field data input by the user. In particular, whether to enter value data for the field or to continue adding a sub-level field to the field may be determined based on the type of data selected by the user. If the data type selected by the user is a basic type such as a character string, a number or Boolean, the name and the value of the field input by the user can be received through the data editing interface; if the data type selected by the user is an object type or an array type, a corresponding data editing interface can be continuously generated to guide the user to add the sub-level fields to the added fields, the JSON data structure can be automatically determined through the selection of the user in the whole process, and the complicated JSON grammar rules do not need to be memorized or input by the user, so that the difficulty and the error probability of writing JSON data by the user can be reduced, the operability is high, and the user threshold can be reduced.
The embodiment of the present invention also provides a corresponding data editing system, so that those skilled in the art can better understand and implement the embodiment of the present invention, and the detailed description is provided below with reference to the accompanying drawings.
Referring to the data editing system shown in fig. 10, in an embodiment of the present invention, the data editing system 10 may include a data editing unit 11, a recording unit 12, a data structure determining unit 13, and a first generating unit 14, where:
the data editing unit 11 is suitable for acquiring a structure selection operation result of a user and field data input by the user through a data editing interface;
a recording unit 12 adapted to record a structure selection operation result of a user and input field data;
a data structure determining unit 13, adapted to determine a JSON data structure according to the structure selection operation result of the user recorded by the recording unit 12;
the first generating unit 14 is adapted to generate corresponding JSON data by combining the JSON data structure determined by the data structure determining unit 13 and the input field data recorded by the recording unit 12.
By adopting the data editing system, a user does not need to know the detailed syntax format of JSON and memorize and input various corresponding symbols, and only needs to perform some structure selection operations and input field data parts through a visual data editing interface, so that the difficulty and the error probability of writing JSON data by the user can be reduced, the operability is high, and the user threshold can be reduced.
With continued reference to fig. 10, in a specific implementation, the data editing system 10 may further include: and the second generating unit 15 is adapted to generate a data editing interface corresponding to the next step according to the JSON data structure determined by the data structure determining unit 13.
By adopting the data editing system, after the corresponding JSON data is generated, the corresponding data editing interface of the next step is generated according to the determined JSON data structure, so that the user can be automatically guided to perform the data editing of the next step according to the determined JSON data structure, and the user does not need to consider the specific syntactic format of each JSON data in the whole data editing process, thereby further enhancing the operability of data editing, improving the data editing efficiency, reducing the difficulty and error probability of writing the JSON data by the user, and further reducing the use threshold of the user.
In a specific implementation, as shown in fig. 10, the data structure determining unit 13 may include at least one of the following:
a first determining subunit 131, adapted to determine, according to the parent field of the added field selected by the user, a hierarchical relationship between the added field and its parent field;
a second determining subunit 132, adapted to determine a syntax structure of the added field according to the data type of the added field selected by the user.
By adopting the data editing system, the hierarchical relationship between the added field and the parent field thereof can be determined according to the parent field of the added field selected by the user, the syntactic structure of the added field can be determined according to the data type of the added field selected by the user, and JSON data with various complex structures can be generated by determining the hierarchical relationship among the fields and the syntactic structure of the fields, so that the JSON data editing difficulty can be reduced, the probability of errors caused by manual input can be reduced, and the data editing efficiency can be improved.
In a specific implementation, the data type of the added field may include: array type, object type, and base type. Wherein the basic types may include: one or more of character strings, numbers, boolean, and the like.
In a specific implementation, the second generating unit 15 is adapted to generate a corresponding field adding interface to receive a sub-level field corresponding to a field added by a user when an editing field operation selected by the user is obtained when the data type of the field to be added is an object type; and when the array type is received when the data type of the added field is received, generating a corresponding data editing interface according to the array element type selected by the user.
By adopting the data editing system, when the data type of the added field is determined to be an object type or an array type, a corresponding data editing interface is automatically generated according to the selection operation of the user to guide the user to input the corresponding field data, so that the data editing system is convenient, quick and easy to operate.
More specifically, the second generating unit 15 is adapted to generate a field editing interface when the array element type selected by the user is the basic type, the field editing interface including a corresponding field data input area to obtain the field data input by the user; and when the array element type selected by the user is the object type, adding a null object to the array, and generating a field editing interface to acquire the sub-level field created by the user for the null object based on the field adding operation.
The embodiment of the present invention further provides a corresponding data processing device, where the data processing device includes a memory and a processor, where the memory stores a computer instruction capable of being executed on the processor, and the processor executes the steps of the data editing method in any of the above embodiments when executing the computer instruction.
The embodiment of the present invention further provides a corresponding computer-readable storage medium, where a computer instruction is stored, and when the computer instruction runs, the step of executing the data editing method in any of the above embodiments is executed, which is not described again. In particular implementations, the computer-readable storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (12)

1. A method for editing data, comprising:
acquiring and recording a structure selection operation result of a user through a data editing interface;
determining a JSON data structure according to the structure selection operation result;
acquiring and recording field data input by a user through a data editing interface;
and combining the determined JSON data structure and the input field data to generate corresponding JSON data.
2. The data editing method according to claim 1, wherein after generating the corresponding JSON data, further comprising:
and generating a corresponding data editing interface of the next step according to the determined JSON data structure.
3. The data editing method according to claim 2, wherein the determining the JSON data structure according to the result of the selection operation by the user includes at least one of:
determining the hierarchical relationship between the added field and the parent field thereof according to the parent field of the added field selected by the user;
and determining the syntactic structure of the added field according to the data type of the added field selected by the user.
4. The data editing method according to claim 3, wherein the data type of the added field includes: array type, object type, and base type.
5. The data editing method of claim 4, wherein the generating a corresponding data editing interface for the next step according to the determined JSON data structure comprises:
when the data type of the added field is an object type, generating a corresponding field adding interface to receive the sub-level field corresponding to the object added by the user when the editing field operation selected by the user is obtained;
and when the data type of the added field is received as the array type, generating a corresponding data editing interface according to the array element type selected by the user.
6. The data editing method of claim 5, wherein the generating of the corresponding data editing interface according to the array element type selected by the user comprises:
when the array element type selected by the user is a basic type, acquiring field data input by the user through a corresponding field data input area in a field editing interface;
and when the array element type selected by the user is the object type, adding a null object to the array, and generating a field editing interface to acquire the sub-level field added to the null object by the user based on the field adding operation.
7. The data editing method of claim 3, wherein the determining the syntactic structure of the added field according to the data type of the added field selected by the user comprises:
the data type of the added field selected by the user is received through a drop down list or an optional control.
8. A data editing system, comprising:
the data editing unit is suitable for acquiring a structure selection operation result of a user and field data input by the user through a data editing interface;
the recording unit is suitable for recording the structure selection operation result of the user and the input field data;
the data structure determining unit is suitable for determining a JSON data structure according to the structure selection operation result of the user recorded by the recording unit;
and the first generation unit is suitable for combining the JSON data structure determined by the data structure determination unit and the input field data recorded by the recording unit to generate corresponding JSON data.
9. The data editing system of claim 8, further comprising:
and the second generation unit is suitable for generating a corresponding data editing interface of the next step according to the JSON data structure determined by the data structure determination unit.
10. The data editing system of claim 9, wherein the data structure determining unit comprises at least one of:
the first determining subunit is suitable for determining the hierarchical relationship between the added field and the parent field thereof according to the parent field of the added field selected by the user;
and the second determining subunit is suitable for determining the syntactic structure of the added field according to the data type of the added field selected by the user.
11. A data processing apparatus comprising a memory and a processor, the memory having stored thereon computer instructions executable on the processor, wherein the processor, when executing the computer instructions, performs the steps of the method of any one of claims 1 to 7.
12. A computer readable storage medium having computer instructions stored thereon, wherein the computer instructions when executed perform the steps of the method of any one of claims 1 to 7.
CN201910021935.0A 2019-01-10 2019-01-10 Data editing method and system, data processing device and storage medium Pending CN111427882A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910021935.0A CN111427882A (en) 2019-01-10 2019-01-10 Data editing method and system, data processing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910021935.0A CN111427882A (en) 2019-01-10 2019-01-10 Data editing method and system, data processing device and storage medium

Publications (1)

Publication Number Publication Date
CN111427882A true CN111427882A (en) 2020-07-17

Family

ID=71545705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910021935.0A Pending CN111427882A (en) 2019-01-10 2019-01-10 Data editing method and system, data processing device and storage medium

Country Status (1)

Country Link
CN (1) CN111427882A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030074636A1 (en) * 2001-10-15 2003-04-17 Ensoftek, Inc. Enabling easy generation of XML documents from XML specifications
US20090125830A1 (en) * 2007-11-13 2009-05-14 Apple Inc. Compound Fields
CN103389895A (en) * 2012-08-30 2013-11-13 爱乐活(北京)科技有限公司 Method and system for generating front end page
CN105867995A (en) * 2016-04-29 2016-08-17 无锡天脉聚源传媒科技有限公司 Editing method and device for XML (extensible markup language) file
CN106775725A (en) * 2016-12-19 2017-05-31 网易(杭州)网络有限公司 A kind of visual configuration edit methods and device
US20170344227A1 (en) * 2016-05-31 2017-11-30 Vmware, Inc. Visual designer for editing large schemaless xml file
CN107450931A (en) * 2017-08-15 2017-12-08 竞技世界(北京)网络技术有限公司 Visualizing editing method and device based on INI configuration files

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030074636A1 (en) * 2001-10-15 2003-04-17 Ensoftek, Inc. Enabling easy generation of XML documents from XML specifications
US20090125830A1 (en) * 2007-11-13 2009-05-14 Apple Inc. Compound Fields
CN103389895A (en) * 2012-08-30 2013-11-13 爱乐活(北京)科技有限公司 Method and system for generating front end page
CN105867995A (en) * 2016-04-29 2016-08-17 无锡天脉聚源传媒科技有限公司 Editing method and device for XML (extensible markup language) file
US20170344227A1 (en) * 2016-05-31 2017-11-30 Vmware, Inc. Visual designer for editing large schemaless xml file
CN106775725A (en) * 2016-12-19 2017-05-31 网易(杭州)网络有限公司 A kind of visual configuration edit methods and device
CN107450931A (en) * 2017-08-15 2017-12-08 竞技世界(北京)网络技术有限公司 Visualizing editing method and device based on INI configuration files

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JDORN: "JSON Schema Based Editor", pages 1 - 21, Retrieved from the Internet <URL:https://github.com/jdorn/json-editor> *
克: "JSON Editor中文文档", pages 1 - 19, Retrieved from the Internet <URL:https://www.cnblogs.com/handk/p/4766271.html> *

Similar Documents

Publication Publication Date Title
KR101805946B1 (en) Generating text manipulation programs using input-output examples
US6789231B1 (en) Method and system for providing alternatives for text derived from stochastic input sources
CN110738037B (en) Method, apparatus, device and storage medium for automatically generating electronic form
US9311278B2 (en) Visual editor for editing complex expressions
US9524279B2 (en) Help document animated visualization
JP2007094818A (en) Batch copy and paste method, device and computer program for a plurality of pieces of data
CN104572067A (en) Associating a visualization of user interface with source code
CN111124379B (en) Page generation method and device, electronic equipment and storage medium
US10635855B1 (en) Code comment markup
JP4588295B2 (en) Sequence analysis method and sequence analysis apparatus
CN111813409A (en) Code generation method, device, equipment and storage medium of interactive interface
JP4839087B2 (en) Workflow management system
US20090132506A1 (en) Methods and apparatus for integration of visual and natural language query interfaces for context-sensitive data exploration
CN115309298A (en) Text structuring method and device, medium and equipment based on rich text editor
CN106484389A (en) Stream of action sectional management
JPWO2005098660A1 (en) Document processing apparatus and document processing method
JPWO2005098658A1 (en) Document processing apparatus and document processing method
CN116627418B (en) Multi-level form interface visual generation method and device based on recursion algorithm
CN102323858A (en) Input method for identifying modification item in input and terminal and system
CN103941979A (en) Method and device for inputting characters into mobile device
CN111061478A (en) Page form modification method, device, equipment and readable storage medium
CN111427882A (en) Data editing method and system, data processing device and storage medium
KR101989634B1 (en) Creating logic using pre-built controls
CN115329753A (en) Intelligent data analysis method and system based on natural language processing
JP2009211599A (en) Mapping definition creation system and mapping definition creation program

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