Conversion method and device, equipment and storage medium
By analyzing the field mapping relationship of JSON data and generating index paths, JSON data is converted into two-dimensional arrays, solving the problems of JSON data processing complexity and resource waste in the existing technology, and achieving efficient data conversion.
Patent Information
- Application Number
- CN202411111111.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-13
AI Technical Summary
The prior art is difficult to effectively convert JSON data in complex formats into two-dimensional arrays, resulting in waste of resources and increased development complexity.
By obtaining JSON data, analyzing its field mapping relationship, generating an index path based on the mapping relationship and conversion strategy, and using the conversion scheme tree to convert the data into a two-dimensional array, realizing the conversion of JSON data and two-dimensional arrays.
Simplifies the JSON data processing process, reduces resource waste, improves data conversion efficiency, and reduces development complexity.
Smart Images

Figure CN119127788A_ABST
Abstract
Description
Background Art
[0002] JSON (JavaScript Object Notation) is designed based on a subset of ECMAScript. It is an open standard file format and data exchange format that is easy for people to read and write, and easy for machines to parse and generate. JSON is independent of language design, and many programming languages support data exchange in JSON format. JSON is a commonly used data format that has many uses in electronic data exchange, including data exchange between web applications and servers. Its concise and clear hierarchical structure effectively improves network transmission efficiency, making it an ideal data exchange language.
[0003] In the related art, it is usually necessary to expand the complex format JSON data into a two-dimensional array before processing. How to convert JSON data is a problem to be solved in this field. Summary of the invention
[0004] The present disclosure provides a conversion method, apparatus, device and storage medium, which realize the conversion of JSON data into a two-dimensional array at least to a certain extent.
[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0006] According to one aspect of the present disclosure, there is provided a transformation method comprising:
[0007] Acquire first data;
[0008] Parsing the first data to obtain a mapping relationship between fields in the first data;
[0009] Determine an index path based on a mapping relationship, a conversion strategy, and a field in the first data;
[0010] The first data is converted into the second data based on the index path.
[0011] In one embodiment of the present disclosure, converting first data into second data based on the index path includes:
[0012] Generate a transformation plan tree based on the index path;
[0013] The first data is converted into the second data based on the conversion scheme tree.
[0014] In one embodiment of the present disclosure, converting first data into second data based on a conversion scheme tree includes:
[0015] Traverse the transformation plan tree and determine the leaf nodes of the transformation plan tree;
[0016] The data corresponding to the leaf nodes are combined to obtain the second data.
[0017] In one embodiment of the present disclosure, determining an index path based on a mapping relationship, a conversion strategy, and a field in the first data includes:
[0018] Marking the field based on the attribute of the field in the first data and the conversion strategy to obtain a marked field;
[0019] The index path is determined based on the marked fields and the mapping relationship between the fields.
[0020] In one embodiment of the present disclosure, marking the field based on the attribute of the field in the first data and the conversion strategy to obtain the marked field includes:
[0021] The field is marked based on the attribute of the field in the first data and the correspondence between the preset attribute and the mark value to obtain a marked field.
[0022] In one embodiment of the present disclosure, marking the field based on the attribute of the field in the first data and the conversion strategy to obtain the marked field includes:
[0023] The attributes of the fields in the first data are input into the first intelligent model to obtain the marked fields.
[0024] In one embodiment of the present disclosure, parsing the first data includes:
[0025] The first data is parsed based on the second intelligent model to obtain a mapping relationship between fields in the first data.
[0026] According to another aspect of the present disclosure, there is provided a conversion device, comprising:
[0027] An acquisition module, used for acquiring first data;
[0028] A parsing module, used to parse the first data to obtain a mapping relationship between fields in the first data;
[0029] A determination module, configured to determine an index path based on a mapping relationship of fields in the first data, a conversion strategy, and fields;
[0030] The conversion module is used to convert the first data into the second data based on the index path.
[0031] In one embodiment of the present disclosure, the conversion module includes:
[0032] A generation unit, used for generating a transformation scheme tree based on the index path;
[0033] The conversion unit is used to convert the first data into the second data based on the conversion scheme tree.
[0034] In one embodiment of the present disclosure, the conversion unit comprises:
[0035] A traversal subunit is used to traverse the transformation scheme tree and determine the leaf nodes of the transformation scheme tree;
[0036] The combining subunit is used to combine the data corresponding to the leaf nodes to obtain the second data.
[0037] In one embodiment of the present disclosure, the determination module includes:
[0038] A marking unit, used to mark the field based on the attribute of the field in the first data and the conversion strategy to obtain a marked field;
[0039] The determination unit is used to determine the index path based on the marked fields and the mapping relationship between the fields.
[0040] In one embodiment of the present disclosure, a marking unit includes:
[0041] The marking subunit is used to mark the field based on the attribute of the field in the first data and the corresponding relationship between the preset attribute and the marking value to obtain the marked field.
[0042] In one embodiment of the present disclosure, the parsing module includes:
[0043] The parsing unit is used to parse the first data based on the second intelligent model to obtain a mapping relationship between fields in the first data.
[0044] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the above-mentioned conversion method by executing the executable instructions.
[0045] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned conversion method is implemented.
[0046] The conversion method, apparatus, device and storage medium provided by the embodiments of the present disclosure obtain first data, parse the first data, obtain a mapping relationship between fields in the first data, determine an index path based on the mapping relationship between fields in the first data, a conversion strategy and fields, and convert the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0047] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0049] Figure 1 A schematic diagram of the structure of a conversion system in an embodiment of the present disclosure is shown;
[0050] Figure 2 A flow chart of a conversion method in an embodiment of the present disclosure is shown;
[0051] Figure 3 Another conversion method flow chart in the embodiment of the present disclosure is shown;
[0052] Figure 4 A schematic diagram of a transformation scheme tree in an embodiment of the present disclosure is shown;
[0053] Figure 5 A flow chart of another conversion method in an embodiment of the present disclosure is shown;
[0054] Figure 6 A flow chart of another conversion method in an embodiment of the present disclosure is shown;
[0055] Figure 7 A flow chart of another conversion method in an embodiment of the present disclosure is shown;
[0056] Figure 8 A flow chart of another conversion method in an embodiment of the present disclosure is shown;
[0057] Fig. 9 A schematic diagram of a conversion device in an embodiment of the present disclosure is shown;
[0058] Fig.10 A structural block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0059] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0060] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0061] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0062] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0063] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0064] With the development of society, the types of JSON data are gradually increasing. If multiple types of JSON data are converted into two-dimensional arrays, a lot of development and deployment of multiple services are required, which wastes a lot of resources.
[0065] In order to solve the above technical problems, the present disclosure provides a conversion method, device, equipment and storage medium. In order to explain the present disclosure in detail, the present disclosure first explains the conversion method.
[0066] It should be pointed out that, in the absence of conflict, the embodiments of the present disclosure and the technical features therein may be combined with each other.
[0067] The specific implementation method of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0068] Figure 1 A schematic diagram of the structure of a conversion system in an embodiment of the present disclosure is shown, and the system can apply the conversion method or conversion device in each embodiment of the present disclosure.
[0069] like Figure 1 As shown, the conversion system 10 may include a data acquisition module 101 and a data processing module 102 .
[0070] The data acquisition module 101 and the data processing module 102 may be located on two different devices. For example, the data acquisition module 101 may be a module on a device such as a camera for recording video, and the data processing module 102 may be a module on an electronic device with processing capabilities such as a computer. The data acquisition module 101 and the data processing module 102 may be located on the same device. For example, the data acquisition module 101 and the data processing module 102 may be a video recording module and a processing module on a mobile phone.
[0071] The data acquisition module 101 and the data processing module 102 are connected to each other through a network, which may be a wired network or a wireless network.
[0072] Optionally, the wireless network or wired network described above uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged through the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.
[0073] The following describes a situation in which the data acquisition module 101 and the data processing module 102 may be located on two different devices.
[0074] The data acquisition module 101 may be located on a terminal device, which may be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, wearable devices, augmented reality devices, virtual reality devices, etc.
[0075] Optionally, the client of the application installed in different terminal devices is the same, or the client of the same type of application based on different operating systems. Based on the different terminal platforms, the specific form of the client of the application can also be different, for example, the application client can be a mobile client, a PC client, etc.
[0076] The data processing module 102 may be located on a server, which may be a server that provides various services, such as a background management server that provides support for devices operated by users using terminal devices. The background management server may analyze and process the received request and other data, and feed back the processing results to the terminal device.
[0077] Optionally, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0078] Those skilled in the art will know that Figure 1 The number of data acquisition modules and data processing modules in the embodiment is only for illustration, and any number of data acquisition modules and data processing modules may be provided according to actual needs, which is not limited in the embodiments of the present disclosure.
[0079] Figure 2 A flow chart of a conversion method in an embodiment of the present disclosure is shown.
[0080] like Figure 2 As shown, the identification method may include:
[0081] S210, obtaining first data.
[0082] In some embodiments, the first data may be data including multiple fields, wherein a mapping relationship or a calling relationship may exist between the multiple fields.
[0083] Exemplarily, the first data may be JSON data.
[0084] S220: Parse the first data to obtain a mapping relationship between fields in the first data.
[0085] In some embodiments, the first data may be parsed based on an intelligent model or a Schema management tool.
[0086] S230, determining an index path based on a mapping relationship, a conversion strategy, and fields in the first data.
[0087] In some embodiments, the index path may include a data call relationship represented in the form of data.
[0088] S240: Convert the first data into second data based on the index path.
[0089] In some embodiments, the second data may include a two-dimensional array.
[0090] The conversion method provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0091] Figure 3 A flow chart of another conversion method in an embodiment of the present disclosure is shown.
[0092] like Figure 3 As shown, the identification method may include:
[0093] S310, obtaining first data;
[0094] S320, parsing the first data to obtain a mapping relationship between fields in the first data;
[0095] S330, determining an index path based on a mapping relationship, a conversion strategy, and a field in the first data;
[0096] S340: Generate a transformation solution tree based on the index path.
[0097] In some embodiments, when there are multiple index paths, the multiple index paths may have one starting index.
[0098] Exemplarily, since multiple fields in the first data have the same outermost call, multiple index paths can be converted into a conversion solution tree with the same root node.
[0099] Exemplarily, the index path may be:
[0100] (field 1)[root, A(b), items[*]],
[0101] (field 2)[root, B(b), items[1]],
[0102] (field 3)[root, B(q), items[2]],
[0103] (Field 4) [root, C(b), c1(b)],
[0104] (field 5) [root, C(b), c2(b)]]
[0105] Each field corresponds to an index.
[0106] like Figure 4 The following is the transformation scheme tree corresponding to the above example. For an attribute of object type, "(b)" is used to indicate that when the field from which data is extracted is combined with the field from which data is extracted from the attribute of the same object, if the amount of data extracted from the field is less than that from the other field, the combination is performed in a circular filling manner; "(q)" is used to indicate the combination is performed in a default manner. For an array type field, items is used to indicate the sub-items of the array, [*] is used to indicate traversing each sub-item of the array, and [i] is used to indicate indexing the i-th sub-item of the array.
[0107] S350: Convert the first data into second data based on the conversion scheme tree.
[0108] In some embodiments, taking the index path and the transformation scheme tree in the above example as an example, the two-dimensional array result obtained by transformation may be:
[0109] Field 1 Field 2 Field 3 Field 4 Field 5 a1 b1 b2 c11 c22 a2 b1 null c11 c22
[0110] The conversion method provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0111] Figure 5 A flow chart of another conversion method in an embodiment of the present disclosure is shown.
[0112] like Figure 5 As shown, the identification method may include:
[0113] S510, obtaining first data;
[0114] S520, parsing the first data to obtain a mapping relationship between fields in the first data;
[0115] S530, determining an index path based on a mapping relationship, a conversion strategy, and a field in the first data;
[0116] S540, generating a transformation scheme tree based on the index path;
[0117] S550, traversing the transformation scheme tree to determine the leaf nodes of the transformation scheme tree;
[0118] S560, combining the data corresponding to the leaf nodes to obtain second data.
[0119] In some embodiments, Figure 4 As shown, A(b), items[*], B(b), items[1], B(q), items[2], C(b), c1(b), C(b), c2(b)] can all be leaf nodes.
[0120] In some embodiments, combining data corresponding to leaf nodes to obtain second data may include: using data on each path or each branch in the transformation scheme tree as data in the same column, and then combining data in multiple columns to obtain the second data.
[0121] The conversion method provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0122] Figure 6 A flow chart of another conversion method in an embodiment of the present disclosure is shown.
[0123] like Figure 6 As shown, the identification method may include:
[0124] S610, obtaining first data;
[0125] S620, parsing the first data to obtain a mapping relationship between fields in the first data;
[0126] S630: Mark the field based on the attribute of the field in the first data and the conversion strategy to obtain a marked field.
[0127] In some embodiments, marking fields may include: using root to represent the outermost layer of the original JSON data, and indexing to the fields of basic types (character, numeric, Boolean, null) layer by layer through attribute values. For a property of an object type, this property uses "(b)" to represent that when a field from which data is extracted is combined with a field from an attribute under the same object, if the amount of data extracted from this field is less than that of another field, the combination is performed in a circular filling manner; "(q)" is used to represent the combination in a default manner. For array type fields, items are used to represent the subitems of the array, [*] is used to represent traversing each subitem of the array, and [i] is used to represent the i-th subitem of the index array. Formally, an index path is an array.
[0128] S640: Determine an index path based on the marked fields and the mapping relationship between the fields.
[0129] In some embodiments, after marking, the marked fields can be arranged in order based on the mapping relationship to obtain an index path.
[0130] S650: Convert the first data into second data based on the index path.
[0131] The conversion method provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0132] Figure 7 A flow chart of a conversion method in an embodiment of the present disclosure is shown.
[0133] like Figure 7 As shown, the identification method may include:
[0134] S710, obtaining first data;
[0135] S720, parsing the first data to obtain a mapping relationship between fields in the first data;
[0136] S730, input the attributes of the fields in the first data into the first intelligent model to obtain the marked fields.
[0137] In some embodiments, the intelligent model can be trained based on the attributes of the fields in the historical first data and the fields that have been historically marked to obtain a trained first intelligent model.
[0138] S740: Determine an index path based on the marked fields and the mapping relationship between the fields.
[0139] S750: Convert the first data into second data based on the index path.
[0140] The conversion method provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0141] Figure 8 A flow chart of a conversion method in an embodiment of the present disclosure is shown.
[0142] like Figure 8As shown, the identification method may include:
[0143] S810, obtaining first data;
[0144] S820, parse the first data based on the second intelligent model to obtain a mapping relationship between fields in the first data.
[0145] In some embodiments, the intelligent model can be trained based on the historical first data and the mapping relationship between the fields in the historical first data to obtain a trained second intelligent model.
[0146] S830: Determine an index path based on a mapping relationship, a conversion strategy, and fields in the first data.
[0147] S840: Convert the first data into second data based on the index path.
[0148] The conversion method provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0149] Based on the same inventive concept, the present disclosure also provides a conversion device in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0150] Fig. 9 A schematic diagram of a conversion device in an embodiment of the present disclosure is shown.
[0151] like Fig. 9 As shown, the conversion device 900 may include:
[0152] An acquisition module 910, configured to acquire first data;
[0153] The parsing module 920 is used to parse the first data to obtain a mapping relationship between fields in the first data;
[0154] A determination module 930, configured to determine an index path based on a mapping relationship, a conversion strategy, and fields in the first data;
[0155] The conversion module 940 is used to convert the first data into the second data based on the index path.
[0156] In some embodiments, the conversion module comprises:
[0157] A generation unit, used for generating a transformation scheme tree based on the index path;
[0158] The conversion unit is used to convert the first data into the second data based on the conversion scheme tree.
[0159] The conversion device provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0160] In some embodiments, the conversion unit comprises:
[0161] A traversal subunit is used to traverse the transformation scheme tree and determine the leaf nodes of the transformation scheme tree;
[0162] The combining subunit is used to combine the data corresponding to the leaf nodes to obtain the second data.
[0163] The conversion device provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0164] In some embodiments, the determining module includes:
[0165] A marking unit, used to mark the field based on the attribute of the field in the first data and the conversion strategy to obtain a marked field;
[0166] The determination unit is used to determine the index path based on the marked fields and the mapping relationship between the fields.
[0167] The conversion device provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0168] In some embodiments, the labeling unit comprises:
[0169] The marking subunit is used to mark the field based on the attribute of the field in the first data and the corresponding relationship between the preset attribute and the marking value to obtain the marked field.
[0170] The conversion device provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0171] In some embodiments, the parsing module includes:
[0172] The parsing unit is used to parse the first data based on the second intelligent model to obtain a mapping relationship between fields in the first data.
[0173] The conversion device provided by the embodiment of the present disclosure obtains first data, parses the first data, obtains a mapping relationship between fields in the first data, determines an index path based on the mapping relationship between fields in the first data, a conversion strategy, and fields, and converts the first data into second data based on the index path, thereby realizing the conversion of JSON data into a two-dimensional array.
[0174] The identification device provided in the embodiment of the present disclosure can be used to execute the identification methods provided in the above-mentioned method embodiments. The implementation principles and technical effects are similar and will not be described herein for the sake of brevity.
[0175] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0176] Refer to the following Fig.10 The electronic device 1000 according to this embodiment of the present disclosure is described. Fig.10 The electronic device 1000 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0177] like Fig.10 As shown, the electronic device 1000 is in the form of a general computing device. The components of the electronic device 1000 may include but are not limited to: the at least one processing unit 1010, the at least one storage unit 1020, and a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010).
[0178] The storage unit stores program codes, which can be executed by the processing unit 1010, so that the processing unit 1010 performs the steps of various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1010 can perform the following steps of the above method embodiment:
[0179] Acquire first data;
[0180] Parsing the first data to obtain a mapping relationship between fields in the first data;
[0181] Determine an index path based on a mapping relationship, a conversion strategy, and a field in the first data;
[0182] The first data is converted into the second data based on the index path.
[0183] The storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 10201 and / or a cache storage unit 10202 , and may further include a read-only storage unit (ROM) 10203 .
[0184] The storage unit 1020 may also include a program / utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0185] Bus 1030 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0186] The electronic device 1000 may also process images with one or more external devices 1040 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also process images with one or more devices that enable a user to interact with the electronic device 1000, and / or may process images with any device that enables the electronic device 1000 to process images with one or more other computing devices (e.g., routers, modems, etc.). Such image processing may be performed through an input / output (I / O) interface 1050. Furthermore, the electronic device 1000 may also process images with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 1060. As shown, the network adapter 1060 processes images with other modules of the electronic device 1000 through a bus 1030. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0187] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0188] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.
[0189] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0190] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0191] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0192] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0193] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0194] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0195] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0196] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A transformation method, characterized in that: include: Acquire first data; Parsing the first data to obtain a mapping relationship between fields in the first data; Determine an index path based on a mapping relationship of fields in the first data, a conversion strategy, and the fields; The first data is converted into second data based on the index path.
2. The method according to claim 1, characterized in that The converting the first data into second data based on the index path includes: Generate a transformation scheme tree based on the index path; The first data is converted into second data based on the conversion solution tree.
3. The method according to claim 1, characterized in that The converting the first data into second data based on the conversion scheme tree includes: Traversing the transformation scheme tree to determine the leaf nodes of the transformation scheme tree; The data corresponding to the leaf nodes are combined to obtain the second data.
4. The method according to claim 1, characterized in that: The determining of the index path based on the mapping relationship of the fields in the first data, the conversion strategy and the fields includes: Marking the field based on the attribute of the field in the first data and the conversion strategy to obtain a marked field; An index path is determined based on the marked fields and a mapping relationship between the fields.
5. The method according to claim 4, characterized in that The step of marking the field based on the attribute of the field in the first data and the conversion strategy to obtain the marked field includes: The field is marked based on the attribute of the field in the first data and the correspondence between the preset attribute and the mark value to obtain a marked field.
6. The method according to claim 4, characterized in that The step of marking the field based on the attribute of the field in the first data and the conversion strategy to obtain the marked field includes: The attributes of the fields in the first data are input into the first intelligent model to obtain the marked fields.
7. The method according to claim 4, characterized in that The parsing of the first data includes: The first data is parsed based on the second intelligent model to obtain a mapping relationship between fields in the first data.
8. A conversion device, characterized in that: include: An acquisition module, used for acquiring first data; A parsing module, used to parse the first data to obtain a mapping relationship between fields in the first data; A determination module, configured to determine an index path based on a mapping relationship between fields in the first data, a conversion strategy, and the fields; A conversion module is used to convert the first data into second data based on the index path.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the conversion method according to any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the conversion method according to any one of claims 1 to 7 is implemented.
