Data processing method and device, electronic equipment and storage medium
By extracting and generating target data information, the problem of difficult parsing of object markup languages is solved, and efficient parsing and management of data transmission are achieved.
Patent Information
- Application Number
- CN202211350514.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-10-31
AI Technical Summary
In large and complex data transmissions, parsing Object Markup Language (Object Markup Language) becomes increasingly difficult, making it hard to accurately manipulate the content of Object Markup Language, resulting in low data transmission efficiency.
By extracting path and data information from each node in the original data, target data information is generated based on the path and data information, enabling the gateway to manage requests based on the target data and achieve rapid parsing and management.
It improves data parsing efficiency, and the gateway can manage requests based on target data information, thus improving data management efficiency.
Smart Images

Figure CN115665285B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a data processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rapid development of computer technology, in order to improve data transmission efficiency and ensure the security of data transmission, specific data structures are usually used for data transmission. For example, object markup languages can be used for data transmission, thereby improving the efficiency of data transmission.
[0003] For security reasons, parsing and monitoring are typically performed based on the public fields of the Object Markup Language (Object Markup Language), requiring reading and writing of Object Markup Language content, or object serialization or deserialization operations. However, in the context of large and complex transmitted data, parsing Object Markup Language becomes increasingly difficult, making it challenging to accurately manipulate its content. Summary of the Invention
[0004] This invention provides a data processing method, apparatus, electronic device, and storage medium, which realizes the parsing of raw data to be processed based on path information and data information in the raw data, and determines the target data information, so that the gateway can control the data based on the target data information.
[0005] In a first aspect, the present invention provides a data processing method, comprising:
[0006] Obtain the raw data to be processed, and process the raw data to obtain the original data;
[0007] Extract the path information of each node from the original data, and obtain the data information corresponding to each node based on the path information; wherein, the data information includes data field information and data format information;
[0008] Target data information is determined based on the data information and the preset format information, and target data is constructed based on the target data information and the path information, so that the gateway can perform request control based on the target data.
[0009] Secondly, embodiments of the present invention also provide a data processing apparatus, the apparatus comprising:
[0010] The raw data acquisition module is used to acquire the raw data to be processed and to process the raw data to obtain the raw data.
[0011] The data information acquisition module is used to extract the path information of each node in the original data, and acquire the data information corresponding to each node based on the path information; wherein, the data information includes data field information and data format information;
[0012] The request control module is used to determine target data information based on the data information and preset format information, and to construct target data based on the target data information and the path information, so that the gateway can perform request control based on the target data.
[0013] Thirdly, embodiments of the present invention also provide an electronic device, the device comprising:
[0014] One or more processors; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to implement the data processing method as described in any of the embodiments of the present invention.
[0017] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data processing method as described in any of the embodiments of the present invention.
[0018] The technical solution of this invention involves acquiring raw data to be processed, processing the raw data to obtain raw data, extracting path information of each node in the raw data, obtaining data information corresponding to each node based on the path information, and finally determining target data information based on the data information and preset format information. Target data is then constructed based on the target data information and the path information, enabling the gateway to perform request control based on the target data. Based on the above technical solution, by extracting path information and data information from the raw data and generating target data information based on the path information and data information, rapid parsing of the raw data to be processed is achieved, improving data parsing efficiency. Furthermore, the gateway can perform request control based on the target data information, thus achieving the technical effect of improving data management efficiency.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of the present invention;
[0022] Figure 2 This is a flowchart of a data processing method provided in an embodiment of the present invention;
[0023] Figure 3 This is a structural block diagram of a data processing device provided in an embodiment of the present invention;
[0024] Figure 4 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] Example 1
[0028] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of the present invention. This embodiment is applicable to situations where target data information is determined based on path information and data information in the original data, so that the gateway can perform request management based on the target data information. This method can be executed by a data processing device, which can be implemented in hardware / software. The device can be configured in an electronic device, such as a PC or a server.
[0029] like Figure 1 As shown, the method includes:
[0030] S110. Obtain the raw data to be processed, and process the raw data to obtain the raw data.
[0031] The raw data to be processed can be data obtained from a user's request. Raw data can be understood as data with a specific format obtained after processing the raw data to be processed; for example, the raw data can be a JSON object.
[0032] Specifically, when a user needs to use the functions provided by the application, they can send a request message by triggering the corresponding control. After obtaining the request message, the raw data to be processed can be extracted from it. For example, the raw data to be processed can be a JSON string in the request message. Then, after obtaining the raw data to be processed, further processing can be performed on the raw data to obtain the original data. For example, the JSON string in the request message can be converted into a JSON object, and then the converted raw data to be processed can be further processed.
[0033] S120. Extract the path information of each node in the original data, and obtain the data information corresponding to each node based on the path information.
[0034] The path information can be used to retrieve the corresponding data. The data information includes data field information and data format information. Field information can be the field values corresponding to each node in the original data. Data format information can be understood as information used to identify the current data format.
[0035] Specifically, the path information of each node in the original data is obtained, and the corresponding data information of each node is retrieved based on this path information. For example, the absolute position of the data information under the current node can be determined through the path information, and the data information at that position can be directly extracted. It should be noted that JSON (JavaScript Object Notation) is a lightweight data exchange language conceived and designed by Douglas Crockford. This language is based on easily readable text and is used to transmit data objects composed of attribute values or sequential values. JSON format mainly has two representation methods: multi-level structure: {"data":{"A":"a"}} and single-level structure: {"data.A":"a"}. These two forms are equivalent and each has its advantages and disadvantages. The multi-level structure is easier to read, while the single-level structure is easier to match and search.
[0036] S130. Target data information is determined based on the data information and preset format information, and target data is constructed based on the target data information and the path information, so that the gateway can perform request control based on the target data.
[0037] Here, preset format information can be understood as pre-set format information. Target data information can be understood as the data information to be acquired. Target data can be data with a specific format generated based on path information and target data information, such as a MAP object.
[0038] Specifically, the system acquires the data format information and determines whether the fields in the current data meet preset conditions based on the data format information and preset format information. If the preset conditions are met, the fields in the current data are identified as target data. If the preset conditions are not met, the system continues processing the data information of the next node. After identifying all target data, the system constructs target data based on the target data and path information, enabling the gateway to manage request information based on the target data. For example, by reading and writing the corresponding JSON field values through the path information in the MAP object, the gateway can complete the management and verification of public field fields in JSON messages, such as data anonymization, signature verification, encryption and decryption, anti-replay attack, and blacklist / whitelist monitoring.
[0039] Based on the above technical solution, the step of determining the target data information based on the data information and the preset format information includes: when it is detected that the data format information in the data information does not match the preset format information, then the data field information in the data information is determined as the target data information; when it is detected that the data format information in the data information matches the preset format information, then a data extraction method is determined based on the data format information in the data information, and the target data information is extracted based on the data extraction method.
[0040] Among them, the data extraction method can be a method used to process the current data information.
[0041] Specifically, if the data format information in the data information does not match the preset format information, it means that there is no need to process the current data information again, and the data field information in the current data information is determined as the target data information. If the format information in the data information matches the preset format information, it means that the current data information has not been fully parsed, and the data extraction method needs to be determined based on the data format information of the current data information, and then the current data information is further parsed based on the data extraction method.
[0042] Based on the above technical solution, the step of determining the data extraction method based on the data format information in the data information, and extracting the target data information based on the data extraction method, includes: when the data format information of the current data information is detected to be an object format, obtaining the object path information corresponding to the data information under the current node; connecting the object path information with the path information of the previous node, and obtaining the data information of the next node, so as to determine the target data information based on the data information of the next node.
[0043] Here, object format can be understood as the data format information of the data fields in the current data information being an object. Object path information can be an absolute path used to indicate the storage location of the current data information.
[0044] Specifically, if the current data information is in object format, it means that further parsing is needed. This involves obtaining the object path information corresponding to the data information under the current node, concatenating this path information with the path information of the previous node, and obtaining the data information of the next node. The path information of the next node is then processed to obtain the target data information. It should be noted that JSON data structures are mainly composed of objects and arrays. Objects can be represented as content enclosed in curly braces "{}", and the data structure is a key-value pair structure of {key: value, key: value, ...}. In object-oriented languages, the key is the path information, and the value is the corresponding data field information, making it easy to understand. The method for retrieving the value is: object.key, where the attribute value can be a number, string, array, or object. Arrays in JSON are enclosed in square brackets "[]", with a data structure of ["a","b","c",...]. The method for retrieving values is the same as in all languages, using indexing. The field value type can be a number, string, JSON array, JSON object, etc.
[0045] Based on the above technical solution, the step of determining the data extraction method based on the format information of the field value and extracting the target field value based on the data extraction method includes: when the data format information of the current data information is detected to be in array format, obtaining the path information corresponding to the data information under the current node, and adding identification information to the path information to obtain array path information; connecting the array path information with the path information of the previous node, and processing the current data information.
[0046] The array format is understood as an array of data field information within the current data information. The identifier information can be used to identify that the current path information is an array path.
[0047] Specifically, if the current data information is in array format, the path information corresponding to the data information under the current node is obtained, and an identifier is added to the path information to obtain array path information. This array path information is then concatenated with the path information of the previous node before parsing the current array. For example, after obtaining the path information of the current data information, an index is added to the path information to indicate that the path information is an array.
[0048] Based on the above technical solution, the array path information is connected with the path information of the previous node, and the current data information is processed, including: obtaining the path information and data information corresponding to each element in the current data information; when it is detected that the data format information in the data information does not match the preset format information, the data field information in the data information is determined as the target data information; when it is detected that the data format information in the data information matches the preset format information, the data information corresponding to the current element is processed based on the data format information in the data information.
[0049] Here, an element can be the basic unit that makes up an array.
[0050] Specifically, if the current data information is in array format, then the path information and data information corresponding to each element in the current data information are extracted. The corresponding data processing method is determined according to the preset format information and the data format information in the data information. For example, if the data format information in the data information does not match the preset format information, then the data field information in the data information is determined as the target data information; if the data format information in the data information matches the preset format information, then the data information corresponding to the current element is processed based on the data format information in the data information.
[0051] Based on the above technical solution, the step of processing the data information corresponding to the current element based on the data format information in the data information includes: when the data format information of the current data information is detected to be in object format, extracting the path information of the current element; connecting the path information of the current element with the path information of the previous element, and obtaining the data information of the next element.
[0052] Specifically, if the data format information in the current element's data information is in object format, extract the path information of the current element's data information, connect it with the path information of the previous element, obtain the data information of the next element, and determine the target data information based on the data information of the next element, until the data information of all elements in the array has been parsed.
[0053] Based on the above technical solution, the step of processing the data information corresponding to the current element based on the data format information in the data information includes: when the format information of the current data information is detected to be an array format, extracting the path information of the current element and adding identification information to the path information to obtain array path information; connecting the array path information with the path information of the previous element, and processing the current data information.
[0054] Specifically, if the current data information is in array format, the path information corresponding to the data information under the current element is obtained, and an identifier is added to the path information to obtain the array path information. This array path information is then concatenated with the path information of the previous element before parsing the current array. For example, after obtaining the path information of the current element's data information, an index is added to the path information to indicate that the path information is an array path information.
[0055] The technical solution of this invention involves acquiring raw data to be processed, processing the raw data to obtain raw data, extracting path information of each node in the raw data, obtaining data information corresponding to each node based on the path information, and finally determining target data information based on the data information and preset format information. Target data is then constructed based on the target data information and the path information, enabling the gateway to perform request control based on the target data. Based on the above technical solution, by extracting path information and data information from the raw data and generating target data information based on the path information and data information, rapid parsing of the raw data to be processed is achieved, improving data parsing efficiency. Furthermore, the gateway can perform request control based on the target data information, thus achieving the technical effect of improving data management efficiency.
[0056] Example 2
[0057] Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of the present invention. This embodiment further optimizes the data processing method based on the above embodiments. Specific implementation details can be found in the technical solution of this embodiment. Technical terms that are the same as or corresponding to those in the above embodiments will not be repeated here.
[0058] like Figure 2 As shown, the method in this embodiment specifically includes:
[0059] Obtaining raw data: Specifically, this can be done by retrieving the raw data to be processed from the request message. First, the raw data to be processed is converted into data, for example, by converting a JSON string into a JSON object. Then, the raw data is parsed. The specific conversion method is as follows:
[0060] functionA(Mapmap,StringjsonString,StringfullKey,Stringkey){
[0061] JSONjson=JSON.parseObject(jsonString);
[0062] functionB(map, json, fullKey);
[0063] }
[0064] The original data is parsed layer by layer: specifically, the multi-layered JSON object is flattened into a single layer, and then...
[0065] The process involves determining the data format of child nodes in the original data. If the data format is an object, the path information of the child node is concatenated with the path information of the parent node (e.g., using a "."), and the data is processed recursively. If the data format is an array, an identifier is added to the path information of the child node before concatenating it with the path information of the parent node (again, using a "."), and the data is processed recursively. The specific parsing method is as follows:
[0066]
[0067]
[0068] The array is parsed layer by layer: Specifically, the data format of each element in the JSON array is checked in a loop. If the data format is an object, the path information of the current element is concatenated with the path information of the previous element (e.g., using a "."), and the data is processed recursively. If the data format is an array, the path information of the current element is appended with an identifier and then concatenated with the path information of the previous element (e.g., using a "."), and the data is processed recursively. The specific parsing method is as follows:
[0069]
[0070]
[0071] Generating Target Data: Specifically, after parsing the original data, target data is generated based on the target data information and path information. For example, JSON is completely converted into a MAP object based on the target data information and path information. It should be noted that the technical solution of this embodiment of the invention, by completely converting JSON into a MAP object based on the target data information and path information, enables the API gateway to read and write the corresponding JSON field values through the MAP key. The API gateway can then complete the control and verification of public field fields in the JSON message, such as data anonymization, signature verification, encryption / decryption, anti-replay attack, blacklist / whitelist monitoring, etc., while maintaining the complete structure of the JSON message. After the API gateway completes its supervision, it facilitates message restoration; and the JSON parsing process can be adjusted according to the restoration needs, such as NULL values, JSON index start numbers, etc., which can be flexibly configured.
[0072] The technical solution of this invention involves acquiring raw data to be processed, processing the raw data to obtain raw data, extracting path information of each node in the raw data, obtaining data information corresponding to each node based on the path information, and finally determining target data information based on the data information and preset format information. Target data is then constructed based on the target data information and the path information, enabling the gateway to perform request control based on the target data. Based on the above technical solution, by extracting path information and data information from the raw data and generating target data information based on the path information and data information, rapid parsing of the raw data to be processed is achieved, improving data parsing efficiency. Furthermore, the gateway can perform request control based on the target data information, thus achieving the technical effect of improving data management efficiency.
[0073] Example 3
[0074] Figure 3 This is a structural block diagram of a data processing device provided in an embodiment of the present invention. The device includes: a raw data acquisition module 310, a data information acquisition module 320, and a request control module 330.
[0075] The raw data acquisition module 310 is used to acquire raw data to be processed and process the raw data to obtain raw data.
[0076] The data information acquisition module 320 is used to extract the path information of each node in the original data and acquire the data information corresponding to each node based on the path information; wherein, the data information includes data field information and data format information;
[0077] The request control module 330 is used to determine target data information based on the data information and preset format information, and to construct target data based on the target data information and the path information, so that the gateway can perform request control based on the target data.
[0078] Based on the above technical solution, the request control module is used to determine the data field information in the data information as the target data information when it detects that the data format information in the data information does not match the preset format information; when it detects that the data format information in the data information matches the preset format information, it determines the data extraction method based on the data format information in the data information, and extracts the target data information based on the data extraction method.
[0079] Based on the above technical solution, the request control module is used to detect that the data format information of the current data information is in object format, obtain the object path information corresponding to the data information under the current node; connect the object path information with the path information of the previous node, and obtain the data information of the next node, so as to determine the target data information based on the data information of the next node.
[0080] Based on the above technical solution, the request control module includes: an array parsing unit that, when detecting that the data format information of the current data information is in array format, obtains the path information corresponding to the data information under the current node, adds identification information to the path information to obtain array path information; connects the array path information with the path information of the previous node, and processes the current data information.
[0081] Based on the above technical solution, the array parsing unit is used to obtain the path information and data information corresponding to each element in the current data information; when it is detected that the data format information in the data information does not match the preset format information, the data field information in the data information is determined to be the target data information; when it is detected that the data format information in the data information matches the preset format information, the data information corresponding to the current element is processed based on the data format information in the data information.
[0082] Based on the above technical solution, the array parsing unit is used to extract the path information of the current element when it detects that the data format information of the current data information is in object format; connect the path information of the current element with the path information of the previous element, and obtain the data information of the next element.
[0083] Based on the above technical solution, when the array parsing unit detects that the format information of the current data information is an array format, it extracts the path information of the current element and adds identification information to the path information to obtain array path information; it connects the array path information with the path information of the previous element and processes the current data information.
[0084] The technical solution of this invention involves acquiring raw data to be processed, processing the raw data to obtain raw data, extracting path information of each node in the raw data, obtaining data information corresponding to each node based on the path information, and finally determining target data information based on the data information and preset format information. Target data is then constructed based on the target data information and the path information, enabling the gateway to perform request control based on the target data. Based on the above technical solution, by extracting path information and data information from the raw data and generating target data information based on the path information and data information, rapid parsing of the raw data to be processed is achieved, improving data parsing efficiency. Furthermore, the gateway can perform request control based on the target data information, thus achieving the technical effect of improving data management efficiency.
[0085] The data processing apparatus provided in the embodiments of the present invention can execute the data processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0086] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0087] Example 3
[0088] Figure 4 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0089] like Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0090] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0091] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as data processing methods.
[0092] In some embodiments, the data processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the data processing method by any other suitable means (e.g., by means of firmware).
[0093] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0094] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0095] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0096] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0097] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0098] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0099] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0100] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A data processing method, characterized by, The method comprises the following steps: acquiring raw data to be processed, and processing the raw data to be processed to obtain original data; extracting path information of each node in the original data, and acquiring data information corresponding to each node based on the path information; wherein the data information comprises data field information and data format information; determining target data information based on the data information and preset format information, so as to constitute target data based on the target data information and the path information, and enabling a gateway to make a request for control based on the target data; the determination of the target data information based on the data information and the preset format information comprises: when it is detected that the data format information in the data information does not match the preset format information, determining the data field information in the data information as the target data information; when it is detected that the data format information in the data information matches the preset format information, determining a data extraction mode based on the data format information in the data information, and extracting the target data information based on the data extraction mode.
2. The method of claim 1, wherein, the determination of the data extraction mode based on the data format information in the data information, and the extraction of the target data information based on the data extraction mode comprises: when it is detected that the data format information of the current data information is an object format, acquiring object path information corresponding to the data information under the current node; connecting the object path information with path information of a previous node, and acquiring data information of a next node, so as to determine the target data information based on the data information of the next node.
3. The method of claim 1, wherein, the determination of the data extraction mode based on the data format information in the data information, and the extraction of the target data information based on the data extraction mode comprises: when it is detected that the data format information of the current data information is an array format, acquiring path information corresponding to the data information under the current node, and adding identification information to the path information to obtain array path information; connecting the array path information with path information of a previous node, and processing the current data information.
4. The method of claim 3, wherein, the connection of the array path information with the path information of the previous node, and the processing of the current data information comprises: acquiring path information and data information corresponding to each element in the current data information; when it is detected that the data format information in the data information does not match the preset format information, determining the data field information in the data information as the target data information; when it is detected that the data format information in the data information matches the preset format information, processing data information corresponding to the current element based on the data format information in the data information.
5. The method of claim 4, wherein, the processing of the data information corresponding to the current element based on the data format information in the data information comprises: when it is detected that the data format information of the current data information is an object format, extracting path information of the current element; connecting the path information of the current element with path information of a previous element, and acquiring data information of a next element.
6. The method of claim 4, wherein, the processing of the data information corresponding to the current element based on the data format information in the data information comprises: When it is detected that the format information of the current data information is an array format, path information of a current element is extracted, and identification information is added to the path information to obtain array path information; The array path information is connected with path information of a previous element, and the current data information is processed.
7. A data processing apparatus, characterized by, Comprise: An original data acquisition module configured to acquire to-be-processed original data, and to process the to-be-processed original data to obtain original data; A data information acquisition module configured to extract path information of each node in the original data, and to acquire data information corresponding to each node based on the path information; wherein the data information comprises data field information and data format information; A request control module configured to determine target data information based on the data information and preset format information, to constitute target data based on the target data information and the path information, and to enable a gateway to perform request control based on the target data; The request control module is configured to, when it is detected that the data format information in the data information does not match the preset format information, determine that data field information in the data information is target data information; and when it is detected that the data format information in the data information matches the preset format information, determine a data extraction manner based on the data format information in the data information, and to extract the target data information based on the data extraction manner.
8. An electronic device, comprising: The electronic device comprises: One or more processors; and A memory communicatively connected to the at least one processor; wherein The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the data processing method in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to execute the data processing method in any one of claims 1-6 when executed.
Citation Information
Patent Citations
Data processing method and Internet of things gateway
CN107395572A
Method for the transmission of user data objects
CN1692615A