Data processing method and device, storage medium and electronic device
By identifying and processing the types of raw data and parsing the attributes of unstructured data and variables of structured data, it solves the problem of developers' heavy workload and low efficiency when processing unprocessed data, and improves data utilization and efficiency. .
Patent Information
- Application Number
- CN202210006005.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-04
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-01-04
AI Technical Summary
It is difficult for existing technologies to effectively process and utilize large amounts of unprocessed raw data, resulting in heavy workload for developers and low data utilization and efficiency.
By obtaining the original data, determine its type, and perform processing based on the type: for unstructured data, obtain description information, determine parsing rules, parse and save it as attribute data; for structured data, obtain plaintext data, process and save it as variable data.
It reduces the workload of developers, improves data availability and utilization, and improves data usage efficiency.
Smart Images

Figure CN114357249B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method and device, a storage medium and an electronic device. Background Art
[0002] With the widespread use of computers, computers have begun to be used in all walks of life. With the application of computers in work and life, a large amount of data has been generated, especially in the financial and Internet industries, which receive a large amount of user data, risk strategy data, user behavior data and other data in daily work.
[0003] Currently, these data are usually unprocessed raw data. When developers use the raw data for corresponding development work or mine the raw data, the unprocessed raw data is difficult to be used directly, which increases the workload of developers and reduces the utilization and efficiency of data. Summary of the invention
[0004] In view of this, the present invention provides a data processing method and device, a storage medium and an electronic device. The present invention can process the original data and then extract corresponding data from the original data, so that developers can directly use the data extracted from the original data, reduce the workload of developers, and improve data utilization.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] A first aspect of the present invention discloses a data processing method, comprising:
[0007] Acquire original data, and determine the data type of the original data;
[0008] When the data type of the original data is unstructured data, obtaining description information of the original data, and determining a parsing rule based on the description information;
[0009] Parsing the original data based on the parsing rule to obtain attribute data in the original data, and calling a preset data storage module to save the attribute data to an unstructured database;
[0010] When the data type of the original data is structured data, obtaining plaintext data of the original data;
[0011] Obtaining each variable in the plaintext data, and determining the variable type of each variable;
[0012] Based on the variable type of each variable, each variable is processed to obtain variable data, and the variable data is saved in a structured database.
[0013] In the above method, optionally, the step of obtaining the plaintext data of the original data includes:
[0014] Determining whether the original data is encrypted data;
[0015] If the original data is encrypted data, decrypting the original data and determining the decrypted data as the plaintext data of the original data;
[0016] If the original data is not encrypted data, the original data is determined to be plaintext data.
[0017] In the above method, optionally, the obtaining of raw data and determining the data type of the raw data includes:
[0018] Get the request instruction sent by the user;
[0019] Sending the request instruction to a preset data front-end processing module;
[0020] Acquire response data acquired by the data front-end processing module based on the request instruction, determine the response data as original data, and determine the data type of the original data as structured data.
[0021] In the above method, optionally, the obtaining of raw data and determining the data type of the raw data includes:
[0022] The uploaded data carrying the description information is acquired through the data interface, the uploaded data is determined as original data, and the data type of the original data is determined to be unstructured data.
[0023] In the above method, optionally, the step of processing each variable based on the variable type of each variable to obtain variable data includes:
[0024] For each variable of the renaming type, use the keyword of each variable to perform renaming processing to obtain the first renaming variable of each variable;
[0025] For each variable whose variable type is a derived type, each variable is merged to obtain a derived variable;
[0026] For each variable whose variable type is array type, a number is added to the variable name of each variable to rename each variable to obtain a second renamed variable of each variable;
[0027] Each first renamed variable, the derived variable, and each second renamed variable are determined as variable data.
[0028] In the above method, optionally, the process in which the data front-end processing device obtains the response data based on the request instruction includes:
[0029] Parsing the request instruction to determine the data request method and data content format of the request instruction;
[0030] Based on the data request method and the data content format, generate a request message corresponding to the request instruction;
[0031] Sending the request message to a remote server through a preset proxy server, so that the remote server generates response data corresponding to the request message;
[0032] The response data fed back by the remote server is obtained through the proxy server.
[0033] A second aspect of the present invention discloses a data processing device, comprising:
[0034] A first acquisition unit, used to acquire original data and determine the data type of the original data;
[0035] a second acquisition unit, configured to acquire description information of the original data when the data type of the original data is unstructured data, and determine a parsing rule based on the description information;
[0036] A calling unit, configured to parse the original data based on the parsing rule to obtain attribute data in the original data, and to call a preset data storage module to save the attribute data into an unstructured database;
[0037] A third acquisition unit, configured to acquire plaintext data of the original data when the data type of the original data is structured data;
[0038] A fourth acquisition unit, used to acquire each variable in the plaintext data and determine a variable type of each variable;
[0039] The processing unit is used to process each of the variables based on the variable type of each of the variables to obtain variable data, and save the variable data to a structured database.
[0040] In the above device, optionally, the third acquisition unit includes:
[0041] A judging subunit, used to judge whether the original data is encrypted data;
[0042] a decryption subunit, configured to, if the original data is encrypted data, decrypt the original data and determine the decrypted data as the plaintext data of the original data;
[0043] The first determining subunit is used to determine the original data as plain text data if the original data is not encrypted data.
[0044] In the above device, optionally, the first acquisition unit includes:
[0045] A first acquisition subunit is used to acquire a request instruction sent by a user;
[0046] A sending subunit, used for sending the request instruction to a preset data front-end processing module;
[0047] The second acquisition subunit is used to acquire the response data acquired by the data front-end processing module based on the request instruction, determine the response data as original data, and determine the data type of the original data as structured data.
[0048] In the above device, optionally, the first acquisition unit includes:
[0049] The second determining subunit is used to obtain the uploaded data carrying the description information through the data interface, determine the uploaded data as original data, and determine the data type of the original data as unstructured data.
[0050] In the above device, optionally, the processing unit includes:
[0051] A first renaming subunit is used to perform renaming processing on each variable of the renaming type using the keyword of each variable to obtain a first renaming variable of each variable;
[0052] A merging subunit is used for merging each variable of a derived type to obtain a derived variable;
[0053] The second renaming subunit is used for adding numbers to the variable name of each variable of the array type to rename each variable to obtain a second renamed variable of each variable;
[0054] The third determining subunit is used to determine each of the first renamed variables, the derived variables, and each of the second renamed variables as variable data.
[0055] The above device may optionally further include:
[0056] A determination unit, configured to parse the request instruction and determine a data request method and a data content format of the request instruction;
[0057] A first generating unit, configured to generate a request message corresponding to the request instruction based on the data request mode and the data content format;
[0058] A second generating unit, configured to send the request message to a remote server through a preset proxy server, so that the remote server generates response data corresponding to the request message;
[0059] A feedback unit is used to obtain the response data fed back by the remote server through the proxy server.
[0060] A third aspect of the present invention discloses a storage medium, which includes stored instructions, wherein when the instructions are executed, a device where the storage medium is located is controlled to execute the data processing method as described above.
[0061] A fourth aspect of the present invention discloses an electronic device, comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the data processing method as described above.
[0062] Compared with the prior art, the present invention has the following advantages:
[0063] The embodiment of the present invention provides a data processing method and device, a storage medium and an electronic device, the method comprising: obtaining original data and determining the data type of the original data; when the data type of the original data is unstructured data, obtaining description information of the original data and determining parsing rules based on the description information; parsing the original data based on the parsing rules to obtain attribute data in the original data, and calling a preset data storage module to save the attribute data to an unstructured database; when the data type of the original data is structured data, obtaining the plaintext data of the original data; obtaining each variable in the plaintext data and determining the variable type of each variable; based on the variable type of each variable, processing each variable to obtain variable data, and saving the variable data to a structured database. Determine the data type of the original data, and when the original data is unstructured data, process the original data to extract attribute data from the original data; when the original data is structured data, process the original data to extract variable data from the original data. By processing the original data, the workload of the staff can be reduced, the difficulty of applying the original data can be reduced, the availability of the data can be improved, and the utilization rate and efficiency of the data can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0065] Figure 1 A method flow chart of a data processing method provided by an embodiment of the present invention;
[0066] Figure 2 A flow chart of a method for a data front-end processing module to obtain response data based on a request instruction provided by an embodiment of the present invention;
[0067] Figure 3 A flow chart of structured data processing provided by an embodiment of the present invention;
[0068] Figure 4 A flowchart of processing unstructured data provided by an embodiment of the present invention;
[0069] Figure 5 A schematic diagram of the structure of a data processing device provided by an embodiment of the present invention;
[0070] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0071] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0072] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0073] Explain the professional terms used in this invention:
[0074] Structured data: Structured data is also called row data. It is data that is logically expressed and implemented by a two-dimensional table structure. It strictly follows the data format and length specifications and is mainly stored and managed through relational databases. In contrast to structured data, unstructured data is not suitable for being represented by a two-dimensional table in a database, including office documents of all formats, XML, HTML, various reports, pictures, audio, and video information. Databases that support unstructured data use multi-valued fields, fields, and variable-length field mechanisms to create and manage data items, and are widely used in full-text retrieval and various multimedia information processing fields.
[0075] Unstructured data: Unstructured data is data with irregular or incomplete structure, no predefined data model, and is not convenient to be represented by a two-dimensional logical table in a database. It includes office documents of all formats, text, pictures, XML, HTML, various reports, images, and audio / video information, etc.
[0076] At present, in the daily work of banks or other Internet companies, a large amount of user data, risk strategy data, user behavior data, etc. are received. These data are divided into structured data (such as name, ID number, mobile phone number, etc.) and unstructured data (such as pictures, files, etc.). How to process, handle, store, and use these data, and what methods or ways to process these data, such as a "device", a program project or a piece of code, etc. The industry generally stores structured data by field through the database (such as name, ID number, mobile phone number, etc. in the data), but it cannot solve JSON (a lightweight data exchange format) data, especially the array in JSON cannot be processed; unstructured data is stored on the disk and the disk path is stored in the database field without processing the unstructured data content, which is very inefficient.
[0077] The present invention aims to process unprocessed raw data, which can reduce the development workload of developers when applying data, reduce the difficulty of using data, and improve the efficiency and utilization of data.
[0078] The present invention can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or devices, etc.
[0079] The embodiment of the present invention provides a data processing method, the execution subject of the method can be a computer or a processor, referring to Figure 1 , is a method flow chart of a data processing method provided by an embodiment of the present invention, and is specifically described as follows:
[0080] S101: Obtain original data and determine the data type of the original data.
[0081] In the method provided in the embodiment of the present invention, data types are divided into two types, one is unstructured data and the other is structured data.
[0082] The following is an explanation of the process of obtaining unstructured data. The specific contents are as follows:
[0083] The uploaded data carrying the description information is acquired through the data interface, the uploaded data is determined as original data, and the data type of the original data is determined to be unstructured data.
[0084] It should be noted that a data interface is pre-set on the data receiving and processing module. The data interface is used to upload unstructured data. The data uploaded through the data interface can be called uploaded data. The uploaded data carries its own description information, which includes but is not limited to the data name, data size and other descriptions of the uploaded data. Furthermore, the user uses the data interface to upload the data collected by the user, and the external data acquisition module can also upload the collected data through the data interface.
[0085] The following is an explanation of the process of obtaining structured data. The specific contents are as follows:
[0086] Get the request instruction sent by the user;
[0087] Sending the request instruction to a preset data front-end processing module;
[0088] Acquire response data acquired by the data front-end processing module based on the request instruction, determine the response data as original data, and determine the data type of the original data as structured data.
[0089] It should be noted that the request instruction can be a query request, and the request instruction contains the specific content, format, etc. of the structured data that the user wants to request or query. The user sends the request instruction to the load balancer, and the load balancer sends the request instruction to the gateway, which forwards it to the data receiving and processing module. The data receiving and processing module sends the request instruction to the data front-end processing module through the data sending module. The data front-end processing module obtains the corresponding response data from the remote server based on the request instruction, and sends the response data to the data receiving and processing module through the data sending module. After receiving the response data fed back by the data front-end processing module, the data receiving and processing module directly determines the response data as original data, and determines that the data type of the original data is structured data. Preferably, the response data includes but is not limited to business data, return code, and return information.
[0090] Further, the present invention provides a method flow for a data front-end processing module to obtain response data based on a request instruction, which can be specifically referred to Figure 2 , and the specific description is as follows:
[0091] S201. Analyze the request instruction to determine the data request method and data content format of the request instruction.
[0092] The data front-end processing module analyzes the request instruction to determine the data request method and data content format of the request instruction. Exemplarily, the data request methods include but are not limited to JSON method (a lightweight data exchange format), XML method (Extensible Markup Language), SOAP method (Simple Object Access Protocol), the method of a jar package program provided by a third party (a Java language software package program), etc.
[0093] Exemplarily, the data content formats include but are not limited to: text / plain (plain text format), text / xml (XML format), application / xml (XML data format), application / json (JSON data format), application / pdf (pdf format), application / msword (Word document format), application / octet-stream (binary stream data), image / gif (gif image format), image / jpeg (jpg image format), image / png (png image format), etc.
[0094] Further, when determining the data content format, it can be distinguished according to Content-Type (content type).
[0095] S202. Generate a request message corresponding to the request instruction based on the data request method and data content format.
[0096] It should be noted that different data request methods have different message splicing methods, and different data content formats have different input parameter messages. According to the message splicing method corresponding to the data request method and the input parameter message corresponding to the data format content, splice the request message corresponding to the request instruction. Among them, the request message includes but is not limited to information such as the data request method, data content format, and specific data content to be obtained.
[0097] Exemplarily, for the JSON method, content-type: application / json, the message splicing is similar to {"userName":"张三","idNo":"12334567891223"...}.
[0098] After splicing the valid input message, the request message can be obtained.
[0099] S203: Send the request message to the remote server through a preset proxy server, so that the remote server generates response data corresponding to the request message.
[0100] After generating the request message, the data front-end proxy module sends the request message to the proxy server, which can be a network proxy server; the proxy server sends the request message to the remote server of the external system, so that the remote server parses the request message and generates response data based on the request message.
[0101] S204: Acquire the response data fed back by the remote server through the proxy server.
[0102] The remote server sends the response data to the proxy server, so that the proxy server sends the response data to the data front-end processing module.
[0103] In the method provided by the embodiment of the present invention, different data types are acquired in different ways, thereby effectively distinguishing the data types of the acquired original data, so as to facilitate subsequent corresponding processing of the original data.
[0104] S102: When the data type of the original data is unstructured data, obtain description information of the original data, and determine a parsing rule based on the description information.
[0105] The data type of the original data is determined by the file name in the description information, and the parsing rules are determined based on the data type. For example, when the data type is a readable data type such as word, excel, pdf, etc., the reading rules corresponding to the data type can be used as parsing rules; when the data type is a special type, such as radar data, meteorological data, satellite data, etc., the rules agreed with the data provider need to be used as parsing rules.
[0106] S103: parsing the original data based on the parsing rules to obtain attribute data in the original data, and calling a preset data storage module to save the attribute data into an unstructured database.
[0107] Parsing the original data according to the determined parsing rules can also be understood as reading the original data according to the parsing rules, so as to obtain attribute data in the original data, and the attribute data includes but is not limited to file size, creation date, type, data in each field, etc.
[0108] After extracting the attribute data, the data receiving and processing module sends the attribute data to the data storage module, so that the data storage module saves the attribute data to an unstructured database according to preset storage rules. Preferably, the unstructured database includes but is not limited to an unstructured storage database and an unstructured data storage disk.
[0109] The data storage module can determine whether to save the attribute data in a field of an unstructured storage database or in an unstructured data storage disk according to the data size of the attribute data. If it is determined to be saved in an unstructured storage database, the attribute data is saved in a clob (a database built-in type field, which stores a character large object as a column value in a row of a database table) field of the unstructured database; if it is determined to be saved in an unstructured data storage disk, after the attribute data is saved in the unstructured data storage disk, the storage address needs to be recorded and saved in a field of the unstructured storage database.
[0110] S104: When the data type of the original data is structured data, obtain the plaintext data of the original data.
[0111] It should be noted that the original data is encrypted, and the encrypted data cannot be operated, so it is necessary to obtain the plaintext data of the original data. The specific process is as follows:
[0112] Determine whether the original data is encrypted data;
[0113] If the original data is encrypted data, the original data is decrypted and the decrypted data is determined as the plaintext data of the original data;
[0114] If the original data is not encrypted data, the original data is determined to be plain text data.
[0115] Preferably, when judging whether the original data is encrypted data, it can be determined by judging whether there is an encryption mark in the original data. When there is an encryption mark in the original data, it can be determined that the original data is encrypted data; when there is no encryption mark in the original data, it can be determined that the original data is not encrypted data. Exemplarily, the encryption mark can be a data signature.
[0116] S105: Obtain each variable in the plaintext data, and determine the variable type of each variable.
[0117] Extract each variable from the plaintext data. It should be noted that the variable can be understood as key data.
[0118] There are different types of variables. The type of variable is associated with the way the variable is processed. Different variable types correspond to different processing methods.
[0119] S106. Based on the variable type of each variable, process each variable to obtain variable data, and save the variable data to a structured database.
[0120] Preferably, the variable types in the present invention include but are not limited to renamed types, derived types and array types; the structured database is set in the data lake storage receiving module.
[0121] Exemplarily, for each variable whose variable type is a renamed type, a keyword of each variable is used to perform a renaming process to obtain a first renamed variable of each variable; for each variable whose variable type is a derived type, each variable is merged to obtain a derived variable; for each variable whose variable type is an array type, a number is added to the variable name of each variable to rename each variable to obtain a second renamed variable of each variable; each first renamed variable, derived variable and each second renamed variable are all determined as variable data.
[0122] It should be noted that the original data is not required to contain variables of the above three variable types at the same time, and the original data must contain variables of at least one variable type.
[0123] In the method provided by the embodiment of the present invention, the original data is obtained, and the data type of the original data is determined; when the data type of the original data is unstructured data, the description information of the original data is obtained, and the parsing rules are determined based on the description information; the original data is parsed based on the parsing rules to obtain the attribute data in the original data, and the preset data storage module is called to save the attribute data to the unstructured database; when the data type of the original data is structured data, the plain text data of the original data is obtained; each variable in the plain text data is obtained, and the variable type of each variable is determined; based on the variable type of each variable, each variable is processed to obtain variable data, and the variable data is saved to the structured database. After receiving the original data, the data type of the original data is determined, and when the data type of the original data is unstructured data, the attribute data in the original data is extracted, and when the data type of the original data is structured data, the variable data in the original data is extracted; different data types adopt different processing methods, so that the original data can be analyzed, parsed, processed, etc., so that the difficulty of using the original data can be reduced, the workload of developers can be reduced, and the use efficiency and utilization rate of data can be improved.
[0124] In order to fully illustrate the data processing method provided by the embodiment of the present invention, the present invention provides a flow chart for processing structured data. Figure 3 , the specific instructions are as follows:
[0125] The figure includes a load balancer, a gateway, a data receiving and processing module, a data sending module, a data front-end processing module, a proxy server, a remote server, a data statistics module, and a data lake data receiving module.
[0126] The data receiving and processing module is used to process the original data of structured data type, and the variable data obtained after processing is saved in the data lake data receiving module. The original data can be the data obtained according to the request instruction sent by the user.
[0127] Each module is described as follows:
[0128] The load balancer can also be understood as a load balancing server (ngnix), which has four functions: reverse proxy, load balancing, dynamic and static separation, and forward proxy. The present invention uses the forward proxy function of ngnix. This is a server communication between a client (data user) and an original server (data provider). In order to obtain content from the original server, the client sends a request to the internal server proxy (ngnix) and specifies the target (original server), and then the proxy forwards the request to the original server and returns the obtained content to the client. Further, the load balancer obtains the request instruction sent by the user and sends the request instruction to the gateway.
[0129] The gateway can be a Eureka service registration gateway, which can contain multiple Eureka service registration gateways. Its main function is to divert and hot deploy gateway services. Different servers deploy the same "eureka service". The start and stop of each server has no effect on the "eureka service" or the ongoing business. The "eureka service" is divided into two parts: service registration---register the program to be registered in the "eureka service"; gateway distribution: according to the configuration, distribute different user requests to different server nodes to realize the distributed deployment of services. Furthermore, the gateway can send request instructions to the data receiving and processing modules of different servers.
[0130] The data receiving and processing module is provided with a variety of processing logics, such as judgment logic, processing logic, etc. When processing the original data, the processing logic is used to process the original data. Preferably, when the data receiving and processing module receives the request instruction sent by the user, it can directly send the request instruction to the data sending module, or it can first call the judgment logic to determine whether there is the cached data required by the user. If not, the request instruction is sent to the data sending module; if so, the cached data is sent to the gateway, so that the gateway feeds back the cached data to the user.
[0131] After the data receiving and processing module sends the request instruction to the data sending module, the data sending module will send the request instruction to the data front-end processing module, so that the data front-end processing module obtains response data based on the request instruction, and feeds back the response data to the data receiving and processing module through the data sending module, wherein the response data is the original data whose data type is structured data.
[0132] The process of processing the original data by the data receiving and processing module is as follows: calling the processing program to parse, decrypt, process and derive new data. Data has an expiration date, and the data obtained each time is slightly different (for example, the "mobile phone network time" data changes every second). The data is valid within the validity period, and the data outside the validity period needs to be updated, and the previously obtained data is invalid. After the data receiving and processing module obtains the data, it is called the original data. Some of the original data is encrypted, and is usually encrypted and decrypted using the agreed public and private keys; some data is plain text, and the plain text data can be processed directly. During processing, one situation is to extract the individual keywords in the data (the variable type in the above text is the variable of the rename type) and name them as new keywords-new variables (the first rename variable in the above text). Sometimes multiple single variables (variables of derived type) are merged into one variable - derived variable (for example, the total loan amount in the past three months is formed by adding up the loan amounts of three months); another case is to extract the array in the data (variables of array type in the above text) and rename the new keywords - variables (the second renamed variables in the above text) in the form of variable + number, where the array is multiple single keywords.
[0133] Optionally, after receiving the raw data of structured data, the data receiving and processing module can also push the raw data to the data statistics module, so that the data statistics module can perform cumulative calculations on the number of successful and failed calls of the data. When calculating the call volume, the success or failure of the call is determined based on the return value of the data. The settlement methods for different data are different. For example, some data with a return value of 0 are successful, while some data with a return value of 100053 are also successful data, but no results are found for this data (such as user blacklist data).
[0134] Furthermore, after receiving the original data (including return code, return information and business data), the data statistics module processes the return code (code) and return information (msg) in the original data, and accumulates the success and failure result values as the call volume for statistical calculation. The calculation of some data call volume requires parsing business data. For example, in Huifa personal query data, the business data includes 10 information fields (the number of untrustworthy old defaulters, the number of restricted entry and exit times, etc.). It is necessary to determine whether the values of these 10 information fields are all greater than 0. If they are greater than 0, they are found, and if they are equal to 0, they are not found---they are not counted as call volume statistics. "Return code" includes success code, failure code, unfound code, exception code, etc. Different remote data are different according to different company regulations, and correspond to "return information" one by one. For example, if the return code is 0, the corresponding return message is successful. Business data is the data that needs to be processed or handled, such as: loan limit, loan amount, cumulative online time and other data.
[0135] After receiving the request instruction, the data front-end processing module needs to identify the request method, then perform message splicing, obtain the request message, and send the request message to the proxy server.
[0136] The proxy server sends the request message to the remote server of the corresponding third-party system, so that the remote server calls the preset built-in program to generate response data based on the request message, and sends the response data to the proxy server, so that the proxy server feeds back the response data to the data front-end processing module.
[0137] Furthermore, the third-party system can be understood as any external system, such as an anti-fraud system, a credit reporting system of the People's Bank of China, etc.; the data generated by the third-party system can also be understood as remote third-party data. Remote third-party data is a broad concept that includes any requested external data, such as judicial data, anti-fraud data, and credit reporting data of the People's Bank of China, etc.
[0138] The data receiving and processing module can also send the variable data obtained after processing the original data, and / or the original data to the data lake data receiving module, so that the data lake data receiving module saves the variable data and / or the original data. Further, the module can send the data to the data lake and save it in the hbase (a distributed, column-oriented open source database) database for archiving.
[0139] In order to fully illustrate the data processing method provided by the embodiment of the present invention, the present invention provides a processing flow chart of unstructured data, specifically referring to Figure 4 , the specific instructions are as follows:
[0140] As shown in the figure, the figure includes a load balancer, a gateway, a data receiving and processing module, a data storage module, an external data acquisition module, a network proxy server, an unstructured data storage disk, an unstructured data storage repository, a data download module, and a data retrieval module. The specific description of the gateway and the load balancer can be referred to Figure 3 In the description.
[0141] The data receiving and processing module obtains the original data of unstructured data uploaded by the external data acquisition module through the data interface. The external data acquisition module can obtain unstructured data from the external disk and remote unstructured data. Furthermore, the user can also upload the original data of unstructured data through the data interface of the data receiving and processing module.
[0142] Preferably, the original data in the present invention is divided into three types, namely "unstructured data uploaded by users", "unstructured data acquired remotely" and "unstructured data on external disks".
[0143] "User-uploaded unstructured data" refers to documents, pictures, videos and other data uploaded by users, which usually have attribute description information of the data uploaded, such as what data the uploaded document is, whether the picture file is the user's ID file or the user's biopsy file (facial expression recognition file, fingerprint, etc.), file time, size, etc.; "Remotely acquired unstructured data" includes unstructured data downloaded from a website or remote server or crawled as allowed by regulations, generally documents, pictures, videos, etc. When acquiring this data, the description of the file on the website will be copied or the document description information will be parsed from the website; "External disk unstructured data" refers to collected and organized unstructured data provided by other external structures, banks, companies, etc., which generally have data description information corresponding to this data, such as in a picture, what picture it is, when it was taken, picture size, pixels, etc.
[0144] When users upload unstructured data, they upload the data to the load balancer, the load balancing service sends the data to the gateway, and the gateway distributes the data to the data receiving and processing modules of different servers.
[0145] The data receiving and processing module has two main functions: receiving and processing. There are three types of receiving: 1. Receiving the unstructured data description filled in by the user; 2. Receiving the unstructured data uploaded by the user (the original data mentioned above); 3. Receiving the data sent by the external processing module (the original data mentioned above). During processing, the unstructured data (the original data mentioned above) is parsed by technical means, such as determining the file type and file size through the file name in the description information of the unstructured data (the original data mentioned above), and determining whether it is readable and writable through the file type (word, excel, pdf and other files can be read and parsed, and some special data such as radar data, meteorological data, and satellite data need to be read by agreeing on parsing rules with the provider), and then determining the parsing rules, and parsing the unstructured data (the original data mentioned above) according to the parsing rules to obtain attribute data.
[0146] The data receiving and processing module sends the attribute data to the data storage module, so that the data storage module saves the attribute data; exemplary, the saving process is as follows: according to the preset storage rules (such as the data size of the unstructured data (the original data above)), determine whether to store it in the clob (a database built-in type field, which stores the character large object as a column value in a row of a database table) field of the "unstructured storage database", or store it in the "unstructured data storage disk". If it is stored in the storage disk, then it is only necessary to record the storage address and save the address in the "unstructured storage database" field.
[0147] The external data acquisition module acquires two types of data: 1. Unstructured data on external disks. Unstructured data acquired by directly reading external disks. For example, reports submitted or provided by subordinate units or other companies through USB flash drives, mobile hard drives, optical disks, etc., user liveness detection data, scans of various paper documents signed by users, etc.; 2. Remote unstructured data. Unstructured data information of authorized websites or servers is acquired through technologies such as web crawlers, such as reportage, books, papers, test reports, etc. These data are packaged and transmitted to the data receiving and processing module.
[0148] When users download unstructured data, they send the download request to the load balancer. The load balancing service sends the download request to the gateway, which distributes it to the data download modules of different servers.
[0149] The data download module is used to receive users' download requests and organize demand information, which includes but is not limited to the required unstructured data types (document type, image type, video type, etc.), unstructured data categories (reportage, biopsy data, radar data, etc.), and send the demand information to the data retrieval module.
[0150] The data retrieval module searches the unstructured data repository according to the demand information, generates the query results, and sends the query results to the data download module, so that the data download module feeds back the query results to the user; wherein, there are two situations for the query results, one is that the relevant data is found, then the query result contains the queried data and the information characterized as being queried; the other is that the relevant data is not found, then the query result contains the information characterized as not being queried.
[0151] In order to solve the processing, handling, analysis, storage and use of a large amount of structured data and unstructured data, the present invention provides a method for processing data, which processes structured data and unstructured data separately. For structured data, the method uses the user uploaded data as a query condition to request access to the structured data stored in the remote third-party company or other internal system for analysis, processing, storage and use; for unstructured data, the key attributes of the unstructured data uploaded by the user or read externally or remotely are extracted for processing and storage, and the key attributes are used as query conditions.
[0152] The present invention can effectively flatten the JSON data or JSON array in the structured data and save it in the fields in the database in the form of different variables, which we call derived variables, and it is very convenient to use; for unstructured data, we will abstract different fields, such as data size, storage time, data source, etc., and even go deep into the unstructured data for parsing and extraction (such as word, excel file data, etc.), forming the private attributes of the data for better use.
[0153] and Figure 1 Corresponding to the method shown in FIG. 1 , an embodiment of the present invention further provides a data processing device, which is used to support Figure 1 The method shown in the figure is applied in practice. The schematic diagram of the structure of the device is shown in FIG. Figure 5 The specific instructions are as follows:
[0154] A first acquisition unit 501 is used to acquire original data and determine the data type of the original data;
[0155] A second acquisition unit 502 is configured to acquire description information of the original data when the data type of the original data is unstructured data, and determine a parsing rule based on the description information;
[0156] A calling unit 503 is used to parse the original data based on the parsing rule to obtain attribute data in the original data, and call a preset data storage module to save the attribute data to an unstructured database;
[0157] A third acquisition unit 504 is used to acquire plain text data of the original data when the data type of the original data is structured data;
[0158] The fourth acquisition unit 505 is used to acquire each variable in the plaintext data and determine the variable type of each variable;
[0159] The processing unit 506 is used to process each of the variables based on the variable type of each of the variables to obtain variable data, and save the variable data to a structured database.
[0160] The embodiment of the present invention provides a data processing device, including: obtaining raw data and determining the data type of the raw data; when the data type of the raw data is unstructured data, obtaining description information of the raw data, and determining parsing rules based on the description information; parsing the raw data based on the parsing rules to obtain attribute data in the raw data, and calling a preset data storage module to save the attribute data to an unstructured database; when the data type of the raw data is structured data, obtaining plain text data of the raw data; obtaining each variable in the plain text data, and determining the variable type of each variable; based on the variable type of each variable, processing each variable to obtain variable data, and saving the variable data to a structured database. Determine the data type of the raw data, and when the raw data is unstructured data, process the raw data to extract attribute data from the raw data; when the raw data is structured data, process the raw data to extract variable data from the raw data. By processing the raw data, the workload of the staff can be reduced, the difficulty of applying the raw data can be reduced, the availability of the data can be improved, and the utilization rate and efficiency of the data can be improved.
[0161] In the device provided in the embodiment of the present invention, the third obtaining unit 504 may be configured as follows:
[0162] A judging subunit, used to judge whether the original data is encrypted data;
[0163] a decryption subunit, configured to, if the original data is encrypted data, decrypt the original data and determine the decrypted data as the plaintext data of the original data;
[0164] The first determination subunit is used to determine the original data as plain text data if the original data is not encrypted data.
[0165] In the device provided in the embodiment of the present invention, the first acquiring unit 501 may be configured as follows:
[0166] A first acquisition subunit is used to acquire a request instruction sent by a user;
[0167] A sending subunit, used for sending the request instruction to a preset data front-end processing module;
[0168] The second acquisition subunit is used to acquire the response data acquired by the data front-end processing module based on the request instruction, determine the response data as original data, and determine the data type of the original data as structured data.
[0169] In the device provided in the embodiment of the present invention, the first acquiring unit 501 may be configured as follows:
[0170] The second determining subunit is used to obtain the uploaded data carrying the description information through the data interface, determine the uploaded data as original data, and determine the data type of the original data as unstructured data.
[0171] In the device provided in the embodiment of the present invention, the processing unit 506 may be configured as follows:
[0172] A first renaming subunit is used to perform renaming processing on each variable of the renaming type using the keyword of each variable to obtain a first renaming variable of each variable;
[0173] A merging subunit is used for merging each variable of a derived type to obtain a derived variable;
[0174] The second renaming subunit is used for adding numbers to the variable name of each variable of the array type to rename each variable to obtain a second renamed variable of each variable;
[0175] The third determining subunit is used to determine each of the first renamed variables, the derived variables, and each of the second renamed variables as variable data.
[0176] In the device provided in the embodiment of the present invention, it can also be configured as follows:
[0177] A determination unit, configured to parse the request instruction and determine a data request method and a data content format of the request instruction;
[0178] A first generating unit, configured to generate a request message corresponding to the request instruction based on the data request mode and the data content format;
[0179] A second generating unit, configured to send the request message to a remote server through a preset proxy server, so that the remote server generates response data corresponding to the request message;
[0180] A feedback unit is used to obtain the response data fed back by the remote server through the proxy server.
[0181] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned data processing method.
[0182] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 6 As shown, it specifically includes a memory 601 and one or more instructions 602, wherein the one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to execute the one or more instructions 602 to perform the above-mentioned data processing method.
[0183] The specific implementation processes and derivative methods of the above-mentioned embodiments are all within the protection scope of the present invention.
[0184] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0185] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0186] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data processing method, characterized in that: include: Acquire original data, and determine the data type of the original data; When the data type of the original data is unstructured data, obtaining description information of the original data, and determining a parsing rule based on the description information; Parsing the original data based on the parsing rule to obtain attribute data in the original data, and calling a preset data storage module to save the attribute data to an unstructured database; The calling of a preset data storage module to save the attribute data to the unstructured database includes: the data storage module determines whether to save the attribute data to the unstructured storage database or to the unstructured data storage disk according to the data size of the attribute data; if it is determined that the attribute data is to be saved to the unstructured storage database, the attribute data is saved to the clob field of the unstructured storage database; if it is determined that the attribute data is to be saved to the unstructured data storage disk, after the attribute data is saved to the unstructured data storage disk, a storage address is recorded, and the storage address is saved to a field of the unstructured storage database; When the data type of the original data is structured data, obtaining plaintext data of the original data; Obtain each variable in the plaintext data, and determine the variable type of each variable; the variable type includes a renamed type, a derived type, and an array type; For each variable whose variable type is the renamed type, a keyword of each variable is used to perform a renaming process to obtain a first renamed variable of each variable; for each variable whose variable type is the derived type, each variable is merged to obtain a derived variable; for each variable whose variable type is the array type, a number is added to the variable name of each variable to rename each variable to obtain a second renamed variable of each variable; each first renamed variable, the derived variable and each second renamed variable are determined as variable data, and the variable data are saved to a structured database.
2. The method according to claim 1, characterized in that The obtaining of the plaintext data of the original data includes: Determining whether the original data is encrypted data; If the original data is encrypted data, decrypting the original data and determining the decrypted data as the plaintext data of the original data; If the original data is not encrypted data, the original data is determined to be plaintext data.
3. The method according to claim 1, characterized in that The obtaining of raw data and determining the data type of the raw data includes: Get the request instruction sent by the user; Sending the request instruction to a preset data front-end processing module; Acquire response data acquired by the data front-end processing module based on the request instruction, determine the response data as original data, and determine the data type of the original data as structured data.
4. The method according to claim 1, characterized in that: The obtaining of raw data and determining the data type of the raw data includes: The uploaded data carrying the description information is acquired through the data interface, the uploaded data is determined as original data, and the data type of the original data is determined to be unstructured data.
5. The method according to claim 3, characterized in that: The process of the data front-end processing module obtaining the response data based on the request instruction includes: Parsing the request instruction to determine the data request method and data content format of the request instruction; Based on the data request method and the data content format, generate a request message corresponding to the request instruction; Sending the request message to a remote server through a preset proxy server, so that the remote server generates response data corresponding to the request message; The response data fed back by the remote server is obtained through the proxy server.
6. A data processing device, characterized in that: include: A first acquisition unit, used to acquire original data and determine the data type of the original data; a second acquisition unit, configured to acquire description information of the original data when the data type of the original data is unstructured data, and determine a parsing rule based on the description information; A calling unit, configured to parse the original data based on the parsing rule to obtain attribute data in the original data, and to call a preset data storage module to save the attribute data into an unstructured database; The calling of a preset data storage module to save the attribute data to the unstructured database includes: the data storage module determines whether to save the attribute data to the unstructured storage database or to the unstructured data storage disk according to the data size of the attribute data; if it is determined that the attribute data is to be saved to the unstructured storage database, the attribute data is saved to the clob field of the unstructured storage database; if it is determined that the attribute data is to be saved to the unstructured data storage disk, after the attribute data is saved to the unstructured data storage disk, a storage address is recorded, and the storage address is saved to a field of the unstructured storage database; A third acquisition unit, configured to acquire plaintext data of the original data when the data type of the original data is structured data; A fourth acquisition unit, used to acquire each variable in the plaintext data and determine the variable type of each variable; the variable type includes a renamed type, a derived type, and an array type; The processing unit includes: a first duplicate naming subunit, a merging subunit, a second duplicate naming subunit and a third determining subunit; The first renaming subunit is used to perform a renaming process on each of the variables whose variable type is the renaming type using a keyword of each of the variables to obtain a first rename variable of each of the variables; The merging subunit is used for merging the variables of the derivative type to obtain the derived variables; The second renaming subunit is used for adding a number to the variable name of each variable whose variable type is the array type, so as to rename each variable to obtain a second renamed variable of each variable; The third determining subunit is used to determine each of the first renamed variables, the derived variables, and each of the second renamed variables as variable data, and save the variable data to a structured database.
7. The device according to claim 6, characterized in that The third acquisition unit includes: A judging subunit, used to judge whether the original data is encrypted data; a decryption subunit, configured to, if the original data is encrypted data, decrypt the original data and determine the decrypted data as the plaintext data of the original data; The first determination subunit is used to determine the original data as plain text data if the original data is not encrypted data.
8. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the data processing method according to any one of claims 1 to 5.
9. An electronic device, characterized in that: The device comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the data processing method according to any one of claims 1 to 5.
