A distributed data merging processing method, device, equipment and medium

By using the module-fetching sharding rules and account routing tables in distributed databases to merge temporary account data and formal account data, the problem that data merging in distributed databases cannot guarantee atomicity is solved, and the final consistency of transactions and the efficiency of data merging is achieved.

CN114238514BActive Publication Date: 2025-08-19PINGAN YIQIANBAO E COMMERCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111563871.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-08-19
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

In the distributed database framework, data merging of different databases cannot guarantee the atomicity of the merging process, resulting in the ultimate consistency of transactions that cannot be achieved.

Method used

By responding to user registration information, obtaining temporary account names and data, using the module-fetching rules to store them in a distributed database, creating a shared database to store the account routing table, and queries the routing table to merge temporary account data and official account data to ensure that the data is merged and stored in a locked state, and using an intermediate database to restore data to cope with failures.

Benefits of technology

It realizes the atomicity of the data merging process in the distributed database framework, ensures the ultimate consistency of transactions, and improves the efficiency and reliability of data merging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114238514B_ABST
    Figure CN114238514B_ABST
Patent Text Reader

Abstract

The present invention proposes a distributed data merging processing method, apparatus, device, and medium, comprising: obtaining, in response to the current user's registration information, a temporary account name and temporary account data of the current user's temporary account in a single database, and assigning the formal account name and formal account data of the current user's formal account in a distributed database; sorting the temporary account name and temporary account data according to a modular sharding rule, and storing the sorted temporary account name and temporary account data in a database within the distributed database; creating a shared database that stores an account routing table; and querying the account routing table to merge the temporary account data with the formal account data. The present invention solves the problem of data merging from different databases in a distributed database framework, ensuring the advantage of achieving eventual consistency of transactions within the distributed database framework.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a distributed data merging processing method, device, equipment and medium. Background Art

[0002] In the financial industry, an account identifies a user and is tied to their assets within the current application system, such as red envelopes in food delivery apps or points in banking apps. To attract new users, financial companies create temporary accounts for unregistered users and link them to them, sending them information about benefits, thereby encouraging them to register for accounts and claim them. When a user registers an account and needs to claim previously granted benefits, the backend system automatically merges these accounts, transferring any benefits previously allocated to the temporary account to their official account.

[0003] With the rapid development of internet technology and the increasing volume of data, processing the vast amount of information on the internet has become a challenge. Processing this massive amount of information on a single machine requires significant processing power and port capabilities. However, these high-performance standalone machines are expensive, and this single-machine processing model also has limitations. Therefore, the system architecture was upgraded from a single database to a distributed one. While distributed databases solve the problem of merging data in a single database, they also introduce atomicity issues. When merging data from accounts in different databases, database transactions cannot guarantee the atomicity of the merge process. Atomicity in database transactions means that all operations in a transaction are indivisible within the database: either all or none of them are executed. Summary of the Invention

[0004] In order to improve the atomicity of the merging process by using database transactions when merging account data in different databases, the present invention proposes the following technical solution.

[0005] A distributed data merging processing method, comprising:

[0006] In response to the current user's registration information, obtain a temporary account name and temporary account data of the current user's temporary account in the single database, and assign a formal account name and formal account data of the current user's formal account in the distributed database;

[0007] sorting the temporary account names and the temporary account data according to a modulo sharding rule, and storing the sorted temporary account names and temporary account data in a database in the distributed database, wherein the modulo sharding rule is defined as sorting temporary accounts in a user region in the single database, where the user region includes the current user;

[0008] Creating a shared database, wherein the shared database stores an account routing table;

[0009] Query the account routing table, call the temporary account data and the official account data, merge the temporary account data and the official account data, and store them in the database where the official account is located.

[0010] In one embodiment of the present invention, the account routing table includes a temporary account name, a formal account name, a mapping relationship between the temporary account name and the formal account name, a temporary account database identifier and a formal account database identifier, and the status of the temporary account data and the formal account data, so as to perform call merging processing of the temporary account data and the formal account data.

[0011] In one embodiment of the present invention, the temporary account data and the formal account data include a locked state and an unlocked state;

[0012] The temporary account data and the official account data are locked to prevent them from being called and modified.

[0013] The state of unlocking the temporary account data and the formal account data is an unlocked state, so that the temporary account data and the formal account data are called and merged.

[0014] In one embodiment of the present invention, the steps of querying the account routing table, calling the temporary account data and the formal account data, merging the temporary account data and the formal account data, and storing them in the database where the formal account is located include:

[0015] Obtain the temporary account database identifier and the formal account database identifier by using the modulo sharding rule;

[0016] After querying the account routing table and calling the temporary account data and the formal account data, the temporary account data and the formal account data are locked in the shared database to prevent the temporary account data and the formal account data from being called and modified.

[0017] In one embodiment of the present invention, the step of querying the account routing table, calling the temporary account data and the formal account data, merging the temporary account data and the formal account data, and storing them in the database where the formal account is located further includes: calling the temporary account data and the formal account data, locking the temporary account data and the formal account data in a shared database, merging the temporary account data with the formal account data, and storing the merged account data in a database corresponding to the formal account database identifier.

[0018] In one embodiment of the present invention, the steps of querying the account routing table, calling the temporary account data and the formal account data, merging the temporary account data and the formal account data, and storing them in the database where the formal account is located further include:

[0019] After the merged account data is stored in the database corresponding to the formal account database identifier, the temporary account data is unlocked in the temporary account database, and the formal account data is unlocked in the formal account database.

[0020] In one embodiment of the present invention, the distributed data merging processing method further includes:

[0021] When merging temporary account data and formal account data, the temporary account data is recorded and stored in the intermediate database. When the merger of temporary account data and formal account data fails, data restoration is performed using the temporary account data stored in the intermediate database.

[0022] The present invention further provides a distributed data merging processing device, the distributed data merging device comprising:

[0023] an acquiring unit, configured to acquire, in response to the registration information of the current user, a temporary account name and temporary account data of the temporary account of the current user in the single database, and assign a formal account name and formal account data of the formal account of the current user in the distributed database;

[0024] a sorting unit, configured to sort the temporary account names and the temporary account data according to a modulo sharding rule, and store the sorted temporary account names and temporary account data in a database in the distributed database, wherein the modulo sharding rule is defined as sorting temporary accounts in a user area in the single database, where the user area includes a current user;

[0025] A data unit is used to create a shared database, wherein the shared database stores an account routing table;

[0026] The merging unit is used to query the account routing table, call the temporary account data and the formal account data, merge the temporary account data and the formal account data, and store them in the database where the formal account is located.

[0027] The present invention further provides an electronic device, comprising:

[0028] a memory storing at least one instruction; and

[0029] The processor executes the instructions stored in the memory to implement the distributed data merging processing method.

[0030] The present invention also proposes a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the distributed data merging processing method.

[0031] The present invention proposes a distributed data merging processing method, device, equipment and medium, which solves the problem that the atomicity of the merging process cannot be guaranteed due to the merging of data from different databases in a distributed database framework, and ensures the advantage of achieving eventual consistency of transactions in the distributed database framework. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A schematic flow chart of a distributed data merging processing method of the present invention;

[0033] Figure 2 This is a flow chart of sub-steps of step S40 of a distributed data merging processing method of the present invention;

[0034] Figure 3 A functional module diagram of a distributed data merging processing method of the present invention;

[0035] Figure 4 A schematic structural diagram of an electronic device for a distributed data merging processing method of the present invention; DETAILED DESCRIPTION

[0036] The following describes the embodiments of the present invention through specific examples. Those skilled in the art will readily understand the other advantages and benefits of the present invention from the disclosure herein. The present invention may also be implemented or applied through various other specific embodiments, and the details in this specification may be modified or altered based on different viewpoints and applications without departing from the spirit of the present invention.

[0037] It should be noted that the illustrations provided in this embodiment are only used to schematically illustrate the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.

[0038] like Figure 1 FIG. 1 is a flow chart of a preferred embodiment of a distributed data merging processing method of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.

[0039] The distributed data merging processing method is applied to one or more electronic devices, wherein the electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0040] The electronic device may be any electronic product that can interact with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0041] The electronic device may further include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of hosts or network servers.

[0042] The network where the electronic device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.

[0043] See also Figures 1-2 In some embodiments, a distributed data merging processing method includes:

[0044] Step S10: In response to the current user's registration information, obtain the temporary account name and temporary account data of the current user's temporary account in the single database, and assign the formal account name and formal account data of the current user's formal account in the distributed database.

[0045] Before the current user registers an account and becomes a formal account, a single database will create a temporary account for the current user. The single database will also send welfare information to the current user's temporary account at irregular intervals. The current user's temporary account has a temporary account name and temporary account data. The temporary account name is a unique account name that distinguishes the current user from other users, and the temporary account data is a data set containing welfare data corresponding to the current user's temporary account name. In the distributed database, the current user's registration information is reviewed, and the current user whose registration information passes the review is assigned to the formal account. The current user's formal account has the formal account name and formal account data.

[0046] The data items and types of the temporary account name of the current user and the official account name on the official account can be the same, and the data items and types of the temporary account data of the current user and the official account data can be the same. The specific method of setting the temporary account name and the official account name is not limited. In one embodiment, the temporary account name and the official account name can be automatically assigned by the system, such as temp1, temp2, temp3, etc.

[0047] In one embodiment, the temporary account name and the formal account name can be registered by the current user himself, wherein the temporary account name and the formal account name can be set differently. For example, the temporary account name and the formal account name are detected, and the binary code corresponding to the detected temporary account name or formal account name is read. The next time the temporary account name or the formal account name is used to register the same account name, a prompt is given to indicate that the same temporary account name or the formal account name has been registered and it is recommended to re-register.

[0048] In one embodiment, the temporary account name or the official account name can be registered by the current user himself, wherein the temporary account name and the official account name can be set to be the same. For example, the temporary account name or the official account name can be bound to the current user's ID number or mobile phone number, etc., and each account can be distinguished by the difference in the current user's binding information. In the distributed database, the current user's temporary account name or the official account name can be modified, wherein the method of modifying the temporary account name or the official account name is not restricted. In some embodiments, the temporary account name or the official account name can be modified free of charge by the current user, and the temporary account name or the official account name can also be modified by the current user consuming account points in the distributed database. The account points can be obtained by the current user participating in welfare activities.

[0049] Step S20: sort the temporary account names and the temporary account data according to the modulo sharding rule, and store the sorted temporary account names and temporary account data in a database in the distributed database. The modulo sharding rule is defined as sorting temporary accounts in a user area in the single database, where the user area includes the current user.

[0050] When extracting the temporary account name and temporary account data of the current user from a single database, the temporary account name and temporary account data of the current user must first be stored. In some embodiments, the temporary account name and temporary account data of the current user can be stored in a distributed database. The temporary account name and temporary account data of the current user can be stored in the same database within the distributed database, thereby improving the efficiency of subsequent extraction of the temporary account name and temporary account data of the current user.

[0051] The specific rules of the modular sharding rules are not limited. In some embodiments, the modular sharding rules can be different modular sharding rules such as [account number % 100] and [account number % 50]. [Account number % 100] indicates that a user area in the single database containing 100 temporary accounts is sorted and extracted, wherein the user area of the 100 temporary accounts includes the current user. [Account number % 50] indicates that a user area in the single database containing 50 temporary accounts is sorted and extracted, wherein the user area of 50 temporary accounts includes the current user. By sorting 100 or 50 temporary accounts at one time, the efficiency of temporary account sorting is increased. Since the temporary account name and temporary account data of each temporary account are different, when sorting 100 or 50 temporary accounts at the same time, the temporary account names and temporary account data will not be garbled or incorrect.

[0052] When the modulo sharding rule adopts [account number%50], 50 temporary accounts are sorted at one time, and the sorted temporary account names and temporary account data are stored in the distributed database. There is no restriction on the way of storing the temporary account names and temporary account data sorted according to the modulo sharding rule in the distributed database. In some embodiments, the sorted temporary account names and temporary account data can be stored in sequence. For example, when the number of databases in the distributed database is less than 50, the sorted temporary account names and temporary account data can be sorted in the order of the distributed database. After the temporary accounts are sorted once in the order of the distributed database, since the temporary account names and temporary account data are greater than the number of databases in the distributed database, the temporary account names and temporary account data can be stored again in the order of the distributed database.

[0053] When the number of databases in the distributed database is equal to 50, the selected temporary account names and temporary account data can be sorted according to the order of the distributed database. Since the number of databases in the distributed database is the same as the number of sorting by the modulo sharding rule, after the temporary users are sorted once according to the order of the distributed database, they can be stored again according to the order of the distributed database.

[0054] When the number of databases in the distributed database is greater than 50, the temporary account names and temporary account data at the sorting location can be sorted according to the order of the distributed databases. After the temporary accounts are sorted once according to the order of the distributed databases, the temporary account names and temporary account data do not fill the number of databases in the distributed database. Therefore, the temporary account names and temporary account data that are subsequently sorted and processed by the modulo sharding rule can then be stored according to the database order of the distributed database.

[0055] Step S30: Create a shared database to store an account routing table. A shared database is created to store an account routing table. The account routing table stores the current user's temporary account name, official account name, the mapping between the temporary and official account names, the temporary and official account database identifiers, and the status of the temporary and official account data.

[0056] A shared database is created in a distributed database. The shared database stores an account routing table. The account routing table is a spreadsheet (file) or a database-like table stored in a router or a networked computer. In some embodiments, the account routing table may store the current user's temporary account name, formal account name, the mapping relationship between the temporary account name and the formal account name, the DBID (database identifier) of the temporary account and the formal account, and the current status of the temporary account and the formal account.

[0057] The mapping relationship between temporary account names and formal account names is different under different modulo sharding rules and under different numbers of databases in a distributed database. The mapping relationship between temporary account names and formal account names can be set by the modulo sharding rules and the number of databases in the distributed database.

[0058] The current status of the temporary account data and official account data of the current user may include a locked state L and an unlocked state S. When the status of the temporary account and official account of the current user is locked state L, the temporary account data and official account data of the current user are locked to prevent other merge or rewrite operations from overwriting the temporary account data or official account data while the data is being merged. When the status of the temporary account and official account of the current user is unlocked state S, the temporary account data and official account data of the current user are unlocked, and read, write, or merge operations can be performed on the temporary account data and official account data of the current user.

[0059] For example, the name of the current user's temporary account is temp1, the name of the current user's formal account is acount9, the DBID of the current user's formal account is 09, and the current status of the temporary account data and the formal account data is S. The current user's temporary account name and temporary account data can be read through the one-to-one correspondence of temp1, and the current user's formal account name and formal account data can be read through the one-to-one correspondence of acount9. The corresponding relationship between the temporary account name and the formal account name is temp1-acount9. The DBID of the current user's temporary account is 01, and the DBID of the current user's formal account is 09.

[0060] Step S40: query the account routing table, call the temporary account data and the formal account data, merge the temporary account data and the formal account data, and store them in the database where the formal account is located.

[0061] Step S41: Obtain the temporary account database identifier of the current user and the formal user database identifier of the current user through the modulo sharding rule.

[0062] Since the mapping of the temporary account name of the current user to the distributed database is associated with the modulo sharding rule and the number of databases in the distributed database, the DBID of the temporary account of the current user is obtained according to the set modulo sharding rule.

[0063] Step S42: Acquire temporary account data from the database corresponding to the temporary account database identifier of the current user, and update the current state of the temporary account data of the current user in the database corresponding to the temporary account database identifier to a locked state L, locking the temporary account name and temporary account data to prevent data changes.

[0064] On the premise that the current status of the temporary account data and the formal account data in the shared database is set to the locked state L, first, the database corresponding to the temporary account database identifier of the current user is obtained in the shared database, then the temporary account data of the temporary account is obtained in the database corresponding to the temporary account database identifier of the current user, and then the current status of the database identifier of the current user in the database of the temporary account database identifier is set to the locked state L, so as to avoid changes in the temporary account name and temporary account data.

[0065] Step S43: Obtain the formal account data from the database corresponding to the formal account database identifier of the current user, and update the current state of the formal account data of the current user in the database of the formal account database identifier to a locked state L, locking the formal account name and formal account data to prevent data changes.

[0066] On the premise that the current status of the temporary account data in the shared database is set to the locked state L, first, the database corresponding to the current user's formal account database identifier is obtained in the shared database, then the formal account data is obtained in the database corresponding to the current user's formal account database identifier, and then the current status of the current user's formal account data in the database of the formal account database identifier is set to the locked state L to avoid changes in the formal account name and formal account data.

[0067] Step S44: Merge the acquired temporary account data with the acquired formal account data, and store the merged account data in a database corresponding to the formal account database identifier of the current user.

[0068] On the premise that the current status of the temporary account data of the current user in the temporary account database is set to the locked state L, and on the premise that the current status of the formal account data of the current user in the formal account database is set to the locked state L, the temporary account data and the formal account data are merged, and then the merged account data is stored in the database corresponding to the formal account database identifier of the current user and stored.

[0069] Step S45: Update the current status of the temporary account data of the current user to the unlocked state S in the database of the temporary account database identifier, update the current status of the formal account data of the current user to the unlocked state S in the database of the formal account database identifier, and update the current status of the temporary account data and formal account data of the current user to the unlocked state S in the shared database.

[0070] The temporary account data and the formal account data of the current user are merged, and the merged account data is stored in the database corresponding to the formal account database identifier of the current user, and the current state of the temporary account data of the current user in the database of the temporary account database identifier is updated to the unlocked state S, and the current state of the formal account data of the current user in the database of the formal account database identifier is updated to the unlocked state S, and the current state of the temporary account data and the formal account data of the current user in the shared database is set to the unlocked state S, so that the temporary account data or the formal account data of the current user can be processed again for the next account data merging operation.

[0071] Step S50: When merging the temporary account data and the formal account data, the temporary account data is recorded and stored in the intermediate database. When the merging of the temporary account data and the formal account data fails, data restoration is performed using the temporary account data stored in the intermediate database.

[0072] When merging temporary account data with official account data, the temporary account data is recorded and stored in an intermediate database, which may be a distributed database. If, during the merging process, a server power outage occurs, preventing the merging of the temporary account data with the official account data, the temporary account data in the intermediate database can be used to restore the temporary account data.

[0073] It should be noted that in the present invention, in order to further ensure the security of the data, the data and models involved can also be deployed on the blockchain to prevent the data from being maliciously tampered with.

[0074] It should be noted that the step division of the various methods above is only for the purpose of clear description. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they contain the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0075] like Figure 3 FIG2 is a functional block diagram of a distributed data merging device according to the present invention. The distributed data merging device 11 includes an acquisition unit 110, a sorting unit 111, a data unit 112, a merging unit 113, and a recording unit 114. The modules / units referred to in the present invention are a series of computer program segments that can be executed by the processor 13 and can perform fixed functions, and are stored in the memory 12.

[0076] Step S10: In response to the current user's registration information, the acquisition unit 110 acquires the temporary account name and temporary account data of the current user's temporary account in the single database, and assigns the formal account name and formal account data of the current user's formal account in the distributed database.

[0077] Step S20: According to the modulo sharding rule, the sorting unit 111 sorts the temporary account name and the temporary account data, and stores the sorted temporary account name and temporary account data in a database in the distributed database. The modulo sharding rule is defined as sorting temporary accounts in a user area in the single database, where the user area includes the current user.

[0078] Step S30: The data unit 112 creates a shared database, where the shared database stores the account routing table.

[0079] A shared database is created. The shared database stores an account routing table. The account routing table stores the current user's temporary account name, formal account name, a mapping relationship between the temporary account name and the formal account name, a temporary account database identifier and a formal account database identifier, and the status of the temporary account data and the formal account data.

[0080] Step S40: query the account routing table, call the temporary account data and the formal account data, merge the temporary account data and the formal account data, and store them in the database where the formal account is located.

[0081] Step S41: Obtain the temporary account database identifier of the current user and the formal user database identifier of the current user through the modulo sharding rule.

[0082] Step S42: Acquire temporary account data from the database corresponding to the temporary account database identifier of the current user, and update the current state of the temporary account data of the current user in the database corresponding to the temporary account database identifier to a locked state L, locking the temporary account name and temporary account data to prevent data changes.

[0083] Step S43: Obtain the formal account data from the database corresponding to the formal account database identifier of the current user, and update the current state of the formal account data of the current user in the database of the formal account database identifier to a locked state L, locking the formal account name and formal account data to prevent data changes.

[0084] Step S44: Merge the acquired temporary account data with the acquired formal account data, and store the merged account data in a database corresponding to the formal account database identifier of the current user.

[0085] Step S45: Update the current status of the temporary account data of the current user to the unlocked state S in the database of the temporary account database identifier, update the current status of the formal account data of the current user to the unlocked state S in the database of the formal account database identifier, and update the current status of the temporary account data and formal account data of the current user to the unlocked state S in the shared database.

[0086] Step S50: When merging the temporary account data and the formal account data, the recording unit 114 records the temporary account data and stores it in the intermediate database. When the merging of the temporary account data and the formal account data fails, data restoration is performed using the temporary account data stored in the intermediate database.

[0087] like Figure 4 FIG. 1 is a schematic diagram of the structure of an electronic device according to a preferred embodiment of the present invention for implementing a distributed data merging processing method.

[0088] The electronic device 1 may include a memory 12 , a processor 13 , and a bus, and may further include a computer program stored in the memory 12 and executable on the processor 13 , such as a distributed data merging program.

[0089] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. The electronic device 1 may have either a bus structure or a star structure. The electronic device 1 may also include more or less other hardware or software than shown in the figure, or a different arrangement of components. For example, the electronic device 1 may also include input and output devices, network access devices, etc.

[0090] It should be noted that the electronic device 1 is only an example. Other existing or future electronic products that are adaptable to the present invention should also be included in the protection scope of the present invention and included herein by reference.

[0091] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 12 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Furthermore, the memory 12 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of a text recognition program based on direction detection, but can also be used to temporarily store data that has been output or is to be output.

[0092] In some embodiments, the processor 13 may be comprised of an integrated circuit, such as a single packaged integrated circuit or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, connecting the various components of the entire electronic device 1 using various interfaces and circuits. It executes or runs programs or modules stored in the memory 12 (e.g., executing a text recognition program based on direction detection) and calls data stored in the memory 12 to perform various functions of the electronic device 1 and process data.

[0093] The processor 13 executes the operating system of the electronic device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-mentioned embodiments of the text recognition method based on direction detection, for example Figure 1 Steps shown.

[0094] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into an acquisition unit 110, a sorting unit 111, a data unit 112, a merging unit 113, and a recording unit 114.

[0095] Figure 4 Only the electronic device 1 having components 12-13 is shown, and it can be understood by those skilled in the art that Figure 4 The structure shown does not constitute a limitation on the electronic device 1 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0096] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the inventive concept, such as the technical solutions formed by the mutual replacement of the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this application.

[0097] Except for the technical features described in the specification, the remaining technical features are known technologies to those skilled in the art. In order to highlight the innovative features of the present invention, the remaining technical features will not be described here in detail.

Claims

1. A method for processing distributed data merging, characterized in that: It includes: In response to the current user's registration information, obtain a temporary account name and temporary account data of the current user's temporary account in the single database, and assign a formal account name and formal account data of the current user's formal account in the distributed database; sorting the temporary account names and the temporary account data according to a modulo sharding rule, and storing the sorted temporary account names and temporary account data in a database in the distributed database, wherein the modulo sharding rule is defined as sorting temporary accounts in a user region in the single database, where the user region includes the current user; Creating a shared database, wherein the shared database stores an account routing table; Query the account routing table, call temporary account data and formal account data, merge the temporary account data and formal account data, and store them in the database where the formal account is located; The account routing table includes the temporary account name, the formal account name, the mapping relationship between the temporary account name and the formal account name, the temporary account database identifier and the formal account database identifier, and the status of the temporary account data and the formal account data, so as to perform call and merge processing of the temporary account data and the formal account data; The mapping relationship between temporary account names and formal account names varies under different modulo sharding rules and also varies under different numbers of databases in a distributed database. The mapping relationship between temporary account names and formal account names is set by the modulo sharding rules and the number of databases in the distributed database. The temporary account data and the formal account data include a locked state and an unlocked state; The temporary account data and the official account data are locked to prevent them from being called and modified. The state of unlocking the temporary account data and the formal account data is an unlocked state, so that the temporary account data and the formal account data are called and merged.

2. A distributed data merging processing method according to claim 1, characterized in that: The steps of querying the account routing table, calling the temporary account data and the formal account data, merging the temporary account data and the formal account data, and storing them in the database where the formal account is located include: Obtain the temporary account database identifier and the formal account database identifier by using the modulo sharding rule; After querying the account routing table and calling the temporary account data and the formal account data, the temporary account data and the formal account data are locked in the shared database to prevent the temporary account data and the formal account data from being called and modified.

3. A distributed data merging processing method according to claim 2, characterized in that: The steps of querying the account routing table, calling the temporary account data and the formal account data, merging the temporary account data and the formal account data, and storing them in the database where the formal account is located also include: The temporary account data and the formal account data are called, locked in the shared database, and then the temporary account data and the formal account data are merged, and the merged account data is stored in the database corresponding to the formal account database identifier.

4. A distributed data merging processing method according to claim 3, characterized in that: The steps of querying the account routing table, calling the temporary account data and the formal account data, merging the temporary account data and the formal account data, and storing them in the database where the formal account is located also include: After the merged account data is stored in the database corresponding to the formal account database identifier, the temporary account data is unlocked in the temporary account database, and the formal account data is unlocked in the formal account database.

5. The method for processing distributed data merging according to claim 1, characterized in that: The distributed data merging processing method further includes: When merging temporary account data and formal account data, the temporary account data is recorded and stored in the intermediate database. When the merger of temporary account data and formal account data fails, data restoration is performed using the temporary account data stored in the intermediate database.

6. A distributed data merging processing device, characterized in that: The distributed data merging device comprises: an acquiring unit, configured to acquire, in response to the registration information of the current user, a temporary account name and temporary account data of the temporary account of the current user in the single database, and assign a formal account name and formal account data of the formal account of the current user in the distributed database; a sorting unit, configured to sort the temporary account names and the temporary account data according to a modulo sharding rule, and store the sorted temporary account names and temporary account data in a database in the distributed database, wherein the modulo sharding rule is defined as sorting temporary accounts in a user area in the single database, where the user area includes a current user; A data unit is used to create a shared database, wherein the shared database stores an account routing table; A merging unit is used to query the account routing table, call temporary account data and formal account data, merge the temporary account data and formal account data, and store them in the database where the formal account is located; The account routing table includes the temporary account name, the formal account name, the mapping relationship between the temporary account name and the formal account name, the temporary account database identifier and the formal account database identifier, and the status of the temporary account data and the formal account data, so as to perform call and merge processing of the temporary account data and the formal account data; The mapping relationship between temporary account names and formal account names varies under different modulo sharding rules and also varies under different numbers of databases in a distributed database. The mapping relationship between temporary account names and formal account names is set by the modulo sharding rules and the number of databases in the distributed database. The temporary account data and the formal account data include a locked state and an unlocked state; The temporary account data and the official account data are locked to prevent them from being called and modified. The state of unlocking the temporary account data and the formal account data is an unlocked state, so that the temporary account data and the formal account data are called and merged.

7. An electronic device, characterized in that: The electronic device comprises: a memory storing at least one instruction; and A processor executes instructions stored in the memory to implement a distributed data merging processing method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement a distributed data merging processing method as claimed in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Order processing method and device

    CN108009883A

  • Account merging method and device and server

    CN113179282A