Data Type Mapping Processing Method and Its Device, Equipment, Medium and Product

By generating key attribute units and performing type mapping, the problem of inconsistent data formats between different database types is solved, and safe and efficient data transmission and storage is achieved.

CN114661726BActive Publication Date: 2025-07-29GUANGZHOU HUADUO NETWORK TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210351811.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-02
Publication Date
2025-07-29
Estimated Expiration
2042-04-02

AI Technical Summary

Technical Problem

In the prior art, the database types of data consumption end and data storage end are different, resulting in frequent data format modification wasting time and computing resources, and it is difficult to ensure data security directly connected to the data source database.

Method used

By obtaining the key-value pairs in the first database, a key attribute unit is generated, and combined into the same key attribute unit according to preset rules, it is pushed to the type query service for type mapping, ensuring that the data type complies with the second database storage format and avoiding directly providing data source permissions.

Benefits of technology

Adaptive data type conversion is realized to ensure data security, improve data transmission efficiency and system stability, and reduce abnormal risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661726B_ABST
    Figure CN114661726B_ABST
Patent Text Reader

Abstract

The present application discloses a data type mapping processing method, its device, equipment, medium and product. The method includes: obtaining multiple key-value pairs respectively stored in multiple target data areas in a first database to obtain key data and value data included in these key-value pairs, and then generating corresponding key attribute units for these key-value pair data; merging key attribute units with the same key data into the same key attribute unit; respectively pushing the same key attribute units without target key data to other servers, and at the same time merging the same key attribute units with target key data into a unique key attribute unit; pushing the unique key attribute unit to a type query service, so that the type query service responds to a type query request and maps the merged data type in the corresponding unique key attribute unit to a second data type stored in a second database for request feedback. The present application can adaptively convert the data format to ensure the data stability of the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of databases, and in particular to a data type mapping processing method, and also to corresponding devices, equipment, non-volatile storage media and products of the method. Background Art

[0002] Existing major Internet platforms use various types of databases for data consumption and production to achieve real-time data stream processing. Generally, the databases provided to data consumers for consumption and the databases where data consumers store their own consumption data are built based on different database concepts to improve the performance of the services associated with each database. For example, the databases generally provided to data consumers for consumption are built based on the Kafka concept to improve the database's throughput and scalability, while the databases where data consumers store their consumed data are generally built based on the SQL concept to improve the database's usability and scalability.

[0003] However, because the data type of the data in the database consumed by the data consumer is different from the data type used for data storage in the database where the consumed data is stored, most platforms will agree on a fixed field type so that the data consumer must use the same format for both data consumption and data production. However, usually one data production end may correspond to multiple data consumers. When any data consumer needs to change the data format, it needs to notify all data consumers associated with its consumption production end to modify the data format at the same time. Frequent data format modifications will waste a lot of time and occupy a lot of computing resources, making it difficult for related online services to be smoothly launched for users.

[0004] Another part of the platform will directly connect to the data source database, so that the data type can also be read. However, if the data consumer is given the permission to directly read the data source database, the data security of the data source database will be difficult to guarantee.

[0005] In view of the problems existing in data consumption and production between existing databases built based on different database concepts, the applicant has made corresponding explorations in order to solve this problem. Summary of the Invention

[0006] The purpose of this application is to provide a data type mapping processing method to meet user needs. In addition, it also relates to corresponding devices, equipment, non-volatile storage media and computer program products of this method.

[0007] In order to achieve the purpose of this application, the following technical solutions are adopted:

[0008] A data type mapping processing method proposed for the purpose of this application includes the following steps:

[0009] Obtain multiple key-value pairs stored in multiple target data areas in the first database respectively, so as to obtain the key data and value data included in these key-value pairs respectively, and determine the data type and data width of the key data corresponding to the value data, and then generate key attribute units including the key data, data type and data width for these key-value pair data respectively;

[0010] Obtain the key attribute units with the same key data, and merge these key attribute units into the same key attribute unit according to the preset unit merging rule. The same key attribute unit includes the key data, the merged data type generated by merging the data types of each key attribute unit, and the maximum data width among these key attribute units;

[0011] Push the same key attribute units without the target key data to other servers respectively, and at the same time receive the same key attribute units with the target key data pushed by other servers, and then merge the same key attribute units with the target key data into a unique key attribute unit according to the unit merging rule;

[0012] Push the unique key attribute unit to the type query service, so that the type query service responds to the type query request for the target key data, and maps the merged data type in the unique key attribute unit to the second data type stored in the second database according to the preset type mapping rule for request feedback.

[0013] In a further embodiment, in the step of determining the data type and data width of the key data corresponding to the value data and then generating key attribute units including the key data, data type and data width for these key-value pair data respectively, the following steps executed by the server are included:

[0014] Parse the current key-value pair to obtain the key data and value data included in the current key-value pair;

[0015] According to the preset data type determination rule, determine its data type according to the initial data type corresponding to the value data;

[0016] Determine the data width corresponding to the value data, and then generate a key attribute unit including the key data, data type and data width for the current key-value pair.

[0017] In a further embodiment, in the step of obtaining the key attribute units with the same key data and merging these key attribute units into the same key attribute unit according to the preset unit merging rule, the following steps executed by the server are included:

[0018] Analyze the first key attribute unit and the second key attribute unit with target key data, and obtain the data types and data widths contained in each of them;

[0019] According to the preset data type merging rules, merge the data type of the first key attribute unit and the data type of the second attribute unit into a merged data type;

[0020] Determine the larger data width in the first key attribute unit and the second attribute unit to generate a key attribute unit containing this data width, the target key data, and the merged data type;

[0021] And so on, merge all the key attribute units with the target key data currently into the same key attribute unit.

[0022] In a further embodiment, in the step of respectively pushing the same key attribute units without the target key data to other servers, the steps executed by the server include the following:

[0023] Determine the key data contained in each of all the same key attribute units, and query the server identifiers corresponding to these key data in the preset push server list. The push server list stores multiple mapping relation data composed of key data identifiers and server identifiers;

[0024] Determine the key data whose corresponding server identifier is not the server identifier of the current server, and push the same key attribute unit to which it belongs to the corresponding server according to the server identifiers corresponding to these key data.

[0025] In a further embodiment, in the step of enabling the type query service to respond to the type query request for the target key data, and according to the preset type mapping rules, map the first data type in the unique key attribute unit to the second data type stored in the second database for request feedback, the steps executed by the type query service include the following:

[0026] Respond to the type query request pushed by the consumer side, and determine the target key data corresponding to the type query request;

[0027] Query the unique key attribute unit with the target key data in the key attribute unit pool, and obtain the merged data type and data width contained in the unique key attribute unit. The key attribute unit pool stores the unique key attribute units pushed by each server;

[0028] Call the preset type mapping rules, and map the merged data type to the second data type stored in the second database according to the merged data type and data width, so as to push the second data type to the consumer side.

[0029] In a further embodiment, the method includes the following post - processing steps performed by the consumer side:

[0030] Query key - value pairs with target key data from the first database, and obtain the value data included in the key - value pairs;

[0031] Push a type query request pointing to the target key data to the type query service, and then obtain a second data type fed back by the type query service in response to the type query request;

[0032] Store the value data in the second database in the data type characterized by the second data type.

[0033] A data type mapping processing device proposed for the purpose of adapting to the present application includes:

[0034] A key attribute unit generation module, configured to obtain multiple key - value pairs respectively stored in multiple target data areas in the first database, respectively obtain the key data and value data included in these key - value pairs, and determine the data type and data width of the key data corresponding to the value data, and then generate key attribute units including the key data, data type, and data width for these key - value pair data respectively;

[0035] A key attribute unit merging module, configured to obtain the key attribute units with the same key data, and merge these key attribute units into the same key attribute unit according to a preset unit merging rule. The same key attribute unit includes the key data, a merged data type generated by merging the data types of these key attribute units, and the maximum data width among these key attribute units;

[0036] A uniqueness unit merging module, configured to push the same key attribute units without target key data to other servers respectively, and at the same time receive the same key attribute units with target key data pushed by other servers, and then merge the same key attribute units with target key data into a unique key attribute unit according to the unit merging rule;

[0037] A key attribute unit pushing module, configured to push the unique key attribute unit to the type query service, so that the type query service responds to a type query request for the target key data, and maps the merged data type in the unique key attribute unit to a second data type conforming to the storage in the second database for request feedback according to a preset type mapping rule.

[0038] In a further embodiment, the key attribute unit generation module includes:

[0039] A key - value pair parsing sub - module, configured to parse the current key - value pair and obtain the key data and value data included in the current key - value pair;

[0040] A data type conversion sub-module, which is used to determine its data type according to the preset data type determination rule and the initial data type corresponding to the value data;

[0041] A key attribute unit generation sub-module, which is used to determine the data width corresponding to the value data, and then generate a key attribute unit including the key data, data type and data width for the current key-value pair.

[0042] In a further embodiment, the key attribute unit merging module includes:

[0043] A key attribute unit parsing sub-module, which is used to parse the first key attribute unit and the second key attribute unit with the target key data, and obtain the data type and data width contained in each of them;

[0044] A data type merging sub-module, which is used to merge the data type of the first key attribute unit and the data type of the second attribute unit into a merged data type according to the preset data type merging rule;

[0045] A maximum width determination sub-module, which is used to determine the larger data width in the first key attribute unit and the second attribute unit, so as to generate a key attribute unit including the data width, the target key data and the merged data type;

[0046] The same key attribute unit generation sub-module, which is used to merge all the key attribute units with the target key data into the same key attribute unit by analogy.

[0047] In a further embodiment, the uniqueness unit merging module includes:

[0048] A server identifier query sub-module, which is used to determine the key data contained in all the same key attribute units, and query the server identifier corresponding to each of the key data in the preset push server list, and the push server list stores a plurality of mapping relation data composed of key data identifiers and server identifiers;

[0049] A key attribute unit push sub-module, which is used to determine the key data whose corresponding server identifier is not the current server, and push the same key attribute unit to which it belongs to the corresponding server according to the server identifier corresponding to each of the key data.

[0050] In a further embodiment, the key attribute unit push module includes:

[0051] A type query request response sub-module, which is used to respond to the type query request pushed by the consumer side and determine the target key data corresponding to the type query request;

[0052] The unique unit query sub-module is used to query the unique key attribute unit with the target key data in the key attribute unit pool, and obtain the merged data type and data width included in the unique key attribute unit. The key attribute unit pool stores the unique key attribute units pushed by each server.

[0053] The data type mapping sub-module is used to call a preset type mapping rule, and map the merged data type to a second data type that conforms to the storage of the second database according to the merged data type and data width, so as to push the second data type to the consumer side.

[0054] To solve the above technical problems, an embodiment of the present application further provides a computer device, including a memory and a processor. Computer-readable instructions are stored in the memory. When the computer-readable instructions are executed by the processor, the processor executes the steps of the above data type mapping processing method.

[0055] To solve the above technical problems, an embodiment of the present application further provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the above data type mapping processing method.

[0056] To solve the above technical problems, an embodiment of the present application further provides a computer program product, including a computer program and computer instructions. When the computer program and computer instructions are executed by a processor, the processor executes the steps of the above data type mapping processing method.

[0057] Compared with the prior art, the advantages of the present application are as follows:

[0058] The present application can provide an adaptive data type conversion service for the platform. By generating corresponding unique key attribute units for the key data corresponding to each key-value pair stored in the first database consumed by the consumer side, after the consumer side obtains the corresponding key-value pair from the first database, it can send a type query request pointing to the key data included in the key-value pair to the type query service, so as to obtain the request feedback from the type query service by mapping the data type included in the unique key attribute unit corresponding to the key data to the second data type that conforms to the second database for data storage by the consumer side, so that the consumer side stores the value data of the key data in the second database in the data type represented by the second type data for data storage, enabling the platform to not need to provide the data source permission to the consumer side. Only the consumer side can determine the data storage format of the data it consumes in its own database through the type query service, ensuring the data security of the data source database, and the streaming data of the platform does not need to cause an exception in the real-time data stream processing system due to changes in the data type format.

[0059] In addition, the server cluster responsible for generating the corresponding unique key attribute units for the key data in this application is distributedly deployed, and each server is only responsible for the unique key attribute units of the key data it needs to process, realizing shunt data processing, improving the generation efficiency of each unique key attribute unit, and ensuring the data uniqueness of the unique key attribute units.

[0060] Secondly, in this application, the server cluster generates the corresponding unique key attribute units for each key data in advance, without the consumer end waiting for the unique key attribute units of the key data it needs to be completed before performing the mapping processing of the second data type, improving the overall data transmission efficiency of the real-time data stream processing system. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The above and / or additional aspects and advantages of this application will become obvious and easy to understand from the following description of the embodiments in conjunction with the drawings, where:

[0062] Figure 1 A schematic diagram of a typical network deployment architecture related to implementing the technical solution of this application;

[0063] Figure 2 A schematic flowchart of a typical embodiment of the data type mapping processing method of this application;

[0064] Figure 3 A schematic flowchart formed by the specific implementation manner of this application for generating the corresponding key attribute units for key-value pairs;

[0065] Figure 4 A schematic flowchart formed by the specific implementation manner of this application for merging the key attribute units with the same key data into the same key attribute unit;

[0066] Figure 5 A schematic flowchart formed by the specific implementation manner of this application for pushing the same key attribute unit;

[0067] Figure 6 A schematic flowchart formed by the specific implementation manner of this application for the type query service to perform data type mapping in response to the type query request pushed by the consumer end;

[0068] Figure 7 A schematic flowchart formed by the specific implementation manner of this application for the consumer end to obtain the second data type from the type query service;

[0069] Figure 8 A schematic block diagram of the principle of a typical embodiment of the data type mapping processing device of this application;

[0070] Figure 9 A basic structural block diagram of a computer device according to an embodiment of this application. Detailed implementation manners

[0071] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary only for explaining the present application and should not be construed as limiting the present application.

[0072] Those skilled in the art of the present technology can understand that unless specifically stated otherwise, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present application means the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any unit and all combinations of one or more related listed items.

[0073] Those skilled in the art of the present technology can understand that unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of those of ordinary skill in the art to which the present application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have a meaning consistent with the meaning in the context of the prior art, and will not be interpreted with an idealized or overly formal meaning unless specifically defined as here.

[0074] Those skilled in the art of the present technology can understand that the "client", "terminal", and "terminal device" used herein include both devices with a wireless signal receiver that only has the ability to receive and no ability to transmit, and devices with both receiving and transmitting hardware that can perform two-way communication on a two-way communication link. Such devices may include: cellular or other communication devices such as personal computers, tablet computers, etc., which have a single-line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which can combine voice, data processing, fax, and / or data communication capabilities; PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, Internet / intranet access, a web browser, a notepad, a calendar, and / or a GPS (Global Positioning System) receiver; traditional laptop and / or palm computers or other devices, which are traditional laptop and / or palm computers or other devices with and / or including a radio frequency receiver. The "client", "terminal", and "terminal device" used herein can be portable, transportable, installed in a vehicle (air, sea, and / or land), or suitable for and / or configured to run locally, and / or run in a distributed manner at any other location on the earth and / or in space. The "client", "terminal", and "terminal device" used herein can also be a communication terminal, an Internet access terminal, a music / video playback terminal, for example, it can be a PDA, a MID (Mobile Internet Device), and / or a mobile phone with music / video playback function, or it can also be a smart TV, a set-top box, etc.

[0075] The hardware referred to by names such as "server", "client", and "working node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer, which is a hardware device with the necessary components disclosed by the von Neumann principle, including a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit loads the program stored in the external memory into the memory for execution, executes the instructions in the program, and interacts with the input / output devices to complete specific functions.

[0076] It should be noted that the concept of "server" in this application can similarly be extended to the case applicable to server clusters. According to the network deployment principles understood by those skilled in the art, the servers should be logically divided. Physically, these servers can either be independent of each other but can be invoked through interfaces, or integrated into a physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility and should not be restricted by this when implementing the network deployment method of this application.

[0077] Please refer to Figure 1 , the hardware foundation required for the implementation of the related technical solutions of this application can be deployed according to the architecture shown in the figure. The server 80 referred to in this application is deployed in the cloud. As an online server, it can be responsible for further connecting relevant data servers and other servers providing relevant support, etc., thereby forming a logically related service cluster to provide services for relevant terminal devices such as the smartphone 81 and personal computer 82 shown in the figure or a third-party server (not shown). The smartphone and the personal computer can both access the Internet through well-known network access methods and establish a data communication link with the server 80 in the cloud to run terminal application programs related to the services provided by the server.

[0078] For the server, the application program is usually constructed as a service process, opening corresponding program interfaces for application programs running on various terminal devices to make remote calls. The related technical solutions suitable for running on the server in this application can be implemented in the server in this way.

[0079] The application program refers to an application program running on the server or terminal device. This application program implements the related technical solutions of this application in a programming manner. Its program code can be saved in a non-volatile storage medium recognizable by a computer in the form of computer-executable instructions and be loaded into the memory by the central processing unit for running. The related device of this application is constructed through the running of this application program on the computer.

[0080] For the server, the application program is usually constructed as a service process, opening corresponding program interfaces for application programs running on various terminal devices to make remote calls. The related technical solutions suitable for running on the server in this application can be implemented in the server in this way.

[0081] Those skilled in the art should be aware that: Although the various methods of this application are described based on the same concept and thus show commonality with each other, unless otherwise specified, these methods can be executed independently. Similarly, for each of the embodiments disclosed in this application, they are all proposed based on the same inventive concept. Therefore, for concepts with the same expression, as well as concepts that are only appropriately transformed for convenience although the concept expressions are different, they should be equivalently understood.

[0082] Please refer to Figure 2 , a data type mapping processing method of this application. In its typical embodiment, it includes the following steps:

[0083] Step S11, obtain multiple key-value pairs respectively stored in multiple target data areas in the first database, so as to respectively obtain the key data and value data included in these key-value pairs, and determine the data type and data width of the key data corresponding to the value data, and then generate key attribute units including the key data, data type and data width for these key-value pair data respectively:

[0084] The server respectively obtains multiple stored key-value pairs from multiple target data areas in the first database, and then parses these key-value pairs to obtain the key data and value data included in each of these key-value pairs.

[0085] The current server is in a server cluster, and this server cluster is responsible for generating the corresponding key attribute units for the key-value pairs stored in the first database, so as to generate corresponding key attribute units for the key-value pairs stored in the first database in a distributed manner, and hand over the key attribute units to the type query service, so as to provide the consumer with the data type of the value data included in the key-value pairs obtained from the first database in the second database, and then store the value data in the data type feedback by the type query service.

[0086] The server queries the target data areas corresponding to the respective target data area identifiers in the first database according to multiple target data area identifiers, so as to obtain all key-value pairs included in the respective target data areas. The first database is generally constructed based on the Kafka concept. The first database contains multiple topics, and each of the topics contains multiple partitions. Correspondingly, the second database is generally a database constructed based on the SQL concept. It can be understood that the ways of storing data in the first database and the second database are generally different. For example, the first database generally stores data in the form of key-value pairs. When the value data in the key-value pair is a number, the value data generally does not distinguish between integers and decimals in the key-value pair and JSON, while in the second database constructed based on SQL, the numeric data is classified into integer type, long integer type or floating point number, etc. Therefore, when any consumer obtains the corresponding key-value pair from the first database and needs to store the value data included in the key-value pair into its own second database, it is impossible to determine the data type of the value data. For this reason, in this method, a server cluster constructed by multiple servers is responsible for generating corresponding key attribute units for the key-value pairs stored in the first database in units of key data, and handing these key attribute units to the type query service, so that the consumer that needs to store the key-value pair into the second database can obtain the data type for storing the value data it needs to store in the second database by pushing a request to the type query service.

[0087] After the server obtains multiple key-value pairs from the multiple target data areas, it will parse these key-value pairs to obtain the key data and value data included in each of the key-value pairs, and then determine the data type and data width of the key data to which the value data belongs to generate the key attribute unit. Specifically, the server parses the current key-value pair to obtain the key data and value data included therein, and according to the preset data type determination rule, determines its data type according to the initial data type corresponding to the value data, and at the same time determines the data width corresponding to the value data, and then generates a key attribute unit including the key data, data type and data width for the current key-value pair.

[0088] The method by which the server determines the data type of the value data based on the initial data type corresponding to the value data, that is, the specific determination method of the data type determination rule, is generally determined according to the data included in the value data. For example, when the value data is data with double quotes, the value data will be correspondingly determined as the data type representing the character type; when the value data is without double quotes and only contains numbers, the value data will be correspondingly determined as the data type representing the integer type; when the value data is without double quotes and contains numbers and a dot, the value data will be correspondingly determined as the data type representing the decimal type; when the value data is a boolean value, the value data will be correspondingly determined as the data type representing the integer type. It can be understood that the relevant data type determination methods in the data type determination rule are set based on the data storage format of the second database, that is, set based on the data storage specification of SQL. Those skilled in the art can flexibly set the relevant rules in the data type determination rule according to the data storage format of the second database in the actual business, and this step will not be elaborated.

[0089] The method by which the server determines the data width corresponding to the value data is generally to determine the data width of the value data based on binary. For example, when the value data is the decimal number

[255] , the server converts the value data into binary, that is, converts

[255] into [11111111], and the data width of the value data is 8 bits.

[0090] After the server determines the data type and data width corresponding to any of the key-value pairs, it will generate a key property unit including the key data of the key-value pair, the data type, and the data width, which is convenient for the subsequent execution of merging key property units.

[0091] Step S12, obtain the key property units with the same key data, and according to the preset unit merging rule, merge these key property units into the same key property unit. The same key property unit includes the key data, the merged data type generated by merging the data types of each key property unit, and the maximum data width among these key property units:

[0092] After the server generates the corresponding key property units for all the key values it currently has, it will classify these key property units based on the key data, and then merge multiple key property units with the same key data into the same key property unit.

[0093] After the server obtains all key attribute units with the same key data, according to the preset unit merging rule, these key attribute units will be merged into one same key attribute unit. The same key attribute unit and the key attribute unit are both triples, that is, they both have key data, data type, and data width. When the data type included in the same key attribute unit is the merged data type obtained by merging the data types included in all the key attribute units respectively, correspondingly, the data width is the maximum data width among the data widths included in these key data units.

[0094] Regarding the specific implementation of the server merging all key attribute units with the same key data into the same key attribute unit, after the server obtains the first key attribute unit and the second key attribute unit with the target key data, it takes the data type included in the first key attribute unit as the first data type, takes the data type of the second key attribute unit as the second data type, and then according to the preset data type merging rule, merges the first data type and the second data type into the current merged data type, and determines the larger data width among the first key attribute unit and the second key attribute unit to generate a key attribute unit including this data width, the merged data type, and the target key data. Then, this key attribute unit is merged with other key attribute units with the target key data, and so on, until all key attribute units with the target key data are merged into the same key attribute unit.

[0095] In the data type merging rule, the data type with the highest merging weight among the two data types to be merged is taken as the merged data type through the merging weights corresponding to each data type. For example, generally among the merging weights of each data type, the merging weight of the character data type is the highest, the merging weight of the decimal data type is less than that of the character data type, and the merging weight of the integer data type is less than that of the decimal data type. When the first data type to be merged currently is the decimal data type, and the second data type to be merged with the first data type is the integer data type, then the data type after the merger of the first data type and the second data type will be the decimal data type; those skilled in the art can flexibly design the merging weights of each design type, and this step will not be elaborated here.

[0096] Step S13, push the same key attribute units without the target key data to other servers respectively, and at the same time receive the same key attribute units with the target key data pushed by other servers, and then according to the unit merging rule, merge the same key attribute units with the target key data into a unique key attribute unit:

[0097] After the server finishes merging the key attribute units of multiple groups of data with the same key into the same key attribute unit respectively, it will obtain multiple same key attribute units with different key data respectively. At this time, the server will push the same key attribute units without the key data it needs to process to other servers correspondingly.

[0098] Each server in the server cluster where the server is located is responsible for one or more unique key attribute units corresponding to the key data for each of them, so as to form a distributed shunting structure to process the unique key attribute units. Among them, the records of the key data that each server in the server cluster needs to process are generally stored in each server, so that the server can push the same key attribute units without the key data it needs to process to the corresponding servers respectively, and these servers will process them. Specifically, the current server determines the key data included in all the same key attribute units respectively, and queries the server identifiers corresponding to these key data in the preset push server list. The push server list stores multiple mapping relationship data composed of key data identifiers and server identifiers, and then determines the same key attribute units with the server identifier being the current server, and at the same time pushes the other same key attribute units to the servers corresponding to their respective server identifiers respectively, so that these servers can process the same key attribute units of the key data they need to process respectively.

[0099] After the server obtains multiple same key attribute units with target key data pushed by other servers, it will merge these same key attribute units into the unique key attribute unit according to the unit merging rule. Since the unit merging rule is the same as the unit merging rule described in step S12, for the specific implementation manner of merging these same key attribute units into the unique key attribute unit, please refer to the relevant embodiments in step S12, and this step will not be elaborated here.

[0100] It can be understood that there is only one unique key attribute unit corresponding to each key data, so as to ensure the uniqueness of the unique key attribute units stored in the subsequent type query service, and prevent the existence of unique key attribute units with the same key data, resulting in the type query service being unable to determine the second data type of the key data in the second database.

[0101] Step S14, push the unique key attribute unit to the type query service, so that the type query service can respond to the type query request for the target key data, and map the merged data type in the unique key attribute unit to the second data type that conforms to the storage in the second database according to the preset type mapping rule for request feedback:

[0102] After the server generates the unique key attribute unit, it pushes the unique key attribute unit to the type query service, so that the type query service can receive the unique key attribute unit and store it in the key attribute unit pool, so as to subsequently respond to the type query request for the key data contained in the unique key attribute unit and push the merged data type in the unique key attribute unit to the consumer end to which the request belongs and map it to the second data type that conforms to the second database storage.

[0103] The key attribute unit pool of the type query service is used to store the unique key attribute units pushed by each server in the server cluster.

[0104] After the type query service responds to the type query request pushed by the consumer end, it will determine the target key data corresponding to the type query request, and then query the unique key attribute unit with the target key data in the key attribute unit pool to obtain the merged data type and data width contained in the unique key attribute unit. Then, it calls the preset type mapping rule, and according to the merged data type and data width, maps the merged data type to the second data type that conforms to the second database storage, so as to push the second data type to the consumer end.

[0105] The implementation manner of mapping the merged data type to the second data type according to the type mapping rule for the type query service of the above type is as follows: After the type query service parses and obtains the merged data type and data width included in the unique key attribute unit corresponding to the current query request, it will call the type mapping rule to determine the second data type corresponding to the data type and the number of binary digits represented by the data width according to the data type represented by the merged data type and the number of binary digits represented by the data width. For example, when the merged data type represents an integer data type and the number of binary digits represented by the data width does not exceed 8 bits, the second data type to which the merged data type will be mapped is the INT data type in the data type of the second database constructed based on SQL. When the number of binary digits represented by the data width exceeds 8 bits and is less than 16 bits, the second data type mapped by the merged data type is the BIGINT data type in the data type of the second database; for the data type represented by the merged data type being a decimal data type, this data type will be mapped to the DECIMAL data type in the data type of the second database, and the number of binary digits of the DECIMAL data type is the number of binary digits represented by the data width; for the data type represented by the merged data type being a character data type, when the number of binary digits represented by the data width does not exceed 255 bits, the merged data type will be mapped to the VARCHAR(255) data type in the data type of the second database. When the number of binary digits represented by the data width exceeds 255 bits and does not exceed 65535 bits, the merged data type will be mapped to the VARCHAR(65535) data type. When the number of binary digits represented by the data width exceeds 65535 bits, the merged data type will be mapped to the TEXT data type.

[0106] It can be understood that in the type mapping rule, integer, decimal, and character data classifications are made according to the data type represented by the merged data type, and based on the data width corresponding to the merged data type, the merged data type is mapped to the corresponding second data type under each data classification. Of course, those skilled in the art can flexibly design the mapping method of the type mapping rule according to the database concept based on which the second database is built. This step will not be elaborated here.

[0107] After the consumer side pushes a type query request pointing to the target key data to the type query service to obtain the second data type corresponding to the target key data from the type query service, before the type query request updates the unique key attribute unit stored in its key attribute unit pool, it will store the value data corresponding to the target key data in its second database in the data type represented by the second data type.

[0108] As can be seen from the typical implementation of this method, this method can provide an adaptive data type conversion service for the platform. By generating a corresponding unique key attribute unit for each key data corresponding to the key-value pairs stored in the first database consumed by the consumer side, so that after the consumer side obtains the corresponding key-value pairs from the first database, by sending a type query request pointing to the key data included in the key-value pair to the type query service, so as to obtain the request feedback from the type query service by mapping the data type included in the unique key attribute unit corresponding to the key data to the second data type that conforms to the second database for data storage by the consumer side, enabling the consumer side to store the value data of the key data in the second database in the data type represented by the second type of data for data storage, enabling the platform to not need to provide the data source permission to the consumer side, only requiring the consumer side to be able to determine the data storage format of the data it consumes in its own database through the type query service, ensuring the data security of the data source database, and the streaming data of the platform does not need to cause anomalies in the real-time data stream processing system due to changes in the data type format.

[0109] In addition, the server cluster responsible for generating the corresponding unique key attribute unit for the key data in this method is distributedly deployed, and each server is only responsible for the unique key attribute unit of the key data it needs to process, realizing shunt data processing, improving the generation efficiency of each unique key attribute unit, and also ensuring the data uniqueness of the unique key attribute unit.

[0110] Secondly, this method generates the corresponding unique key attribute unit for each key data in advance through the server cluster, without the consumer side waiting for the unique key attribute unit of the key data it needs to complete before performing the mapping process of the second data type, improving the overall data transmission efficiency of the real-time data stream processing system.

[0111] The above typical embodiments and their variant embodiments fully disclose the implementation scheme of the data type mapping processing method of this application. However, various variant embodiments of this method can still be deduced through the transformation and amplification of some technical means. The following briefly describes other embodiments:

[0112] In one embodiment, please refer to Figure 3 , in the step of determining the data type and data width of the key data corresponding to the value data and then generating key attribute units including the key data, data type, and data width for these key-value pair data respectively, the following steps executed by the server are included:

[0113] Step S111, parse the current key-value pair to obtain the key data and value data included in the current key-value pair:

[0114] After the server obtains the current key-value pair from any of the target data areas, it will parse and obtain the key data and value data included in the current key-value pair.

[0115] Step S112, according to the preset data type determination rule, determine its data type according to the initial data type corresponding to the value data:

[0116] After the server obtains the key data and value data included in the current key-value pair, it will determine the data type corresponding to the initial data type of the key data according to the mapped data type determination rule. For example, when the value data is data with double quotes, then the value data will be correspondingly determined as the data type representing the character type; when the value data is without double quotes and only contains numbers, then the value data will be correspondingly determined as the data type representing the integer type; when the value data is without double quotes and contains numbers and a dot, then the value data will be correspondingly determined as the data type representing the decimal type; when the value data is a boolean value, then the value data will be correspondingly determined as the data type representing the integer type; it can be understood that the relevant data type determination methods in the data type determination rule are set based on the data storage format of the second database, that is, set based on the SQL data storage specification. Those skilled in the art can flexibly set the relevant rules in the data type determination rule according to the data storage format of the second database in actual business, and this step will not be elaborated here.

[0117] Step S113, determine the data width corresponding to the value data, and then generate a key attribute unit for the current key-value pair that includes the key data, data type, and data width:

[0118] When the server determines the data type of the value data, it will also simultaneously determine the data width corresponding to the value data. Generally, the data width of the value data is determined based on binary. For example, when the value data is the decimal number

[255] , the server will convert the value data to binary, that is, convert

[255] to [11111111], then the data width of the value data is 8 bits.

[0119] After the server determines the data type and data width corresponding to the value data, it will generate a key attribute unit that includes the data type, the data width, and the key data corresponding to the value data.

[0120] In this embodiment, by determining the data type and data width corresponding to the value data in the key-value pair, and then generating the key attribute unit corresponding to the key-value pair, so as to facilitate the subsequent parsing and merging processing of the key attribute unit.

[0121] In one embodiment, please refer to Figure 4The step of obtaining the key attribute units having the same key data and merging the key attribute units into the same key attribute unit according to a preset unit merging rule includes the following steps executed by the server:

[0122] Step S121: Parse the first key attribute unit and the second key attribute unit containing the target key data to obtain the data type and data width contained in each of them:

[0123] After obtaining the first key attribute unit and the second key attribute unit having the target key data, the server uses the data type contained in the first key attribute unit as the first data type and the data type of the second key attribute unit as the second data type, and obtains the data width contained in each of the two units.

[0124] Step S122: According to a preset data type merging rule, the data type of the first key attribute unit and the data type of the second attribute first are merged into a merged data type:

[0125] In the data type merging rule, the data type with the highest merging weight among the two data types to be merged will be used as the merged data type through the merging weight corresponding to each data type. For example, among the merging weights of various data types, the character data type has the highest merging weight, the decimal data type has a smaller merging weight than the character data type, and the integer data type has a smaller merging weight than the decimal data type. When the first data type currently being merged is a decimal data type, and the second data type to be merged with the first data type is an integer data type, then the data type after the first data type and the second data type are merged will be a decimal data type. Designers in this field can flexibly design the merging weights of various design types, and this step will not be described in detail.

[0126] Step S123: Determine the larger data width of the first key attribute unit and the second attribute unit to generate a key attribute unit including the data width, the target key data, and the merged data type:

[0127] When merging the first data type and the second data type, the server will simultaneously determine the larger data width in the first key attribute unit and the second key attribute unit, and then after completing the data type merging of the first data type and the second data type to generate the corresponding merged data type, it will generate a key attribute unit containing the larger data width, the merged data type and the target key data.

[0128] Step S124, and so on, merge all key attribute units that currently have target key data into the same key attribute unit:

[0129] After the server obtains the key attribute unit generated by the unit merging of the first key attribute unit and the second key attribute unit, it will perform unit merging of this key attribute unit with other key attribute units having the target key data, and so on, until all key attribute units having the target key data are merged into the same key attribute unit.

[0130] In this embodiment, the server merges key attribute units with the same key data to merge all key attribute units with the same key data into the same key attribute unit, and the merging rules for merging key attribute units mainly target the data types and data widths of both sides.

[0131] In one embodiment, please refer to Figure 5 , in the step of respectively pushing the same key attribute units without the target key data to other servers, the following steps executed by the server are included:

[0132] Step S131: Determine the key data contained in each of all the same key attribute units, and query the server identifier corresponding to each of these key data in the preset push server list. The push server list stores multiple mapping relationship data composed of key data identifiers and server identifiers:

[0133] After the server completes the merging of all the same key attribute units corresponding to all the key data it currently has, it will query the server identifier corresponding to each of these key data from the simultaneous servers to determine the unique key attribute unit merging of the same key attribute units it needs to process, and push the same key attribute units it does not need to process to the corresponding servers for unique key attribute unit merging.

[0134] The push server list stores multiple mapping relationship data composed of key data identifiers and server identifiers, so that the server can query the server identifier corresponding to the key data identifier of the key data from the recommended server list according to the key data contained in each same key attribute unit.

[0135] Step S132: Determine the key data whose corresponding server identifier is not the server identifier of the current server, and push the same key attribute units to which they belong to the corresponding servers according to the server identifiers corresponding to each of these key data:

[0136] After the server determines the server identifier corresponding to each same key attribute unit, it will determine the same key attribute units that it is responsible for performing unique key attribute unit merging among these same attribute units, and push the other same key attribute units to the servers with the server identifiers of their units according to the server identifiers of the other same key attribute units.

[0137] In this embodiment, the server only processes the merging of the unique key attribute units of the same key attribute unit that it needs to process, and pushes the other same key attribute units that it does not process to the corresponding other servers for processing, thereby forming a distributed shunt and merge of unique key attribute units, and ensuring the data uniqueness of the unique key attribute units.

[0138] In one embodiment, please refer to Figure 6 , in the step of enabling the type query service to respond to the type query request for the target key data and mapping the first data type in the unique key attribute unit to the second data type that conforms to the second database storage according to the preset type mapping rule for request feedback, the following steps performed by the type query service are included:

[0139] Step S141, respond to the type query request pushed by the consumer end, and determine the target key data corresponding to the type query request:

[0140] The type query service responds to the type query request pushed by any consumer end and determines the target key data of the unit corresponding to the type query request.

[0141] The type query request may include the target key data corresponding to it or the key data identifier corresponding to the target key data, so that the type query service can determine the target key data pointed to by the type query request.

[0142] Step S142, query the unique key attribute unit with the target key data in the key attribute unit pool, and obtain the merged data type and data width included in the unique key attribute unit. The key attribute unit pool stores the unique key attribute units pushed by each server:

[0143] After the server determines the target key data pointed to by the type query request, it will query the unique key attribute unit with the target key data in the key attribute unit pool, and then parse the unique key attribute unit to obtain the merged data type and data width included in the unique key attribute unit.

[0144] Step S143, call the preset type mapping rule, and map the merged data type to the second data type that conforms to the second database storage according to the merged data type and data width, so as to push the second data type to the consumer end:

[0145] The implementation manner of mapping the merged data type to the second data type according to the type mapping rule for the type query service of this type is as follows: After the type query service parses and obtains the merged data type and data width included in the unique key attribute unit corresponding to the current query request, it will call the type mapping rule to determine the second data type corresponding to this data type and the number of binary digits according to the data type represented by the merged data type and the number of binary digits represented by the data width. For example, when the merged data type represents an integer data type and the number of binary digits represented by the data width does not exceed 8 bits, the second data type to which this merged data type will be mapped is the INT data type in the data type of the second database constructed based on SQL. When the number of binary digits represented by the data width exceeds 8 bits and is less than 16 bits, the second data type mapped by the merged data type is the BIGINT data type in the data type of the second database; for the merged data type representing a decimal data type, this data type will be mapped to the DECIMAL data type in the data type of the second database, and the number of binary digits of this DECIMAL data type is the number of binary digits represented by the data width; for the merged data type representing a character data type, when the number of binary digits represented by the data width does not exceed 255 bits, the merged data type will be mapped to the VARCHAR(255) data type in the data type of the second database. When the number of binary digits represented by the data width exceeds 255 bits and does not exceed 65535 bits, the merged data type will be mapped to the VARCHAR(65535) data type. When the number of binary digits represented by the data width exceeds 65535 bits, the merged data type will be mapped to the TEXT data type.

[0146] It can be understood that in the type mapping rule, integer, decimal, and character data classifications are made according to the data type represented by the merged data type, and based on the data width corresponding to the merged data type, the merged data type is mapped to the corresponding second data type under each data classification. Of course, those skilled in the art can flexibly design the mapping method of the type mapping rule according to the database concept based on which the second database is built. This step will not be elaborated here.

[0147] After the type query service determines the second data type corresponding to the target key data, it pushes the second data type to the consumer side. So that after the consumer side obtains the second data type corresponding to the target key data from the type query service, before the type query request updates the unique key attribute unit stored in its key attribute unit pool, it stores the value data corresponding to the target key data in its second database in the data type represented by the second data type.

[0148] In this embodiment, the type query service is a query service for the consumer side through the second data type. The type query service determines the second data type corresponding to the key data by mapping the combined data type and data width of the unique key attribute units of the key data required to be queried by the consumer side, so that the consumer side stores the value data of the key data in the second database in the data type represented by the second data type.

[0149] In one embodiment, please refer to Figure 7 , the following post - steps executed by the consumer side are included in this method:

[0150] Step S15, query the key - value pair with the target key data from the first database, and obtain the value data included in the key - value pair:

[0151] After the consumer side queries the data area of the key - value pair with the target key data from the first database, it obtains the key - value pairs from these data areas and obtains the value data included in each of these key - value pairs. Of course, these key - value pairs can also be pushed by the business server responsible for the first database to the consumer side, and then the consumer side will parse these key - value pairs to obtain the key data and value data included in each of these key - value pairs.

[0152] Step S16, push a type query request pointing to the target key data to the type query service, and then obtain the second data type fed back by the type query service in response to the type query request:

[0153] The consumer side will push a type query request pointing to the key data whose second data type cannot be confirmed currently to the type query service to obtain the second data type corresponding to each of these type query requests from the type query service.

[0154] Step S17, store the value data in the second database in the data type represented by the second data type:

[0155] After the consumer end obtains the second data type corresponding to each key data from the type query service, before the type query service updates its key attribute unit, it stores the value data corresponding to each of these key data and the data type represented by its corresponding second data type in its own second database, facilitating subsequent consumption or production.

[0156] In this embodiment, after the consumer end obtains key-value pairs from the first database, it will push a type query request pointing to the key data of the key-value pairs to the type query service to obtain the second data type corresponding to the key data, and then store the value data corresponding to the key data in the data type represented by the second data type in the second database subsequently.

[0157] Furthermore, by functionalizing each step in the methods disclosed in the above embodiments, a data type mapping processing device of the present application can be constructed. According to this idea, please refer to Figure 8 , in a typical embodiment thereof, the device includes: a key attribute unit generation module 11, configured to obtain multiple key-value pairs respectively stored in multiple target data areas in the first database, so as to respectively obtain the key data and value data included in these key-value pairs, and determine the data type and data width of the key data corresponding thereto according to the value data, and then generate key attribute units including the key data, data type, and data width for these key-value pair data respectively; a key attribute unit merging module 12, configured to obtain the key attribute units with the same key data, and merge these key attribute units into the same key attribute unit according to a preset unit merging rule, where the same key attribute unit includes the key data, the merged data type generated by merging the data types of each of these key attribute units, and the maximum data width among these key attribute units; a uniqueness unit merging module 13, configured to respectively push the same key attribute units without the target key data to other servers, and at the same time receive the same key attribute units with the target key data pushed by other servers, and then merge the same key attribute units with the target key data into a unique key attribute unit according to the unit merging rule; a key attribute unit pushing module 14, configured to push the unique key attribute unit to the type query service, so that the type query service responds to the type query request for the target key data, and maps the merged data type in the unique key attribute unit to the second data type conforming to the storage in the second database for request feedback.

[0158] In one embodiment, the key attribute unit generation module 11 includes: a key-value pair parsing sub-module for parsing the current key-value pair to obtain the key data and value data included in the current key-value pair; a data type conversion sub-module for determining its data type according to the initial data type corresponding to the value data according to the preset data type determination rule; and a key attribute unit generation sub-module for determining the data width corresponding to the value data, and then generating a key attribute unit including the key data, data type, and data width for the current key-value pair.

[0159] In one embodiment, the key attribute unit merging module 12 includes: a key attribute unit parsing sub-module for parsing the first key attribute unit and the second key attribute unit having the target key data to obtain the data type and data width included in each of them; a data type merging sub-module for merging the data type of the first key attribute unit and the data type of the second key attribute unit into a merged data type according to the preset data type merging rule; a maximum width determination sub-module for determining the larger data width in the first key attribute unit and the second key attribute unit to generate a key attribute unit including the data width, the target key data, and the merged data type; and an identical key attribute unit generation sub-module for, by analogy, merging all the key attribute units having the target key data currently into an identical key attribute unit.

[0160] In one embodiment, the uniqueness unit merging module 13 includes: a server identifier query sub-module for determining the key data included in each of all the identical key attribute units, and querying the server identifier corresponding to each of the key data in a preset push server list, where the push server list stores a plurality of mapping relation data composed of key data identifiers and server identifiers; and a key attribute unit push sub-module for determining the key data whose corresponding server identifier is not the current server identifier, and pushing the identical key attribute unit to which it belongs to the corresponding server according to the server identifier corresponding to each of the key data.

[0161] In one embodiment, the key attribute unit push module 14 includes: a type query request response sub-module for responding to the type query request pushed by the consumer side and determining the target key data corresponding to the type query request; a uniqueness unit query sub-module for querying the unique key attribute unit having the target key data in the key attribute unit pool and obtaining the merged data type and data width included in the unique key attribute unit, where the key attribute unit pool stores the unique key attribute units pushed by each server; and a data type mapping sub-module for calling the preset type mapping rule and mapping the merged data type to a second data type conforming to the second database storage according to the merged data type and data width, so as to push the second data type to the consumer side.

[0162] To solve the above technical problems, an embodiment of the present application further provides a computer device for running a computer program implemented according to the data type mapping processing method. For details, please refer to Figure 9 , Figure 9 , which is a basic structural block diagram of the computer device in this embodiment.

[0163] As Figure 9 shown, it is a schematic internal structure diagram of the computer device. The computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected through a system bus. Among them, the non-volatile storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The control information sequence can be stored in the database. When the computer-readable instructions are executed by the processor, the processor can implement a data type mapping processing method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The computer-readable instructions can be stored in the memory of the computer device. When the computer-readable instructions are executed by the processor, the processor can execute a data type mapping processing method. The network interface of the computer device is used to connect and communicate with the terminal. Those skilled in the art can understand that Figure 9 the structure shown in

[0164] is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0165] The present application further provides a non-volatile storage medium. The data type mapping processing method is written as a computer program and stored in the storage medium in the form of computer-readable instructions. When the computer-readable instructions are executed by one or more processors, it means the program runs on the computer, thereby enabling one or more processors to execute the steps of the data type mapping processing method in any of the above embodiments.

[0166] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. This computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM), etc.

[0167] In summary, this application can adaptively convert data formats to ensure the data stability of the database.

[0168] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the indication of the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily have to be executed at the same time, but can be executed at different times, and their execution order does not necessarily have to be sequential, but can be executed alternately or alternately with at least a part of the sub-steps or stages of other steps or other steps.

[0169] Those skilled in the art of this technology can understand that the steps, measures, and solutions in the various operations, methods, and processes discussed in this application can be alternated, changed, combined, or deleted. Further, the other steps, measures, and solutions in the various operations, methods, and processes discussed in this application can also be alternated, changed, rearranged, decomposed, combined, or deleted. Further, the steps, measures, and solutions in the prior art that are the same as those disclosed in this application can also be alternated, changed, rearranged, decomposed, combined, or deleted.

[0170] The above are only some embodiments of this application. It should be noted that for those of ordinary skill in the art of this technology, without departing from the principle of this application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of this application.

Claims

1. A method for processing data type mapping, characterized in that It includes the following steps: Obtain multiple key-value pairs stored in multiple target data areas in the first database respectively, so as to obtain the key data and value data included in these key-value pairs respectively, and determine the data type and data width of the key data corresponding to the value data, and then generate key attribute units including the key data, data type and data width for these key-value pair data respectively; Obtain the key attribute units with the same key data, and merge these key attribute units into the same key attribute unit according to the preset unit merging rule. The same key attribute unit includes the key data, the merged data type generated by merging the data types of each key attribute unit, and the maximum data width among these key attribute units; Push the same key attribute units without the target key data to other servers respectively, and at the same time receive the same key attribute units with the target key data pushed by other servers. Then, according to the unit merging rule, merge the same key attribute units with the target key data into a unique key attribute unit, including the following steps executed by the server: Determine the key data included in each of all the same key attribute units, and query the server identifier corresponding to each of these key data in the preset push server list. The push server list stores multiple mapping relationship data composed of key data identifiers and server identifiers; Determine the key data whose corresponding server identifier is not the server identifier of the current server, and push the same key attribute unit to which it belongs to the corresponding server according to the server identifier corresponding to each of these key data; Push the unique key attribute unit to the type query service, so that the type query service responds to the type query request for the target key data, and maps the merged data type in the unique key attribute unit to the second data type stored in the second database according to the preset type mapping rule for request feedback.

2. The method according to claim 1, characterized in that, In the step of determining the data type and data width of the key data corresponding to the value data, and then generating key attribute units including the key data, data type and data width for these key-value pair data respectively, it includes the following steps executed by the server: Parse the current key-value pair to obtain the key data and value data included in the current key-value pair; Determine its data type according to the preset data type determination rule based on the initial data type corresponding to the value data; Determine the data width corresponding to the value data, and then generate a key attribute unit including the key data, data type and data width for the current key-value pair.

3. The method according to claim 1, characterized in that, In the step of obtaining the key attribute units with the same key data, and merging these key attribute units into the same key attribute unit according to the preset unit merging rule, it includes the following steps executed by the server: Parse the first key attribute unit and the second key attribute unit with the target key data to obtain the data type and data width included in each of them; Merge the data type of the first key attribute unit and the data type of the second key attribute unit into the merged data type according to the preset data type merging rule; Determine the larger data width between the first key attribute unit and the second key attribute unit to generate a key attribute unit including this data width, the target key data, and the merged data type; And so on, merge all the key attribute units currently having the target key data into the same key attribute unit.

4. The method according to claim 1, characterized in that In the step of enabling the type query service response to act on the type query request for the target key data and mapping the first data type in the unique key attribute unit to the second data type stored in the second database for request feedback according to the preset type mapping rule, the following steps executed by the type query service are included: Respond to the type query request pushed by the consumer side, and determine the target key data corresponding to this type query request; Query the unique key attribute unit having the target key data in the key attribute unit pool, and obtain the merged data type and data width included in this unique key attribute unit. The key attribute unit pool stores the unique key attribute units pushed by each server; Invoke the preset type mapping rule, and according to the merged data type and data width, map this merged data type to the second data type stored in the second database, so as to push this second data type into the consumer side.

5. The method according to claim 1, wherein This method includes the following post - processing steps executed by the consumer side: Query the key - value pair having the target key data from the first database, and obtain the value data included in this key - value pair; Push a type query request pointing to the target key data to the type query service, and further obtain the second data type fed back by the type query service in response to this type query request; Store the value data in the second database in the data type characterized by the second data type.

6. A data type mapping processing device, characterized in that, It includes: A key attribute unit generation module, which is used to obtain multiple key - value pairs respectively stored in multiple target data areas in the first database, so as to respectively obtain the key data and value data included in these key - value pairs, and determine the data type and data width of the key data corresponding to the value data, and then generate key attribute units including the key data, data type, and data width for these key - value pair data respectively; A key attribute unit merging module, which is used to obtain the key attribute units having the same key data, and according to the preset unit merging rule, merge these key attribute units into the same key attribute unit. The same key attribute unit includes the key data, the merged data type generated by merging the data types of each key attribute unit, and the largest data width among these key attribute units; A uniqueness unit merging module, which is used to respectively push the same key attribute units without the target key data to other servers, and at the same time receive the same key attribute units having the target key data pushed by other servers, and then according to the unit merging rule, merge the same key attribute units having the target key data into a unique key attribute unit; The uniqueness unit merging module includes: A server identifier query sub-module, which is used to determine the key data included in each of all the same key attribute units, so as to query the server identifiers corresponding to the respective key data in a preset push server list, and a plurality of mapping relation data composed of key data identifiers and server identifiers are stored in the push server list; A key attribute unit push sub-module, which is used to determine the key data whose corresponding server identifier is not the server identifier of the current server, and push the same key attribute unit to which it belongs to the corresponding server according to the server identifiers corresponding to the respective key data; A key attribute unit push module, which is used to push the unique key attribute unit to a type query service, so that the type query service responds to a type query request for the target key data, and maps the merged data type in the unique key attribute unit to a second data type that conforms to the storage of the second database according to a preset type mapping rule for request feedback.

7. An electronic device, comprising a central processing unit and a memory, characterized in that, The central processing unit is used to call and run a computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 5.

8. A non-volatile storage medium, characterized in that, It stores a computer program implemented according to the method according to any one of claims 1 to 5 in the form of computer-readable instructions. When the computer program is called and run by a computer, it executes the steps included in the method.

9. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Data storage method, device, equipment and storage medium

    CN110737663A

  • Data processing method and device, equipment and storage medium

    CN112765269A