[go: up one dir, main page]

CN111507826A - Method and device for ensuring idempotency when a mobile phone number is associated with a bank account - Google Patents

Method and device for ensuring idempotency when a mobile phone number is associated with a bank account Download PDF

Info

Publication number
CN111507826A
CN111507826A CN202010304815.4A CN202010304815A CN111507826A CN 111507826 A CN111507826 A CN 111507826A CN 202010304815 A CN202010304815 A CN 202010304815A CN 111507826 A CN111507826 A CN 111507826A
Authority
CN
China
Prior art keywords
mobile phone
account
phone number
request
bank account
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010304815.4A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National Clearing Center People's Bank Of China
Original Assignee
National Clearing Center People's Bank Of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National Clearing Center People's Bank Of China filed Critical National Clearing Center People's Bank Of China
Priority to CN202010304815.4A priority Critical patent/CN111507826A/en
Publication of CN111507826A publication Critical patent/CN111507826A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2272Management thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a method and a device for ensuring idempotency when a mobile phone number is associated with a bank account, wherein the method comprises the following steps: acquiring a request for associating the mobile phone number with a bank account; when the association request is a registration request for registering a bank account as a default account corresponding to the mobile phone number, judging whether a data record corresponding to the mobile phone number exists in a preset occupancy table, wherein a main key of the occupancy table is the mobile phone number; when the data record corresponding to the mobile phone number does not exist in the occupation table, generating a data record in the occupation table according to the registration request; and when the operation of the registration request is completed, deleting the data record corresponding to the registration request in the occupation table. The invention realizes that idempotency is kept when the default account corresponding to the mobile phone number is maintained.

Description

手机号与银行账户关联时保证幂等性的方法及装置Method and device for ensuring idempotency when a mobile phone number is associated with a bank account

技术领域technical field

本发明涉及银行领域,具体而言,涉及一种手机号与银行账户关联时保证幂等性的方法及装置。The present invention relates to the field of banking, in particular, to a method and device for ensuring idempotency when a mobile phone number is associated with a bank account.

背景技术Background technique

目前银行间转账主要基于银行账户完成,由于需输入账号、户名等信息,操作较为繁琐,在便捷性和用户体验方面存在不足。近年来提出一种基于手机号的转账方式,采用这种方式用户办理收付款业务时仅需要输入对方的手机号码和金额即可完成支付,操作便捷。At present, inter-bank transfers are mainly completed based on bank accounts. Due to the need to input account number, account name and other information, the operation is cumbersome, and there are shortcomings in convenience and user experience. In recent years, a transfer method based on mobile phone number has been proposed. In this method, users only need to input the mobile phone number and amount of the other party to complete the payment when handling collection and payment services, and the operation is convenient.

基于手机号进行转账需要先将手机号与银行账户进行关联,例如将手机号与A银行的A1账户以及B银行的B1账户进行绑定、将A银行的A1账户关联为手机号的默认账户等。在将手机号与银行账户进行关联时如何对并发性、幂等性的场景进行处理是一个问题。例如在进行银行账户绑定时,根据业务规则,同一手机号码在一个银行只能绑定一个账户,当一个手机号出现并发与一个银行的两个银行账户进行绑定时,目前的系统可能会将该手机号同时与一个银行的两个银行账户进行绑定,这就严重违反了业务规则。To transfer money based on mobile phone number, you need to associate the mobile phone number with the bank account first, such as binding the mobile phone number with the A1 account of Bank A and the B1 account of Bank B, and associating the A1 account of Bank A as the default account of the mobile phone number, etc. . How to deal with concurrency and idempotency scenarios when associating mobile phone numbers with bank accounts is a problem. For example, when binding bank accounts, according to business rules, the same mobile phone number can only be bound to one account in a bank. When a mobile phone number appears concurrently bound to two bank accounts of a bank, the current system may It is a serious violation of business rules to bind the mobile phone number to two bank accounts of one bank at the same time.

本发明针对上述将手机号与银行账户进行关联时对并发性、幂等性的场景进行处理的问题,提出了一种手机号与银行账户关联时保证幂等性的方法。Aiming at the above problem of processing concurrency and idempotency when associating a mobile phone number with a bank account, the present invention proposes a method for ensuring idempotency when a mobile phone number is associated with a bank account.

发明内容SUMMARY OF THE INVENTION

本发明为了解决上述背景技术中的至少一个技术问题,提出了一种手机号与银行账户关联时保证幂等性的方法及装置。In order to solve at least one technical problem in the above background technology, the present invention proposes a method and device for ensuring idempotency when a mobile phone number is associated with a bank account.

为了实现上述目的,根据本发明的一个方面,提供了一种手机号与银行账户关联时保证幂等性的方法,该方法包括:In order to achieve the above object, according to an aspect of the present invention, a method for ensuring idempotency when a mobile phone number is associated with a bank account is provided, the method comprising:

获取手机号与银行账户的关联请求;Obtain the association request between the mobile phone number and the bank account;

当所述关联请求为将银行账户注册为手机号对应的默认账户的注册请求时,判断预设的占位表中是否存在所述手机号对应的数据记录,其中,占位表的主键为手机号;When the association request is a registration request for registering a bank account as a default account corresponding to a mobile phone number, determine whether there is a data record corresponding to the mobile phone number in the preset placeholder table, where the primary key of the placeholder table is the phone number No;

当所述占位表中不存在所述手机号对应的数据记录时,根据所述注册请求在所述占位表中生成一条数据记录;When the data record corresponding to the mobile phone number does not exist in the placeholder table, generate a data record in the placeholder table according to the registration request;

当所述注册请求操作完成时,删除所述占位表中的所述注册请求对应的数据记录。When the registration request operation is completed, the data record corresponding to the registration request in the placeholder table is deleted.

可选的,该手机号与银行账户关联时保证幂等性的方法还包括:Optionally, the method for ensuring idempotency when the mobile phone number is associated with the bank account further includes:

当所述关联请求为将手机号与银行账户进行绑定的绑定请求时,判断是否存在与所述绑定请求中的手机号和所述绑定请求中的银行账户对应的账户所属开户机构号对应的客户账户信息表,其中,客户账户信息表的主键为手机号和账户所属开户机构号;When the association request is a binding request for binding a mobile phone number with a bank account, determine whether there is an account opening institution to which the account corresponding to the mobile phone number in the binding request and the bank account in the binding request belongs The customer account information table corresponding to the account number, wherein the primary key of the customer account information table is the mobile phone number and the account opening institution number to which the account belongs;

当不存在对应的客户账户信息表时,执行所述绑定请求,并在绑定成功后生成对应的客户账户信息表。When the corresponding client account information table does not exist, the binding request is executed, and the corresponding client account information table is generated after the binding is successful.

可选的,该手机号与银行账户关联时保证幂等性的方法还包括:Optionally, the method for ensuring idempotency when the mobile phone number is associated with the bank account further includes:

确定所述关联请求对应的待变更关联属性与当前关联属性是否一致;Determine whether the to-be-changed association attribute corresponding to the association request is consistent with the current association attribute;

若一致,拒绝所述关联请求并生成提示信息。If they are consistent, reject the association request and generate prompt information.

可选的,该手机号与银行账户关联时保证幂等性的方法还包括:Optionally, the method for ensuring idempotency when the mobile phone number is associated with the bank account further includes:

获取关联账户注销请求;Get the associated account cancellation request;

当判断所述关联账户注销请求对应的待注销的记录不存在时,拒绝所述账户注销请求。When it is determined that the record to be cancelled corresponding to the associated account cancellation request does not exist, the account cancellation request is rejected.

为了实现上述目的,根据本发明的另一方面,提供了一种手机号与银行账户关联时保证幂等性的装置,该装置包括:In order to achieve the above object, according to another aspect of the present invention, a device for ensuring idempotency when a mobile phone number is associated with a bank account is provided, the device comprising:

关联请求获取单元,用于获取手机号与银行账户的关联请求;an association request obtaining unit, used to obtain an association request between a mobile phone number and a bank account;

占位表查询单元,用于当所述关联请求为将银行账户注册为手机号对应的默认账户的注册请求时,判断预设的占位表中是否存在所述手机号对应的数据记录,其中,占位表的主键为手机号;A placeholder table query unit, configured to judge whether there is a data record corresponding to the mobile phone number in the preset placeholder table when the association request is a registration request for registering a bank account as a default account corresponding to a mobile phone number, wherein , the primary key of the placeholder table is the mobile phone number;

占位表数据记录插入单元,用于当所述占位表中不存在所述手机号对应的数据记录时,根据所述注册请求在所述占位表中生成一条数据记录;a placeholder table data record inserting unit, configured to generate a data record in the placeholder table according to the registration request when there is no data record corresponding to the mobile phone number in the placeholder table;

占位表数据记录删除单元,用于当所述注册请求操作完成时,删除所述占位表中的所述注册请求对应的数据记录。A placeholder table data record deletion unit, configured to delete the data record corresponding to the registration request in the placeholder table when the registration request operation is completed.

可选的,该手机号与银行账户关联时保证幂等性的装置还包括:Optionally, the device for ensuring idempotency when the mobile phone number is associated with the bank account further includes:

客户账户信息表查询单元,用于当所述关联请求为将手机号与银行账户进行绑定的绑定请求时,判断是否存在与所述绑定请求中的手机号和所述绑定请求中的银行账户对应的账户所属开户机构号对应的客户账户信息表,其中,客户账户信息表的主键为手机号和账户所属开户机构号;A customer account information table query unit, configured to determine whether there is a mobile phone number in the binding request and the binding request when the association request is a binding request for binding a mobile phone number with a bank account The customer account information table corresponding to the account opening institution number to which the bank account corresponding to the account belongs, wherein the primary key of the customer account information table is the mobile phone number and the account opening institution number to which the account belongs;

绑定请求执行单元,用于当不存在对应的客户账户信息表时,执行所述绑定请求,并在绑定成功后生成对应的客户账户信息表。The binding request execution unit is configured to execute the binding request when the corresponding client account information table does not exist, and generate the corresponding client account information table after the binding is successful.

可选的,该手机号与银行账户关联时保证幂等性的装置还包括:Optionally, the device for ensuring idempotency when the mobile phone number is associated with the bank account further includes:

待变更关联属性核验单元,用于确定所述关联请求对应的待变更关联属性与当前关联属性是否一致;a to-be-changed association attribute verification unit, configured to determine whether the to-be-changed association attribute corresponding to the association request is consistent with the current association attribute;

处理单元,用于当所述待变更关联属性与当前关联属性一致时,拒绝所述关联请求并生成提示信息。A processing unit, configured to reject the association request and generate prompt information when the association attribute to be changed is consistent with the current association attribute.

可选的,该手机号与银行账户关联时保证幂等性的装置还包括:Optionally, the device for ensuring idempotency when the mobile phone number is associated with the bank account further includes:

关联账户注销请求获取单元,用于获取关联账户注销请求;An associated account cancellation request obtaining unit, used to obtain the associated account cancellation request;

关联账户注销请求核验单元,用于当判断所述关联账户注销请求对应的待注销的记录不存在时,拒绝所述账户注销请求。The associated account cancellation request verification unit is configured to reject the account cancellation request when it is determined that the record to be cancelled corresponding to the associated account cancellation request does not exist.

为了实现上述目的,根据本发明的另一方面,还提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述手机号与银行账户关联时保证幂等性的方法中的步骤。In order to achieve the above object, according to another aspect of the present invention, a computer device is also provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the computer The program implements the steps in the method for ensuring idempotency when the mobile phone number is associated with a bank account.

为了实现上述目的,根据本发明的另一方面,还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序在计算机处理器中执行时实现上述手机号与银行账户关联时保证幂等性的方法中的步骤。In order to achieve the above object, according to another aspect of the present invention, a computer-readable storage medium is also provided, where the computer-readable storage medium stores a computer program, and the computer program realizes the above-mentioned mobile phone when executed in a computer processor Steps in a method for guaranteeing idempotency when a number is associated with a bank account.

本发明的有益效果为:本发明利用占位表实现了在维护手机号码对应的默认账户时能够保持幂等性。The beneficial effects of the present invention are as follows: the present invention can maintain idempotency when maintaining the default account corresponding to the mobile phone number by using the occupancy table.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are For some embodiments of the present invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts. In the attached image:

图1是本发明实施例手机号与银行账户关联时保证幂等性的方法的第一流程图;1 is a first flowchart of a method for ensuring idempotency when a mobile phone number is associated with a bank account according to an embodiment of the present invention;

图2是本发明实施例手机号与银行账户关联时保证幂等性的方法的第二流程图;2 is a second flowchart of a method for ensuring idempotency when a mobile phone number is associated with a bank account according to an embodiment of the present invention;

图3是本发明实施例手机号与银行账户关联时保证幂等性的装置的第一结构框图;3 is a first structural block diagram of an apparatus for ensuring idempotency when a mobile phone number is associated with a bank account according to an embodiment of the present invention;

图4是本发明实施例手机号与银行账户关联时保证幂等性的装置的第二结构框图;4 is a second structural block diagram of an apparatus for ensuring idempotency when a mobile phone number is associated with a bank account according to an embodiment of the present invention;

图5是本发明实施例计算机设备示意图。FIG. 5 is a schematic diagram of a computer device according to an embodiment of the present invention.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to make those skilled in the art better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only Embodiments are part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "comprising" and "having" in the description and claims of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusion, for example, including a series of steps or units The processes, methods, systems, products or devices are not necessarily limited to those steps or units expressly listed, but may include other steps or units not expressly listed or inherent to such processes, methods, products or devices.

需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本发明。It should be noted that the embodiments of the present invention and the features of the embodiments may be combined with each other under the condition of no conflict. The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

本发明提供一种手机号与银行账户关联时保证幂等性的方法,应用在手机号码支付领域。在本发明实施例中,手机号码支付要遵守以下几个基本规则:The invention provides a method for ensuring idempotency when a mobile phone number is associated with a bank account, which is applied in the field of mobile phone number payment. In this embodiment of the present invention, mobile phone number payment must comply with the following basic rules:

(一)一个银行账户只可关联一个手机号码;(1) A bank account can only be associated with one mobile phone number;

(二)一个手机号码可以关联多家银行的账户,在一家银行只可关联一个银行账户;(2) One mobile phone number can be associated with the accounts of multiple banks, and only one bank account can be associated with one bank;

(三)一个手机号码只能被一个客户注册使用,一个客户可以使用多个手机号码注册;(3) One mobile phone number can only be registered and used by one customer, and one customer can use multiple mobile phone numbers to register;

(四)任一时刻,一个手机号码只对应一个默认账户。(4) At any time, a mobile phone number corresponds to only one default account.

本发明为了维持以上几点业务规则,从技术角度考虑可能存在多种异常的发生情况,在大并发量的情况下,系统在注册、变更等功能上进行防多种情况并发、幂等性等进行多重设计,设计了一种手机号与银行账户关联时保证幂等性的方法,保障了系统的健壮性和结果的唯一性。In order to maintain the above business rules, the present invention considers that there may be a variety of abnormal situations from a technical point of view. In the case of a large amount of concurrency, the system performs functions such as registration and change to prevent concurrency in multiple situations, idempotency, etc. After multiple designs, a method is designed to ensure idempotency when the mobile phone number is associated with the bank account, which ensures the robustness of the system and the uniqueness of the result.

在本发明实施例中,涉及到并发性、幂等性的场景包括:1、同一手机号,同一银行并发两笔注册报文;2、同一手机号,不同银行,并发注册为默认账户;3、待变更的属性与原来的属性一致;4待注销的记录不存在。本发明针对以上涉及到并发性、幂等性的场景提出了一种保证幂等性的方法。In the embodiment of the present invention, scenarios involving concurrency and idempotency include: 1. The same mobile phone number, the same bank sends two registration messages; 2. The same mobile phone number, different banks, concurrently register as a default account; 3. , The property to be changed is the same as the original property; 4 The record to be cancelled does not exist. The present invention proposes a method for ensuring idempotency for the above scenarios involving concurrency and idempotency.

本发明实施例的手机号与银行账户的关联请求包括:将银行账户注册为手机号对应的默认账户的注册请求、将手机号与银行账户进行绑定的绑定请求等。The association request between the mobile phone number and the bank account in the embodiment of the present invention includes: a registration request for registering the bank account as a default account corresponding to the mobile phone number, a binding request for binding the mobile phone number with the bank account, and the like.

图1是本发明实施例手机号与银行账户关联时保证幂等性的方法的第一流程图,如图1所示,本实施例的手机号与银行账户关联时保证幂等性的方法包括步骤S101至步骤S104。FIG. 1 is a first flowchart of a method for ensuring idempotency when a mobile phone number is associated with a bank account according to an embodiment of the present invention. As shown in FIG. 1 , the method for ensuring idempotency when a mobile phone number is associated with a bank account in this embodiment includes the following steps: Steps S101 to S104.

步骤S101,获取将银行账户注册为手机号对应的默认账户的注册请求。Step S101, obtaining a registration request for registering the bank account as the default account corresponding to the mobile phone number.

步骤S102,判断预设的占位表中是否存在所述手机号对应的数据记录。Step S102, judging whether there is a data record corresponding to the mobile phone number in the preset occupancy table.

步骤S103,当所述占位表中不存在所述手机号对应的数据记录时,根据所述注册请求在所述占位表中生成一条数据记录。Step S103, when the data record corresponding to the mobile phone number does not exist in the placeholder table, generate a data record in the placeholder table according to the registration request.

步骤S104,当所述注册请求操作完成时,删除所述占位表中的所述注册请求对应的数据记录。Step S104, when the registration request operation is completed, delete the data record corresponding to the registration request in the occupancy table.

在本发明实施例中,在每次接收到将银行账户注册为手机号对应的默认账户的注册请求时,先在预设的占位表中查询是否存在与该手机号对应的数据记录。若不存在则向占位表中插入一条数据记录,执行完注册请求后更新状态为成功或失败,同步删除占位表中的数据记录。如果接收到两条并发的注册请求时,前面的注册请求会在占位表中插入一条数据记录,使得后面的注册请求因为占位表中唯一索引(手机号)而插入失败,直到前面的注册请求执行完成(成功或失败)后,后面的注册请求才能在占位表中插入一条该手机号对应的新的数据记录,以此解决两条并发的注册请求的幂等性问题。在本发明实施例中,占位表的作用类似于数据库加锁的功能。注册、变更以及注销等非只读操作,都需要在同一张占位表里占位,也就是说一个手机号同时只能处理一项非只读的操作。在本发明的可选实施例中占位表的结构可以为:仅有单一字段手机号,同时该字段为唯一主键。以下表1为本发明一可选实施例的占位表的数据结构。In this embodiment of the present invention, each time a registration request for registering a bank account as a default account corresponding to a mobile phone number is received, a preset occupancy table is first queried to see if there is a data record corresponding to the mobile phone number. If it does not exist, insert a data record into the placeholder table, update the status to success or failure after executing the registration request, and delete the data record in the placeholder table synchronously. If two concurrent registration requests are received, the previous registration request will insert a data record into the placeholder table, so that the subsequent registration request fails to be inserted due to the unique index (mobile phone number) in the placeholder table, until the previous registration After the request execution is completed (success or failure), the subsequent registration request can insert a new data record corresponding to the mobile phone number in the placeholder table, so as to solve the idempotency problem of two concurrent registration requests. In this embodiment of the present invention, the function of the placeholder table is similar to the function of database locking. Non-read-only operations such as registration, change, and cancellation all need to occupy a place in the same placeholder table, which means that a mobile phone number can only handle one non-read-only operation at the same time. In an optional embodiment of the present invention, the structure of the placeholder table may be as follows: there is only a single field mobile phone number, and this field is a unique primary key. The following Table 1 is a data structure of a placeholder table according to an optional embodiment of the present invention.

Figure BDA0002455393690000061
Figure BDA0002455393690000061

表1Table 1

上述步骤S101至步骤S104的方法针对的是上述同一手机号,不同银行,并发注册为默认账户的场景,本发明在这种场景下,幂等性控制是靠占位表实现的。若没有占位表,两个注册请求同时处理,很有可能将两个银行账户都注册为同一个手机号的默认账户,这就违反了手机号码支付的基本规则。本发明在第一个注册请求受理时,将手机号加入一手机号为唯一主键的占位表,在处理完成后,再从占位表删除,加入和移出占位表的操作和正常注册是同一个事务,若注册业务中途失败,则一起回滚。如果在处理同时并发出现第二个注册请求受理,由于占位表中已经存在该手机号对应的数据记录,第二个注册请求会排队,直至第一个注册请求处理完成。The above-mentioned methods from steps S101 to S104 are aimed at the above-mentioned scenario of the same mobile phone number, different banks, and concurrent registration as a default account. In this scenario, the idempotent control of the present invention is implemented by a placeholder table. If there is no placeholder table and two registration requests are processed at the same time, it is very likely that both bank accounts will be registered as the default account of the same mobile phone number, which violates the basic rules of mobile phone number payment. In the present invention, when the first registration request is accepted, the mobile phone number is added to a placeholder table with the phone number as the unique primary key, and after the processing is completed, it is deleted from the placeholder table. The operations of adding and removing the placeholder table and normal registration are For the same transaction, if the registration business fails in the middle, it will be rolled back together. If a second registration request is accepted concurrently during processing, since the data record corresponding to the mobile phone number already exists in the placeholder table, the second registration request will be queued until the processing of the first registration request is completed.

由以上描述可以看出,本发明利用占位表实现了在维护手机号码对应的默认账户时能够保持幂等性。It can be seen from the above description that the present invention can maintain idempotency when maintaining the default account corresponding to the mobile phone number by using the placeholder table.

图2是本发明实施例手机号与银行账户关联时保证幂等性的方法的第二流程图,如图2所示,本实施例的手机号与银行账户关联时保证幂等性的方法还包括步骤S201至步骤S203。2 is a second flow chart of a method for ensuring idempotency when a mobile phone number is associated with a bank account according to an embodiment of the present invention. As shown in FIG. 2 , the method for ensuring idempotency when a mobile phone number is associated with a bank account in this embodiment is further Steps S201 to S203 are included.

步骤S201,获取将手机号与银行账户进行绑定的绑定请求。Step S201, obtaining a binding request for binding the mobile phone number with the bank account.

步骤S202,判断是否存在与所述绑定请求中的手机号和所述绑定请求中的银行账户对应的账户所属开户机构号对应的客户账户信息表。Step S202, judging whether there is a client account information table corresponding to the mobile phone number in the binding request and the account opening institution number to which the account corresponding to the bank account in the binding request belongs.

步骤S203,当不存在对应的客户账户信息表时,执行所述绑定请求,并在绑定成功后生成对应的客户账户信息表。Step S203, when there is no corresponding client account information table, execute the binding request, and generate a corresponding client account information table after the binding is successful.

本发明此部分内容针对上述同一手机号,同一银行并发两笔注册报文的场景,例如客户同时提交将手机号与A银行的A1账户,以及A银行的A2账户进行注册绑定。针对这种场景,This part of the present invention is aimed at the above-mentioned scenario where the same mobile phone number and the same bank send two registration messages, for example, the customer submits the registration and binding of the mobile phone number with the A1 account of Bank A and the A2 account of Bank A at the same time. For this scenario,

在本发明实施例中,在进行账号绑定时,根据业务规则,同一手机号码在一个银行只能注册一个银行账户。当同手机号在同银行出现两笔信息完全相同的注册报文并发时,为了遵守业务规则,将客户账户信息表中手机号和账户所属开户机构号设为多字段主键,受理第二笔注册报文时,由于主键冲突,将会被拒绝,以此解决并发的问题。In the embodiment of the present invention, when performing account binding, according to business rules, the same mobile phone number can only be registered with one bank account in one bank. When two registration messages with exactly the same information appear in the same bank with the same mobile phone number, in order to comply with business rules, the mobile phone number and the account opening institution number to which the account belongs in the customer account information table are set as multi-field primary keys, and the second registration is accepted. When the message is sent, it will be rejected due to the primary key conflict, so as to solve the problem of concurrency.

在本发明的一个可选实施例中,用户账户信息表的数据格式可以如下表1所示。如下表2所示,本发明的用户账户信息表包括:手机号、账户所属开户机构号、商业银行行号、用户证件号、用户证件类型、默认类型、用户账户、用户户名、掩码户名、其他ID、账户状态、更新时间和注册时间。其中,手机号和账户所属开户机构号为用户账户信息表的主键。In an optional embodiment of the present invention, the data format of the user account information table may be as shown in Table 1 below. As shown in Table 2 below, the user account information table of the present invention includes: mobile phone number, account opening institution number to which the account belongs, commercial bank bank number, user certificate number, user certificate type, default type, user account, user account name, mask account name, other IDs, account status, update time and registration time. The mobile phone number and the account opening institution number to which the account belongs are the primary keys of the user account information table.

Figure BDA0002455393690000071
Figure BDA0002455393690000071

表2Table 2

在表2中,用户证件号、用户证件类型和用户户名用于对用户的身份信息进行确认;默认类型定义了该用户的当前账户是否为默认账户;账户状态定义了当前账户是否为冻结状态;更新时间和注册时间分别记录了当前账户的注册时间和最近一次的变更时间。In Table 2, the user ID number, user ID type and user name are used to confirm the user's identity information; the default type defines whether the user's current account is the default account; the account status defines whether the current account is in a frozen state ; The update time and registration time respectively record the registration time and the latest change time of the current account.

在本发明实施例中,用户账户信息表的索引主键设置为手机号和账户所属开户机构号,保证一个手机号在一个机构只能注册一个账户。本发明利用账户信息表的主键保持事务的完整性,在手机号码支付中,使用手机号、账户所属开户机构号等字段作为主键,如果在提交时数据库主键冲突报错则事务回滚。保持事务的完整性,如果在提交时报错则事务回滚。In the embodiment of the present invention, the index primary key of the user account information table is set to the mobile phone number and the account opening institution number to which the account belongs, ensuring that one mobile phone number can only register one account in one institution. The invention utilizes the primary key of the account information table to maintain the integrity of the transaction. In the mobile phone number payment, fields such as the mobile phone number and the account opening institution number to which the account belongs are used as the primary key. If the database primary key conflicts and an error is reported during submission, the transaction is rolled back. The integrity of the transaction is maintained, and the transaction is rolled back if an error is reported during the commit.

在本发明实施例中,针对上述待变更的属性与原来的属性一致的场景,本发明收到手机号与银行账户的关联请求后,先进行业务检查,若关联请求对应的待变更关联属性与当前的属性一致,则拒绝并返回“默认账户属性与注册的默认账户属性相同,无需变更”的错误信息。这样的设计是为了防止重复变更。In the embodiment of the present invention, for the above-mentioned scenario in which the attribute to be changed is consistent with the original attribute, after receiving the association request between the mobile phone number and the bank account, the present invention first performs a business check. If the current attributes are the same, it will reject and return the error message "The default account attributes are the same as the registered default account attributes and do not need to be changed". This design is to prevent repeated changes.

在本发明实施例中,针对上述待注销的记录不存在的场景,本发明收到关联账户注销请求后,先进行业务检查,若待注销的记录不存在,则拒绝注销,这样的设计是保证收到多少次注销报文,结果都是一致的。In the embodiment of the present invention, for the above scenario where the record to be cancelled does not exist, the present invention first performs a business check after receiving the request for cancellation of the associated account, and refuses to cancel if the record to be cancelled does not exist. This design ensures that The result is the same no matter how many times the logout message is received.

由以上描述可以看出,本发明的手机号与银行账户关联时保证幂等性的方法能够满足手机号码支付业务的需求。其中针对大并发量的情况下,为保障用户资金安全,系统在注册、变更等功能上进行防多种情况并发、幂等性等进行多重设计,增加应用软件设计的复杂度,但从用户资金安全角度保障系统的健壮性和结果的唯一性。It can be seen from the above description that the method for ensuring idempotency when a mobile phone number is associated with a bank account of the present invention can meet the requirements of the mobile phone number payment service. Among them, in the case of a large amount of concurrency, in order to ensure the safety of user funds, the system implements multiple designs in terms of registration, change and other functions to prevent concurrency in various situations, idempotency, etc., which increases the complexity of application software design, but from user funds. The security perspective guarantees the robustness of the system and the uniqueness of the results.

需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。It should be noted that the steps shown in the flowcharts of the accompanying drawings may be executed in a computer system, such as a set of computer-executable instructions, and, although a logical sequence is shown in the flowcharts, in some cases, Steps shown or described may be performed in an order different from that herein.

基于同一发明构思,本发明实施例还提供了一种手机号与银行账户关联时保证幂等性的装置,可以用于实现上述实施例所描述的手机号与银行账户关联时保证幂等性的方法,如下面的实施例所述。由于手机号与银行账户关联时保证幂等性的装置解决问题的原理与手机号与银行账户关联时保证幂等性的方法相似,因此手机号与银行账户关联时保证幂等性的装置的实施例可以参见手机号与银行账户关联时保证幂等性的方法的实施例,重复之处不再赘述。以下所使用的,术语“单元”或者“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。Based on the same inventive concept, an embodiment of the present invention also provides a device for ensuring idempotency when a mobile phone number is associated with a bank account, which can be used to implement the idempotency guarantee when a mobile phone number is associated with a bank account described in the above embodiments method, as described in the examples below. Since the principle of the device that guarantees idempotency when the mobile phone number is associated with the bank account is similar to the method of ensuring the idempotency when the mobile phone number is associated with the bank account, the implementation of the device that guarantees the idempotency when the mobile phone number is associated with the bank account For an example, please refer to the embodiment of the method for ensuring idempotency when a mobile phone number is associated with a bank account, and the repetition will not be repeated. As used below, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.

图3是本发明实施例手机号与银行账户关联时保证幂等性的装置的第一结构框图,如图3所示,本发明实施例手机号与银行账户关联时保证幂等性的装置包括:关联请求获取单元1、占位表查询单元2、占位表数据记录插入单元3和占位表数据记录删除单元4。3 is a first structural block diagram of an apparatus for ensuring idempotency when a mobile phone number is associated with a bank account according to an embodiment of the present invention. As shown in FIG. 3 , the apparatus for ensuring idempotency when a mobile phone number is associated with a bank account according to an embodiment of the present invention includes: : an association request obtaining unit 1 , a placeholder table query unit 2 , a placeholder table data record inserting unit 3 , and a placeholder table data record deletion unit 4 .

关联请求获取单元1,用于获取手机号与银行账户的关联请求。The association request obtaining unit 1 is configured to obtain the association request between the mobile phone number and the bank account.

占位表查询单元2,用于当所述关联请求为将银行账户注册为手机号对应的默认账户的注册请求时,判断预设的占位表中是否存在所述手机号对应的数据记录,其中,占位表的主键为手机号。A placeholder table query unit 2, configured to judge whether there is a data record corresponding to the mobile phone number in the preset placeholder table when the association request is a registration request for registering a bank account as a default account corresponding to a mobile phone number, The primary key of the placeholder table is the mobile phone number.

占位表数据记录插入单元3,用于当所述占位表中不存在所述手机号对应的数据记录时,根据所述注册请求在所述占位表中生成一条数据记录。The occupancy table data record inserting unit 3 is configured to generate a data record in the occupancy table according to the registration request when there is no data record corresponding to the mobile phone number in the occupancy table.

占位表数据记录删除单元4,用于当所述注册请求操作完成时,删除所述占位表中的所述注册请求对应的数据记录。The placeholder table data record deletion unit 4 is configured to delete the data record corresponding to the registration request in the placeholder table when the registration request operation is completed.

图4是本发明实施例手机号与银行账户关联时保证幂等性的装置的第二结构框图,如图4所示,本发明实施例的手机号与银行账户关联时保证幂等性的装置还还包括:客户账户信息表查询单元5和绑定请求执行单元6。FIG. 4 is a second structural block diagram of an apparatus for ensuring idempotency when a mobile phone number is associated with a bank account according to an embodiment of the present invention. As shown in FIG. 4 , the apparatus for ensuring idempotency when a mobile phone number is associated with a bank account according to an embodiment of the present invention It also includes: a customer account information table query unit 5 and a binding request execution unit 6 .

客户账户信息表查询单元5,用于当所述关联请求为将手机号与银行账户进行绑定的绑定请求时,判断是否存在与所述绑定请求中的手机号和所述绑定请求中的银行账户对应的账户所属开户机构号对应的客户账户信息表,其中,客户账户信息表的主键为手机号和账户所属开户机构号。Customer account information table query unit 5, configured to determine whether there is a mobile phone number in the binding request and the binding request when the association request is a binding request for binding a mobile phone number with a bank account The customer account information table corresponding to the account opening institution number to which the bank account corresponding to the account belongs to, wherein the primary key of the customer account information table is the mobile phone number and the account opening institution number to which the account belongs.

绑定请求执行单元6,用于当不存在对应的客户账户信息表时,执行所述绑定请求,并在绑定成功后生成对应的客户账户信息表。The binding request execution unit 6 is configured to execute the binding request when the corresponding client account information table does not exist, and generate the corresponding client account information table after the binding is successful.

在本发明的可选实施例中,本发明的手机号与银行账户关联时保证幂等性的装置,还包括:In an optional embodiment of the present invention, the device for ensuring idempotency when a mobile phone number is associated with a bank account of the present invention further includes:

待变更关联属性核验单元,用于确定所述关联请求对应的待变更关联属性与当前关联属性是否一致;a to-be-changed association attribute verification unit, configured to determine whether the to-be-changed association attribute corresponding to the association request is consistent with the current association attribute;

处理单元,用于当所述待变更关联属性与当前关联属性一致时,拒绝所述关联请求并生成提示信息。A processing unit, configured to reject the association request and generate prompt information when the association attribute to be changed is consistent with the current association attribute.

在本发明的可选实施例中,本发明的手机号与银行账户关联时保证幂等性的装置,还包括:In an optional embodiment of the present invention, the device for ensuring idempotency when a mobile phone number is associated with a bank account of the present invention further includes:

关联账户注销请求获取单元,用于获取关联账户注销请求;An associated account cancellation request obtaining unit, used to obtain the associated account cancellation request;

关联账户注销请求核验单元,用于当判断所述关联账户注销请求对应的待注销的记录不存在时,拒绝所述账户注销请求。The associated account cancellation request verification unit is configured to reject the account cancellation request when it is determined that the record to be cancelled corresponding to the associated account cancellation request does not exist.

为了实现上述目的,根据本申请的另一方面,还提供了一种计算机设备。如图5所示,该计算机设备包括存储器、处理器、通信接口以及通信总线,在存储器上存储有可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述实施例方法中的步骤。In order to achieve the above object, according to another aspect of the present application, a computer device is also provided. As shown in FIG. 5 , the computer device includes a memory, a processor, a communication interface and a communication bus, and a computer program that can be run on the processor is stored in the memory, and the processor implements the above embodiments when executing the computer program steps in the method.

处理器可以为中央处理器(Central Processing Unit,CPU)。处理器还可以为其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等芯片,或者上述各类芯片的组合。The processor may be a central processing unit (Central Processing Unit, CPU). The processor may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other Chips such as programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above types of chips.

存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及单元,如本发明上述方法实施例中对应的程序单元。处理器通过运行存储在存储器中的非暂态软件程序、指令以及模块,从而执行处理器的各种功能应用以及作品数据处理,即实现上述方法实施例中的方法。As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer-executable programs, and units, such as program units corresponding to the above method embodiments of the present invention. The processor executes various functional applications of the processor and works data processing by running the non-transitory software programs, instructions and modules stored in the memory, that is, to implement the methods in the above method embodiments.

存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储处理器所创建的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至处理器。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system and an application program required by at least one function; the storage data area may store data created by the processor, and the like. Additionally, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory may optionally include memory located remotely from the processor, such remote memory being connectable to the processor via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

所述一个或者多个单元存储在所述存储器中,当被所述处理器执行时,执行上述实施例中的方法。The one or more units are stored in the memory, and when executed by the processor, perform the methods in the above-described embodiments.

上述计算机设备具体细节可以对应参阅上述实施例中对应的相关描述和效果进行理解,此处不再赘述。The specific details of the above computer equipment can be understood by referring to the corresponding related descriptions and effects in the above embodiments, which will not be repeated here.

为了实现上述目的,根据本申请的另一方面,还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序在计算机处理器中执行时实现上述手机号与银行账户关联时保证幂等性的方法中的步骤。本领域技术人员可以理解,实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述存储介质可为磁碟、光盘、只读存储记忆体(Read-OnlyMemory,ROM)、随机存储记忆体(RandomAccessMemory,RAM)、快闪存储器(Flash Memory)、硬盘(Hard Disk Drive,缩写:HDD)或固态硬盘(Solid-State Drive,SSD)等;所述存储介质还可以包括上述种类的存储器的组合。In order to achieve the above object, according to another aspect of the present application, a computer-readable storage medium is also provided, where the computer-readable storage medium stores a computer program, and the computer program realizes the above-mentioned mobile phone when executed in a computer processor Steps in a method for guaranteeing idempotency when a number is associated with a bank account. Those skilled 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, and the program can be stored in a computer-readable storage medium. During execution, the processes of the embodiments of the above-mentioned methods may be included. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, Abbreviation: HDD) or solid-state drive (Solid-State Drive, SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memories.

显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device, which can be centralized on a single computing device, or distributed in a network composed of multiple computing devices Alternatively, they can be implemented with program codes executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or they can be integrated into The multiple modules or steps are fabricated into a single integrated circuit module. As such, the present invention is not limited to any particular combination of hardware and software.

以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims (10)

1.一种手机号与银行账户关联时保证幂等性的方法,其特征在于,包括:1. a method for guaranteeing idempotency when a mobile phone number is associated with a bank account, it is characterized in that comprising: 获取手机号与银行账户的关联请求;Obtain the association request between the mobile phone number and the bank account; 当所述关联请求为将银行账户注册为手机号对应的默认账户的注册请求时,判断预设的占位表中是否存在所述手机号对应的数据记录,其中,占位表的主键为手机号;When the association request is a registration request for registering a bank account as a default account corresponding to a mobile phone number, determine whether there is a data record corresponding to the mobile phone number in the preset placeholder table, where the primary key of the placeholder table is the phone number No; 当所述占位表中不存在所述手机号对应的数据记录时,根据所述注册请求在所述占位表中生成一条数据记录;When the data record corresponding to the mobile phone number does not exist in the placeholder table, generate a data record in the placeholder table according to the registration request; 当所述注册请求操作完成时,删除所述占位表中的所述注册请求对应的数据记录。When the registration request operation is completed, the data record corresponding to the registration request in the placeholder table is deleted. 2.根据权利要求1所述的手机号与银行账户关联时保证幂等性的方法,其特征在于,还包括:2. the method for guaranteeing idempotency when the mobile phone number according to claim 1 is associated with the bank account, it is characterized in that, also comprises: 当所述关联请求为将手机号与银行账户进行绑定的绑定请求时,判断是否存在与所述绑定请求中的手机号和所述绑定请求中的银行账户对应的账户所属开户机构号对应的客户账户信息表,其中,客户账户信息表的主键为手机号和账户所属开户机构号;When the association request is a binding request for binding a mobile phone number with a bank account, determine whether there is an account opening institution to which the account corresponding to the mobile phone number in the binding request and the bank account in the binding request belongs The customer account information table corresponding to the account number, wherein the primary key of the customer account information table is the mobile phone number and the account opening institution number to which the account belongs; 当不存在对应的客户账户信息表时,执行所述绑定请求,并在绑定成功后生成对应的客户账户信息表。When the corresponding client account information table does not exist, the binding request is executed, and the corresponding client account information table is generated after the binding is successful. 3.根据权利要求1所述的手机号与银行账户关联时保证幂等性的方法,其特征在于,还包括:3. the method for guaranteeing idempotency when the mobile phone number according to claim 1 is associated with the bank account, is characterized in that, also comprises: 确定所述关联请求对应的待变更关联属性与当前关联属性是否一致;Determine whether the to-be-changed association attribute corresponding to the association request is consistent with the current association attribute; 若一致,拒绝所述关联请求并生成提示信息。If they are consistent, reject the association request and generate prompt information. 4.根据权利要求1所述的手机号与银行账户关联时保证幂等性的方法,其特征在于,还包括:4. the method for guaranteeing idempotency when the mobile phone number according to claim 1 is associated with the bank account, is characterized in that, also comprises: 获取关联账户注销请求;Get the associated account cancellation request; 当判断所述关联账户注销请求对应的待注销的记录不存在时,拒绝所述账户注销请求。When it is determined that the record to be cancelled corresponding to the associated account cancellation request does not exist, the account cancellation request is rejected. 5.一种手机号与银行账户关联时保证幂等性的装置,其特征在于,包括:5. A device for ensuring idempotency when a mobile phone number is associated with a bank account, comprising: 关联请求获取单元,用于获取手机号与银行账户的关联请求;an association request obtaining unit, used to obtain an association request between a mobile phone number and a bank account; 占位表查询单元,用于当所述关联请求为将银行账户注册为手机号对应的默认账户的注册请求时,判断预设的占位表中是否存在所述手机号对应的数据记录,其中,占位表的主键为手机号;A placeholder table query unit, configured to judge whether there is a data record corresponding to the mobile phone number in the preset placeholder table when the association request is a registration request for registering a bank account as a default account corresponding to a mobile phone number, wherein , the primary key of the placeholder table is the mobile phone number; 占位表数据记录插入单元,用于当所述占位表中不存在所述手机号对应的数据记录时,根据所述注册请求在所述占位表中生成一条数据记录;a placeholder table data record inserting unit, configured to generate a data record in the placeholder table according to the registration request when there is no data record corresponding to the mobile phone number in the placeholder table; 占位表数据记录删除单元,用于当所述注册请求操作完成时,删除所述占位表中的所述注册请求对应的数据记录。A placeholder table data record deletion unit, configured to delete the data record corresponding to the registration request in the placeholder table when the registration request operation is completed. 6.根据权利要求5所述的手机号与银行账户关联时保证幂等性的装置,其特征在于,还包括:6. The device for guaranteeing idempotency when a mobile phone number is associated with a bank account according to claim 5, further comprising: 客户账户信息表查询单元,用于当所述关联请求为将手机号与银行账户进行绑定的绑定请求时,判断是否存在与所述绑定请求中的手机号和所述绑定请求中的银行账户对应的账户所属开户机构号对应的客户账户信息表,其中,客户账户信息表的主键为手机号和账户所属开户机构号;A customer account information table query unit, configured to determine whether there is a mobile phone number in the binding request and the binding request when the association request is a binding request for binding a mobile phone number with a bank account The customer account information table corresponding to the account opening institution number to which the bank account corresponding to the account belongs, wherein the primary key of the customer account information table is the mobile phone number and the account opening institution number to which the account belongs; 绑定请求执行单元,用于当不存在对应的客户账户信息表时,执行所述绑定请求,并在绑定成功后生成对应的客户账户信息表。The binding request execution unit is configured to execute the binding request when the corresponding client account information table does not exist, and generate the corresponding client account information table after the binding is successful. 7.根据权利要求5所述的手机号与银行账户关联时保证幂等性的装置,其特征在于,还包括:7. The device for guaranteeing idempotency when a mobile phone number is associated with a bank account according to claim 5, further comprising: 待变更关联属性核验单元,用于确定所述关联请求对应的待变更关联属性与当前关联属性是否一致;a to-be-changed association attribute verification unit, configured to determine whether the to-be-changed association attribute corresponding to the association request is consistent with the current association attribute; 处理单元,用于当所述待变更关联属性与当前关联属性一致时,拒绝所述关联请求并生成提示信息。A processing unit, configured to reject the association request and generate prompt information when the association attribute to be changed is consistent with the current association attribute. 8.根据权利要求5所述的手机号与银行账户关联时保证幂等性的装置,其特征在于,还包括:8. The device for ensuring idempotency when a mobile phone number is associated with a bank account according to claim 5, further comprising: 关联账户注销请求获取单元,用于获取关联账户注销请求;An associated account cancellation request obtaining unit, used to obtain the associated account cancellation request; 关联账户注销请求核验单元,用于当判断所述关联账户注销请求对应的待注销的记录不存在时,拒绝所述账户注销请求。The associated account cancellation request verification unit is configured to reject the account cancellation request when it is determined that the record to be cancelled corresponding to the associated account cancellation request does not exist. 9.一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至4任一项所述的方法。9. A computer device comprising a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor implements any of claims 1 to 4 when the processor executes the computer program method described in item. 10.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序在计算机处理器中执行时实现如权利要求1至4任意一项所述的方法。10. A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed in a computer processor, the computer program according to any one of claims 1 to 4 is implemented. method.
CN202010304815.4A 2020-04-17 2020-04-17 Method and device for ensuring idempotency when a mobile phone number is associated with a bank account Pending CN111507826A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010304815.4A CN111507826A (en) 2020-04-17 2020-04-17 Method and device for ensuring idempotency when a mobile phone number is associated with a bank account

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010304815.4A CN111507826A (en) 2020-04-17 2020-04-17 Method and device for ensuring idempotency when a mobile phone number is associated with a bank account

Publications (1)

Publication Number Publication Date
CN111507826A true CN111507826A (en) 2020-08-07

Family

ID=71869345

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010304815.4A Pending CN111507826A (en) 2020-04-17 2020-04-17 Method and device for ensuring idempotency when a mobile phone number is associated with a bank account

Country Status (1)

Country Link
CN (1) CN111507826A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113993119A (en) * 2021-10-26 2022-01-28 中国银行股份有限公司 Mobile phone number cancellation method and device based on mobile banking
CN114219476A (en) * 2021-12-17 2022-03-22 中国建设银行股份有限公司 An account association method, device, device and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104378330A (en) * 2013-08-13 2015-02-25 北京奇虎科技有限公司 A method for account registration, corresponding device and server
CN104517217A (en) * 2014-11-24 2015-04-15 形山科技(深圳)有限公司 Data processing method and terminal
CN104754136A (en) * 2015-04-15 2015-07-01 上海斐讯数据通信技术有限公司 Method and system for managing account numbers relevant to mobile phone numbers on basis of intelligent terminals
US20160125377A1 (en) * 2014-10-31 2016-05-05 Visa International Service Association Systems and Methods for Enrolling a User in a Membership Account
CN110570297A (en) * 2019-08-21 2019-12-13 中国人民银行清算总中心 Bank account query method and device based on mobile phone number

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104378330A (en) * 2013-08-13 2015-02-25 北京奇虎科技有限公司 A method for account registration, corresponding device and server
US20160125377A1 (en) * 2014-10-31 2016-05-05 Visa International Service Association Systems and Methods for Enrolling a User in a Membership Account
CN104517217A (en) * 2014-11-24 2015-04-15 形山科技(深圳)有限公司 Data processing method and terminal
CN104754136A (en) * 2015-04-15 2015-07-01 上海斐讯数据通信技术有限公司 Method and system for managing account numbers relevant to mobile phone numbers on basis of intelligent terminals
CN110570297A (en) * 2019-08-21 2019-12-13 中国人民银行清算总中心 Bank account query method and device based on mobile phone number

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113993119A (en) * 2021-10-26 2022-01-28 中国银行股份有限公司 Mobile phone number cancellation method and device based on mobile banking
CN114219476A (en) * 2021-12-17 2022-03-22 中国建设银行股份有限公司 An account association method, device, device and medium
CN114219476B (en) * 2021-12-17 2025-09-16 中国建设银行股份有限公司 Account association method, device, equipment and medium

Similar Documents

Publication Publication Date Title
US12405925B2 (en) Decentralized database associating public keys and communications addresses
US11250518B2 (en) Method for secure ledger distribution and computer system using secure distributed ledger technology
CN110494877B (en) Systems and methods for issuing and tracking digital tokens within distributed network nodes
JP7108611B2 (en) Electronic bill management method, device and storage medium
US20220156837A1 (en) Distributed ledger implementation for entity formation and monitoring system
US10984494B2 (en) Systems and methods for interception of smart contracts
WO2017109140A1 (en) Decentralized, tamper-resistant, asset-oriented database system and method of recording a transaction
WO2019097322A1 (en) Optimization of high volume transaction performance on a blockchain
CN110494876A (en) System and method for issuing and tracking digital tokens within distributed network nodes
CN107993149A (en) Account information management method, system and readable storage medium storing program for executing
TWI734217B (en) Block chain-based invoice redemption method and device and electronic equipment
US11250439B2 (en) Systems and methods for smart contract intervention
CN110852730A (en) Transaction processing method and device based on digital currency and electronic equipment
JP7254585B2 (en) Inter-system linkage method and node
WO2021098139A1 (en) Method and device for storing state data of cross-chain transaction, and storage medium
JP2022525551A (en) Preventing erroneous transmission of copies of data records to distributed ledger systems
CN111311341A (en) Bill processing method, equipment and medium
CN113835780A (en) Incident response method and device
US20230351337A1 (en) Generating and securing digital checks using distributed ledger and embedded chip methods
CN111507826A (en) Method and device for ensuring idempotency when a mobile phone number is associated with a bank account
CN107577700B (en) Database disaster recovery processing method and device
KR20210106013A (en) Preventing transmission of incorrect copies of data records to distributed ledger systems
CN114511321A (en) Point-to-point based data processing method, system, computing device and storage medium
US10839387B2 (en) Blockchain based action and billing
US20250173706A1 (en) Ordered, append-only data storage

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200807

RJ01 Rejection of invention patent application after publication