Method, device and equipment for account clearing based on telecommunications services
Patent Information
- Application Number
- CN202311326348.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-10-13
AI Technical Summary
[0005]本申请提供一种基于电信业务的账户销账处理方法、装置以及设备,用以解决大账户销账处理效率低的技术问题
[0055]本申请提供的基于电信业务的账户销账处理方法、装置以及设备,服务器调取待处理的账户下的账本集合,并调取待处理的账户下的账单集合;重复执行以下步骤,直至处理完账本集合中的各账本数据,其中,i的初始值为1:基于二分查找方式,根据第i个账本数据对应的账单标识和账单集合中的账单的账单标识,从账单集合中确定出与第i个账本数据对应的各账单;根据第i个账本数据的销账余额,对与第i个账本数据对应的各账单进行销账处理,得到销账结果;确定i的取值加1;其中,i为大于等于1的正整数。从而可以提高大账户销账处理的效率。
Smart Images

Figure CN117372007B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of telecommunications, and more particularly to a method, apparatus, and equipment for processing account cancellation based on telecommunications services. Background Technology
[0002] With the development of telecommunications services, bill cancellation has become a core business of telecommunications services. For postpaid systems, bill cancellation is usually performed on all accounts in batches at the beginning of each month.
[0003] In existing technologies, the cancellation process uses the account as the basic operation unit. First, all ledgers and invoices for that account are loaded. Then, all ledgers are iterated through to process the cancellation. Specifically, during the iteration through all ledgers, all invoices for that account are iterated through for each ledger to process the cancellation. The number of iterations in this cancellation method is the product of the total number of ledgers and the total number of invoices.
[0004] For large accounts, the number of ledgers can reach hundreds of thousands, and the number of invoices can reach millions. Therefore, processing the write-off of large accounts using the methods described above is time-consuming, resulting in low efficiency. Thus, there is an urgent need for a method to improve the efficiency of writing off large accounts. Summary of the Invention
[0005] This application provides a method, apparatus, and equipment for processing account cancellation based on telecommunications services, in order to solve the technical problem of low efficiency in processing large account cancellations.
[0006] Firstly, this application provides a method for account cancellation processing based on telecommunications services, comprising:
[0007] Retrieve the ledger set under the account to be processed; wherein the ledger set includes at least one ledger data under the account to be processed, the ledger data has write-off balance and write-off range information, the write-off range information represents the bill identifier of the bill that can be written off in the ledger data; and retrieve the bill set under the account to be processed; wherein the bill set includes multiple bills, the bills in the bill set have bill identifiers, and the bills in the bill set are sorted according to the bill identifiers;
[0008] Repeat the following steps until all ledger data in the ledger set has been processed, where the initial value of i is 1: Based on the binary search method, determine each bill corresponding to the i-th ledger data from the bill set according to the bill identifier corresponding to the i-th ledger data and the bill identifier of the bill in the bill set; Based on the cleared balance of the i-th ledger data, perform clearing processing on each bill corresponding to the i-th ledger data to obtain the clearing result; Determine the value of i and increment it by 1; where i is a positive integer greater than or equal to 1.
[0009] Optionally, the ledger data also includes the ledger generation time; retrieving the set of ledgers under the account to be processed includes:
[0010] Obtain at least one ledger data under the account to be processed;
[0011] Based on the write-off scope information of the acquired ledger data, the acquired ledger data are classified and processed to obtain multiple ledger subsets; wherein, each ledger subset includes at least one ledger data, and the write-off scope information of the ledger data in the ledger subset is the same.
[0012] For each subset of ledgers, the ledger data in that subset is sorted according to the ledger generation time to obtain a sorted subset of ledgers.
[0013] Based on the number of bills that can be cancelled as represented by the cancellation range information corresponding to the ledger subset, the sorted ledger subsets are sorted to obtain the ledger set.
[0014] Optionally, retrieve the collection of bills under the account to be processed, including:
[0015] Retrieve each bill under the account to be processed; wherein, the bill has a billing period and user information;
[0016] Based on the billing period of the obtained bills, the obtained bills are classified and processed to obtain a bill subset; wherein, the bill subset includes at least one bill, and the bills in the bill subset have the same billing period;
[0017] For each subset of bills, sort them according to the user information of the bills in that subset to obtain a sorted subset of bills;
[0018] Based on the billing period corresponding to each bill subset, sort the sorted bill subsets to obtain the bill set.
[0019] Optionally, for each subset of bills, the user information of the bills in that subset is sorted to obtain a sorted subset of bills, including:
[0020] For each subset of bills, the subset of bills is classified according to user information to obtain the user sets under the subset of bills; wherein, each user set includes at least one bill, and the bills in the user set belong to the same user; each user corresponds to at least one bill, and each user has a network access time;
[0021] For each user set under each bill subset, sort the user sets under the bill subset according to the user's network access time to obtain the sorted user sets under the bill subset.
[0022] For each sorted user set under each bill subset, sort the bills in the sorted user set according to the bill items in the sorted user set to obtain the processed user set under each bill subset.
[0023] For each subset of bills, the sorted subset of bills is generated based on the processed user sets within that subset of bills.
[0024] Optionally, based on the write-off balance of the i-th ledger data, write-off processing is performed on each bill corresponding to the i-th ledger data to obtain the write-off result, including:
[0025] For each bill corresponding to the i-th ledger data, determine the difference between the clearance balance of the i-th ledger data and the outstanding amount of the bill corresponding to the i-th ledger data, and obtain the difference with the bill corresponding to the i-th ledger data.
[0026] For each bill corresponding to the i-th ledger data, if it is determined that the difference between the bill and the bill corresponding to the i-th ledger data is greater than or equal to zero, then the clearance balance of the i-th ledger data is updated to the difference, and the bill corresponding to the i-th ledger data is deleted.
[0027] For each bill corresponding to the i-th ledger data, if it is determined that the difference between the bill and the bill corresponding to the i-th ledger data is less than zero, then the clearance balance of the i-th ledger data is updated to zero, and the outstanding payment data of the bill corresponding to the i-th ledger data is updated to the absolute value of the difference.
[0028] Secondly, this application provides an account cancellation processing device based on telecommunications services, comprising:
[0029] A retrieval unit is used to retrieve a set of ledgers under an account to be processed; wherein the set of ledgers includes at least one ledger data under the account to be processed, the ledger data has write-off balance and write-off range information, the write-off range information represents the bill identifier of the bill that can be written off in the ledger data; and retrieves a set of bills under the account to be processed; wherein the set of bills includes multiple bills, the bills in the set of bills have bill identifiers, and the bills in the set of bills are sorted according to the bill identifiers;
[0030] The processing unit is used to repeatedly execute the following steps until all the ledger data in the ledger set has been processed, wherein the initial value of i is 1: Based on the binary search method, according to the bill identifier corresponding to the i-th ledger data and the bill identifier of the bill in the bill set, determine each bill corresponding to the i-th ledger data from the bill set; according to the cleared balance of the i-th ledger data, perform clearing processing on each bill corresponding to the i-th ledger data to obtain the clearing result; determine the value of i and increment it by 1; wherein i is a positive integer greater than or equal to 1.
[0031] Optionally, the ledger data also includes the ledger generation time; retrieving the set of ledgers under the account to be processed includes:
[0032] The first acquisition module is used to acquire at least one ledger data under the account to be processed;
[0033] The first classification module is used to classify the acquired ledger data based on the write-off range information of the acquired ledger data to obtain multiple ledger subsets; wherein, each ledger subset includes at least one ledger data, and the write-off range information of the ledger data in the ledger subset is the same.
[0034] The first sorting module is used to sort the ledger data in each ledger subset according to the ledger generation time of the ledger data, so as to obtain the sorted ledger subset.
[0035] The second sorting module is used to sort each sorted subset of ledgers according to the number of bills that can be cancelled as represented by the cancellation range information corresponding to the subset of ledgers, so as to obtain the set of ledgers.
[0036] Optionally, retrieve the collection of bills under the account to be processed, including:
[0037] The second acquisition module is used to acquire each bill under the account to be processed; wherein, the bill has a billing period and user information;
[0038] The second classification module is used to classify the acquired bills according to their billing periods to obtain a bill subset; wherein the bill subset includes at least one bill, and the bills in the bill subset have the same billing period;
[0039] The third sorting module is used to sort each bill subset according to the user information of the bills in that bill subset, and obtain the sorted bill subset.
[0040] The fourth sorting module is used to sort each sorted bill subset according to the billing period corresponding to the bill subset, so as to obtain the bill set.
[0041] Optionally, for each subset of bills, the user information of the bills in that subset is sorted to obtain a sorted subset of bills, including:
[0042] The classification submodule is used to classify each bill subset according to user information to obtain the user sets under the bill subset; wherein, each user set includes at least one bill, and the bills in the user set belong to the same user; each user corresponds to at least one bill, and each user has a network access time;
[0043] The first sorting submodule is used to sort the user sets under each bill subset according to the user's network access time, so as to obtain the sorted user sets under the bill subset.
[0044] The second sorting submodule is used to sort the bills in each sorted user set under each bill subset according to the bill items in the sorted user set, so as to obtain the processed user set under each bill subset.
[0045] The generation submodule is used to generate the sorted bill subset for each bill subset based on the processed user sets in that bill subset.
[0046] Optionally, based on the write-off balance of the i-th ledger data, write-off processing is performed on each bill corresponding to the i-th ledger data to obtain the write-off result, including:
[0047] The determination module is used to determine the difference between the clearance balance of the i-th ledger data and the outstanding payment data of the bill corresponding to the i-th ledger data for each bill, and obtain the difference with the bill corresponding to the i-th ledger data.
[0048] The first processing module is used to update the clearance balance of the i-th ledger data to the difference between the bill corresponding to the i-th ledger data and the bill corresponding to the i-th ledger data if the difference is greater than or equal to zero.
[0049] The second processing module is used to update the clearance balance of the i-th ledger data to zero if the difference between the i-th ledger data and the bill corresponding to the i-th ledger data is determined to be less than zero, and to update the arrears data of the bill corresponding to the i-th ledger data to the absolute value of the difference.
[0050] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0051] The memory stores computer-executed instructions;
[0052] The processor executes computer execution instructions stored in the memory to implement the method provided in the first aspect above.
[0053] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method provided in the first aspect above.
[0054] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method provided in the first aspect above.
[0055] This application provides a method, apparatus, and device for processing account cancellation based on telecommunications services. The server retrieves the set of ledgers and the set of bills for the account to be processed. The following steps are repeated until all ledger data in the ledger set is processed, where the initial value of i is 1: Based on a binary search method, each bill corresponding to the i-th ledger data is determined from the bill set according to the bill identifier corresponding to the i-th ledger data and the bill identifier of the bill in the bill set; based on the cancellation balance of the i-th ledger data, each bill corresponding to the i-th ledger data is cancelled to obtain the cancellation result; the value of i is incremented by 1; where i is a positive integer greater than or equal to 1. This improves the efficiency of large account cancellation processing. Attached Figure Description
[0056] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0057] Figure 1 A flowchart illustrating an account cancellation processing method based on telecommunications services, provided for an embodiment of this application;
[0058] Figure 2 A flowchart illustrating another account cancellation processing method based on telecommunications services provided in this application embodiment;
[0059] Figure 3 A schematic diagram of the structure of an account cancellation processing device based on telecommunications services provided in an embodiment of this application;
[0060] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0061] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0062] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0063] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0064] With the development of telecommunications services, bill cancellation has become a core business of telecommunications services. For postpaid systems, bill cancellation is usually performed on all accounts in batches at the beginning of each month.
[0065] In existing technologies, the cancellation process uses the account as the basic operation unit. First, all ledgers and invoices for that account are loaded. Then, all ledgers are iterated through to process the cancellation. Specifically, during the iteration through all ledgers, all invoices for that account are iterated through for each ledger to process the cancellation. The number of iterations in this cancellation method is the product of the total number of ledgers and the total number of invoices.
[0066] For large accounts, the number of ledgers can reach hundreds of thousands, and the number of invoices can reach millions. Therefore, processing the cancellation of accounts for large accounts using the methods described above requires a significant amount of time, resulting in low efficiency in the cancellation process.
[0067] The method, apparatus, and equipment for account cancellation processing based on telecommunications services provided in this application are intended to solve the above-mentioned technical problems of the prior art.
[0068] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0069] Figure 1 A flowchart illustrating an account cancellation processing method based on telecommunications services, provided as an embodiment of this application, is shown below. Figure 1 As shown, the method in this embodiment includes:
[0070] S101. Retrieve the set of ledgers under the account to be processed; wherein the set of ledgers includes at least one ledger data under the account to be processed, and the ledger data has cancellation balance and cancellation range information, and the cancellation range information represents the bill identifier of the bill that can be cancelled by the ledger data.
[0071] For example, the execution subject of this embodiment can be a server.
[0072] The server retrieves the set of ledgers under the account to be processed. The set of ledgers includes at least one ledger data under the account to be processed. The ledger data has cancellation balance and cancellation range information. The cancellation range information represents the bill identifier of the bill that can be cancelled by the ledger data. The cancellation range information also represents the number of bills that can be cancelled by the ledger data.
[0073] For example, the server retrieves the ledger set B under the account A to be processed. Ledger set B includes two ledgers, B1 and B2. Ledger B1 has a clearance balance of 1000 yuan, and the bills that can be cleared in ledger B1 are identified by identifiers 1 and 2, with a total of 2 bills that can be cleared. Ledger B2 has a clearance balance of 5000 yuan, and the bills that can be cleared in ledger B2 are identified by identifiers 2, 4, and 7, with a total of 3 bills that can be cleared.
[0074] S102. Retrieve the bill set under the account to be processed; wherein, the bill set includes multiple bills, the bills in the bill set have bill identifiers, and the bills in the bill set are sorted according to the bill identifiers.
[0075] For example, the server retrieves a set of bills under the account to be processed; wherein the set of bills includes multiple bills, each bill has a bill identifier, and the bills in the set are sorted according to the bill identifier.
[0076] For example, the server retrieves the bill set D under the account A to be processed. The bill set D includes five bills, namely bill 1, bill 2, bill 3, bill 4 and bill 5. Bill 1 has bill identifier 1, bill 2 has bill identifier 2, bill 3 has bill identifier 3, bill 4 has bill identifier 4 and bill 5 has bill identifier 5. The five bills in the bill set D are sorted according to the bill identifier, and the order of the five bills in the bill set D is: bill 1, bill 2, bill 3, bill 4 and bill 5.
[0077] S103. Repeat the following steps until all ledger data in the ledger set has been processed, where the initial value of i is 1: Based on the binary search method, determine each bill corresponding to the i-th ledger data from the bill set according to the bill identifier corresponding to the i-th ledger data and the bill identifier of the bill in the bill set; Based on the clearance balance of the i-th ledger data, perform clearance processing on each bill corresponding to the i-th ledger data to obtain the clearance result; Determine the value of i and increment it by 1; Where i is a positive integer greater than or equal to 1.
[0078] The binary search method works as follows: For each bill identifier corresponding to the i-th ledger data, compare this bill identifier with the bill identifier of the bill at the middle position of the bill set. If they are equal, the search is successful; otherwise, divide the bill set into two subsets using the bill identifier of the bill at the middle position. If the bill identifier of the bill at the middle position is greater than the bill identifier corresponding to the i-th ledger data, continue searching the first subset; otherwise, continue searching the second subset. Repeat this process until a bill identifier that meets the conditions is found in the bill set, at which point the search is successful; or, until no subset exists, at which point the search is unsuccessful.
[0079] For example, the server uses a binary search method to determine each bill corresponding to the first ledger data from the bill set based on the bill identifier corresponding to each bill in the first ledger data and the bill identifier of the bill in the bill set; based on the cleared balance of the first ledger data, the server performs clearing processing on each bill corresponding to the first ledger data to obtain the clearing result.
[0080] The server uses a binary search approach. Based on the bill identifier corresponding to each bill in the second ledger data and the bill identifier of the bill in the bill set, it determines each bill corresponding to the second ledger data from the bill set. Based on the cleared balance of the second ledger data, it performs clearing processing on each bill corresponding to the second ledger data to obtain the clearing result.
[0081] This process continues until all the data in the ledger set has been processed.
[0082] In this embodiment, the server retrieves the ledger set and the bill set under the account to be processed; the following steps are repeated until all ledger data in the ledger set is processed, where the initial value of i is 1: Based on a binary search method, according to the bill identifier corresponding to the i-th ledger data and the bill identifier of the bill in the bill set, the bills corresponding to the i-th ledger data are determined from the bill set; according to the cleared balance of the i-th ledger data, the bills corresponding to the i-th ledger data are cleared to obtain the cleared result; the value of i is incremented by 1; where i is a positive integer greater than or equal to 1. The method of this embodiment can improve the efficiency of clearing large accounts.
[0083] Figure 2 A flowchart of another account cancellation processing method based on telecommunications services provided in the embodiments of this application is shown below. Figure 2 As shown, the method in this embodiment includes:
[0084] S201. Retrieve the set of ledgers under the account to be processed; wherein the set of ledgers includes at least one ledger data under the account to be processed, and the ledger data has cancellation balance and cancellation range information, and the cancellation range information represents the bill identifier of the bill that can be cancelled by the ledger data.
[0085] Optionally, the ledger data also includes the ledger generation time; S201 includes the following processes:
[0086] The first step of S201 is to obtain at least one ledger data under the account to be processed.
[0087] The second step of S201 is to classify and process the acquired ledger data based on the write-off scope information of the ledger data to obtain multiple ledger subsets; wherein each ledger subset includes at least one ledger data, and the write-off scope information of the ledger data in the ledger subset is the same.
[0088] The third step of S201 is to sort the ledger data in each ledger subset according to the ledger generation time, thereby obtaining the sorted ledger subset.
[0089] The fourth step of S201 is to sort each sorted ledger subset according to the number of bills that can be cancelled as represented by the cancellation range information corresponding to the ledger subset, and obtain the ledger set.
[0090] For example, the execution subject in this embodiment is a server.
[0091] The server retrieves at least one ledger data item for the account to be processed. Each ledger data item contains a write-off balance, write-off scope information, and a ledger generation time. The write-off scope information indicates the bill identifier of the bill that can be written off, and also indicates the number of bills that can be written off. For example, the server retrieves the following ledger data items for the account to be processed: Ledger Data B1, Ledger Data B2, and Ledger Data B3. Ledger Data B1 has a write-off balance of 200 yuan, a ledger generation time of February 1, 2022, and write-off bill 1 is available for write-off. Ledger Data B2 has a write-off balance of 500 yuan, a ledger generation time of May 15, 2022, and write-off bill 1 is available for write-off. Ledger Data B3 has a write-off balance of 1000 yuan, a ledger generation time of March 20, 2022, and write-off bills 1 and 2 are available for write-off.
[0092] Based on the clearance scope information of each ledger data obtained, the server classifies the acquired ledger data and groups at least one ledger data with the same clearance scope information into one category, thus obtaining multiple ledger subsets; each ledger subset has clearance scope information corresponding to that ledger subset.
[0093] For each subset of ledgers, the server sorts the ledger data according to its creation time, resulting in a sorted subset. For example, the server sorts the ledger data in each subset from earliest to latest creation time, resulting in a sorted subset where the ledger data is arranged sequentially from earliest to latest creation time.
[0094] The server sorts the sorted ledger subsets based on the number of cancelable bills indicated by the cancellation range information corresponding to each subset, thus obtaining the ledger set. For example, the server sorts the sorted ledger subsets in ascending order of the number of cancelable bills indicated by the cancellation range information corresponding to each subset, thus obtaining the ledger set.
[0095] The method of this embodiment can retrieve at least one ledger data under the account to be processed, and sort the ledger data to obtain a ledger set.
[0096] S202. Retrieve the bill set under the account to be processed; wherein, the bill set includes multiple bills, the bills in the bill set have bill identifiers, and the bills in the bill set are sorted according to the bill identifiers.
[0097] Optionally, S202 includes the following process:
[0098] The first step of S202 is to obtain the bills for the accounts to be processed; the bills contain billing periods and user information.
[0099] The second step of S202 is to classify the obtained bills according to their billing periods to obtain a bill subset; wherein the bill subset includes at least one bill, and the bills in the bill subset have the same billing period.
[0100] The third step of S202 is to sort each bill subset according to the user information of the bills in that subset, and obtain a sorted bill subset.
[0101] The fourth step of S202 is to sort the sorted bill subsets according to the billing period corresponding to each bill subset, so as to obtain the bill set.
[0102] Optionally, the third step of S202 includes the following procedures:
[0103] The first step of the third step in S202 is to classify each bill subset according to the user information to obtain the user sets under the bill subset; wherein, each user set includes at least one bill, and the bills in the user set belong to the same user; each user has at least one bill, and the user has a network access time.
[0104] The second step of the third step in S202 is to sort the user sets under each bill subset according to the user's network access time to obtain the sorted user sets under the bill subset.
[0105] The third step of S202 involves sorting the bills in each sorted user set according to the account items of the bills in each bill subset, thereby obtaining the processed user set under each bill subset.
[0106] The fourth step of the third step in S202 is to generate a sorted subset of bills for each subset of bills, based on the processed user sets within that subset of bills.
[0107] For example, the server retrieves the bills under the account to be processed; each bill has a bill identifier, bill items, outstanding payment data, billing period, and user information. The billing period represents the time the bill was generated, and the user information includes the user's network access time. For example, bill items can be SMS bills, voice call bills, etc.
[0108] The server categorizes the obtained bills according to their billing periods, grouping at least one bill with the same billing period into one category, thus obtaining multiple bill subsets. Each bill subset has a corresponding billing period.
[0109] For each subset of bills, the server categorizes the bills based on the user information within that subset, grouping at least one bill with identical user information into one category. This results in user sets for each subset of bills. Each user set includes at least one bill, and the bills within a user set belong to the same user. In other words, each user set has user information corresponding to that user set. Each user has at least one bill and a network access time.
[0110] For each subset of bills, the server sorts the user sets within that subset based on the users' onboarding time, resulting in sorted user sets for that subset. For example, the server might sort the user sets within each subset of bills from earliest to latest onboarding time.
[0111] For each sorted user set within each bill subset, the server sorts the bills in that sorted user set according to the item counts, resulting in a processed user set for each bill subset. For example, the server sorts the bills in that sorted user set according to a preset item count order, resulting in a processed user set for each bill subset.
[0112] For each subset of bills, the server generates a sorted subset of bills based on the processed user sets within that subset.
[0113] The server sorts the sorted bill subsets according to their corresponding billing periods, resulting in a bill set. For example, the server sorts the sorted bill subsets from earliest to latest billing period, thus obtaining the bill set.
[0114] The method in this embodiment can retrieve all bills under the account to be processed, sort the bills, and obtain a bill set.
[0115] S203. Repeat the following steps until all ledger data in the ledger set has been processed, where the initial value of i is 1:
[0116] The first step of S203 is to determine the bills corresponding to the i-th ledger data from the bill set based on the bill identifier corresponding to the i-th ledger data and the bill identifiers of the bills in the bill set.
[0117] The second step of S203 is to process the cancellation of each bill corresponding to the i-th ledger data based on the cancellation balance of the i-th ledger data, and obtain the cancellation result.
[0118] The binary search method works as follows: For each bill identifier corresponding to the i-th ledger data, compare this bill identifier with the bill identifier of the bill at the middle position of the bill set. If they are equal, the search is successful; otherwise, divide the bill set into two subsets using the bill identifier of the bill at the middle position. If the bill identifier of the bill at the middle position is greater than the bill identifier corresponding to the i-th ledger data, continue searching the first subset; otherwise, continue searching the second subset. Repeat this process until a bill identifier that meets the conditions is found in the bill set, at which point the search is successful; or, until no subset exists, at which point the search is unsuccessful.
[0119] The third step of S203 is to determine the value of i and add 1; where i is a positive integer greater than or equal to 1.
[0120] Optionally, the second step of S203 includes the following process:
[0121] The first step of the second step of S203 is to determine the difference between the clearance balance of the i-th ledger data and the outstanding payment data of the bill corresponding to the i-th ledger data for each bill, thereby obtaining the difference with the bill corresponding to the i-th ledger data.
[0122] In the second step of S203, for each bill corresponding to the i-th ledger data, if it is determined that the difference between the bill corresponding to the i-th ledger data and the bill is greater than or equal to zero, then the clearance balance of the i-th ledger data is updated to the difference, and the bill corresponding to the i-th ledger data is deleted.
[0123] In the third step of the second step of S203, for each bill corresponding to the i-th ledger data, if it is determined that the difference between the bill corresponding to the i-th ledger data and the bill is less than zero, then the clearance balance of the i-th ledger data is updated to zero, and the outstanding payment data of the bill corresponding to the i-th ledger data is updated to the absolute value of the difference.
[0124] For example, for the first ledger data in the ledger set, the server uses a binary search method to determine each bill corresponding to the first ledger data from the bill set based on the bill identifier corresponding to each bill of the first ledger data and the bill identifier of the bill in the bill set.
[0125] For each bill corresponding to the first ledger data, the server determines the difference between the cleared balance of the first ledger data and the outstanding amount of the bill corresponding to the first ledger data, thus obtaining the difference with the bill corresponding to the first ledger data.
[0126] For each bill corresponding to the first ledger data, if the server determines that the difference between the bill and the bill corresponding to the first ledger data is greater than or equal to zero, it updates the clearance balance of the first ledger data to the difference and deletes the bill corresponding to the first ledger data.
[0127] For each bill corresponding to the first ledger data, if the server determines that the difference between the bill and the bill corresponding to the first ledger data is less than zero, it updates the clearance balance of the first ledger data to zero and determines that the outstanding payment data of the bill corresponding to the first ledger data is updated to the absolute value of the difference.
[0128] For the second ledger data in the ledger set, the server uses a binary search method to determine the bills corresponding to the second ledger data from the bill set based on the bill identifier corresponding to each bill in the second ledger data and the bill identifier of the bills in the bill set.
[0129] For each bill corresponding to the second ledger data, the server determines the difference between the cleared balance of the second ledger data and the outstanding amount of the bill corresponding to the second ledger data, thus obtaining the difference with the bill corresponding to the second ledger data.
[0130] For each bill corresponding to the second ledger data, if the server determines that the difference between the bill and the bill corresponding to the second ledger data is greater than or equal to zero, then the clearing balance of the second ledger data is updated to the difference, and the bill corresponding to the second ledger data is deleted.
[0131] For each bill corresponding to the second ledger data, if the server determines that the difference between the bill and the bill corresponding to the second ledger data is less than zero, it updates the clearance balance of the second ledger data to zero and determines that the outstanding payment data of the bill corresponding to the second ledger data is updated to the absolute value of the difference.
[0132] This process continues until all the data in the ledger set has been processed.
[0133] For example, the ledger set B under the account to be processed includes two ledger data, namely ledger data B1 and ledger data B2. Ledger data B1 has a clearance balance of 1000 yuan, and the corresponding bill identifiers for ledger data B1 are 1 and 2, meaning that the bills that can be cleared by ledger data B1 are bill 1 and bill 2. Ledger data B1 has a clearance balance of 5000 yuan, and the corresponding bill identifiers for ledger data B2 are 2, 4, and 7, meaning that the bills that can be cleared by ledger data B2 are bill 2, bill 4, and bill 7.
[0134] The bill set D under the pending account includes three bills, namely Bill 1, Bill 2, and Bill 7. Among them, the outstanding amount of Bill 1 is 700 yuan, the outstanding amount of Bill 2 is 600 yuan, and the outstanding amount of Bill 7 is 800 yuan.
[0135] For ledger data B1, the server uses a binary search approach. Based on the bill identifier 1 corresponding to ledger data B1, it determines that a bill 1 corresponding to bill identifier 1 exists in bill set D. The server also uses a binary search approach, based on the bill identifier 2 corresponding to ledger data B1, to determine that a bill 2 corresponding to bill identifier 2 exists in bill set D. Therefore, the bills corresponding to ledger data B1 in bill set D are: bill 1 and bill 2. At this time, the outstanding balance of ledger data B1 is 1000 yuan, the outstanding amount of bill 1 is 700 yuan, and the outstanding amount of bill 2 is 600 yuan.
[0136] For bill 1, the server calculates the difference between the clearance balance of ledger data B1 and the outstanding amount of bill 1: 1000-700=300, and obtains a difference of 300 for bill 1 corresponding to ledger data B1. Since this difference is greater than 0, the clearance balance of ledger data B1 is updated to 300 yuan, and bill 1 is deleted from bill set D.
[0137] For bill 2, the server calculates the difference between the cleared balance of ledger data B1 and the outstanding amount of bill 2: 300-600=-300, and obtains the difference of bill 1 corresponding to ledger data B1 as -300; since this difference is less than 0, the cleared balance of ledger data B1 is updated to 0 yuan, and the outstanding amount of bill 2 is updated to 300 yuan.
[0138] For ledger data B2, the server uses a binary search method. Based on the bill identifier 2 corresponding to ledger data B2, it determines that bill 2 exists in bill set D. Using the same binary search method, based on the bill identifier 4 corresponding to ledger data B2, it determines that no bill exists in bill set D corresponding to bill identifier 2. Using the same binary search method, based on the bill identifier 7 corresponding to ledger data B2, it determines that bill 7 exists in bill set D corresponding to bill identifier 7. Therefore, the bills corresponding to ledger data B2 in bill set D are: bill 2 and bill 7. At this time, the outstanding balance of ledger data B2 is 5000 yuan, the outstanding amount of bill 2 is 300 yuan, and the outstanding amount of bill 7 is 800 yuan.
[0139] For bill 2, the server calculates the difference between the cleared balance of ledger data B2 and the outstanding amount of bill 2: 5000-300=4700, and obtains the difference of bill 2 corresponding to ledger data B2 as 4700. Since the difference is greater than 0, the cleared balance of ledger data B2 is updated to 4700 yuan, and bill 2 is deleted from the bill set D.
[0140] For bill 7, the server calculates the difference between the clearance balance of ledger data B2 and the outstanding amount of bill 7: 4700-800=3900, resulting in a difference of 3900 between bill 7 and ledger data B2. Since this difference is greater than 0, the clearance balance of ledger data B2 is updated to 3900 yuan, and bill 7 is deleted from bill set D.
[0141] The method described in this embodiment can accurately locate the bills that can be cancelled for each account under the account to be processed from the bill set under the account to be processed, thereby improving the efficiency of large account cancellation processing.
[0142] Figure 3 A schematic diagram of the structure of an account cancellation processing device based on telecommunications services provided in this application embodiment is shown below. Figure 3 The device 30 includes:
[0143] The retrieval unit 31 is used to retrieve the ledger set under the account to be processed; wherein the ledger set includes at least one ledger data under the account to be processed, the ledger data has cancellation balance and cancellation range information, the cancellation range information represents the bill identifier of the bill that can be cancelled in the ledger data; and retrieve the bill set under the account to be processed; wherein the bill set includes multiple bills, the bills in the bill set have bill identifiers, and the bills in the bill set are sorted according to the bill identifiers.
[0144] Processing unit 32 is used to repeatedly execute the following steps until all ledger data in the ledger set is processed, wherein the initial value of i is 1: Based on the binary search method, according to the bill identifier corresponding to the i-th ledger data and the bill identifier of the bill in the bill set, determine each bill corresponding to the i-th ledger data from the bill set; according to the clearing balance of the i-th ledger data, perform clearing processing on each bill corresponding to the i-th ledger data to obtain the clearing result; determine the value of i and increment it by 1; wherein i is a positive integer greater than or equal to 1.
[0145] Optionally, the ledger data also includes the ledger generation time; the retrieval unit 31 includes:
[0146] The first acquisition module is used to acquire at least one ledger data under the account to be processed.
[0147] The first classification module is used to classify the acquired ledger data based on the write-off range information of the acquired ledger data, and obtain multiple ledger subsets; wherein, each ledger subset includes at least one ledger data, and the write-off range information of the ledger data in the ledger subset is the same.
[0148] The first sorting module is used to sort the ledger data in each ledger subset according to the ledger generation time, so as to obtain the sorted ledger subset.
[0149] The second sorting module is used to sort each sorted ledger subset according to the number of bills that can be cancelled as represented by the cancellation range information corresponding to the ledger subset, so as to obtain the ledger set.
[0150] Optionally, the retrieval unit 31 includes:
[0151] The second acquisition module is used to acquire each bill under the account to be processed; wherein, the bill has the billing period and user information.
[0152] The second classification module is used to classify the obtained bills according to their billing periods to obtain bill subsets; wherein, each bill subset includes at least one bill, and the bills in the bill subset have the same billing period.
[0153] The third sorting module is used to sort each bill subset according to the user information of the bills in that subset, and obtain the sorted bill subset.
[0154] The fourth sorting module is used to sort the sorted bill subsets according to the billing period corresponding to the bill subsets, so as to obtain the bill set.
[0155] Optionally, the third sorting module includes:
[0156] The classification submodule is used to classify each bill subset according to user information to obtain the user sets under the bill subset; wherein, each user set includes at least one bill, the bills in the user set belong to the same user, each user has at least one bill, and the user has a network access time.
[0157] The first sorting submodule is used to sort the user sets under each bill subset according to the user's network access time, so as to obtain the sorted user sets under the bill subset.
[0158] The second sorting submodule is used to sort the bills in each sorted user set under each bill subset according to the bill items in the sorted user set, so as to obtain the processed user set under each bill subset.
[0159] The generation submodule is used to generate a sorted subset of bills for each subset of bills, based on the processed user sets within that subset of bills.
[0160] Optionally, the processing unit 32 includes:
[0161] The determination module is used to determine the difference between the clearance balance of the i-th ledger data and the outstanding payment data of the bill corresponding to the i-th ledger data for each bill, and obtain the difference with the bill corresponding to the i-th ledger data.
[0162] The first processing module is used to update the clearance balance of the i-th ledger data to the difference between the bill corresponding to the i-th ledger data and the bill corresponding to the i-th ledger data if the difference is greater than or equal to zero, and delete the bill corresponding to the i-th ledger data.
[0163] The second processing module is used to update the clearance balance of the i-th ledger data to zero if the difference between the i-th ledger data and the bill corresponding to the i-th ledger data is less than zero, and to update the arrears data of the bill corresponding to the i-th ledger data to the absolute value of the difference.
[0164] The apparatus provided in this embodiment can be referred to the method provided in the above embodiments. The technical process and effects are the same, and will not be described again.
[0165] Figure 4 This application provides a schematic diagram of the structure of an electronic device, such as... Figure 4 As shown, the electronic device includes: a transmitter 41, a receiver 42, a memory 43, and a processor 44.
[0166] Memory 43 is used to store computer instructions.
[0167] The processor 44 is used to execute computer instructions stored in the memory 43 to implement the technical solution of any of the methods provided in the foregoing embodiments.
[0168] Transmitter 41 is used to receive instructions and data sent by other devices.
[0169] Receiver 42 is used to send instructions and data to external devices.
[0170] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the above embodiments.
[0171] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the above embodiments.
[0172] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0173] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0174] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0175] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0176] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the storage unit can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.
[0177] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0178] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0179] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0180] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for processing account cancellation based on telecommunications services, characterized in that, The method includes: Retrieve the ledger set under the account to be processed; wherein the ledger set includes at least one ledger data under the account to be processed, the ledger data has write-off balance and write-off range information, the write-off range information represents the bill identifier of the bill that can be written off in the ledger data; and retrieve the bill set under the account to be processed; wherein the bill set includes multiple bills, the bills in the bill set have bill identifiers, and the bills in the bill set are sorted according to the bill identifiers; Repeat the following steps until all ledger data in the ledger set has been processed, where the initial value of i is 1: Based on a binary search method, determine the bills corresponding to the i-th ledger data from the bill set according to the bill identifier corresponding to the i-th ledger data and the bill identifiers of the bills in the bill set; Based on the clearance balance of the i-th ledger data, perform clearance processing on the bills corresponding to the i-th ledger data to obtain the clearance result; Determine the value of i and increment it by 1; where i is a positive integer greater than or equal to 1; Retrieve the collection of bills for the pending account, including: Retrieve each bill under the account to be processed; wherein, the bill has a billing period and user information; Based on the billing period of the obtained bills, the obtained bills are classified and processed to obtain a bill subset; wherein, the bill subset includes at least one bill, and the bills in the bill subset have the same billing period; For each subset of bills, sort them according to the user information of the bills in that subset to obtain a sorted subset of bills; Based on the billing period corresponding to each bill subset, sort the sorted bill subsets to obtain the bill set.
2. The method according to claim 1, characterized in that, The ledger data also includes the ledger generation time; Retrieve the set of ledgers for the accounts to be processed, including: Obtain at least one ledger data under the account to be processed; Based on the write-off scope information of the acquired ledger data, the acquired ledger data are classified and processed to obtain multiple ledger subsets; wherein, each ledger subset includes at least one ledger data, and the write-off scope information of the ledger data in the ledger subset is the same. For each subset of ledgers, the ledger data in that subset is sorted according to the ledger generation time to obtain a sorted subset of ledgers. Based on the number of bills that can be cancelled as represented by the cancellation range information corresponding to the ledger subset, the sorted ledger subsets are sorted to obtain the ledger set.
3. The method according to claim 1, characterized in that, For each subset of bills, the user information of the bills in that subset is sorted to obtain a sorted subset of bills, including: For each subset of bills, the subset of bills is classified according to user information to obtain the user sets under the subset of bills; wherein, each user set includes at least one bill, and the bills in the user set belong to the same user; each user corresponds to at least one bill, and each user has a network access time; For each user set under each bill subset, sort the user sets under the bill subset according to the user's network access time to obtain the sorted user sets under the bill subset. For each sorted user set under each bill subset, sort the bills in the sorted user set according to the bill items in the sorted user set to obtain the processed user set under each bill subset. For each subset of bills, the sorted subset of bills is generated based on the processed user sets within that subset of bills.
4. The method according to any one of claims 1-3, characterized in that, Based on the clearance balance of the i-th ledger data, the clearance processes are performed on each invoice corresponding to the i-th ledger data to obtain the clearance results, including: For each bill corresponding to the i-th ledger data, determine the difference between the clearance balance of the i-th ledger data and the outstanding amount of the bill corresponding to the i-th ledger data, and obtain the difference with the bill corresponding to the i-th ledger data. For each bill corresponding to the i-th ledger data, if it is determined that the difference between the bill and the bill corresponding to the i-th ledger data is greater than or equal to zero, then the clearance balance of the i-th ledger data is updated to the difference, and the bill corresponding to the i-th ledger data is deleted. For each bill corresponding to the i-th ledger data, if it is determined that the difference between the bill and the bill corresponding to the i-th ledger data is less than zero, then the clearance balance of the i-th ledger data is updated to zero, and the outstanding payment data of the bill corresponding to the i-th ledger data is updated to the absolute value of the difference.
5. An account cancellation processing device based on telecommunications services, characterized in that, The device includes: A retrieval unit is used to retrieve a set of ledgers under an account to be processed; wherein the set of ledgers includes at least one ledger data under the account to be processed, the ledger data has write-off balance and write-off range information, the write-off range information represents the bill identifier of the bill that can be written off in the ledger data; and retrieves a set of bills under the account to be processed; wherein the set of bills includes multiple bills, the bills in the set of bills have bill identifiers, and the bills in the set of bills are sorted according to the bill identifiers; The processing unit is used to repeatedly execute the following steps until all the ledger data in the ledger set has been processed, wherein the initial value of i is 1: Based on the binary search method, according to the bill identifier corresponding to the i-th ledger data and the bill identifier of the bill in the bill set, determine each bill corresponding to the i-th ledger data from the bill set; according to the cleared balance of the i-th ledger data, perform clearing processing on each bill corresponding to the i-th ledger data to obtain the clearing result; determine the value of i and increment it by 1; wherein i is a positive integer greater than or equal to 1; Retrieve the collection of bills for the pending account, including: The second acquisition module is used to acquire each bill under the account to be processed; wherein, the bill has a billing period and user information; The second classification module is used to classify the acquired bills according to their billing periods to obtain a bill subset; wherein the bill subset includes at least one bill, and the bills in the bill subset have the same billing period; The third sorting module is used to sort each bill subset according to the user information of the bills in that bill subset, and obtain the sorted bill subset. The fourth sorting module is used to sort each sorted bill subset according to the billing period corresponding to the bill subset, so as to obtain the bill set.
6. The apparatus according to claim 5, characterized in that, The ledger data also includes the ledger generation time; Retrieve the set of ledgers for the accounts to be processed, including: The first acquisition module is used to acquire at least one ledger data under the account to be processed; The first classification module is used to classify the acquired ledger data based on the write-off range information of the acquired ledger data to obtain multiple ledger subsets; wherein, each ledger subset includes at least one ledger data, and the write-off range information of the ledger data in the ledger subset is the same. The first sorting module is used to sort the ledger data in each ledger subset according to the ledger generation time of the ledger data, so as to obtain the sorted ledger subset. The second sorting module is used to sort each sorted subset of ledgers according to the number of bills that can be cancelled as represented by the cancellation range information corresponding to the subset of ledgers, so as to obtain the set of ledgers.
7. The apparatus according to claim 5, characterized in that, For each subset of bills, the user information of the bills in that subset is sorted to obtain a sorted subset of bills, including: The classification submodule is used to classify each bill subset according to user information to obtain the user sets under the bill subset; wherein, each user set includes at least one bill, and the bills in the user set belong to the same user; each user corresponds to at least one bill, and each user has a network access time; The first sorting submodule is used to sort the user sets under each bill subset according to the user's network access time, so as to obtain the sorted user sets under the bill subset. The second sorting submodule is used to sort the bills in each sorted user set under each bill subset according to the bill items in the sorted user set, so as to obtain the processed user set under each bill subset. The generation submodule is used to generate the sorted bill subset for each bill subset based on the processed user sets in that bill subset.
8. The apparatus according to any one of claims 5-7, characterized in that, Based on the clearance balance of the i-th ledger data, the clearance processes are performed on each invoice corresponding to the i-th ledger data to obtain the clearance results, including: The determination module is used to determine the difference between the clearance balance of the i-th ledger data and the outstanding payment data of the bill corresponding to the i-th ledger data for each bill, and obtain the difference with the bill corresponding to the i-th ledger data. The first processing module is used to update the clearance balance of the i-th ledger data to the difference between the bill corresponding to the i-th ledger data and the bill corresponding to the i-th ledger data if the difference is greater than or equal to zero. The second processing module is used to update the clearance balance of the i-th ledger data to zero if the difference between the i-th ledger data and the bill corresponding to the i-th ledger data is determined to be less than zero, and to update the arrears data of the bill corresponding to the i-th ledger data to the absolute value of the difference.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Account checking method and system of unified mobile payment platform, storage medium and terminal
CN113947397A
Telecommunication group service charge-off method and system, electronic equipment and storage medium
CN113962688A