Attribute value modification method and device
By grouping and locking multiple accounts to be modified, the problem of waiting for account group locks in batch modification requests is solved, and a more efficient processing process is achieved, reducing the total processing time and database connection usage.
Patent Information
- Application Number
- CN202411284721.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-03
AI Technical Summary
When batch modifying the value attribute values of multiple user accounts, the prior art causes the lock waiting for account grouping records to increase, resulting in an extended total processing time for batch modification requests.
By grouping multiple accounts to be modified, locking information is determined based on the account information to be modified in the account group, and locking the account group. After modifying the value attribute value of the account to be modified, unlock the account group according to the processing results. , realize batch modification of the same batch of accounts.
Reduces the total processing time of batch modification requests, avoids multiple locking and unlocking of the same account group, improves processing efficiency and reduces the time spent on database connections.
Smart Images

Figure CN119250896A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of batch processing, and in particular to a method and device for modifying attribute values. Background Art
[0002] In order to meet the application scenarios such as batch distribution of red envelopes, batch distribution of coupons, batch deduction of expenses, etc., the system needs to process batch modification requests for value attribute values to batch modify the value attribute values of multiple user accounts. Generally, a number of account groups are set in the system, and one account group includes multiple user accounts. The income and expenditure of the value attribute values of all user accounts in the same group are controlled through account groups.
[0003] When modifying the value attribute value of a single user account, it is necessary to lock the record of the account group to which the user account belongs in the database to ensure the consistency of the value attribute value change of the account group. Therefore, when modifying the attribute values of multiple accounts in batches, a large number of lock waits for the same account group records will be caused in a short period of time, increasing the total processing time of batch modification requests. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method and device for modifying attribute values, which can reduce the total processing time of batch modification requests.
[0005] In a first aspect, an embodiment of the present invention provides a method for modifying an attribute value, comprising:
[0006] In response to receiving a request for batch modification of value attribute values, obtaining a plurality of accounts to be modified;
[0007] Grouping the multiple accounts to be modified to obtain multiple account groups;
[0008] For each of the account groups: determining the value attribute value locking information of the account group according to the value attribute value modification information of each account to be modified in the account group; and performing locking processing on the account group according to the value attribute value locking information of the account group;
[0009] For each account to be modified: modifying the value attribute value of the account to be modified according to the value attribute value modification information of the account to be modified;
[0010] According to the processing result of the account to be modified, unlocking processing is performed on each account group.
[0011] Optionally, determining the value attribute value locking information of the account group according to the value attribute value modification information of each account to be modified in the account group includes:
[0012] Determine the accumulated value attribute value information according to the value attribute value modification information of each account to be modified in the account group;
[0013] The value attribute value locking information of the account group is determined according to the value attribute value accumulation information.
[0014] Optionally, the locking information of the value attribute value of the account group and locking the account group includes:
[0015] According to the value attribute value locking information of the account group, generating the value attribute locking record and the value attribute remaining record of the account group in the database;
[0016] The value attribute locking record is locked.
[0017] Optionally, the unlocking process for each account group according to the processing result of the account to be modified includes:
[0018] Determining actual modification information of the account group according to the processing results of each account to be modified in the account group;
[0019] Modify the value attribute locking record of the account group according to the actual modification information;
[0020] In response to the value attribute value corresponding to the modified value attribute record being not 0, the modified value attribute record is unlocked, and the unlocked value attribute record and the remaining value attribute record are merged into the value attribute record of the account group.
[0021] Optionally, determining actual modification information of the account group according to the processing result of each account to be modified in the account group includes:
[0022] Determine each successfully modified account in the account group, wherein the processing result of the successfully modified account indicates that the modification is successful;
[0023] The actual modification information of the account group is determined according to the modification information of the value attribute value of each successfully modified account.
[0024] Optionally, obtaining multiple accounts to be modified includes:
[0025] Obtain the account group corresponding to the value attribute value batch modification request;
[0026] Finding an account corresponding to the account group, wherein the status information of the account indicates that the account has not been modified;
[0027] The found account is determined as the account to be modified.
[0028] Optionally, searching for an account corresponding to the account group includes:
[0029] According to the processing priority, searching for the account corresponding to the account group;
[0030] After modifying the value attribute value of each account to be modified according to the value attribute value modification information of the account to be modified, the method further includes:
[0031] In response to the processing result of the account to be modified indicating that modification has failed, the processing priority of the account to be modified is lowered.
[0032] In a second aspect, an embodiment of the present invention provides a device for modifying an attribute value, including:
[0033] An account acquisition module, configured to acquire a plurality of accounts to be modified in response to receiving a batch modification request for value attribute values;
[0034] A grouping module, used for grouping the multiple accounts to be modified to obtain multiple account groups;
[0035] A locking module is used for: for each of the account groups: determining the value attribute value locking information of the account group according to the value attribute value modification information of each account to be modified in the account group; and performing locking processing on the account group according to the value attribute value locking information of the account group;
[0036] A modification module, for each of the accounts to be modified: modifying the value attribute value of the account to be modified according to the value attribute value modification information of the account to be modified;
[0037] The unlocking module is used to perform unlocking processing on each of the account groups according to the processing result of the account to be modified.
[0038] Optionally, the locking module is specifically used for:
[0039] Determine the accumulated value attribute value information according to the value attribute value modification information of each account to be modified in the account group;
[0040] The value attribute value locking information of the account group is determined according to the value attribute value accumulation information.
[0041] Optionally, the locking module is specifically used for:
[0042] According to the value attribute value locking information of the account group, generating the value attribute locking record and the value attribute remaining record of the account group in the database;
[0043] The value attribute locking record is locked.
[0044] Optionally, the unlocking module is specifically used for:
[0045] Determining actual modification information of the account group according to the processing results of each account to be modified in the account group;
[0046] Modify the value attribute locking record of the account group according to the actual modification information;
[0047] In response to the value attribute value corresponding to the modified value attribute record being not 0, the modified value attribute record is unlocked, and the unlocked value attribute record and the remaining value attribute record are merged into the value attribute record of the account group.
[0048] Optionally, the locking module is specifically used for:
[0049] Determine each successfully modified account in the account group, wherein the processing result of the successfully modified account indicates that the modification is successful;
[0050] The actual modification information of the account group is determined according to the modification information of the value attribute value of each successfully modified account.
[0051] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0052] one or more processors;
[0053] a storage device for storing one or more programs,
[0054] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.
[0055] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the above embodiments.
[0056] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which implements the method described in any of the above embodiments when executed by a processor.
[0057] One embodiment of the above invention has the following advantages or beneficial effects: before modifying the value attribute value of each account to be modified in the account group, the value attribute value locking information of the account group is determined according to the value attribute value modification information of each account to be modified in the account group, and the account group is locked. After modifying the value attribute value of each account to be modified in the account group, the account group is unlocked according to the processing result of each account to be modified. Therefore, for multiple accounts to be modified from the same account group in the same batch, it is only necessary to perform the locking process and unlocking process on the account group once, so that batch modification of multiple accounts to be modified can be achieved, thereby reducing the total processing time of batch modification requests.
[0058] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0060] Figure 1 is a flowchart of a method for modifying an attribute value provided by the first embodiment of the present invention;
[0061] Figure 2 is a flow chart of a method for modifying an attribute value provided by a second embodiment of the present invention;
[0062] Figure 3 is a flow chart of a method for modifying an attribute value provided by a third embodiment of the present invention;
[0063] Figure 4 is a structural schematic diagram of a property value modification device provided by an embodiment of the present invention;
[0064] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0065] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0066] It should be noted that in the technical solution of the present invention, the collection, analysis, use, transmission, storage and other aspects of user personal information involved are in compliance with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken for user personal information to prevent illegal access to such personal information data, ensure that persons who have access to personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. Once these user personal information data are no longer needed, the risks should be minimized by limiting or even prohibiting data collection and / or deleting data.
[0067] Figure 1 is a flow chart of a method for modifying an attribute value provided by the first embodiment of the present invention. Figure 1 As shown, the method includes:
[0068] Step 101: In response to receiving a request for batch modification of value attribute values, a plurality of accounts to be modified are obtained.
[0069] Batch modification requests for value attribute values can be generated for application scenarios such as batch distribution of red envelopes, batch distribution of discount coupons, and batch deduction of expenses. Batch modification requests for value attribute values include: multiple accounts to be modified and value attribute value modification information for each account to be modified. According to the value attribute value modification information for each account to be modified, the value attribute value of each account to be modified is modified.
[0070] Step 102: Group multiple accounts to be modified to obtain multiple account groups.
[0071] According to business needs, multiple account groups can be preset in the system, and each account group includes multiple accounts to be modified. Account groups can be used to control the income and expenditure of the value attribute values of all user accounts in the same group.
[0072] Step 103: For each account group: determine the value attribute value locking information of the account group according to the value attribute value modification information of each account to be modified in the account group; and lock the account group according to the value attribute value locking information of the account group.
[0073] According to the value attribute value modification information of each account to be modified in the account group, the value attribute value accumulation information is determined; according to the value attribute value accumulation information, the value attribute value locking information of the account group is determined.
[0074] The value attribute value modification information of the account to be modified is used to modify the value attribute value of the account to be modified. The value attribute value modification information of the account to be modified can be: increase by 0.5 yuan, decrease by 2 yuan, increase by 5 yuan, etc.
[0075] The accumulated value attribute value information is the statistical information based on the value attribute value modification information of each account to be modified in the account group. If there are 3 accounts to be modified in the account group, and the value attribute value modification information of these 3 accounts to be modified is: increase 5 yuan, increase 12 yuan, and decrease 1 yuan, then the accumulated value attribute value information is: increase 16 yuan, and the value attribute value locking information of the account group is: deduction 16 yuan.
[0076] Step 104: For each account to be modified: modify the value attribute value of the account to be modified according to the value attribute value modification information of the account to be modified.
[0077] According to the value attribute value modification information of the account to be modified, the value attribute value of the account to be modified is modified, that is, the value attribute value of the account to be modified is increased or decreased by the amount corresponding to the value attribute value modification information.
[0078] Corresponding to different application scenarios, the red envelope amount or coupon amount can be added to the personal wallet of the account to be modified, or the amount corresponding to the value attribute value modification information can be deducted from the personal wallet of the account to be modified.
[0079] Step 105: According to the processing result of the account to be modified, unlock each account group.
[0080] The processing result of the account to be modified may include: successful processing or failed processing. According to the processing result of the account to be modified, the account group is unlocked. While processing the batch modification request of the value attribute value, the consistency of the value attribute value change of the account group is ensured. The account group after unlocking can continue to respond to subsequent processing requests.
[0081] In an embodiment of the present invention, before modifying the value attribute value of each to-be-modified account in the account group, the value attribute value locking information of the account group is determined according to the value attribute value modification information of each to-be-modified account in the account group, and the account group is locked. After modifying the value attribute value of each to-be-modified account in the account group, the account group is unlocked according to the processing result of each to-be-modified account. Therefore, for multiple to-be-modified accounts from the same account group in the same batch, it is only necessary to perform the locking process and unlocking process on the account group once, so that batch modification of multiple to-be-modified accounts can be achieved, thereby reducing the total processing time of batch modification requests.
[0082] In addition, if the batch modification requests for the value attribute values of the same account group require a long processing time, when each processing request is waiting for the lock to be released, more database connections are occupied at the same time. Since the total number of database connections is limited, other transactions and tasks may not be able to obtain database connections. After reducing the processing time of the batch modification requests for the value attribute values, the solution described in the present invention will also reduce the corresponding time of occupying database connections, thereby speeding up the rotation of database connections.
[0083] Figure 2 is a flow chart of a method for modifying an attribute value provided by the second embodiment of the present invention. Figure 2 As shown, the method includes:
[0084] Step 201: In response to receiving a request for batch modification of value attribute values, a plurality of accounts to be modified are obtained.
[0085] Step 202: Group multiple accounts to be modified to obtain multiple account groups.
[0086] Step 203: for each account group: according to the value attribute value modification information of each account to be modified in the account group, determine the value attribute value locking information of the account group.
[0087] Step 204: Generate the value attribute locking record and value attribute remaining record of the account group in the database according to the value attribute value locking information of the account group.
[0088] According to the value attribute value locking information, the value attribute records of the account group in the database are split into the value attribute locking records of the account group and the value attribute remaining records.
[0089] For example, if the value attribute record of the account group in the database is 100 yuan, and the value attribute value locking information of the account group is: deduct 16 yuan, then the value attribute locking record and value attribute remaining record of the account group are generated in the database. Among them, the value attribute value in the value attribute locking record is 16 yuan, and the value attribute value in the value attribute remaining record is 84 yuan.
[0090] Step 205: Lock the value attribute lock record.
[0091] The value attribute lock records in the database are locked to ensure the consistency of value attribute value changes of account groups during the processing of batch modification requests for value attribute values.
[0092] The remaining records of the value attribute are not locked and are used to process other processing requests for the account group.
[0093] Step 206: For each account to be modified: modify the value attribute value of the account to be modified according to the value attribute value modification information of the account to be modified.
[0094] Step 207: According to the processing result of the account to be modified, the value attribute locking record of the account group is modified.
[0095] Since there may be cases where the modification process fails, it is necessary to determine the actual modification information of the account group based on the processing results of each account to be modified in the account group. Then, based on the actual modification information, the value attribute lock record of the account group is modified.
[0096] In one embodiment of the present invention, actual modification information of the account group is determined based on the processing results of each account to be modified in the account group, including: determining each successfully modified account in the account group, the processing result of the successfully modified account represents a successful modification; and determining the actual modification information of the account group based on the value attribute value modification information of each successfully modified account.
[0097] Step 208: In response to the value attribute value corresponding to the modified value attribute record being not 0, the modified value attribute record is unlocked, and the unlocked value attribute record and the remaining value attribute records are merged into the value attribute record of the account group.
[0098] The actual modification information is the statistical information of the value attribute value modification information of each account to be modified that has been successfully processed in the account group.
[0099] For example, there are 5 accounts to be modified in the account group, 2 accounts to be modified failed to process, and 3 accounts to be modified successfully. The value attribute value modification information of the 2 accounts to be modified that failed to process is: increase 8 yuan, increase 20 yuan. The value attribute value modification information of the 3 accounts to be modified that succeeded is: increase 5.5 yuan, increase 10 yuan, decrease 0.8 yuan, then the value attribute value cumulative information is: increase 42.7 (8 + 20 + 5.5 + 10-0.8) yuan, the value attribute value locking information of the account group is: deduction 42.7 yuan, and the actual modification information is: increase 14.7 (5.5 + 10-0.8) yuan.
[0100] If the value attribute record of the account group in the database is 100 yuan, then according to the value attribute value locking information of the account group, the value attribute value in the generated value attribute locking record is 42.7 yuan, and the value attribute value in the value attribute remaining record is 57.3 yuan.
[0101] Then, according to the actual modification information: 14.7 yuan is added, and the value attribute lock record of the account group is modified. The value attribute value in the modified value attribute lock record is 42.7-14.7=28 yuan. The unlocked value attribute record and the remaining value attribute record are merged into the value attribute record of the account group. The value attribute value in the merged value attribute record is: 28+57.3=85.3.
[0102] It should be noted that in the process of processing batch modification requests for value attribute values, the remaining value attribute records are also used to process other processing requests for the account group. Therefore, before merging the value attribute records of the account group, the value attribute values in the remaining value attribute records are likely to have changed, and the latest remaining value attribute records and the unlocked value attribute records need to be merged into the value attribute records of the account group.
[0103] In an embodiment of the present invention, the value attribute value locking information of the account group is determined based on the value attribute value modification information of each account to be modified in the account group, and the value attribute locking record and the value attribute remaining record of the account group are generated in the database. The value attribute locking record is used to process batch modification requests for value attribute values and ensure the consistency of value attribute value changes of the account group. The value attribute remaining record is used to process other processing requests for the account group. Therefore, the solution of the embodiment of the present invention can not only improve the execution efficiency of batch processing requests, but also reduce the adverse effects on other applications during the execution of batch processing requests.
[0104] Figure 3 is a flow chart of a method for modifying an attribute value provided by the third embodiment of the present invention. Figure 3 As shown, the method includes:
[0105] Step 301: In response to receiving a value attribute value batch modification request, obtaining the account group corresponding to the value attribute value batch modification request.
[0106] Step 302: searching for an account corresponding to the account group, where the status information of the account indicates that the account has not been modified; and determining the found account as an account to be modified.
[0107] Step 303: Group the multiple accounts to be modified to obtain multiple account groups.
[0108] Step 304: for each account group: determine the value attribute value locking information of the account group according to the value attribute value modification information of each account to be modified in the account group; and lock the account group according to the value attribute value locking information of the account group.
[0109] Step 305: For each account to be modified: modify the value attribute value of the account to be modified according to the value attribute value modification information of the account to be modified.
[0110] In one embodiment of the present invention, searching for accounts corresponding to the account grouping includes: searching for accounts corresponding to the account grouping according to the processing priority; modifying the value attribute value of each account to be modified according to the value attribute value modification information of the account to be modified, and further includes: in response to the processing result of the account to be modified indicating that the modification has failed, lowering the processing priority of the account to be modified.
[0111] Set the preset priority corresponding to the value attribute value batch modification request, find the account corresponding to the account group, and the account processing priority is not less than the preset priority. The found account is used as the account to be modified. If the processing result of the account to be modified indicates that the modification failed, the processing priority of the account to be modified is lowered. The processing priority after the reduction is lower than the preset priority to avoid re-execution of modification processing on the account that failed to be processed, thereby improving the success rate of batch execution.
[0112] Step 306: According to the processing result of the account to be modified, unlock each account group.
[0113] In an embodiment of the present invention, the account group corresponding to the value attribute value batch modification request is obtained, and the account group may correspond to a region, a preferential activity, a customer group, etc. The account corresponding to the account group is searched, and the found account is determined as the account to be modified. The solution of the embodiment of the present invention can set the account group corresponding to the value attribute value batch modification request according to business needs, and flexibly perform batch modification on user accounts of different activities or customer groups.
[0114] To make the solution of the embodiment of the present invention easier to understand, a specific embodiment is described below using batch distribution of red envelopes as a business scenario and preferential activities as account grouping. The solution may include the following process:
[0115] S01: Receive a batch modification request for value attribute values, which is used to issue red envelopes in batches. In the data acquisition stage, select the promotional activities that meet the issuance conditions. Then, according to the promotional activity number, search the partition corresponding to the machine to obtain the account to be modified. The account to be modified is the account waiting for the red envelope to be issued. Each batch task obtains a preset number of account data to be modified.
[0116] S02: Generate a whitelist of accounts to be modified based on the preset number of account data to be modified. Group the accounts to be modified in the whitelist according to the promotion number. Count the corresponding public wallets for each promotion and the total amount of red envelopes to be issued for the promotion in this batch.
[0117] S03: Lock the amount of the public wallet for investment, and the locked amount is the pre-calculated total amount of red envelopes issued in this batch.
[0118] S04: Process each red envelope issued under the promotion activity one by one. For red envelopes that fail to be issued, the priority of the corresponding account to be modified will be lowered. For red envelopes that are successfully issued, the red envelope amount will be credited to the personal wallet.
[0119] S05: Summarize the total amount of red envelopes successfully distributed under the promotion, and deduct the pre-locked amount, the deduction amount is the total amount of red envelopes successfully distributed.
[0120] S06: If the deducted amount is less than the locked amount, the locked amount is unlocked. The red envelope distribution of this batch is completed.
[0121] In the embodiment of the present invention, priority management is implemented for whitelist data to avoid repeated execution of red envelope issuance operations for user accounts that have failed to be processed, thereby improving the success rate of red envelope issuance. The red envelope amounts of accounts in the same promotional activity are summarized, and a locking, deduction, and unlocking mode is adopted to avoid a large number of lock requests for the public wallet in a short period of time, thereby improving the performance of batch issuance of red envelopes.
[0122] Figure 4 is a schematic diagram of a structure of a property value modification device provided by an embodiment of the present invention. Figure 4 As shown, the device comprises:
[0123] An account acquisition module 401 is used to acquire multiple accounts to be modified in response to receiving a value attribute value batch modification request;
[0124] A grouping module 402 is used to group multiple accounts to be modified to obtain multiple account groups;
[0125] The locking module 403 is used for: for each account group, determining the value attribute value locking information of the account group according to the value attribute value modification information of each account to be modified in the account group; and performing locking processing on the account group according to the value attribute value locking information of the account group;
[0126] The modification module 404 is used for modifying the value attribute value of each account to be modified according to the value attribute value modification information of the account to be modified;
[0127] The unlocking module 405 is used to perform unlocking processing on each account group according to the processing result of the account to be modified.
[0128] Optionally, the locking module 403 is specifically used for:
[0129] Determine the accumulated value attribute value information according to the value attribute value modification information of each account to be modified in the account group;
[0130] According to the accumulated information of the value attribute values, the value attribute value locking information of the account group is determined.
[0131] Optionally, the locking module 403 is specifically used for:
[0132] According to the value attribute value locking information of the account group, the value attribute locking record and the value attribute remaining record of the account group are generated in the database;
[0133] Lock the value attribute lock record.
[0134] Optionally, the unlocking module 405 is specifically used for:
[0135] According to the processing results of each account to be modified in the account group, the actual modification information of the account group is determined;
[0136] According to the actual modification information, modify the value attribute lock record of the account group;
[0137] In response to the value attribute value corresponding to the modified value attribute record being not 0, the modified value attribute record is unlocked, and the unlocked value attribute record and the remaining value attribute record are merged into the value attribute record of the account group.
[0138] Optionally, the locking module 405 is specifically used for:
[0139] Determine each successfully modified account in the account group, and the processing result of the successfully modified account indicates that the modification is successful;
[0140] The actual modification information of the account group is determined based on the value attribute value modification information of each successfully modified account.
[0141] Optionally, the account acquisition module 401 is specifically used for:
[0142] Get the account group corresponding to the value attribute value batch modification request;
[0143] Find the account corresponding to the account group. The account status information indicates that the account has not been modified.
[0144] The found account is determined as the account to be modified.
[0145] Optionally, the account acquisition module 401 is specifically used for:
[0146] Find the accounts corresponding to the account group according to the processing priority;
[0147] The modification module 404 is further used to:
[0148] In response to the processing result of the account to be modified indicating that the modification has failed, the processing priority of the account to be modified is lowered.
[0149] An embodiment of the present invention provides an electronic device, including:
[0150] one or more processors;
[0151] a storage device for storing one or more programs,
[0152] When one or more programs are executed by one or more processors, the one or more processors implement the method of any of the above embodiments.
[0153] An embodiment of the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the enterprise risk assessment method in the embodiment of the present invention is implemented.
[0154] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0155] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0156] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0157] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0158] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0159] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0160] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, they may be described as: an account acquisition module, a grouping module, a locking module, a modification module, and an unlocking module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the account acquisition module may also be described as "a module for acquiring multiple accounts to be modified in response to receiving a batch modification request for value attribute values".
[0161] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0162] In response to receiving a request for batch modification of value attribute values, obtaining a plurality of accounts to be modified;
[0163] Grouping the multiple accounts to be modified to obtain multiple account groups;
[0164] For each of the account groups: determining the value attribute value locking information of the account group according to the value attribute value modification information of each account to be modified in the account group; and performing locking processing on the account group according to the value attribute value locking information of the account group;
[0165] For each account to be modified: modifying the value attribute value of the account to be modified according to the value attribute value modification information of the account to be modified;
[0166] According to the processing result of the account to be modified, unlocking processing is performed on each account group.
[0167] According to the technical solution of the embodiment of the present invention, before modifying the value attribute value of each account to be modified in the account group, the value attribute value locking information of the account group is determined according to the value attribute value modification information of each account to be modified in the account group, and the account group is locked. After modifying the value attribute value of each account to be modified in the account group, the account group is unlocked according to the processing result of each account to be modified. Therefore, for multiple accounts to be modified from the same account group in the same batch, it is only necessary to perform the locking process and unlocking process on the account group once, so that batch modification of multiple accounts to be modified can be achieved, thereby reducing the total processing time of batch modification requests.
[0168] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for modifying an attribute value, characterized in that: include: In response to receiving a request for batch modification of value attribute values, obtaining a plurality of accounts to be modified; Grouping the multiple accounts to be modified to obtain multiple account groups; For each of the account groups: determining the value attribute value locking information of the account group according to the value attribute value modification information of each account to be modified in the account group; Locking the account group according to the value attribute value locking information of the account group; For each account to be modified: modifying the value attribute value of the account to be modified according to the value attribute value modification information of the account to be modified; According to the processing result of the account to be modified, unlocking processing is performed on each account group.
2. The method according to claim 1, characterized in that The step of determining the value attribute value locking information of the account group according to the value attribute value modification information of each account to be modified in the account group includes: Determine the accumulated value attribute value information according to the value attribute value modification information of each account to be modified in the account group; The value attribute value locking information of the account group is determined according to the value attribute value accumulation information.
3. The method according to claim 1, characterized in that The locking information according to the value attribute value of the account group and locking the account group includes: According to the value attribute value locking information of the account group, generating the value attribute locking record and the value attribute remaining record of the account group in the database; The value attribute locking record is locked.
4. The method according to claim 3, characterized in that: The unlocking process for each account group according to the processing result of the account to be modified includes: Determining actual modification information of the account group according to the processing results of each account to be modified in the account group; Modify the value attribute locking record of the account group according to the actual modification information; In response to the value attribute value corresponding to the modified value attribute record being not 0, the modified value attribute record is unlocked, and the unlocked value attribute record and the remaining value attribute record are merged into the value attribute record of the account group.
5. The method according to claim 4, characterized in that The determining the actual modification information of the account group according to the processing result of each account to be modified in the account group includes: Determine each successfully modified account in the account group, wherein the processing result of the successfully modified account indicates that the modification is successful; The actual modification information of the account group is determined according to the modification information of the value attribute value of each successfully modified account.
6. The method according to claim 1, characterized in that The obtaining of multiple accounts to be modified includes: Obtain the account group corresponding to the value attribute value batch modification request; Finding an account corresponding to the account group, wherein the status information of the account indicates that the account has not been modified; The found account is determined as the account to be modified.
7. The method according to claim 6, characterized in that The searching for the account corresponding to the account group includes: According to the processing priority, searching for the account corresponding to the account group; After modifying the value attribute value of each account to be modified according to the value attribute value modification information of the account to be modified, the method further includes: In response to the processing result of the account to be modified indicating that modification has failed, the processing priority of the account to be modified is lowered.
8. A device for modifying attribute value, characterized in that: include: An account acquisition module, configured to acquire a plurality of accounts to be modified in response to receiving a batch modification request for value attribute values; A grouping module, used for grouping the multiple accounts to be modified to obtain multiple account groups; A locking module, for each of the account groups: determining the value attribute value locking information of the account group according to the value attribute value modification information of each account to be modified in the account group; Locking the account group according to the value attribute value locking information of the account group; A modification module, for each of the accounts to be modified: modifying the value attribute value of the account to be modified according to the value attribute value modification information of the account to be modified; The unlocking module is used to perform unlocking processing on each of the account groups according to the processing result of the account to be modified.
9. The device according to claim 8, characterized in that The locking module is specifically used for: Determine the accumulated value attribute value information according to the value attribute value modification information of each account to be modified in the account group; The value attribute value locking information of the account group is determined according to the value attribute value accumulation information.
10. The device according to claim 8, characterized in that The locking module is specifically used for: According to the value attribute value locking information of the account group, generating the value attribute locking record and the value attribute remaining record of the account group in the database; The value attribute locking record is locked.
11. The device according to claim 10, characterized in that The unlocking module is specifically used for: Determining actual modification information of the account group according to the processing results of each account to be modified in the account group; Modify the value attribute locking record of the account group according to the actual modification information; In response to the value attribute value corresponding to the modified value attribute record being not 0, the modified value attribute record is unlocked, and the unlocked value attribute record and the remaining value attribute record are merged into the value attribute record of the account group.
12. The device according to claim 11, characterized in that The locking module is specifically used for: Determine each successfully modified account in the account group, wherein the processing result of the successfully modified account indicates that the modification is successful; The actual modification information of the account group is determined according to the modification information of the value attribute value of each successfully modified account.
13. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
14. A computer readable medium having a computer program stored thereon, characterized in that When the program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
