Data processing method, device, data processing equipment and storage medium
Through parsing and path mapping of client data, data key-value pairs are automatically processed, which solves the problem of low data processing efficiency in the existing technology, realizes automatic parsing to configuration, and improves data processing efficiency.
Patent Information
- Application Number
- CN202110094201.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-22
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-01-22
AI Technical Summary
Existing technology cannot realize automatic data parsing and configuration, resulting in low data processing efficiency, especially when the amount of data is large, manual configuration is inefficient.
By parsing the source data sent by the client, multiple original key-value pairs are obtained, the data ID is determined, the path mapping function is determined based on the ID, the target key and storage address are matched, the key value is filled into the local database, and automatic parsing is realized. configuration.
It improves data processing efficiency, realizes automatic analysis to configuration, and solves the problem of low manual configuration efficiency.
Smart Images

Figure CN112817973B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device, data processing equipment and storage medium. Background Art
[0002] Currently, the technical means for data analysis are becoming more and more mature. However, after data analysis, it is still necessary to manually configure the data analysis results. However, when the amount of data is too large, the data processing efficiency of the current technical means based on manual configuration of data analysis results is too low. Therefore, realizing automated data analysis to configuration has become a research hotspot in this field. Summary of the invention
[0003] The present invention provides a data processing method, an apparatus, a data processing device and a storage medium, aiming to solve the technical problem that currently automatic data parsing to configuration cannot be achieved.
[0004] To achieve the above object, the present invention provides a data processing method, which is applied to a server, and the method comprises:
[0005] Parse the source data sent by the client to obtain multiple original key-value pairs;
[0006] Determine a data ID of the source data, and determine a path mapping function of each of the plurality of original key-value pairs according to the data ID;
[0007] Based on the path mapping functions of the plurality of original key-value pairs, respectively, determining the target keys and key value storage addresses of the target keys that match the plurality of original key-value pairs respectively in the local database;
[0008] The key values of each of the plurality of original key-value pairs are obtained, and the key values of each of the plurality of original key-value pairs are filled into the local database according to the key value storage addresses of the target keys that each of the plurality of original key-value pairs matches.
[0009] Optionally, before the step of parsing the source data sent by the client, the step further includes:
[0010] When receiving an access request carrying client parameters sent by a client, responding to the access request and configuring a data ID of the source data of the client based on the client parameters;
[0011] Obtain the data storage type of the client;
[0012] Based on the data storage type of the client, a path mapping function corresponding to the client is constructed, and the data ID of the source data of the client is associated with the path mapping function corresponding to the client.
[0013] Optionally, the step of constructing a path mapping function corresponding to the client based on the data storage type of the client includes:
[0014] If the data storage type of the client is a non-relational data storage type, a key acquisition request carrying a first key set of local key-value pairs is sent to the client, wherein when the client receives the key acquisition request carrying the first key set of local key-value pairs, a second key set of client key-value pairs is acquired to obtain a first key matching result according to the second key set of the client key-value pairs and the first key set of the local key-value pairs, and the second key set of the client key-value pairs and the first key matching result are fed back;
[0015] Receive a second key set of client key-value pairs fed back by the client and a first key matching result fed back by the client;
[0016] Obtaining similarities between each second key in the second key set of the client key-value pairs and each first key in the first key set of the local key-value pairs based on semantic analysis;
[0017] Traversing the similarities between each second key in the second key set and each first key in the first key set to obtain a second key matching result according to the similarities;
[0018] Traversing the first key matching result and the second key matching result to obtain a target key pair having consistent matching results in the first key matching result and the second key matching result and an abnormal key pair other than the target key pair in the first key matching result and / or the second key matching result;
[0019] Determine a first abnormal key and a second abnormal key in the abnormal key pair, and modify the second abnormal key according to the first abnormal key to convert the abnormal key pair into a target key pair;
[0020] Obtain a first key-value storage address of the first key in the target key pair in the client and a second key-value storage address of the second key in the server to construct a path mapping function corresponding to the target key pair according to the first key-value storage address and the second key-value storage address.
[0021] Optionally, the step of constructing a path mapping function corresponding to the client based on the data storage type of the client includes:
[0022] If the data storage type of the client is a relational data storage type, obtaining a third key set of the server key-value pairs;
[0023] Based on a pre-built hash function, calculate a hash value corresponding to each third key in the third key set, so as to create a first index table corresponding to the third key set based on the hash value corresponding to each third key;
[0024] Sending an index acquisition request carrying the first index table to the client, so as to obtain the second index table and the first index matching result fed back by the client through the index acquisition request;
[0025] According to the second index table and the first index table, a target index pair is obtained, and a path mapping function corresponding to the target index pair is constructed.
[0026] Optionally, before the step of determining the target key and key value storage address of the key value matching in each original key value pair in the local database based on the path mapping function of each original key value pair, the step further includes:
[0027] Determine whether the original key-value pair is a linked list key-value pair;
[0028] If the original key-value pair is a linked list key-value pair, obtaining a hash value in the original key-value pair;
[0029] According to the hash value in the original key-value pair, the key value in the original key-value pair is obtained.
[0030] Optionally, the step of obtaining the key value in the original key-value pair according to the hash value in the original key-value pair includes:
[0031] Determine the first node of the linked list corresponding to the original key-value pair according to the hash value in the original key-value pair, so as to determine the data linked list corresponding to the original key-value pair through the first node of the linked list;
[0032] Traverse each node in the data linked list to obtain the key value in the original key-value pair.
[0033] Optionally, the step of parsing the source data sent by the client to obtain a plurality of original key-value pairs further includes:
[0034] Determine the source data type of the source data sent by the client;
[0035] If the source data type is structured data, calling the SQL parsing library to parse the source data to obtain a plurality of original key-value pairs; and,
[0036] If the source data type is unstructured string data, the python parsing library is called to parse the source data to obtain multiple original key-value pairs.
[0037] In addition, to achieve the above object, the present invention further provides a data processing device, the data processing device comprising:
[0038] The acquisition module is used to parse the source data sent by the client to obtain multiple original key-value pairs;
[0039] A first determination module is used to determine a data ID of the source data, and determine a path mapping function of each of the plurality of original key-value pairs according to the data ID;
[0040] A second determination module is used to determine, based on the path mapping functions of the plurality of original key-value pairs, target keys that match each of the plurality of original key-value pairs in the local database and key value storage addresses of the target keys;
[0041] The filling module is used to obtain the key values of each of the multiple original key-value pairs, and fill the respective key values into the local database according to the key value storage addresses of the target keys that each of the multiple original key-value pairs matches.
[0042] In addition, to achieve the above-mentioned purpose, the present invention also provides a data processing device, which includes a processor, a memory and a data processing program stored in the memory. When the data processing program is executed by the processor, the steps of the data processing method described above are implemented.
[0043] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer storage medium, on which a data processing program is stored, and when the data processing program is executed by a processor, the steps of the above-mentioned data processing method are implemented.
[0044] Compared with the prior art, the present invention provides a data processing method, which parses the source data sent by the client to obtain multiple original key-value pairs; determines the data ID of the source data, and determines the path mapping function of each of the multiple original key-value pairs according to the data ID; determines the target keys and key value storage addresses of the target keys that each of the multiple original key-value pairs matches in the local database based on the path mapping functions of each of the multiple original key-value pairs; obtains the key values of each of the multiple original key-value pairs, and fills the respective key values into the local database according to the key value storage addresses of the target keys that each of the multiple original key-value pairs matches. Therefore, compared with the current configuration after manual parsing, the data processing method proposed by the present invention realizes automatic parsing to configuration, thereby improving data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a schematic diagram of the hardware structure of a data processing device involved in each embodiment of the present invention;
[0046] Figure 2 is a flow chart of a first embodiment of a data processing method of the present invention;
[0047] Figure 3 is a flow chart of a second embodiment of a data processing method of the present invention;
[0048] Figure 4 It is a functional module diagram of an embodiment of a data processing device of the present invention.
[0049] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0051] Reference Figure 1 , Figure 1 1 is a schematic diagram of the hardware structure of the data processing device involved in each embodiment of the present invention. In the embodiment of the present invention, the data processing device may include a processor 1001 (such as a central processing unit, CPU), a communication bus 1002, an input port 1003, an output port 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components; the input port 1003 is used for data input; the output port 1004 is used for data output, and the memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 can optionally be a storage device independent of the aforementioned processor 1001. Those skilled in the art can understand that Figure 1 The hardware structure shown in the figure does not constitute a limitation of the present invention, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0052] Continue to refer to Figure 1 , Figure 1 The memory 1005 as a readable storage medium may include an operating system, a network communication module, an application module, and a data processing program. Figure 1 In the terminal shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the data processing program stored in the memory 1005.
[0053] In this embodiment, the data processing device includes: a memory 1005, a processor 1001, and a data processing program stored in the memory 1005 and executable on the processor 1001, wherein the processor 1001 calls the data processing program stored in the memory 1005 and performs the following operations:
[0054] Parse the source data sent by the client to obtain multiple original key-value pairs;
[0055] Determine a data ID of the source data, and determine a path mapping function of each of the plurality of original key-value pairs according to the data ID;
[0056] Based on the path mapping functions of the plurality of original key-value pairs, respectively, determining the target keys and key value storage addresses of the target keys that match the plurality of original key-value pairs respectively in the local database;
[0057] The key values of each of the plurality of original key-value pairs are obtained, and the key values of each of the plurality of original key-value pairs are filled into the local database according to the key value storage addresses of the target keys that each of the plurality of original key-value pairs matches.
[0058] Further, the processor 1001 may call the data processing program stored in the memory 1005, and further perform the following operations:
[0059] When receiving an access request carrying client parameters sent by a client, responding to the access request and configuring a data ID of the source data of the client based on the client parameters;
[0060] Obtain the data storage type of the client;
[0061] Based on the data storage type of the client, a path mapping function corresponding to the client is constructed, and the data ID of the source data of the client is associated with the path mapping function corresponding to the client.
[0062] Further, the processor 1001 may call the data processing program stored in the memory 1005, and further perform the following operations:
[0063] If the data storage type of the client is a non-relational data storage type, a key acquisition request carrying a first key set of local key-value pairs is sent to the client, wherein when the client receives the key acquisition request carrying the first key set of local key-value pairs, a second key set of client key-value pairs is acquired to obtain a first key matching result according to the second key set of the client key-value pairs and the first key set of the local key-value pairs, and the second key set of the client key-value pairs and the first key matching result are fed back;
[0064] Receive a second key set of client key-value pairs fed back by the client and a first key matching result fed back by the client;
[0065] Obtaining similarities between each second key in the second key set of the client key-value pairs and each first key in the first key set of the local key-value pairs based on semantic analysis;
[0066] Traversing the similarities between each second key in the second key set and each first key in the first key set to obtain a second key matching result according to the similarities;
[0067] Traversing the first key matching result and the second key matching result to obtain a target key pair having consistent matching results in the first key matching result and the second key matching result and an abnormal key pair other than the target key pair in the first key matching result and / or the second key matching result;
[0068] Determine a first abnormal key and a second abnormal key in the abnormal key pair, and modify the second abnormal key according to the first abnormal key to convert the abnormal key pair into a target key pair;
[0069] Obtain a first key-value storage address of the first key in the target key pair in the client and a second key-value storage address of the second key in the server to construct a path mapping function corresponding to the target key pair according to the first key-value storage address and the second key-value storage address.
[0070] Further, the processor 1001 may call the data processing program stored in the memory 1005, and further perform the following operations:
[0071] If the data storage type of the client is a relational data storage type, obtaining a third key set of the server key-value pairs;
[0072] Based on a pre-built hash function, calculate a hash value corresponding to each third key in the third key set, so as to create a first index table corresponding to the third key set based on the hash value corresponding to each third key;
[0073] Sending an index acquisition request carrying the first index table to the client, so as to obtain the second index table and the first index matching result fed back by the client through the index acquisition request;
[0074] According to the second index table and the first index table, a target index pair is obtained, and a path mapping function corresponding to the target index pair is constructed.
[0075] Further, the processor 1001 may call the data processing program stored in the memory 1005, and further perform the following operations:
[0076] Determine whether the original key-value pair is a linked list key-value pair;
[0077] If the original key-value pair is a linked list key-value pair, obtaining a hash value in the original key-value pair;
[0078] According to the hash value in the original key-value pair, the key value in the original key-value pair is obtained.
[0079] Further, the processor 1001 may call the data processing program stored in the memory 1005, and further perform the following operations:
[0080] Determine the first node of the linked list corresponding to the original key-value pair according to the hash value in the original key-value pair, so as to determine the data linked list corresponding to the original key-value pair through the first node of the linked list;
[0081] Traverse each node in the data linked list to obtain the key value in the original key-value pair.
[0082] Further, the processor 1001 may call the data processing program stored in the memory 1005, and further perform the following operations:
[0083] Determine the source data type of the source data sent by the client;
[0084] If the source data type is structured data, calling the SQL parsing library to parse the source data to obtain a plurality of original key-value pairs; and,
[0085] If the source data type is unstructured string data, the python parsing library is called to parse the source data to obtain multiple original key-value pairs.
[0086] based on Figure 1 According to the hardware structure shown, the first embodiment of the present invention provides a data processing method.
[0087] Reference Figure 2 , Figure 2 FIG. 1 is a flow chart of a first embodiment of a data processing method according to the present invention.
[0088] The embodiment of the present invention provides an embodiment of a data processing method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here. Specifically, the data processing method of this embodiment includes:
[0089] Step S10: parsing the source data sent by the client to obtain a plurality of original key-value pairs;
[0090] Specifically, in this embodiment, it should be noted that the data processing method proposed in the present invention is applied to a server, and the server is connected to communicate with multiple clients for providing source data, wherein a data calling platform is deployed in the server, and a source data providing platform is deployed in the client. For example, a financial platform is deployed in the server, wherein the financial platform can be used by users for real estate mortgage financing. When the user needs to carry out real estate mortgage financing, the server needs to obtain the real estate source data from the client for providing the real estate source data, such as sending a data calling request to the client, so that the client can receive the data calling request and then retrieve the data from the client. The real estate information management platform calls relevant real estate source data, where the real estate information management platform is a platform that can provide unified real estate registration services in accordance with the latest national specifications. The platform realizes the exchange of business data between various platforms through data exchange service interfaces, such as OGC services, WebService services, etc., and builds a real estate registration database. For example, when Company A needs real estate mortgage financing, the user can send a data call request to the real estate information management platform where Company A is located based on the financial platform in the server, so as to obtain the real estate source data of Company A from the real estate information management platform where Company A is located.
[0091] In addition, it should be noted that in order to improve data processing efficiency and facilitate horizontal expansion of the database, in this embodiment, a non-relational database is used to store data, for example, data is stored in a key-value pair (i.e., key: value) format, wherein the non-relational database is stored in a key-value pair, and the key-value pair structure is not fixed, each tuple can have different fields, and each tuple can add some of its own key-value pairs as needed, not limited to a fixed structure, to reduce data reading time and storage space. It can be understood that the key-value pair stores data (equivalent to the key in the key-value pair) in the stack in the form of an address (or index), and the user can add the fields he needs as needed. When it is necessary to perform an associated query on multiple tables, it is only necessary to take out the corresponding key value according to the key in the key-value pair to complete the query, wherein the key in the key-value pair can be customized by the user, for example, when storing the user's 420xxxxx, the corresponding key can be named the ID number, i.e., "ID number: 420xxxxx", and the corresponding key can also be named dyh, i.e., "dyh: 420xxxxx", etc. This embodiment does not limit this.
[0092] Therefore, in this embodiment, after obtaining the source data sent by the client, the source data is parsed into a plurality of original key-value pairs.
[0093] In addition, for ease of understanding, this embodiment parses the source data sent by the client to obtain a plurality of original key-value pairs.
[0094] Determine the source data type of the source data sent by the client;
[0095] If the source data type is structured data, calling the SQL parsing library to parse the source data to obtain a plurality of original key-value pairs; and,
[0096] If the source data type is unstructured string data, the python parsing library is called to parse the source data to obtain multiple original key-value pairs.
[0097] In this step, it should be noted that due to the different data storage methods of each client, for example, when the business volume of the real estate information management platform in the client is not high, the database storage method of the real estate information management platform in the client can be a relational database storage method, where a relational database refers to a database that uses a relational model to organize data, such as storing data in a two-dimensional table model (such as Excel), based on which users can easily obtain information, and when the business concurrency of the real estate information management platform is high (such as reaching tens of thousands of read and write requests per second), or when the database needs to be horizontally expanded, it is often necessary to shut down for data migration.
[0098] Therefore, based on the above situation, in some embodiments, when the business concurrency of the real estate information management platform is high (such as reaching tens of thousands of read and write requests per second), or when the database needs to be horizontally expanded, the database storage method of the real estate information management platform needs to be a non-relational database, for example, storing data in key-value pairs (ie key: value).
[0099] Therefore, before parsing the source data, it is necessary to first determine the source data type of the source data. When the source data is unstructured string data, the source data is directly split into multiple key-value pairs. Optionally, first determine the parsing library corresponding to the current programming language environment of the unstructured string data. For example, when the unstructured string data is compiled based on the Python language, the Python parsing library is called to parse the source data to split the source data into multiple key-value pairs.
[0100] In addition, when the source data is structured data, such as in the form of an Excel table, since the database storage method of the server is a non-relational database, that is, data is stored in a key-value pair (i.e., key: value) manner, the source data type of the source data needs to be in the form of a key-value pair. Specifically, the SQL (Structured Query Language) component is called to parse the source data to obtain each parameter and the parameter definition name corresponding to each parameter. For ease of understanding, this embodiment illustrates this by example:
[0101] The source data sent by the real estate information management platform is as follows:
[0102] Name Residential address ID number Zhang San Hubei 420xxxxx Li Si Guangdong 403xxxxx
[0103] The SQL (Structured Query Language) component is called to parse the source data. Specifically, the SQL (Structured Query Language) component is called to identify that the source data is in the form of XML, and then the source data is parsed according to the XML parsing rules to obtain the key-value pairs: 'Name: Zhang San', 'Name: Li Si', 'Residential address: Hubei', 'Residential address: Guangdong', 'ID number: 420xxxxx' and 'ID number: 403xxxxx'.
[0104] Step S20: determining the data ID of the source data, and determining the path mapping function of each of the plurality of original key-value pairs according to the data ID;
[0105] Step S30: determining target keys and key value storage addresses of the target keys that match the respective original key-value pairs in the local database based on the path mapping functions of the respective original key-value pairs;
[0106] Step S40: obtaining respective key values in the plurality of original key-value pairs, and filling respective key values into the local database according to the key value storage addresses of the target keys that match the plurality of original key-value pairs.
[0107] Specifically, the data ID of the above-mentioned source data refers to the serial number of the source data. It is easy to understand that since the server is communicated and connected with multiple clients for improving the source data, in order to distinguish the source data provided by each client, in this embodiment, after the server is connected to the client, the client's data ID is pre-configured for the source data corresponding to the client, wherein, optionally, the data ID of the source data output by each real estate information management platform is configured based on the docking port between the real estate information management platform in the server and the financial platform in the client. For example, when the docking port between the real estate information management platform a and the financial platform is an RJ-45 port, the data ID of the source data output by the real estate information management platform a is configured to RJ-45. When the docking port between the real estate information management platform b and the financial platform is an SC port, or according to the data location of each real estate information management platform in the client, the data ID of each real estate information management platform is configured. For example, the data ID of the source data output by the real estate information management platform in Hubei Province is set to hb:xxx, and the data ID of the real estate information management platform in Guangdong Province is set to gd:xxx. If the docking port between the real estate information management platform a and the financial platform is an RJ-45 port, and the data location of the real estate information management platform a is Hubei, the data ID of the source data output by the real estate information management platform a is configured to hb:RJ-45. In addition, the configuration rules of the data ID can also be other methods, which are not limited in this embodiment.
[0108] Furthermore, in order to realize automatic data parsing to configuration in the future, after configuring the client's data ID, a path mapping function is constructed between the server and the client, and the client's data ID is associated with the path mapping function, thereby realizing the subsequent automatic data parsing to configuration.
[0109] Specifically, after obtaining multiple original key-value pairs, determine the data ID of the source data, and determine the path mapping function of each original key-value pair based on the data ID. Then, based on the path mapping function of each original key-value pair, determine the target key that matches the key value in each original key-value pair in the local database. For example, if the original key-value pair is 'ID number: value', and the path mapping function of the original key-value pair is "ID number: dyh", then it is determined that the target key of the original key-value pair in the local database is 'ID number: value' is dyh. Finally, after determining that the target key is dyh, obtain the storage address of the value key value in the original key-value pair 'ID number: value' in the client and the storage address of the target key dyh in the local database to obtain the key value in the original key-value pair, and fill the key value in the original key-value pair into the local database according to the storage address of the target key dyh in the local database.
[0110] In addition, in some embodiments, since heterogeneous key-value pairs may exist when parsing data, such as linked list key-value pairs, and since the linked list key-value pairs cannot directly obtain the key values in the key-value pairs, in this embodiment, in order to avoid data missing in the local database due to the existence of heterogeneous key-value pairs after parsing, before the step of determining the target key and key value storage address matching the key value in each original key-value pair in the local database based on the path mapping function of each original key-value pair, the following is also included:
[0111] Determine whether the original key-value pair is a linked list key-value pair;
[0112] If the original key-value pair is a linked list key-value pair, obtaining a hash value in the original key-value pair;
[0113] According to the hash value in the original key-value pair, the key value in the original key-value pair is obtained.
[0114] It is easy to understand that a linked list key-value pair stores the key value in the key-value pair in the nodes of the linked list. Specifically, the key value in the key-value pair is stored in the nodes of the linked list based on a hash method. Therefore, in this embodiment, after detecting that the original key-value pair is a linked list key-value pair, a special addressing logic processing is performed on the linked list key-value pair, that is, the hash value in the original key-value pair is calculated to obtain the key value in the original key-value pair according to the hash value in the original key-value pair.
[0115] In addition, for ease of understanding, this embodiment specifically describes a scheme for determining the key value in the original key-value pair according to the hash value in the original key-value pair:
[0116] Determine the first node of the linked list corresponding to the original key-value pair according to the hash value in the original key-value pair, so as to determine the data linked list corresponding to the original key-value pair through the first node of the linked list;
[0117] Traverse each node in the data linked list to obtain the key value in the original key-value pair.
[0118] In this step, after determining the hash value in the original key-value pair, obtain the position of the hash value in the hash list to determine the position of the first node of the linked list corresponding to the linked list key value, and determine the data linked list corresponding to the linked list key value according to the position of the first node, traverse each node in the data linked list of the linked list key-value pair one by one, find out multiple storage location information of the key value of the linked list key-value pair, to obtain the key value, wherein the linked list key-value pair includes a hash table and a linked list, the hash table is used to store index information of the key value, the index information of the key value includes the key value, the modification time of the key value and the data offset pointer, wherein the linked list is used to store multiple storage area information corresponding to the index information of the key value, wherein one key value corresponds to multiple storage areas.
[0119] Furthermore, when the key-value pair is an array key-value pair, since the array key-value pairs are all stored in the same address, and the storage position of each array key-value pair in the same address is distinguished in the form of the following table index, the key value in the key-value pair can be directly obtained through the index in the key-value pair.
[0120] Therefore, after obtaining the key value in each original key-value pair, based on the path mapping function of each original key-value pair, the target key that matches the key value in each original key-value pair in the local database and the key value storage address corresponding to the target key in the local database are determined to fill the key value in each original key-value pair into the local database, thereby realizing automatic parsing to configuration, thereby improving data processing efficiency.
[0121] It should be understood that the above is only an example and does not constitute any limitation to the technical solution of the present invention. Those skilled in the art can make settings based on needs in actual applications, and they are not listed one by one here.
[0122] Through the above scheme, this embodiment parses the source data sent by the client to obtain multiple original key-value pairs; determines the data ID of the source data, and determines the path mapping function of each original key-value pair according to the data ID; based on the path mapping function of each original key-value pair, determines the target key and key value storage address of the key value matching in each original key-value pair in the local database, so as to fill the key value in each original key-value pair into the local database through the key value storage address. Therefore, compared with the current configuration after manual parsing, the data processing method proposed by the present invention realizes automatic parsing to configuration, thereby improving data processing efficiency.
[0123] Furthermore, based on the first embodiment of the data processing method of the present invention, a second embodiment of the data processing method of the present invention is proposed.
[0124] Reference Figure 3 , Figure 3 It is a flowchart of a second embodiment of a data processing method of the present invention;
[0125] The difference between the second embodiment of the data processing method and the first embodiment of the data processing method is that before the step of determining the path mapping function of the original key-value pair according to the data ID, it also includes:
[0126] Step S101: upon receiving an access request carrying client parameters sent by a client, responding to the access request, and configuring a data ID of the source data of the client based on the client parameters;
[0127] Step S102: Acquire the data storage type of the client;
[0128] Step S103: Based on the data storage type of the client, a path mapping function corresponding to the client is constructed, and the data ID of the source data of the client is associated with the path mapping function corresponding to the client.
[0129] In this embodiment, each time a client is connected, the data ID of the client's source data needs to be pre-configured and a path mapping function corresponding to the client needs to be constructed, so as to achieve automatic parsing and configuration of the source data subsequently output by the client.
[0130] Specifically, the above-mentioned client parameters include the port information of the client, the data location information of the client, the IP address of the client, etc. For example, the data ID of the source data output by each real estate information management platform is configured based on the docking port between the real estate information management platform in the server and the financial platform in the client. For example, when the docking port between the real estate information management platform a and the financial platform is an RJ-45 port, the data ID of the source data output by the real estate information management platform a is configured to RJ-45; when the docking port between the real estate information management platform b and the financial platform is an SC port, or according to the data location of each real estate information management platform in the client, the data ID of the source data output by the real estate information management platform a is configured to RJ-45. Set the data ID of each real estate information management platform. For example, the data ID of the source data output by the real estate information management platform of Hubei Province is set to hb:xxx, and the data ID of the real estate information management platform of Guangdong Province is set to gd:xxx. If the docking port between the real estate information management platform a and the financial platform is the RJ-45 port, and the data location of the real estate information management platform a is Hubei, the data ID of the source data output by the real estate information management platform a is configured to hb:RJ-45. In addition, the configuration rules of the data ID can also be other methods, such as configuring the data ID of the client according to the IP address of the client, which is not limited in this embodiment.
[0131] In addition, specifically, the data types of the database of the above-mentioned client include relational data storage types and non-relational data storage types. It should be noted that due to the different data storage methods of each client, for example, when the business volume of the real estate information management platform in the client is not high, the database storage method of the real estate information management platform in the client can be a relational database storage method, wherein a relational database refers to a database that uses a relational model to organize data, such as storing data in a two-dimensional table model (such as excel), based on which users can easily obtain information, and when the business concurrency of the real estate information management platform is high (such as reaching tens of thousands of read and write requests per second), or when the database needs to be horizontally expanded, it is often necessary to shut down for data migration.
[0132] Therefore, based on the above situation, in some embodiments, when the business concurrency of the real estate information management platform is high (such as reaching tens of thousands of read and write requests per second), or when the database needs to be horizontally expanded, the database storage method of the real estate information management platform needs to be a non-relational database, such as storing data in a key-value pair (ie key: value) format. In this embodiment, in order to improve data processing efficiency and facilitate horizontal expansion of the database, in this embodiment, a non-relational database is used to store data.
[0133] Therefore, in this embodiment, there is a situation where the data storage type of the client is different from the data storage type in this embodiment, that is, the data format of the source data sent by the client is different from the data format of this embodiment. Therefore, in this embodiment, in order to realize automatic data parsing to configuration, a path mapping function corresponding to the client is constructed based on the data storage type of the client.
[0134] In addition, for ease of understanding, this embodiment specifically describes a solution for constructing a path mapping function corresponding to the client based on the data storage type of the client:
[0135] If the data storage type of the client is a non-relational data storage type, a key acquisition request carrying a first key set of local key-value pairs is sent to the client, wherein when the client receives the key acquisition request carrying the first key set of local key-value pairs, a second key set of client key-value pairs is acquired to obtain a first key matching result according to the second key set of the client key-value pairs and the first key set of the local key-value pairs, and the second key set of the client key-value pairs and the first key matching result are fed back;
[0136] Receive a second key set of client key-value pairs fed back by the client and a first key matching result fed back by the client;
[0137] Obtaining similarities between each second key in the second key set of the client key-value pairs and each first key in the first key set of the local key-value pairs based on semantic analysis;
[0138] Traversing the similarities between each second key in the second key set and each first key in the first key set to obtain a second key matching result according to the similarities;
[0139] Traversing the first key matching result and the second key matching result to obtain a target key pair having consistent matching results in the first key matching result and the second key matching result and an abnormal key pair in the first key matching result and / or the second key matching result other than the target key pair;
[0140] Determine a first abnormal key and a second abnormal key in the abnormal key pair, and modify the second abnormal key according to the first abnormal key to convert the abnormal key pair into a target key pair;
[0141] Obtain a first key-value storage address of the first key in the target key pair in the client and a second key-value storage address of the second key in the server to construct a path mapping function corresponding to the target key pair according to the first key-value storage address and the second key-value storage address.
[0142] Specifically, when the data storage type of the client is a non-relational data storage type (i.e., key: value), a key acquisition request is sent to the client to enable the client to feedback the corresponding second key set of the client key-value pair, and then the first key set of the local key-value pair and the second key set of the client key-value pair are matched to obtain the key matching result, such as calculating the similarity between the first key and the second key in the two key sets based on semantic analysis. It is easy to understand that since the keys in the key-value pairs are all user-defined names, there may be different keys used to store the same key value. For example, the key for storing the user's identity number in the server is "identity information" and the key for storing the identity number in the client is "identity card number". Therefore, in this embodiment, it is necessary to calculate the similarity between the first key and the second key in the two key sets based on semantic analysis, and construct a path mapping function between the two first keys and the second keys with the greatest similarity, thereby obtaining the path mapping function corresponding to the client.
[0143] In addition, in some embodiments, in order to improve the accuracy of the path mapping function, when a key acquisition request carrying a first key set of local key-value pairs is sent to a client, the first key set of local key-value pairs is also carried in the key acquisition request, so that the client obtains a first key matching result at the client based on the first key set of local key-value pairs according to the second key set of client key-value pairs and the first key set of local key-value pairs, and feeds back the first key matching result of the client and the second key set of client key-value pairs, so that the server obtains the second key matching result locally.
[0144] Then, the first key matching result and the second key matching result are traversed to obtain target key pairs with consistent matching results and abnormal key pairs with inconsistent matching results in the first key matching result and the second key matching result. Finally, the first abnormal key and the second abnormal key in the abnormal key pair are determined, and the second abnormal key is corrected according to the first abnormal key to convert the abnormal key pair into a target key pair.
[0145] Finally, the first key value storage address of the first key in the client and the second key value storage address of the second key in the server in each target key pair are obtained to construct a path mapping function corresponding to the target key pair according to the first key value storage address and the second key value storage address.
[0146] In addition, in some embodiments, the above-mentioned solution of constructing the path mapping function corresponding to the client based on the data storage type of the client further includes:
[0147] If the data storage type of the client is a relational data storage type, obtaining a third key set of the server key-value pairs;
[0148] Based on a pre-built hash function, calculate a hash value corresponding to each third key in the third key set, so as to create a first index table corresponding to the third key set based on the hash value corresponding to each third key;
[0149] Sending an index acquisition request carrying the first index table to the client, so as to obtain the second index table and the first index matching result fed back by the client through the index acquisition request;
[0150] According to the second index table and the first index table, a target index pair is obtained, and a path mapping function corresponding to the target index pair is constructed.
[0151] Specifically, when the data storage type of the client is a relational data storage type, the client stores data based on an index. Therefore, in this embodiment, when the data storage type of the client is inconsistent with the storage type in the server, the stored data in the server must be converted first, that is, the third key set used to store the client in the server is converted into a first index table through a pre-built hash function, and after obtaining the first index table, an index acquisition request carrying the first index table is sent to the client to obtain the second index table and the first index matching result fed back by the client through the index acquisition request, wherein, when the client obtains the first index table, it obtains the second index table of the client, and then matches the first index table and the second index table to obtain the target index pair, for example, based on semantic analysis, the similarity between the first index and the second index in the two index tables is calculated, and the first index and the second index with the largest similarity are used as the target index pair. In addition, the first abnormal index and the second abnormal index other than the target index pair are obtained in the first index table and the second index table, and the second abnormal index is corrected according to the first abnormal index to convert the first abnormal index and the second abnormal index into the target index pair.
[0152] Furthermore, after obtaining the target index pair, the first index and the second index in each target index pair are determined, and then based on a pre-built anti-hash function, the first index is converted into a third key, and the second index is converted into a fourth key, thereby converting the target index pair into a target key pair, and finally the fourth key value storage address of the fourth key in the client and the third key value storage address of the third key in the server in each target key pair are obtained to construct a path mapping function corresponding to the target key pair according to the third key value storage address and the fourth key value storage address.
[0153] It should be understood that the above is only an example and does not constitute any limitation to the technical solution of the present invention. Those skilled in the art can make settings based on needs in actual applications, and they are not listed one by one here.
[0154] Through the above scheme, this embodiment responds to the access request when receiving an access request carrying client parameters sent by the client, and configures the data ID of the client's source data based on the client parameters; obtains the data storage type of the client; based on the data storage type of the client, constructs a path mapping function corresponding to the client, and associates the data ID of the client's source data with the path mapping function corresponding to the client, thereby realizing automatic parsing to configuration by pre-configuring the data ID of the client's source data and constructing the path mapping function corresponding to the client, thereby improving data processing efficiency.
[0155] In addition, this embodiment also provides a data processing device. Figure 4 , Figure 4 It is a schematic diagram of functional modules of a data processing device according to an embodiment of the present invention.
[0156] In this embodiment, the data processing device is a virtual device stored in Figure 1 The memory 1005 of the data processing device shown is used to implement all functions of the data processing program: used to parse the source data sent by the client to obtain multiple original key-value pairs; used to determine the data ID of the source data, and determine the path mapping function of each of the multiple original key-value pairs according to the data ID; based on the path mapping function of each of the multiple original key-value pairs, determine the target keys and key value storage addresses of the target keys that match each of the multiple original key-value pairs in the local database; obtain the key values of each of the multiple original key-value pairs, and fill the respective key values into the local database according to the key value storage addresses of the target keys that match each of the multiple original key-value pairs.
[0157] Specifically, refer to Figure 4 , the data processing device comprises:
[0158] The acquisition module 10 is used to parse the source data sent by the client to obtain a plurality of original key-value pairs;
[0159] A first determination module 20, configured to determine a data ID of the source data, and determine a path mapping function of each of the plurality of original key-value pairs according to the data ID;
[0160] A second determination module 30 is used to determine, based on the path mapping functions of the plurality of original key-value pairs, target keys that match the plurality of original key-value pairs respectively in the local database and key value storage addresses of the target keys;
[0161] The filling module 40 is used to obtain the key values of each of the multiple original key-value pairs, and fill the respective key values into the local database according to the key value storage addresses of the target keys that each of the multiple original key-value pairs matches.
[0162] In addition, an embodiment of the present invention further provides a computer storage medium, on which a data processing program is stored. When the data processing program is executed by a processor, the steps of the data processing method described above are implemented, which will not be repeated here.
[0163] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including 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 system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0164] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0165] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present invention.
[0166] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A data processing method, characterized in that: Applied to a server, the method comprises: Parse the source data sent by the client to obtain multiple original key-value pairs; Determine a data ID of the source data, and determine a path mapping function of each of the plurality of original key-value pairs according to the data ID; Based on the path mapping functions of the plurality of original key-value pairs, respectively, determining the target keys and key value storage addresses of the target keys that match the plurality of original key-value pairs respectively in the local database; Obtaining respective key values in the plurality of original key-value pairs, and filling respective key values into a local database according to key value storage addresses of target keys that are matched by the plurality of original key-value pairs; Wherein, before the step of determining the path mapping function of the original key-value pair according to the data ID, the method further includes: When receiving an access request carrying client parameters sent by a client, responding to the access request and configuring a data ID of the source data of the client based on the client parameters; Acquire the data storage type of the client, where the data storage type includes: a non-relational data storage type and a relational data storage type; Based on the data storage type of the client, a path mapping function corresponding to the client is constructed, and the data ID of the source data of the client is associated with the path mapping function corresponding to the client.
2. The data processing method according to claim 1, characterized in that: The step of constructing a path mapping function corresponding to the client based on the data storage type of the client includes: If the data storage type of the client is a non-relational data storage type, a key acquisition request carrying a first key set of local key-value pairs is sent to the client, wherein when the client receives the key acquisition request carrying the first key set of local key-value pairs, a second key set of client key-value pairs is acquired to obtain a first key matching result according to the second key set of the client key-value pairs and the first key set of the local key-value pairs, and the second key set of the client key-value pairs and the first key matching result are fed back; Receive a second key set of client key-value pairs fed back by the client and a first key matching result fed back by the client; Obtaining similarities between each second key in the second key set of the client key-value pairs and each first key in the first key set of the local key-value pairs based on semantic analysis; Traversing the similarities between each second key in the second key set and each first key in the first key set to obtain a second key matching result according to the similarities; Traversing the first key matching result and the second key matching result to obtain a target key pair having consistent matching results in the first key matching result and the second key matching result and an abnormal key pair other than the target key pair in the first key matching result and / or the second key matching result; Determine a first abnormal key and a second abnormal key in the abnormal key pair, and modify the second abnormal key according to the first abnormal key to convert the abnormal key pair into a target key pair; Obtain a first key-value storage address of the first key in the target key pair in the client and a second key-value storage address of the second key in the server to construct a path mapping function corresponding to the target key pair according to the first key-value storage address and the second key-value storage address.
3. The data processing method according to claim 1, characterized in that: The step of constructing a path mapping function corresponding to the client based on the data storage type of the client includes: If the data storage type of the client is a relational data storage type, obtaining a third key set of the server key-value pairs; Based on a pre-built hash function, calculate a hash value corresponding to each third key in the third key set, so as to create a first index table corresponding to the third key set based on the hash value corresponding to each third key; Sending an index acquisition request carrying the first index table to the client, so as to obtain the second index table and the first index matching result fed back by the client through the index acquisition request; According to the second index table and the first index table, a target index pair is obtained, and a path mapping function corresponding to the target index pair is constructed.
4. The data processing method according to claim 1, characterized in that: Before the step of determining the target key and key value storage address matching the key value in each original key value pair in the local database based on the path mapping function of each original key value pair, the method further includes: Determine whether the original key-value pair is a linked list key-value pair; If the original key-value pair is a linked list key-value pair, obtaining a hash value in the original key-value pair; According to the hash value in the original key-value pair, the key value in the original key-value pair is obtained.
5. The data processing method according to claim 4, characterized in that: The step of obtaining the key value in the original key-value pair according to the hash value in the original key-value pair comprises: Determine the first node of the linked list corresponding to the original key-value pair according to the hash value in the original key-value pair, so as to determine the data linked list corresponding to the original key-value pair through the first node of the linked list; Traverse each node in the data linked list to obtain the key value in the original key-value pair.
6. The data processing method according to any one of claims 1 to 5, characterized in that: The step of parsing the source data sent by the client to obtain a plurality of original key-value pairs also includes: Determine the source data type of the source data sent by the client; If the source data type is structured data, calling the SQL parsing library to parse the source data to obtain a plurality of original key-value pairs; and, If the source data type is unstructured string data, the python parsing library is called to parse the source data to obtain multiple original key-value pairs.
7. A data processing device, characterized in that: The data processing device comprises: The acquisition module is used to parse the source data sent by the client to obtain multiple original key-value pairs; A first determination module is used to determine a data ID of the source data, and determine a path mapping function of each of the plurality of original key-value pairs according to the data ID; A second determination module is used to determine, based on the path mapping functions of the plurality of original key-value pairs, target keys that match each of the plurality of original key-value pairs in the local database and key value storage addresses of the target keys; A filling module, used to obtain the key values of each of the multiple original key-value pairs, and fill the respective key values into the local database according to the key value storage addresses of the target keys that each of the multiple original key-value pairs matches; The first determining module is further configured to respond to an access request carrying client parameters sent by a client upon receiving the access request, and configure a data ID of the source data of the client based on the client parameters; Acquire the data storage type of the client, where the data storage type includes: a non-relational data storage type and a relational data storage type; Based on the data storage type of the client, a path mapping function corresponding to the client is constructed, and the data ID of the source data of the client is associated with the path mapping function corresponding to the client.
8. A data processing device, characterized in that: The data processing device comprises a processor, a memory and a data processing program stored in the memory. When the data processing program is executed by the processor, the steps of the data processing method according to any one of claims 1 to 6 are implemented.
9. A computer storage medium, characterized in that The computer storage medium stores a data processing program, and when the data processing program is executed by the processor, the steps of the data processing method according to any one of claims 1 to 6 are implemented.
