CN111062792A - Method, device, equipment and storage medium for regulating and controlling limit - Google Patents

Method, device, equipment and storage medium for regulating and controlling limit Download PDF

Info

Publication number
CN111062792A
CN111062792A CN201911307888.2A CN201911307888A CN111062792A CN 111062792 A CN111062792 A CN 111062792A CN 201911307888 A CN201911307888 A CN 201911307888A CN 111062792 A CN111062792 A CN 111062792A
Authority
CN
China
Prior art keywords
limit
parameter
quota
amount
updating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911307888.2A
Other languages
Chinese (zh)
Inventor
翟兴东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201911307888.2A priority Critical patent/CN111062792A/en
Publication of CN111062792A publication Critical patent/CN111062792A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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

Landscapes

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

Abstract

The invention discloses a method, a device, equipment and a storage medium for regulating and controlling a limit, wherein the method comprises the steps of obtaining relevant field information of a target product in a limit updating instruction through a server, and determining a target latitude parameter in a latitude information group corresponding to the target product in a Redis database according to the relevant field information; and the server carries out serial processing on the limit updating operation in the limit updating instruction based on the Redis database, and correspondingly updates the deducible limit corresponding to the target latitude parameter of the target product and the product deducible total limit according to the deducible limit when the deducible limit corresponding to the target latitude parameter is not less than the deducible limit. The invention is based on the Redis database, realizes the multi-latitude line control of the product, realizes the serial execution of line operation during concurrency, improves the flexibility of the line control of the product, and improves the control accuracy of the line of the product and the execution efficiency of a service system.

Description

Method, device, equipment and storage medium for regulating and controlling limit
Technical Field
The invention relates to the technical field of financial technology (Fintech), in particular to a method, a device and equipment for regulating and controlling an amount and a computer readable storage medium.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech), but higher requirements are also put forward on the technologies due to the requirements of the financial industry on safety and real-time performance. At present, a plurality of products or subsystems are always used in a business system of a financial institution, and the products or subsystems in the current situation are generally set with responding resources according to actual needs, such as a development subsystem, capacity resources and system resources are set according to the actual needs of the subsystems, products are developed, and quota resources are set according to the actual needs of the products.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a computer readable storage medium for regulating and controlling a quota, and aims to solve the technical problem that the service is easily influenced or interrupted due to faults when the existing service system is in high concurrency.
In order to achieve the above object, the present invention provides a method for regulating and controlling an amount, which is applied to an amount regulating and controlling system, wherein the amount regulating and controlling system comprises a terminal, a Redis database and a server, and the method for regulating and controlling the amount comprises the following steps:
the server acquires relevant field information of a target product in an amount updating instruction when receiving the amount updating instruction sent by the terminal, and determines a target latitude parameter in a latitude information group corresponding to the target product in the Redis database according to the relevant field information;
the server carries out serial processing on the line updating operation in the line updating instruction based on the Redis database, and compares a deductible line corresponding to the line updating operation with a deductible line corresponding to the target latitude parameter;
and when the deductible amount corresponding to the target latitude parameter is not less than the deductible amount, the server updates the deductible amount corresponding to the target latitude parameter of the target product according to the deductible amount, and correspondingly updates the deductible total amount of the product corresponding to the target product.
Optionally, the latitude information group includes a first amount parameter, a second amount parameter, or a third amount parameter, and the step of acquiring, by the server, related field information of a target product in an amount update instruction when receiving the amount update instruction sent by the terminal, and determining a target latitude parameter in the latitude information group corresponding to the target product in the Redis database according to the related field information specifically includes:
the server acquires relevant field information of a target product in the limit updating instruction when receiving the limit updating instruction sent by the terminal;
and the server determines a target latitude parameter according to a first limit parameter, a second limit parameter or a third limit parameter corresponding to the target product according to the relevant field information based on a preset script program in the Redis database.
Optionally, the method for regulating and controlling the amount further includes:
when the server receives the limit configuration instruction, determining a product to be configured and a product limit parameter corresponding to the latitude information group to be configured in the limit configuration instruction;
judging whether the sum of the first quota parameter and/or the sum of the second quota parameter in the latitude information group to be configured is matched with the third quota parameter in the latitude information group to be configured;
and if the sum of the first quota parameter and/or the sum of the second quota parameter in the latitude information group to be configured is matched with the third quota parameter in the latitude information group to be configured, updating the latitude information of the product to be configured and the corresponding quota information according to the product quota parameter corresponding to the latitude information group to be configured.
Optionally, the method for regulating and controlling the amount further includes:
the server acquires a first quota allocation parameter, a second quota allocation parameter and/or a third quota allocation parameter of the target product when receiving a quota leveling instruction;
comparing the first quota allocation parameter, the second quota allocation parameter and/or the third quota allocation parameter with the allocation quota in a preset quota allocation table, and determining the difference value of the corresponding first quota parameter, the difference value of the second quota parameter and/or the difference value of the third quota parameter;
and correspondingly updating the deducible limit corresponding to the latitude information group of the target product in the Redis database according to the difference of the first limit parameter, the difference of the second limit parameter and/or the difference of the third limit parameter.
Optionally, the step of performing, by the server, serial processing on the credit update operation in the credit update instruction based on the Redis database, and comparing the deductible credit corresponding to the credit update operation with the deductible credit corresponding to the target latitude parameter specifically includes:
the server carries out serial processing on the line updating operation in the line updating instruction and sequentially stores the line updating operation to the Redis database;
adding corresponding operation identifiers to the amount updating operation based on the terminal identifiers, the operation types and the operation triggering time corresponding to the amount updating operation, wherein the same type of amount updating operation triggered by the same terminal in a preset time interval based on the same product corresponds to the same operation identifier;
and comparing the deductible limit corresponding to the limit updating operation with the deductible limit corresponding to the target latitude parameter when no repeated operation identification exists in the limit updating operation.
Optionally, the adding, based on the terminal identifier, the operation type, and the operation trigger time corresponding to the credit line updating operation, the corresponding operation identifier to the credit line updating operation, where after the step of the same terminal corresponding to the same operation identifier to the credit line updating operation of the same type triggered within a preset time interval based on the same product, the method further includes:
and when repeated operation identifiers exist in the quota updating operation, the server deletes quota updating operation corresponding to the repeated operation identifiers in the Redis database.
Optionally, the method for regulating and controlling the amount further includes:
the server judges whether the quota allocation type of the target product belongs to a time interval type;
and if the quota configuration type of the target product belongs to the time interval type, updating the quota of the latitude information group corresponding to the target product according to a preset quota reestablishing rule and the current time.
Optionally, after the step of serially processing, by the server, the credit update operation in the credit update instruction based on the Redis database, and comparing the deductible credit corresponding to the credit update operation with the deductible credit corresponding to the target latitude parameter, the method further includes:
and when the deductible amount corresponding to the target latitude parameter is smaller than the deductible amount, the server returns a reminding message of insufficient amount.
In addition, in order to achieve the above object, the present invention further provides an amount regulating and controlling device, where the amount regulating and controlling method is applied to an amount regulating and controlling system, the amount regulating and controlling system includes a terminal, a Redis database, and a server, and the amount regulating and controlling device includes:
a target latitude parameter confirmation module, configured to, when the server receives a line update instruction sent by the terminal, obtain relevant field information of a target product in the line update instruction, and determine a target latitude parameter in a latitude information group corresponding to the target product in the Redis database according to the relevant field information;
a deduction limit comparison module, configured to perform serial processing on the limit updating operation in the limit updating instruction by the server based on the Redis database, and compare a deduction limit corresponding to the limit updating operation with a deductible limit corresponding to the target latitude parameter;
and the limit deduction updating module is used for updating the deductible limit corresponding to the target latitude parameter of the target product according to the deductive limit when the deductible limit corresponding to the target latitude parameter is not less than the deductive limit, and correspondingly updating the deductible total limit corresponding to the target product.
Optionally, the latitude information group includes a first quota parameter, a second quota parameter or a third quota parameter, and the target latitude parameter confirmation module specifically includes:
the line field acquisition unit is used for acquiring related field information of a target product in the line updating instruction when the server receives the line updating instruction sent by the terminal;
and the target latitude parameter determining unit is used for determining a target latitude parameter by the server according to a first quota parameter, a second quota parameter or a third quota parameter corresponding to the target product according to the relevant field information based on a preset script program in the Redis database.
Optionally, the limit control device further includes a configured limit checking module, and the configured limit checking module is configured to:
when the server receives the limit configuration instruction, determining a product to be configured and a product limit parameter corresponding to the latitude information group to be configured in the limit configuration instruction;
judging whether the sum of the first quota parameter and/or the sum of the second quota parameter in the latitude information group to be configured is matched with the third quota parameter in the latitude information group to be configured;
and if the sum of the first quota parameter and/or the sum of the second quota parameter in the latitude information group to be configured is matched with the third quota parameter in the latitude information group to be configured, updating the latitude information of the product to be configured and the corresponding quota information according to the product quota parameter corresponding to the latitude information group to be configured.
Optionally, the limit regulation and control device further comprises a limit leveling module, and the limit leveling module is used for:
the server acquires a first quota allocation parameter, a second quota allocation parameter and/or a third quota allocation parameter of the target product when receiving a quota leveling instruction;
comparing the first quota allocation parameter, the second quota allocation parameter and/or the third quota allocation parameter with the allocation quota in a preset quota allocation table, and determining the difference value of the corresponding first quota parameter, the difference value of the second quota parameter and/or the difference value of the third quota parameter;
and correspondingly updating the deducible limit corresponding to the latitude information group of the target product in the Redis database according to the difference of the first limit parameter, the difference of the second limit parameter and/or the difference of the third limit parameter.
Optionally, the deduction amount comparing module specifically includes:
the concurrent operation serial unit is used for the server to serially process the quota updating operation in the quota updating instruction and sequentially store the quota updating operation to the Redis database;
the serial number adding unit is used for adding the corresponding operation identifier to the amount updating operation based on the terminal identifier, the operation type and the operation triggering time corresponding to the amount updating operation, wherein the same type of amount updating operation triggered by the same product in a preset time interval corresponds to the same operation identifier by the same terminal;
the updating amount comparison unit is used for comparing the deductive amount corresponding to the amount updating operation with the deductible amount corresponding to the target latitude parameter when no repeated operation identification exists in the amount updating operation;
and the repeated operation deleting unit is used for deleting the quota updating operation corresponding to the repeated operation identification in the Redis database when the server has the repeated operation identification in the quota updating operation.
In addition, to achieve the above object, the present invention further provides an amount regulating device, including: the system comprises a memory, a processor and an amount regulation program which is stored on the memory and can run on the processor, wherein the amount regulation program realizes the steps of the amount regulation method when being executed by the processor.
In addition, in order to achieve the above object, the present invention further provides a computer readable storage medium, where an amount regulating program is stored on the computer readable storage medium, and when the amount regulating program is executed by a processor, the method of regulating the amount as described above is implemented.
The invention provides a limit regulation and control method, which is applied to a limit regulation and control system, wherein the limit regulation and control system comprises a terminal, a Redis database and a server, and the limit regulation and control method comprises the following steps: the server acquires relevant field information of a target product in an amount updating instruction when receiving the amount updating instruction sent by the terminal, and determines a target latitude parameter in a latitude information group corresponding to the target product in the Redis database according to the relevant field information; the server carries out serial processing on the line updating operation in the line updating instruction based on the Redis database, and compares a deductible line corresponding to the line updating operation with a deductible line corresponding to the target latitude parameter; and when the deductible amount corresponding to the target latitude parameter is not less than the deductible amount, the server updates the deductible amount corresponding to the target latitude parameter of the target product according to the deductible amount, and correspondingly updates the deductible total amount of the product corresponding to the target product. Through the mode, the method and the system disclosed by the invention realize the multi-latitude line control of the product based on the Redis database, realize the serial execution of line operation in the concurrent process, improve the flexibility of the line control of the product, improve the control accuracy of the line of the product, improve the execution efficiency of a service system, prevent normal services from being influenced or from being interrupted due to faults, and solve the technical problem that the service is easily influenced or interrupted due to faults when the conventional service system is in high concurrency.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for regulating a quota of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The limit regulation and control equipment of the embodiment of the invention can be a PC or server equipment.
As shown in fig. 1, the credit regulating device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include an operating system, a network communication module, a user interface module, and an amount adjustment program therein.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting a Redis database and performing data communication with the Redis database; the user interface 1003 is mainly used for connecting a client (terminal) and performing data communication with the terminal; the processor 1001 may be configured to call the value limit adjusting program stored in the memory 1005, and perform the following operation of the value limit adjusting method.
Based on the hardware structure, the embodiment of the limit regulation and control method is provided.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the method for regulating and controlling the amount of the present invention, the method for regulating and controlling the amount of the present invention is applied to an amount regulating and controlling system, the amount regulating and controlling system includes a terminal, a Redis database and a server, and the method for regulating and controlling the amount of the present invention includes:
step S10, when receiving the limit updating instruction sent by the terminal, the server acquires the relevant field information of the target product in the limit updating instruction, and determines the target latitude parameter in the latitude information group corresponding to the target product in the Redis database according to the relevant field information;
at present, a plurality of products or subsystems are always used in a business system of a financial institution, and the products or subsystems in the current situation are generally set with responding resources according to actual needs, such as a development subsystem, capacity resources and system resources are set according to the actual needs of the subsystems, products are developed, and quota resources are set according to the actual needs of the products.
In this embodiment, the service system is described as an example of super-recruitment during high concurrency, based on the Redis database, multi-latitude line control of a product is realized, serial execution of line operation during concurrency is realized, flexibility of line control of the product is improved, control accuracy of the line of the product is improved, service execution efficiency of the service system is improved, and normal service is prevented from being affected or interrupted due to faults. Specifically, the server obtains the relevant field information of the target product in the limit updating instruction, such as other (product sharing limit), chnl _ id: other (second limit parameter, i.e. channel sharing limit) or chnl _ id: co _ no1 (first limit parameter, i.e. institution-specific limit), and the like, when receiving the limit updating instruction triggered by the terminal when the user purchases the product. And determining a current target latitude parameter to be updated in the latitude information group corresponding to the target product according to the relevant field information in the limit updating instruction. The Redis is a memory database, the latitude information group comprises a first limit parameter, namely an organization-specific limit, a second limit parameter, namely a channel sharing limit, or a third limit parameter, namely a product total limit, and the target latitude parameter can comprise one or more of an organization-specific limit, a channel sharing limit or a product total limit.
Further, the step S10 specifically includes:
the server acquires relevant field information of a target product in the limit updating instruction when receiving the limit updating instruction sent by the terminal;
and the server determines a target latitude parameter according to a first limit parameter, a second limit parameter or a third limit parameter corresponding to the target product according to the relevant field information based on a preset script program in the Redis database.
In this embodiment, the preset script program may be a Lua script program, where the Lua is a script language and can be executed at the Redis server. The method comprises the steps of writing a general query method through a Lua script in advance, loading the Lua script to a server of a Redis database, and executing commands in the Lua script through the Redis. And (3) inputting a query operation type parameter (such as "C") into the Lua script, and executing a corresponding query quota operation. Specifically, the parameter in the limit updating command can be compared with the parameter corresponding to the mechanism-specific limit, the channel sharing limit or the product total limit, so as to determine the target latitude parameter corresponding to the limit updating operation. The interface of the quota of the target product can be obtained through GetQuotaData function encapsulation in the Lua script, then the quota can be obtained through 3-layer logic, firstly, a first latitude quota, namely an organization-specific quota, is inquired through an hget inquiry command, when a cooper (a first quota parameter, namely an organization-specific quota) cannot be obtained, namely the target product does not have the organization-specific quota, a second latitude quota parameter, namely a channel shared quota, is obtained, and if no channel shared quota exists, a third latitude rod shared quota, namely a product total quota, is obtained.
Step S20, the server carries out serial processing on the line updating operation in the line updating instruction based on the Redis database, and compares the deductible line corresponding to the line updating operation with the deductible line corresponding to the target latitude parameter;
in this embodiment, when receiving a concurrent quota updating instruction, the server obtains a concurrent quota updating operation in the quota updating instruction, sequentially adds the quota updating operation to the Redis database, and sequentially performs serial processing according to quota updating operations sequentially arranged in the Redis database. When the limit updating operation is processed, namely before the limit of the target product is updated, the deductive limit corresponding to each limit updating operation is compared with the deductible limit corresponding to the target latitude parameter of the target product.
Step S30, when the deducible limit corresponding to the target latitude parameter is not less than the deductible limit, the server updates the deductible limit corresponding to the target latitude parameter of the target product according to the deductible limit, and correspondingly updates the deducible total limit corresponding to the target product.
In this embodiment, when the deducible limit corresponding to the target latitude parameter is not less than the deducible limit, that is, the deducible latitude corresponding to the target latitude parameter of the target product, that is, the remaining limit of the target latitude parameter of the target product may complete the current limit updating operation, that is, the product sale of the current limit may be performed. And subtracting the deductible amount from the deducible latitude corresponding to the target latitude parameter of the target product, completing the updating of the deductible amount corresponding to the target latitude parameter of the target product, and updating the deductible total amount corresponding to the product corresponding to the target product. And then, according to the process, continuously updating the next quota updating operation corresponding to the quota updating instruction in the Redis database. Until the limit updating instruction is completed. Further, when the deductible amount corresponding to the target latitude parameter is smaller than the deductible amount, the server returns a reminding message of insufficient amount. That is to say, when it is detected that the deductible amount corresponding to the target latitude parameter is smaller than the deductible amount, a reminding message of insufficient amount is returned so as to remind the user that the amount of the currently purchased product is insufficient.
The embodiment provides a limit regulation and control method, which is applied to a limit regulation and control system, wherein the limit regulation and control system comprises a terminal, a Redis database and a server, and the limit regulation and control method comprises the following steps: the server acquires relevant field information of a target product in an amount updating instruction when receiving the amount updating instruction sent by the terminal, and determines a target latitude parameter in a latitude information group corresponding to the target product in the Redis database according to the relevant field information; the server carries out serial processing on the line updating operation in the line updating instruction based on the Redis database, and compares a deductible line corresponding to the line updating operation with a deductible line corresponding to the target latitude parameter; and when the deductible amount corresponding to the target latitude parameter is not less than the deductible amount, the server updates the deductible amount corresponding to the target latitude parameter of the target product according to the deductible amount, and correspondingly updates the deductible total amount of the product corresponding to the target product. Through the mode, the method and the system disclosed by the invention realize the multi-latitude line control of the product based on the Redis database, realize the serial execution of line operation in the concurrent process, improve the flexibility of the line control of the product, improve the control accuracy of the line of the product, improve the execution efficiency of a service system, prevent normal services from being influenced or from being interrupted due to faults, and solve the technical problem that the service is easily influenced or interrupted due to faults when the conventional service system is in high concurrency.
Further, a second embodiment of the method for regulating and controlling a quota of the present invention is provided based on the first embodiment of the method for regulating and controlling a quota of the present invention.
In this embodiment, the step S20 specifically includes:
the server carries out serial processing on the line updating operation in the line updating instruction and sequentially stores the line updating operation to the Redis database;
adding corresponding operation identifiers to the amount updating operation based on the terminal identifiers, the operation types and the operation triggering time corresponding to the amount updating operation, wherein the same type of amount updating operation triggered by the same terminal in a preset time interval based on the same product corresponds to the same operation identifier;
and comparing the deductible limit corresponding to the limit updating operation with the deductible limit corresponding to the target latitude parameter when no repeated operation identification exists in the limit updating operation.
And when repeated operation identifiers exist in the quota updating operation, the server deletes quota updating operation corresponding to the repeated operation identifiers in the Redis database.
In this embodiment, the credit update operation and the corresponding operation result related to credit change are recorded in the Redis database by an operation identifier, such as an operation serial number, an operation letter or other identifier, so as to prevent a user from sending multiple update operations of the same type within a preset time period, that is, prevent retransmission, and if there is a retransmission update operation, delete the retransmission data update operation according to the operation serial number, or directly return the operation result corresponding to the operation serial number. Specifically, the server serially processes the quota updating operation in the quota updating instruction, and sequentially stores the quota updating operation in the Redis database. And adding the corresponding operation serial number to the limit updating operation based on the terminal identification, the operation type and the operation triggering time corresponding to the limit updating operation, and distributing the same operation serial number to the same terminal based on the same type of limit updating operation triggered by the same product within a preset time interval. And if no repeated operation serial number exists in the quota updating operation, the quota updating operation does not exist repeated updating operation. And if the repeated operation serial number exists in the quota updating operation, the repeated updating operation exists, namely, the repeated quota updating operation is removed according to the operation serial number. And returning the operation result correspondingly stored by the operation serial number to the terminal so as to remind the user that the operation is performed and display the operation result corresponding to the operation.
In more embodiments, the Lua script has a common interface, i.e. different operation types correspond to different functions in the script. The limit inquiry refers to inquiring limits of different latitudes in Redis, the limit setting refers to setting limits of different latitudes according to the access parameters, the limit is skipped when the limit set by the product is inquired without forced updating, and the limit set by the product is covered by the latest limit when the limit set by the product is inquired by the forced updating. The quota deduction function packages an atomic operation for inquiring real-time quota and deducting quota for saving, and realizes the serialization of concurrent quota operation by utilizing the natural atomicity of the Redis server executing script. The specific updating operation is as follows: and judging whether the deductible amount of the target latitude parameter is enough, if not, returning the information of the insufficient amount, and if so, returning the success and the remaining amount after deduction. In further embodiments, the method further comprises: the credit returning operation is the operation opposite to the credit deduction and is used for credit returning after transaction withdrawal or failure. The credit line updating operation is to call the credit line deduction and credit line returning method according to the positive and negative of the transmitted credit line parameters. The operation of inquiring the product is to inquire the information of the whole latitude under the product. The automatic clearing operation sets the automatic expiration time of the product configuration amount in Redis according to the transmitted parameters.
Further, a third embodiment of the method for regulating and controlling a quota of the present invention is provided based on the second embodiment of the method for regulating and controlling a quota of the present invention.
In this embodiment, the method for regulating and controlling the amount further includes:
the server judges whether the quota allocation type of the target product belongs to a time interval type;
and if the quota configuration type of the target product belongs to the time interval type, updating the quota of the latitude information group corresponding to the target product according to a preset quota reestablishing rule and the current time.
In this embodiment, in order to configure the product quota, a quota reestablishment timing task may be preset, that is, a quota with a time interval may be reestablished at a timing according to a preset configuration. After the user sets the quota reestablishing timing task, the server is provided with a timing task, namely, whether the quota configuration type of the product belongs to the time interval type is determined according to the quota configuration record in the database quota table. If the credit allocation record of the product includes the field belonging to the time interval type, the credit allocation record of the product does not need to be rebuilt, that is, how many credits are allocated and initialized and how many credits are fixed. The time interval type comprises a single-day time interval limit, a single-day cycle limit or a cross-day interval limit and the like. And the task of rebuilding the limit of the single-day time interval is to inquire the record in the limit configuration record, compare the set time with the current time, and if the set time is reached, the limit of the product is covered as the set limit in the Redis database. If the current time belongs to the previous single-day interval, the quota rebuilding task can be skipped, for example, a plurality of single-day intervals of quota can be set to achieve the function of similarly releasing a part of quota every other hour during the activity. The cross-day interval limit rebuilding task is to set a limit which is effective for a period of time, the limit is not rebuilt in the effective period, the ending date and the ending time are judged, the limit of the product in Redis is deleted when the ending time passes, and the product is not sold to the outside any more in the mode. The task of rebuilding the single-day cyclic quota is to re-cover the configured quota of the product in the Redis database every day according to the set quota. Wherein, the covered quota can be one or more latitudes in the latitude information group.
Further, the method for regulating and controlling the amount further comprises the following steps:
when the server receives the limit configuration instruction, determining a product to be configured and a product limit parameter corresponding to the latitude information group to be configured in the limit configuration instruction;
judging whether the sum of the first quota parameter and/or the sum of the second quota parameter in the latitude information group to be configured is matched with the third quota parameter in the latitude information group to be configured;
and if the sum of the first quota parameter and/or the sum of the second quota parameter in the latitude information group to be configured is matched with the third quota parameter in the latitude information group to be configured, updating the latitude information of the product to be configured and the corresponding quota information according to the product quota parameter corresponding to the latitude information group to be configured.
In this embodiment, the product sharing quota is the total purchasing quota of the product without separately configuring the channel sharing quota and the institution dedicated quota. The channel sharing quota is a product purchasing quota without individually configuring a mechanism dedicated quota (if the channel sharing quota is not configured, the product sharing quota of the product is used). The special quota for the organization is the quota configuration of the individual organization, so the organization can only sell the quota configuration of the organization. When the user configures the product quota on the management platform page, the server can verify the configured quota according to the preset rule. Wherein the verification rule comprises: checking the product sharing amount (namely the product total amount), wherein the value of the product total amount is influenced by a scale field in product configuration, namely the sum of the sales scales of all sub-channels and sub-organizations is equal to the product total amount; and checking the channel sharing quota, wherein the channel sharing quota is the sum of the special quota of all the organizations. When the product sharing amount page edits the channel sharing amount and stores the channel sharing amount, the sharing amount value of the channel sharing amount is adjusted by default so as to meet the limitation that the sum of the amounts is equal to the total amount of the product. The credit allocation operation is to increase the credit latitude of the channel and organization for the product when the product is not opened to the outside in the initial stage of product allocation. After detecting that a user clicks a storage button on a page, a server transmits parameters into a database according to a product code, a product system, a sales channel, a cooperation mechanism, a limit type, a time interval and a sales limit input by the page, wherein the parameters comprise: optype (operation type), prod _ code (product code), prod _ sys (product belonging system), sys _ sno (system serial number), chnl (product sales channel), cooper (cooperation organization, no quota can be filled) quota (operation quota, part of operation has no quota, no quota can be filled). Here, the term "C" denotes a credit inquiry, the term "B" denotes a credit deduction, the term "U" denotes a credit update, the term "S" denotes a credit setting, the term "CS" denotes a credit setting, the term "C" does not denote a non-mandatory setting, the term "R" denotes a credit return, the term "D" denotes a credit deletion, the term "QP" denotes an inquiry product, and the term "EP" denotes an automatic clearing. Inserting or updating records in a limit configuration record table, calling a limit operation interface of a Redis database, directly inserting product limit data stored in the Redis database according to different operation types of optype, such as S, U and the like, if the limit is set in an updating way, the Redis is not available, and if the limit data in the Redis database is available, obtaining a difference value according to the data in the existing Redis database and the data in the limit configuration record table to update the data in the Redis database.
Further, the method for regulating and controlling the amount further comprises the following steps:
the server acquires a first quota allocation parameter, a second quota allocation parameter and/or a third quota allocation parameter of the target product when receiving a quota leveling instruction;
comparing the first quota allocation parameter, the second quota allocation parameter and/or the third quota allocation parameter with the allocation quota in a preset quota allocation table, and determining the difference value of the corresponding first quota parameter, the difference value of the second quota parameter and/or the difference value of the third quota parameter;
and correspondingly updating the deducible limit corresponding to the latitude information group of the target product in the Redis database according to the difference of the first limit parameter, namely the difference of the mechanism-specific limit, the difference of the second limit parameter, namely the difference of the channel sharing limit, and/or the difference of the third limit parameter, namely the difference of the total limit of the product.
In this embodiment, the amount leveling instruction is to count the sold amount of the product in real time when the amount is abnormal, that is, the sold amount includes a first amount distribution parameter, that is, the sold amount dedicated to the organization, a second amount distribution parameter, that is, the sold amount shared by the channels, and/or a third amount distribution parameter, that is, the total sold amount of the product, and compare the total sold amount with the amount set in the amount configuration record table to obtain a difference, and then compare the difference with the amount in the Redis database to obtain an abnormal data difference, and use the difference as an amount adjustment value, call the Lua script update operation, and update the corresponding amount in the Redis database in real time.
The invention also provides a limit regulation and control device, the limit regulation and control method is applied to a limit regulation and control system, the limit regulation and control system comprises a terminal, a Redis database and a server, and the limit regulation and control device comprises:
a target latitude parameter confirmation module, configured to, when the server receives a line update instruction sent by the terminal, obtain relevant field information of a target product in the line update instruction, and determine a target latitude parameter in a latitude information group corresponding to the target product in the Redis database according to the relevant field information;
a deduction limit comparison module, configured to perform serial processing on the limit updating operation in the limit updating instruction by the server based on the Redis database, and compare a deduction limit corresponding to the limit updating operation with a deductible limit corresponding to the target latitude parameter;
and the limit deduction updating module is used for updating the deductible limit corresponding to the target latitude parameter of the target product according to the deductive limit when the deductible limit corresponding to the target latitude parameter is not less than the deductive limit, and correspondingly updating the deductible total limit corresponding to the target product.
Further, the latitude information group includes a first quota parameter, a second quota parameter or a third quota parameter, and the target latitude parameter confirmation module specifically includes:
the line field acquisition unit is used for acquiring related field information of a target product in the line updating instruction when the server receives the line updating instruction sent by the terminal;
and the target latitude parameter determining unit is used for determining a target latitude parameter by the server according to the first quota parameter, the second quota parameter or the third quota parameter corresponding to the target product according to the relevant field information based on the Lua script program in the Redis database.
Further, the limit regulation and control device further comprises a limit configuration checking module, and the limit configuration checking module is used for:
when the server receives the limit configuration instruction, determining a product to be configured and a product limit parameter corresponding to the latitude information group to be configured in the limit configuration instruction;
judging whether the sum of the first quota parameter and/or the sum of the second quota parameter in the latitude information group to be configured is matched with the third quota parameter in the latitude information group to be configured;
and if the sum of the first quota parameter and/or the sum of the second quota parameter in the latitude information group to be configured is matched with the third quota parameter in the latitude information group to be configured, updating the latitude information of the product to be configured and the corresponding quota information according to the product quota parameter corresponding to the latitude information group to be configured.
Further, the limit regulation and control device further comprises a limit leveling module, and the limit leveling module is used for:
the server acquires a first quota allocation parameter, a second quota allocation parameter and/or a third quota allocation parameter of the target product when receiving a quota leveling instruction;
comparing the first quota allocation parameter, the second quota allocation parameter and/or the third quota allocation parameter with the allocation quota in a preset quota allocation table, and determining the difference value of the corresponding first quota parameter, the difference value of the second quota parameter and/or the difference value of the third quota parameter;
and correspondingly updating the deducible limit corresponding to the latitude information group of the target product in the Redis database according to the difference of the first limit parameter, the difference of the second limit parameter and/or the difference of the third limit parameter.
Further, the deduction limit comparing module specifically comprises:
the concurrent operation serial unit is used for the server to serially process the quota updating operation in the quota updating instruction and sequentially store the quota updating operation to the Redis database;
the serial number adding unit is used for adding the corresponding operation identifier to the amount updating operation based on the terminal identifier, the operation type and the operation triggering time corresponding to the amount updating operation, wherein the same type of amount updating operation triggered by the same product in a preset time interval corresponds to the same operation identifier by the same terminal;
the updating amount comparison unit is used for comparing the deductive amount corresponding to the amount updating operation with the deductible amount corresponding to the target latitude parameter when no repeated operation identification exists in the amount updating operation;
further, the deduction limit comparing module specifically further comprises: and the repeated operation deleting unit is used for deleting the quota updating operation corresponding to the repeated operation identification in the Redis database when the server has the repeated operation identification in the quota updating operation.
Further, the limit regulation and control device comprises a limit timing reestablishing module, and the limit timing reestablishing module is used for:
the server judges whether the quota allocation type of the target product belongs to a time interval type;
and if the quota configuration type of the target product belongs to the time interval type, updating the quota of the latitude information group corresponding to the target product according to a preset quota reestablishing rule and the current time.
Further, the limit regulation and control device specifically includes the insufficient limit and reminds the module, the insufficient limit reminds the module to be used for:
and when the deductible amount corresponding to the target latitude parameter is smaller than the deductible amount, the server returns a reminding message of insufficient amount.
The method executed by each program module can refer to each embodiment of the limit control method of the present invention, and is not described herein again.
The invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention stores an amount control program, and the amount control program implements the steps of the amount control method when executed by the processor.
The method implemented when the quota regulating program running on the processor is executed may refer to each embodiment of the quota regulating method of the present invention, and will not be described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. A method for regulating and controlling the limit is characterized in that the method is applied to a limit regulating and controlling system, the limit regulating and controlling system comprises a terminal, a Redis database and a server, and the method for regulating and controlling the limit comprises the following steps:
the server acquires relevant field information of a target product in an amount updating instruction when receiving the amount updating instruction sent by the terminal, and determines a target latitude parameter in a latitude information group corresponding to the target product in the Redis database according to the relevant field information;
the server carries out serial processing on the line updating operation in the line updating instruction based on the Redis database, and compares a deductible line corresponding to the line updating operation with a deductible line corresponding to the target latitude parameter;
and when the deductible amount corresponding to the target latitude parameter is not less than the deductible amount, the server updates the deductible amount corresponding to the target latitude parameter of the target product according to the deductible amount, and correspondingly updates the deductible total amount of the product corresponding to the target product.
2. The method for controlling limit of claim 1, wherein the latitude information group includes a first limit parameter, a second limit parameter or a third limit parameter, the server obtains relevant field information of a target product in the limit updating instruction when receiving the limit updating instruction sent by the terminal, and the step of determining the target latitude parameter in the latitude information group corresponding to the target product in the Redis database according to the relevant field information specifically includes:
the server acquires relevant field information of a target product in the limit updating instruction when receiving the limit updating instruction sent by the terminal;
and the server determines a target latitude parameter according to a first limit parameter, a second limit parameter or a third limit parameter corresponding to the target product according to the relevant field information based on a preset script program in the Redis database.
3. The method for regulating and controlling the quota of claim 2, wherein the method for regulating and controlling the quota further comprises:
when the server receives the limit configuration instruction, determining a product to be configured and a product limit parameter corresponding to the latitude information group to be configured in the limit configuration instruction;
judging whether the sum of the first quota parameter and/or the sum of the second quota parameter in the latitude information group to be configured is matched with the third quota parameter in the latitude information group to be configured;
and if the sum of the first quota parameter and/or the sum of the second quota parameter in the latitude information group to be configured is matched with the third quota parameter in the latitude information group to be configured, updating the latitude information of the product to be configured and the corresponding quota information according to the product quota parameter corresponding to the latitude information group to be configured.
4. The method for regulating and controlling the quota of claim 2, wherein the method for regulating and controlling the quota further comprises:
the server acquires a first quota allocation parameter, a second quota allocation parameter and/or a third quota allocation parameter of the target product when receiving a quota leveling instruction;
comparing the first quota allocation parameter, the second quota allocation parameter and/or the third quota allocation parameter with the allocation quota in a preset quota allocation table, and determining the difference value of the corresponding first quota parameter, the difference value of the second quota parameter and/or the difference value of the third quota parameter;
and correspondingly updating the deducible limit corresponding to the latitude information group of the target product in the Redis database according to the difference of the first limit parameter, the difference of the second limit parameter and/or the difference of the third limit parameter.
5. The method for regulating and controlling the amount of money according to claim 1, wherein the step of the server serially processing the amount updating operation in the amount updating instruction based on the Redis database and comparing the deductible amount corresponding to the amount updating operation with the deductible amount corresponding to the target latitude parameter specifically comprises:
the server carries out serial processing on the line updating operation in the line updating instruction and sequentially stores the line updating operation to the Redis database;
adding corresponding operation identifiers to the amount updating operation based on the terminal identifiers, the operation types and the operation triggering time corresponding to the amount updating operation, wherein the same type of amount updating operation triggered by the same terminal in a preset time interval based on the same product corresponds to the same operation identifier;
and comparing the deductible limit corresponding to the limit updating operation with the deductible limit corresponding to the target latitude parameter when no repeated operation identification exists in the limit updating operation.
6. The method for regulating and controlling the amount of money according to claim 5, wherein the step of adding the corresponding operation identifier to the amount updating operation based on the terminal identifier, the operation type and the operation triggering time corresponding to the amount updating operation further comprises, after the step of adding the same operation identifier to the same type of amount updating operation triggered by the same terminal within a preset time interval based on the same product, the step of adding the corresponding operation identifier to the same type of amount updating operation corresponding to the same product:
and when repeated operation identifiers exist in the quota updating operation, the server deletes quota updating operation corresponding to the repeated operation identifiers in the Redis database.
7. The method for regulating and controlling the quota of claim 1, the method for regulating and controlling the quota further comprising the steps of:
the server judges whether the quota allocation type of the target product belongs to a time interval type;
and if the quota configuration type of the target product belongs to the time interval type, updating the quota of the latitude information group corresponding to the target product according to a preset quota reestablishing rule and the current time.
8. The method for controlling the amount of money according to any one of claims 1-7, wherein the server serially processes the amount updating operation in the amount updating instruction based on the Redis database, and after the step of comparing the deductible amount corresponding to the amount updating operation with the deductible amount corresponding to the target latitude parameter, the method further comprises:
and when the deductible amount corresponding to the target latitude parameter is smaller than the deductible amount, the server returns a reminding message of insufficient amount.
9. The limit regulation and control device is characterized in that the limit regulation and control method is applied to a limit regulation and control system, the limit regulation and control system comprises a terminal, a Redis database and a server, and the limit regulation and control device comprises:
a target latitude parameter confirmation module, configured to, when the server receives a line update instruction sent by the terminal, obtain relevant field information of a target product in the line update instruction, and determine a target latitude parameter in a latitude information group corresponding to the target product in the Redis database according to the relevant field information;
a deduction limit comparison module, configured to perform serial processing on the limit updating operation in the limit updating instruction by the server based on the Redis database, and compare a deduction limit corresponding to the limit updating operation with a deductible limit corresponding to the target latitude parameter;
and the limit deduction updating module is used for updating the deductible limit corresponding to the target latitude parameter of the target product according to the deductive limit when the deductible limit corresponding to the target latitude parameter is not less than the deductive limit, and correspondingly updating the deductible total limit corresponding to the target product.
10. An amount regulation and control device, characterized in that the amount regulation and control device comprises: a memory, a processor and a credit regulating program stored in the memory and operable on the processor, wherein the credit regulating program when executed by the processor implements the steps of the credit regulating method of any one of claims 1 to 8.
11. A computer-readable storage medium, wherein the computer-readable storage medium has an amount control program stored thereon, and the amount control program, when executed by a processor, implements the steps of the amount control method according to any one of claims 1 to 8.
CN201911307888.2A 2019-12-17 2019-12-17 Method, device, equipment and storage medium for regulating and controlling limit Pending CN111062792A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911307888.2A CN111062792A (en) 2019-12-17 2019-12-17 Method, device, equipment and storage medium for regulating and controlling limit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911307888.2A CN111062792A (en) 2019-12-17 2019-12-17 Method, device, equipment and storage medium for regulating and controlling limit

Publications (1)

Publication Number Publication Date
CN111062792A true CN111062792A (en) 2020-04-24

Family

ID=70302249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911307888.2A Pending CN111062792A (en) 2019-12-17 2019-12-17 Method, device, equipment and storage medium for regulating and controlling limit

Country Status (1)

Country Link
CN (1) CN111062792A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111899088A (en) * 2020-06-23 2020-11-06 四川新网银行股份有限公司 Accurate asset limit calculation method under high-concurrency data flow field scene

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111899088A (en) * 2020-06-23 2020-11-06 四川新网银行股份有限公司 Accurate asset limit calculation method under high-concurrency data flow field scene

Similar Documents

Publication Publication Date Title
CN108259553B (en) Service mail sending method and terminal equipment
CN110309051B (en) Method, system, equipment and storage medium for managing test cases
CN108492005B (en) Project data processing method and device, computer equipment and storage medium
US20210224252A1 (en) Method and device for segmenting list, storage medium and terminal
US9697042B2 (en) Extensibility of business process and application logic
CN108475268A (en) intellectual property document management system
CN111510468B (en) Scheduling method and device of computing task, server and computing system
US11315133B2 (en) System and method for minimizing latency in data consumption system
CN105184943A (en) Appointment number arranging method and device
CN109710665A (en) Report downloading method, apparatus, equipment and readable storage medium storing program for executing
CN113032398B (en) Service processing method, computer equipment and storage medium for multi-type service
CN108646965B (en) Service line processing method, terminal device and medium
CN111045932A (en) Business system simulation processing method and device, electronic equipment and storage medium
CN107861765B (en) Product configuration method, apparatus, and computer-readable storage medium
CN111784292A (en) Electronic passenger ticket refunding method and device, airline department system and payment system
CN111768174A (en) Activity management method, apparatus, device and medium
CN111062792A (en) Method, device, equipment and storage medium for regulating and controlling limit
CN103119618A (en) Database, work content data management server and work content data management program
CN109800265B (en) Data loading method, device, equipment and computer readable storage medium
CN103455500A (en) Method and device for extracting and issuing data
CN112651685B (en) Automatic bin supplementing method and system for value-added tax electronic invoice
CN114201166A (en) Message information generation method and device, electronic equipment and storage medium
CN112328450A (en) Data monitoring method and device, computer equipment and storage medium
CN109101515B (en) Rule configuration method, server and computer-readable storage medium
KR20210085516A (en) Restaurant Order Ordering Management System Using Mobile Device

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