CN112965828B - Multithreading data processing method, device, equipment and storage medium - Google Patents

Multithreading data processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112965828B
CN112965828B CN202110150242.9A CN202110150242A CN112965828B CN 112965828 B CN112965828 B CN 112965828B CN 202110150242 A CN202110150242 A CN 202110150242A CN 112965828 B CN112965828 B CN 112965828B
Authority
CN
China
Prior art keywords
data processing
information
processing resource
account
value information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110150242.9A
Other languages
Chinese (zh)
Other versions
CN112965828A (en
Inventor
冯中杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Easy Yikang Information Technology Co ltd
Original Assignee
Beijing Easy Yikang Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Easy Yikang Information Technology Co ltd filed Critical Beijing Easy Yikang Information Technology Co ltd
Priority to CN202110150242.9A priority Critical patent/CN112965828B/en
Publication of CN112965828A publication Critical patent/CN112965828A/en
Application granted granted Critical
Publication of CN112965828B publication Critical patent/CN112965828B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/12Accounting
    • G06Q40/125Finance or payroll

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Complex Calculations (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a multithreading data processing method, a device, equipment and a storage medium, which relate to the technical field of information processing technology, wherein the method comprises the following steps: receiving a data processing request, and acquiring total amount information of data to be processed and data processing resource allowance information of each effective account to obtain initial data processing resource average value information; respectively comparing the initial data processing resource mean value information with the data processing resource allowance information of each effective account, selecting a first target account set, and recording first quantity information; judging whether the product of the initial data processing resource mean value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed; and if the product of the initial data processing resource average value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed, outputting the current data processing resource average value information of each first target account. The method and the device efficiently and accurately finish the calculation and freezing operation of the data processing resources.

Description

Multithreading data processing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing multithreaded data.
Background
Along with popularization and application of big data, the big data processing (such as data transfer) needs to be more intelligent, so that the collection, statistics and monitoring of the relevant content of the big data are very important. In the traditional database technology, when data transfer is performed, massive data needs to be processed, and because the user data in the database is huge in volume and large in dynamic change of the user data, the system database is huge in read-write pressure, high in system load and slow in calculation speed, and the data processing efficiency is low.
Based on this, how to provide a convenient and efficient data processing scheme is called a technical problem to be solved.
Disclosure of Invention
An object of an embodiment of the present application is to provide a method, an apparatus, a device, and a storage medium for processing multithreaded data, so as to efficiently and accurately complete the computation and freezing operations of data processing resources.
A first aspect of an embodiment of the present application provides a method for processing multithreaded data, including: receiving a data processing request; starting a single thread, acquiring total amount information of data to be processed in a target database and data processing resource allowance information of each effective account, dividing the total amount information of the data to be processed by the total amount of all the effective accounts to obtain initial data processing resource average value information, wherein the effective accounts are accounts which are already activated and have activation dates before the current date; enabling multiple threads, respectively and synchronously comparing the initial data processing resource average value information with the data processing resource allowance information of each effective account, selecting a first target account set with the data processing resource allowance information being greater than or equal to the initial data processing resource average value information, and recording that the total number of the first target accounts of the first target account set is first quantity information; judging whether the product of the initial data processing resource mean value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed; and if the product of the initial data processing resource average value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed, outputting the initial data processing resource average value information allocated to each first target account.
In an embodiment, if the product of the initial data processing resource average value information and the first quantity information is smaller than the total quantity information of the data to be processed, adding preset data processing resource quantity information to the initial data processing resource average value information to obtain second data processing resource average value information, and respectively comparing the second data processing resource average value information with the data processing resource allowance information of each effective account by multiple threads synchronously, selecting a second target account set of which the data processing resource allowance information is greater than or equal to the second data processing resource average value information, and recording that the total number of the second target accounts of the second target account set is second quantity information; judging whether the product of the second data processing resource mean value information and the second quantity information is larger than or equal to the total quantity information of the data to be processed, if the product of the second data processing resource mean value information and the second quantity information is smaller than the total quantity information of the data to be processed, adding the preset data processing resource quantity information to the second data processing resource mean value information to obtain third data processing resource mean value information, enabling multithreading to synchronously compare the third data processing resource mean value information with the data processing resource allowance information of each effective account respectively, selecting a third target account set with the data processing resource allowance information larger than or equal to the third data processing resource mean value information, recording that the total number of the third target accounts of the third target account set is third quantity information, judging whether the product of the third data processing resource mean value information and the third quantity information is larger than or equal to the total quantity information of the data to be processed, and circularly executing until the product of the current data processing resource mean value information and the current target quantity is larger than the total quantity information to be processed, and outputting the current data to be processed of each target account to be processed.
In one embodiment, an account information operation instruction is received; enabling a single thread to acquire the current data processing resource mean value information and the current data processing resource allowance information of each effective account in the target database according to the operation instruction; and enabling multithreading to synchronously process the data of each effective account, and limiting the current data processing resource allowance information use permission of the effective accounts according to the current data processing resource average value information.
In an embodiment, the limiting the current data processing resource allowance information usage right of the valid account according to the current data processing resource average information includes: multithreading respectively and synchronously judging whether the current data processing resource allowance information of each effective account is larger than or equal to the current data processing resource average information; and if the current data processing resource allowance information is larger than or equal to the current data processing resource average value information, closing the use permission of the effective account on part of the data processing resource information which is equal to the current data processing resource average value information in the current data processing resource allowance information, and recording permission closing information into a preset freezing table.
In an embodiment, after closing the usage rights of the valid account to the part of the current data processing resource allowance information equal to the current data processing resource average information, and recording rights closing information into a preset freeze table, the method further includes: and after a preset time period, deducting the current data processing resource mean value information from the current data processing resource allowance information of the effective account.
In an embodiment, the limiting the current data processing resource allowance information usage right of the valid account according to the current data processing resource average information further includes: if the current data processing resource allowance information is smaller than the current data processing resource average information, recording that the account state is insufficient in the data processing resource allowance information, and sending prompt information.
A second aspect of an embodiment of the present application provides a multithreaded data processing apparatus, including: the first receiving module is used for receiving a data processing request; the first acquisition module is used for starting a single thread, acquiring total amount information of data to be processed in a target database and data processing resource allowance information of each effective account, dividing the total amount information of the data to be processed by the total amount of all the effective accounts to obtain initial data processing resource average value information, wherein the effective accounts are accounts which are already activated and have activation dates before the current date; the first comparison module is used for starting multithreading, the multiple threads respectively and synchronously compare the initial data processing resource average value information with the data processing resource allowance information of each effective account, a first target account set with the data processing resource allowance information being greater than or equal to the initial data processing resource average value information is selected, and the total number of the first target accounts of the first target account set is recorded as first quantity information; the first judging module is used for judging whether the product of the initial data processing resource mean value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed; and the output module is used for outputting the initial data processing resource average value information allocated to each first target account if the product of the initial data processing resource average value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed.
In an embodiment, the second comparing module is configured to, if the product of the initial data processing resource average value information and the first quantity information is smaller than the total quantity information of the data to be processed, add preset data processing resource quantity information to the initial data processing resource average value information to obtain second data processing resource average value information, and synchronously compare the second data processing resource average value information with the data processing resource allowance information of each of the effective accounts respectively by multiple threads, select a second target account set in which the data processing resource allowance information is greater than or equal to the second data processing resource average value information, and record that the total number of the second target accounts in the second target account set is the second quantity information; and the second judging module is used for judging whether the product of the second data processing resource mean value information and the second quantity information is larger than or equal to the total quantity information of the data to be processed, if the product of the second data processing resource mean value information and the second quantity information is smaller than the total quantity information of the data to be processed, adding the preset data processing resource quantity information to the second data processing resource mean value information to obtain third data processing resource mean value information, enabling multithreading to synchronously compare the third data processing resource mean value information with the data processing resource allowance information of each effective account respectively, selecting a third target account set with the data processing resource allowance information larger than or equal to the third data processing resource mean value information, recording the third target account total number of the third target account set as third quantity information, judging whether the product of the third data processing resource mean value information and the third quantity information is larger than or equal to the total quantity information of the data to be processed, circularly executing until the current data processing resource mean value information and the current target account quantity information are larger than the total quantity information of the current data to be processed, and outputting the current data to be processed account information when the current account information is distributed.
In one embodiment, the multi-threaded data processing apparatus further comprises: the second receiving module is used for receiving an account information operation instruction; the second acquisition module starts a single thread to acquire the current data processing resource mean value information and the current data processing resource allowance information of each effective account in the target database according to the operation instruction; and the limiting module is used for enabling multithreading to synchronously process the data of each effective account, and limiting the current data processing resource allowance information use permission of the effective account according to the current data processing resource average value information.
In an embodiment, the limiting module is configured to synchronously determine, by using multiple threads, whether current data processing resource allowance information of each of the valid accounts is greater than or equal to the current data processing resource average information; and if the current data processing resource allowance information is larger than or equal to the current data processing resource average value information, closing the use permission of the effective account on part of the data processing resource information which is equal to the current data processing resource average value information in the current data processing resource allowance information, and recording permission closing information into a preset freezing table.
In an embodiment, the limiting module is configured to subtract the current data processing resource average information from the current data processing resource allowance information of the active account after a preset period of time.
In an embodiment, the limiting module is configured to record that the account status is insufficient for the data processing resource allowance information and send out the prompt information if the current data processing resource allowance information is smaller than the current data processing resource average information.
A third aspect of the embodiments of the present application provides an electronic device, including: a memory for storing a computer program; a processor configured to perform the method of the first aspect of the embodiments of the present application and any one of the embodiments thereof, to process the asset data.
A fourth aspect of the present application provides a non-transitory electronic device readable storage medium, comprising: a program which, when run by an electronic device, causes the electronic device to perform the method of the first aspect of the embodiments of the present application and any of the embodiments thereof.
In the embodiment of the application, the data processing resource average value information finally allocated to each target account can be calculated through a polling mode, after checking and confirming the current data processing resource average value information, the target account is frozen, then information related in the whole process of balancing the data processing resources is disclosed, after the disclosure is completed, the data processing resource average value information allocated to the target account is deducted, and meanwhile, accounts which do not meet the conditions are marked, so that the whole process of balancing the data processing resources is more efficient and accurate.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for processing multithreaded data according to an embodiment of the present application;
FIG. 3 is a flow chart of a method for processing multithreaded data according to an embodiment of the present application;
FIG. 4 is a flow chart of a method for processing multithreaded data according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a multi-threaded data processing apparatus according to an embodiment of the present application.
Icon: 100-an electronic device; 110-bus; a 120-processor; 130-memory; 600-a multi-threaded data processing device; 601-a first receiving module; 602-a first acquisition module; 603-a first comparison module; 604-a first judgment module; 605-an output module; 606-a second comparison module; 607-a second determination module; 608-a second receiving module; 609-a second acquisition module; 610-restriction module.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
In the description of the present application, the terms "first," "second," and the like are used merely for distinguishing between descriptions, and do not denote a ordinal number, nor are they to be construed as indicating or implying relative importance.
In the description of the present application, the terms "comprises," "comprising," and/or the like, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and/or groups thereof.
In the description of the present application, the terms "mounted," "disposed," "provided," "connected," and "configured" are to be construed broadly unless otherwise specifically defined and limited. For example, it may be a fixed connection, a removable connection, or a unitary construction; can be mechanically or electrically connected; either directly or indirectly, through intermediaries, or through internal communication between two devices, elements, or components. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art as the case may be.
Please refer to fig. 1, which is a schematic diagram of an electronic device 100 according to an embodiment of the present application, including at least one processor 120 and a memory 130, and one processor is illustrated in fig. 1. The processor 120 and the memory 130 are connected by a bus 110, the memory 130 storing instructions executable by the at least one processor 120, the instructions being executable by the at least one processor 120 to cause the at least one processor 120 to perform a multi-threaded data processing method as in the embodiments described below.
In one embodiment, processor 120 may be a general-purpose processor including, but not limited to, a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc., a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, and the processor 120 is a control center of the electronic device 100, connecting various parts of the entire electronic device 100 using various interfaces and lines. The processor 120 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application.
In one embodiment, memory 130 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, including, but not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), static random access Memory (Static Random Access Memory, SRAM for short), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), and the like.
In one embodiment, the electronic device 100 may also communicate with one or more external devices, such as a keyboard, mouse, bluetooth device, pointing device, etc., so that an account may interact with the electronic device 100.
The structure of the electronic device 100 shown in fig. 1 is merely illustrative, and the electronic device 100 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
As shown in fig. 2, a method for processing multi-threaded data according to an embodiment of the present application, which may be performed by the electronic device 100 shown in fig. 1, includes the following steps:
Step 210: a data processing request is received.
Step 220: starting a single thread, acquiring total amount information of data to be processed in a target database and data processing resource allowance information of each effective account, and calculating to obtain initial data processing resource average value information.
In this step, for example, data processing resource allowance information data of the effective account is sequentially loaded into the memory from the target database at a speed of 10 ten thousand pieces each time until the number of loaded data pieces is less than 10 ten thousand pieces, the total amount information of the data to be processed is the total amount information of the data to be processed which is scheduled to be deducted in this period minus the upper balance resource amount information, the initial data processing resource average value information is equal to the data processing resource average value information, the data processing resource average value information is equal to the total amount information of the data to be processed divided by the total amount of all the effective accounts, and the preset data processing resource amount information is accumulated. The preset data processing resource amount information may be 1 minute, 2 minutes, 3 minutes, or other numbers, and in this embodiment, the preset data processing resource amount information is 1 minute.
An active account is an account whose account status is already active and whose activation date is prior to the current date.
Step 230: and enabling multiple threads, respectively and synchronously comparing the initial data processing resource average value information with the data processing resource allowance information of each effective account, selecting a target account set with the data processing resource allowance information being greater than or equal to the initial data processing resource average value information, and recording the number of the target accounts.
In this step, the total number of accounts is obtained by accumulating while the loaded data is read, that is, when the initial data processing resource average value information is greater than the data processing resource allowance information of the effective accounts, the number of target accounts is increased by 1, and when the data processing resource allowance information of each effective account is compared with the initial data processing resource average value information, the accumulated number of target accounts is the total number of accounts which can participate in the task.
Step 240: and judging whether the product of the initial data processing resource average value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed.
In this step, if the product of the initial data processing resource average information and the number of the first number information is greater than or equal to the total amount information of the data to be processed, step 250 is entered; if the product of the initial data processing resource average information and the number of target accounts is smaller than the total amount information of the data to be processed, step 220 is entered.
Step 250: and outputting the assigned initial data processing resource mean value information of each first target account.
In an embodiment, a first target account set with the data processing resource allowance information being greater than or equal to the initial data processing resource average information is selected, the total number of first target accounts of the first target account set is recorded as first quantity information, whether the product of the initial data processing resource average information and the first quantity information is greater than or equal to the total quantity information of the data to be processed is judged, if the product of the initial data processing resource average information and the first quantity information is greater than or equal to the total quantity information of the data to be processed, the current data processing resource average information of each first target account is output as the initial data processing resource average information.
If the product of the initial data processing resource average value information and the first quantity information is smaller than the total quantity information of the data to be processed, adding preset data processing resource quantity information to the initial data processing resource average value information to obtain second data processing resource average value information, respectively comparing the second data processing resource average value information with the data processing resource allowance information of each effective account, selecting a second target account set of which the data processing resource allowance information is larger than or equal to the second data processing resource average value information, and recording that the total number of second target accounts of the second target account set is the second quantity information; and then judging whether the product of the second data processing resource average value information and the second data quantity information is larger than or equal to the total quantity information of the data to be processed, and if the product of the second data processing resource average value information and the second data quantity information is smaller than the total quantity information of the data to be processed, circularly executing: and adding preset data processing resource amount information to the second data processing resource average value information to obtain third data processing resource average value information, respectively comparing the third data processing resource average value information with data processing resource allowance information of each effective account, selecting a third target account set with the data processing resource allowance information being greater than or equal to the third data processing resource average value information, recording the total number of the third target accounts of the third target account set as third quantity information, judging whether the product of the third data processing resource average value information and the third quantity information is greater than or equal to the total quantity information of the data to be processed, and circularly executing until the product of the current data processing resource average value information and the current quantity of the current target accounts is greater than the total quantity information of the data to be processed, wherein the output current data processing resource average value information is the current data processing resource average value information.
As shown in fig. 3, a method for processing multi-threaded data according to an embodiment of the present application, which may be performed by the electronic device 100 shown in fig. 1, includes the following steps:
step 310: and receiving an account information operation instruction.
In an embodiment, before implementing the step, the number of target accounts and the current data processing resource average value information of each account may be checked, and after a correct checking result is obtained, an account freezing operation is initiated to the digital resource processing system through the management background.
Step 320: and enabling a single thread to acquire the current data processing resource mean value information and the current data processing resource allowance information of each effective account in the target database.
In the step, a thread is started to sequentially load effective account data into a memory from a target database at the speed of 10 ten thousand pieces each time until the number of the loaded data is less than 10 ten thousand pieces, a plurality of threads are started, and the loaded account data are synchronously processed, wherein the account data comprise the current data processing resource allowance information of the effective account.
Step 330: the multithreading synchronously judges whether the current data processing resource allowance information of each effective account is greater than or equal to the current data processing resource average information, if yes, the step 340 is entered, and if not, the step 360 is entered.
Step 340: and limiting the current data processing resource allowance information use authority of the effective account.
In this step, limiting the current data processing resource allowance information usage right of the valid account includes: and closing the use permission of the effective account on part of data processing resource information such as the current data processing resource allowance information and the current data processing resource mean information, and recording permission closing information into a preset freezing table.
Step 350: and after the preset time period, deducting the current data processing resource mean value information from the current data processing resource allowance information of the effective account.
In this step, the preset time period may be set to one week, two weeks, half month or other time periods, and in this embodiment, the preset time period is one week, and in this preset time period, the total amount information of the data to be processed, the current data processing resource average value information of each target account, the total number of target accounts, and other data are disclosed. After the preset time period, namely after the indication is completed, if no people propose objections, the digital resource processing system automatically executes resource deduction operation at regular time, loads data in a freezing table by using a multi-path thread synchronous processing mode, deducts corresponding current data processing resource average value information from the data processing resource allowance information of each target account according to the frozen data, writes the current data processing resource average value information into a record table, and simultaneously deletes the frozen record, and the whole digital resource processing flow is finished.
Step 360: and recording the account state, namely, insufficient information of the allowance of the data processing resources and sending prompt information.
In one embodiment, an account whose account status is marked as deficient in data processing resource margin information may send a notification prompting the account to recharge, and if the account is not recharged within 30 days, the account status is modified to be withdrawn and a resource margin return is performed for the account. If the account is recharged within 30 days, the account state is changed to the active state again, and the next digital resource processing flow can be participated.
As shown in fig. 4, a multi-threaded data processing method according to an embodiment of the present application may be performed by the electronic device 100 shown in fig. 1, and includes the following steps:
step 501: a data processing request is received.
Step 502: starting a single thread, acquiring total amount information of data to be processed in a target database and data processing resource allowance information of each effective account, and calculating to obtain initial data processing resource average value information. See the description of step 220 in the above embodiments for details.
Step 503: and enabling multiple threads, respectively and synchronously comparing the initial data processing resource average value information with the data processing resource allowance information of each effective account, selecting a target account set with the data processing resource allowance information being greater than or equal to the initial data processing resource average value information, and recording the number of the target accounts. See the description of step 230 in the above embodiments for details.
Step 504: and judging whether the product of the initial data processing resource average value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed, if so, entering step 505, otherwise, entering step 502.
Step 505: and outputting the assigned initial data processing resource mean value information of each first target account. See the description of step 250 in the above embodiments for details.
Step 506: and receiving an account information operation instruction. See the description of step 310 in the above embodiments for details.
Step 507: and enabling a single thread to acquire the current data processing resource mean value information and the current data processing resource allowance information of each effective account in the target database. See the description of step 320 in the above embodiments for details.
Step 508: the multithreading synchronously determines whether the current data processing resource allowance information of each effective account is greater than or equal to the current data processing resource average information, if yes, step 509 is entered, otherwise step 511 is entered.
Step 509: and limiting the current data processing resource allowance information use authority of the effective account. See for details the description of step 340 in the above embodiments.
Step 510: and after the preset time period, deducting the current data processing resource mean value information from the current data processing resource allowance information of the effective account. See the description of step 350 in the above embodiments for details.
Step 511: and recording the account state, namely, insufficient information of the allowance of the data processing resources and sending prompt information. See the description of step 360 in the above embodiments for details.
In this step, if the account status is that the effective account with insufficient data processing resource allowance information is not recharged within the first preset period, the account status is modified to be withdrawn and the resource allowance is returned to the effective account, and if the account status is that the effective account with insufficient data processing resource allowance information is recharged within the first preset period, the account status is changed to be activated to participate in the next digital resource processing.
The multithread data processing method solves the problems that in the past, the resource allowance information is needed to be calculated in the daytime when frozen account data processing, when the account has the actions of recharging, exiting and the like, the resource allowance in the account can change at any time, and the calculation is inaccurate; the problem of high read-write pressure of the target database is solved; meanwhile, the problems of high load and low calculation speed of the digital resource processing system because of the need of large amount of calculation are solved.
Referring to fig. 5, a multi-threaded data processing apparatus 600 according to an embodiment of the present application, which is applicable to the electronic device 100 shown in fig. 1, includes: the principle relationships of the first receiving module 601, the first obtaining module 602, the first comparing module 603, the first judging module 604, the output module 605, the second comparing module 606, the second judging module 607, the second receiving module 608, the second obtaining module 609 and the limiting module 610 are as follows:
The first receiving module 601 is configured to receive a data processing request, and refer to the description of step 210 in the above embodiment in detail.
The first obtaining module 602 is configured to enable a single thread, obtain total amount information of data to be processed in the target database and data processing resource allowance information of each valid account, and divide the total amount information of the data to be processed by total amount of all valid accounts to obtain initial data processing resource average value information, where the valid accounts are accounts that have been activated and have an activation date before the current date, which is described in detail in the above embodiment for step 220.
The first comparing module 603 is configured to compare the initial data processing resource average information with the data processing resource allowance information of each effective account, select a first target account set with the data processing resource allowance information greater than or equal to the initial data processing resource average information, and record that the total number of the first target accounts of the first target account set is the first number information, which is described in detail in the above embodiment for step 230.
A first judging module 604, configured to enable multithreading, judge whether the product of the initial data processing resource average value information and the first quantity information is greater than or equal to the total quantity information of the data to be processed, if the product of the initial data processing resource average value information and the first quantity information is smaller than the total quantity information of the data to be processed, add the preset data processing resource quantity information to the initial data processing resource average value information to obtain second data processing resource average value information, respectively compare the second data processing resource average value information with the data processing resource allowance information of each effective account, select a second target account set in which the data processing resource allowance information is greater than or equal to the second data processing resource average value information, and record that the total number of second target accounts of the second target account set is the second quantity information; enabling multithreading, judging whether the product of the second data processing resource average value information and the second quantity information is larger than or equal to the total quantity information of the data to be processed, and if the product of the second data processing resource average value information and the second quantity information is smaller than the total quantity information of the data to be processed, circularly executing: and adding preset data processing resource amount information to the second data processing resource average value information to obtain third data processing resource average value information, respectively comparing the third data processing resource average value information with data processing resource allowance information of each effective account, selecting a third target account set with the data processing resource allowance information being greater than or equal to the third data processing resource average value information, recording the total number of the third target accounts of the third target account set as third number information, starting multithreading, judging whether the product of the third data processing resource average value information and the third number information is greater than or equal to the total number information of the data to be processed, and circularly executing until the product of the current data processing resource average value information and the current number of the current target account is greater than the total number information of the data to be processed, wherein the output current data processing resource average value information is the current data processing resource average value information.
The output module 605 is configured to output the current data processing resource average information of each first target account as the initial data processing resource average information if the product of the initial data processing resource average information and the first quantity information is greater than or equal to the total quantity information of the data to be processed, which is described in detail in the above embodiment as step 250.
And the second comparing module 606 is configured to, if the product of the initial data processing resource average value information and the first quantity information is smaller than the total quantity information of the data to be processed, add the preset data processing resource quantity information to the initial data processing resource average value information to obtain second data processing resource average value information, and make multiple threads synchronously compare the second data processing resource average value information with the data processing resource allowance information of each effective account, select a second target account set in which the data processing resource allowance information is greater than or equal to the second data processing resource average value information, and record that the total number of the second target accounts of the second target account set is the second quantity information.
The second determining module 607 is configured to determine whether the product of the second data processing resource mean value information and the second quantity information is greater than or equal to the total quantity information of the data to be processed, if the product of the second data processing resource mean value information and the second quantity information is less than the total quantity information of the data to be processed, add the preset data processing resource quantity information to the second data processing resource mean value information to obtain third data processing resource mean value information, enable multithreading to synchronously compare the third data processing resource mean value information with the data processing resource allowance information of each effective account respectively, select a third target account set with the data processing resource allowance information greater than or equal to the third data processing resource mean value information, record the total number of the third target accounts of the third target account set as third quantity information, determine whether the product of the third data processing resource mean value information and the third quantity information is greater than or equal to the total quantity information of the data to be processed, and circularly execute until the product of the current data processing resource mean value information and the current quantity of the current target account is greater than the total quantity information of the data to be processed, and output the current data processing resource mean value information allocated to each current target account.
The second receiving module 608 receives the account information freeze request, see the description of step 310 in the above embodiment for details.
The second obtaining module 609 obtains the current data processing resource average information in the target database and the current data processing resource allowance information of each valid account, which is described in detail in the above embodiment for step 320.
The limiting module 610 limits, for each of the valid accounts, the current data processing resource allowance information usage rights of the valid account according to the current data processing resource average information. In one embodiment, the limiting module 610 is configured to determine whether the current data processing resource remaining information of each of the valid accounts is greater than or equal to the current data processing resource average information, respectively, when the multithreading is enabled; if the current data processing resource allowance information is larger than or equal to the current data processing resource average value information, closing the use permission of the effective account on part of the data processing resource information, such as the current data processing resource allowance information, which is equal to the current data processing resource average value information, and recording permission closing information into a preset freezing table; after a preset time period, deducting the current data processing resource average value information from the current data processing resource allowance information of the effective account; if the current data processing resource allowance information is smaller than the current data processing resource average value information, recording that the account state is insufficient in the data processing resource allowance information, and sending out prompt information.
The embodiment of the invention also provides an electronic device readable storage medium, which comprises: a program which, when run on an electronic device, causes the electronic device to perform all or part of the flow of the method in the above-described embodiments. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a Flash Memory (Flash Memory), a Hard Disk (HDD), or a Solid State Drive (SSD), etc. The storage medium may also comprise a combination of memories of the kind described above.
In the several embodiments provided in the present application, the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s).
In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, or the like, which would occur to one skilled in the art, are intended to be included within the spirit and principles of the present application.

Claims (10)

1. A method of multithreaded data processing, comprising:
receiving a data processing request;
starting a single thread, acquiring total amount information of data to be processed in a target database and data processing resource allowance information of each effective account, dividing the total amount information of the data to be processed by the total amount of all the effective accounts to obtain initial data processing resource average value information, wherein the effective accounts are accounts which are already activated and have activation dates before the current date;
enabling multiple threads, respectively and synchronously comparing the initial data processing resource average value information with the data processing resource allowance information of each effective account, selecting a first target account set with the data processing resource allowance information being greater than or equal to the initial data processing resource average value information, and recording that the total number of the first target accounts of the first target account set is first quantity information;
judging whether the product of the initial data processing resource mean value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed;
outputting the initial data processing resource average information allocated to each first target account if the product of the initial data processing resource average information and the first quantity information is larger than or equal to the total quantity information of the data to be processed;
Checking the number of the target accounts and the current data processing resource mean value information of each account, and initiating account freezing operation to the digital resource processing system through the management background after a correct checking result is obtained.
2. The method as recited in claim 1, further comprising:
if the product of the initial data processing resource average value information and the first quantity information is smaller than the total quantity information of the data to be processed, adding preset data processing resource quantity information to the initial data processing resource average value information to obtain second data processing resource average value information, respectively synchronously comparing the second data processing resource average value information with the data processing resource allowance information of each effective account by a plurality of threads, selecting a second target account set of which the data processing resource allowance information is larger than or equal to the second data processing resource average value information, and recording that the total number of the second target accounts of the second target account set is second quantity information;
judging whether the product of the second data processing resource mean value information and the second quantity information is larger than or equal to the total quantity information of the data to be processed, if the product of the second data processing resource mean value information and the second quantity information is smaller than the total quantity information of the data to be processed, adding the preset data processing resource quantity information to the second data processing resource mean value information to obtain third data processing resource mean value information, enabling multithreading to synchronously compare the third data processing resource mean value information with the data processing resource allowance information of each effective account respectively, selecting a third target account set with the data processing resource allowance information larger than or equal to the third data processing resource mean value information, recording that the total number of the third target accounts of the third target account set is third quantity information, judging whether the product of the third data processing resource mean value information and the third quantity information is larger than or equal to the total quantity information of the data to be processed, and circularly executing until the product of the current data processing resource mean value information and the current target quantity is larger than the total quantity information to be processed, and outputting the current data to be processed of each target account to be processed.
3. The method as recited in claim 2, further comprising:
receiving an account information operation instruction;
enabling a single thread to acquire the current data processing resource mean value information and the current data processing resource allowance information of each effective account in the target database according to the operation instruction;
and enabling multithreading to synchronously process the data of each effective account, and limiting the current data processing resource allowance information use permission of the effective accounts according to the current data processing resource average value information.
4. The method of claim 3, wherein limiting the current data processing resource balance information usage rights of the valid account based on the current data processing resource mean information comprises:
multithreading respectively and synchronously judging whether the current data processing resource allowance information of each effective account is larger than or equal to the current data processing resource average information;
and if the current data processing resource allowance information is larger than or equal to the current data processing resource average value information, closing the use permission of the effective account on part of the data processing resource information which is equal to the current data processing resource average value information in the current data processing resource allowance information, and recording permission closing information into a preset freezing table.
5. The method according to claim 4, wherein after closing the usage rights of the valid account to the part of the current data processing resource allowance information equal to the current data processing resource average information, and recording rights closing information into a preset freeze table, further comprising:
and after a preset time period, deducting the current data processing resource mean value information from the current data processing resource allowance information of the effective account.
6. The method of claim 4, wherein limiting current data processing resource balance information usage rights of the valid account according to the current data processing resource mean information, further comprises:
if the current data processing resource allowance information is smaller than the current data processing resource average information, recording that the account state is insufficient in the data processing resource allowance information, and sending prompt information.
7. A multi-threaded data processing apparatus, comprising:
the first receiving module is used for receiving a data processing request;
the first acquisition module is used for starting a single thread, acquiring total amount information of data to be processed in a target database and data processing resource allowance information of each effective account, dividing the total amount information of the data to be processed by the total amount of all the effective accounts to obtain initial data processing resource average value information, wherein the effective accounts are accounts which are already activated and have activation dates before the current date;
The first comparison module is used for starting multithreading, the multiple threads respectively and synchronously compare the initial data processing resource average value information with the data processing resource allowance information of each effective account, a first target account set with the data processing resource allowance information being greater than or equal to the initial data processing resource average value information is selected, and the total number of the first target accounts of the first target account set is recorded as first quantity information;
the first judging module is used for judging whether the product of the initial data processing resource mean value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed;
the output module is used for outputting the initial data processing resource average value information allocated to each first target account if the product of the initial data processing resource average value information and the first quantity information is larger than or equal to the total quantity information of the data to be processed;
the second receiving module is used for checking the number of the target accounts and the current data processing resource mean value information of each account, and after a correct checking result is obtained, the account freezing operation is initiated to the digital resource processing system through the management background.
8. The apparatus as recited in claim 7, further comprising:
the second comparison module is used for adding preset data processing resource amount information to the initial data processing resource average information to obtain second data processing resource average information if the product of the initial data processing resource average information and the first amount information is smaller than the total amount information of the data to be processed, and a plurality of threads respectively and synchronously compare the second data processing resource average information with the data processing resource allowance information of each effective account, select a second target account set of which the data processing resource allowance information is greater than or equal to the second data processing resource average information, and record that the total number of the second target accounts of the second target account set is second amount information;
and the second judging module is used for judging whether the product of the second data processing resource mean value information and the second quantity information is larger than or equal to the total quantity information of the data to be processed, if the product of the second data processing resource mean value information and the second quantity information is smaller than the total quantity information of the data to be processed, adding the preset data processing resource quantity information to the second data processing resource mean value information to obtain third data processing resource mean value information, enabling multithreading to synchronously compare the third data processing resource mean value information with the data processing resource allowance information of each effective account respectively, selecting a third target account set with the data processing resource allowance information larger than or equal to the third data processing resource mean value information, recording the third target account total number of the third target account set as third quantity information, judging whether the product of the third data processing resource mean value information and the third quantity information is larger than or equal to the total quantity information of the data to be processed, circularly executing until the current data processing resource mean value information and the current target account quantity information are larger than the total quantity information of the current data to be processed, and outputting the current data to be processed account information when the current account information is distributed.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor to perform the method of any one of claims 1 to 6 to process asset data.
10. A non-transitory electronic device-readable storage medium, comprising: program which, when run by an electronic device, causes the electronic device to perform the method of any one of claims 1 to 6.
CN202110150242.9A 2021-02-03 2021-02-03 Multithreading data processing method, device, equipment and storage medium Active CN112965828B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110150242.9A CN112965828B (en) 2021-02-03 2021-02-03 Multithreading data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110150242.9A CN112965828B (en) 2021-02-03 2021-02-03 Multithreading data processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112965828A CN112965828A (en) 2021-06-15
CN112965828B true CN112965828B (en) 2024-03-19

Family

ID=76274441

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110150242.9A Active CN112965828B (en) 2021-02-03 2021-02-03 Multithreading data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112965828B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427604A (en) * 2018-02-06 2018-08-21 华为技术有限公司 Resource adjusting method, device and the cloud platform of cluster
CN109685642A (en) * 2018-11-16 2019-04-26 北京三快在线科技有限公司 Credit card method for processing resource, device, electronic equipment and storage medium
CN111105146A (en) * 2019-12-02 2020-05-05 网联清算有限公司 Method, device and equipment for allocating resources to multiple accounts
CN111240841A (en) * 2020-01-10 2020-06-05 支付宝(杭州)信息技术有限公司 Method and system for executing new task or processing resource revocation request
CN111966757A (en) * 2020-10-20 2020-11-20 支付宝(杭州)信息技术有限公司 Method and device for managing storage space of intelligent contract account
CN112232809A (en) * 2020-09-24 2021-01-15 支付宝(杭州)信息技术有限公司 Data management method, device and equipment for frozen account and storage medium
US10896430B1 (en) * 2018-11-21 2021-01-19 Coupa Software Incorporated Detecting supplier fraud from digital transactional data

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8943504B2 (en) * 2012-04-20 2015-01-27 Qualcomm Incorporated Tracking and releasing resources placed on a deferred unlock list at the end of a transaction
US10506641B2 (en) * 2016-01-04 2019-12-10 Bank Of America Corporation Resource optimization allocation system
CN106097023B (en) * 2016-07-01 2018-03-27 腾讯科技(深圳)有限公司 A kind of data processing method and device
US20190391980A1 (en) * 2018-06-26 2019-12-26 Live Nation Entertainment, Inc. Systems methods and apparatus for generation of a database object

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427604A (en) * 2018-02-06 2018-08-21 华为技术有限公司 Resource adjusting method, device and the cloud platform of cluster
CN109685642A (en) * 2018-11-16 2019-04-26 北京三快在线科技有限公司 Credit card method for processing resource, device, electronic equipment and storage medium
US10896430B1 (en) * 2018-11-21 2021-01-19 Coupa Software Incorporated Detecting supplier fraud from digital transactional data
CN111105146A (en) * 2019-12-02 2020-05-05 网联清算有限公司 Method, device and equipment for allocating resources to multiple accounts
CN111240841A (en) * 2020-01-10 2020-06-05 支付宝(杭州)信息技术有限公司 Method and system for executing new task or processing resource revocation request
CN112232809A (en) * 2020-09-24 2021-01-15 支付宝(杭州)信息技术有限公司 Data management method, device and equipment for frozen account and storage medium
CN111966757A (en) * 2020-10-20 2020-11-20 支付宝(杭州)信息技术有限公司 Method and device for managing storage space of intelligent contract account

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
云环境下面向多租赁的虚拟资源分配关键技术研究;苑迎;中国博士学位论文电子期刊网;第41-61页 *
基于相对资源量的集群系统的研究与实现;潘文高 等;现代计算机(14);第1-8页 *
多用户操作系统避免死锁的矩阵搜索法;徐秀娟;机电工程技术;20040715(07);第34-36页 *

Also Published As

Publication number Publication date
CN112965828A (en) 2021-06-15

Similar Documents

Publication Publication Date Title
US9418348B2 (en) Automatic task assignment system
CN104811344A (en) Network dynamic service monitoring method and apparatus
CN110659137B (en) Processing resource allocation method and system for offline tasks
CN108459905B (en) Resource pool capacity planning method and server
CN106126384B (en) A kind of method and device of acquisition performance monitoring unit PMU event
CN106707187B (en) Method and device for determining target SOC of battery
CN112488745A (en) Intelligent charge control management method, device, equipment and storage medium
WO2023029753A1 (en) Device power supply method and apparatus, terminal device and storage medium
CN108228679B (en) Time series data metering method and time series data metering device
CN112965828B (en) Multithreading data processing method, device, equipment and storage medium
CN109992408B (en) Resource allocation method, device, electronic equipment and storage medium
US11200547B2 (en) Payment collection control method and device, server, and computer-readable storage medium
CN113835626A (en) Method and device for determining usable time of disk
CN110222016B (en) File processing method and device
CN109597706B (en) Detection method, device and system for checking difference data
CN111414295A (en) CPU occupancy rate statistical method, device, equipment and medium
US20180108057A1 (en) Prepaid utility metering with complex rates using advanced metering infrastructure (ami) smart meters
CN110674214B (en) Big data synchronization method, device, computer equipment and storage medium
CN114048231A (en) Data processing method, device and computer program product
CN110083624B (en) Stream data processing method, stream data processing apparatus, and computer medium
CN113409147A (en) Account data processing method and device, electronic equipment and storage medium
CN112613945A (en) Method, device, equipment and storage medium for determining lease plan
CN110300000A (en) Charging mode variation, device, electronic equipment and readable storage medium storing program for executing
CN114598705B (en) Message load balancing method, device, equipment and medium
CN112435049B (en) Account checking data processing method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: Room 716, 7 / F, building 2, 28 Andingmen East Street, Dongcheng District, Beijing

Applicant after: Beijing Easy Yikang Information Technology Co.,Ltd.

Address before: Room 716, 7 / F, building 2, 28 Andingmen East Street, Dongcheng District, Beijing

Applicant before: BEIJING QINGSONGCHOU INFORMATION TECHNOLOGY Co.,Ltd.

Country or region before: China

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant