CN113761077B - Method and device for processing bill task - Google Patents

Method and device for processing bill task Download PDF

Info

Publication number
CN113761077B
CN113761077B CN202110003778.8A CN202110003778A CN113761077B CN 113761077 B CN113761077 B CN 113761077B CN 202110003778 A CN202110003778 A CN 202110003778A CN 113761077 B CN113761077 B CN 113761077B
Authority
CN
China
Prior art keywords
processed
task
document
dimension
database
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
CN202110003778.8A
Other languages
Chinese (zh)
Other versions
CN113761077A (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 Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi 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 Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202110003778.8A priority Critical patent/CN113761077B/en
Publication of CN113761077A publication Critical patent/CN113761077A/en
Application granted granted Critical
Publication of CN113761077B publication Critical patent/CN113761077B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/283Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • 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
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/04Manufacturing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Manufacturing & Machinery (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for processing a bill task, and relates to the technical field of computers. One embodiment of the method comprises the following steps: taking a target service dimension as a query condition, and capturing a document task set to be processed corresponding to the target service dimension from a task database; if the document task set to be processed exists, for each document task to be processed, acquiring service information corresponding to the service dimension set from a cache database or a service database according to the service dimension set of the document task to be processed, and processing the document task to be processed according to the service information; and if the document task set to be processed does not exist, deleting the service information corresponding to the target service dimension stored in the cache database. The embodiment can solve the technical problems that the same cache data is put into the cache database and deleted from the cache database for multiple times.

Description

Method and device for processing bill task
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a document task.
Background
After the production operation system generates production service, service receipts are generated and sent to the receipt processing system. The receipt processing system receives the business receipt, generates a task to be processed, and stores the business receipt and the task to be processed in a task database. And when the bill processing system processes the task, acquiring service information from the service database and storing the service information into the cache database.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
1) The document quantity is large, more service information needs to be cached, and the cache database needs to delete the cache data frequently to ensure the availability of space;
2) The same cache key is scattered at a plurality of time points, for example, when cache data of the cache key=k1 is used at a certain time point, the key may be already cleared from the cache database when the next time point of the key is used, and the phenomenon that the same cache data is put into the cache database and cleared from the cache database for a plurality of times occurs;
3) The system cannot actively delete the cache, but can only wait for expiration or insufficient space to passively clear the cache.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method and an apparatus for processing a document task, so as to solve the technical problem that the same cache data is put into a cache database and deleted from the cache database multiple times.
To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a method for processing a document job, including:
taking a target service dimension as a query condition, and capturing a document task set to be processed corresponding to the target service dimension from a task database; the document task set to be processed comprises at least one document task to be processed;
if the document task set to be processed exists, for each document task to be processed, acquiring service information corresponding to the service dimension set from a cache database or a service database according to the service dimension set of the document task to be processed, and processing the document task to be processed according to the service information; wherein the set of business dimensions includes the target business dimension;
and if the document task set to be processed does not exist, deleting the service information corresponding to the target service dimension stored in the cache database.
Optionally, capturing a document task set to be processed corresponding to a target service dimension from a task database by taking the target service dimension as a query condition, including:
setting the target service dimension as null, taking the target service dimension as null as a query condition, and randomly grabbing a document task to be processed from a task database;
Acquiring a target service dimension of the document task to be processed;
and taking the target service dimension of the document task to be processed as a query condition, and capturing the residual document task to be processed corresponding to the target service dimension from the task database, thereby obtaining a document task set to be processed.
Optionally, capturing the remaining document tasks to be processed corresponding to the target service dimension from the task database by taking the target service dimension of the document tasks to be processed as a query condition, including:
and judging whether the target service dimension in the query condition is empty, if so, assigning the target service dimension in the query condition as the target service dimension of the document task to be processed, taking the target service dimension of the document task to be processed as the query condition, and capturing the rest document task to be processed corresponding to the target service dimension from the task database.
Optionally, if the document task set to be processed does not exist, deleting service information corresponding to the target service dimension stored in the cache database, including:
if the document task set to be processed does not exist, continuing to judge whether the target service dimension in the query condition is empty or not;
If not, deleting the service information corresponding to the target service dimension stored in the cache database;
if yes, ending.
Optionally, acquiring service information corresponding to the service dimension set from a cache database or a service database, and processing the document task to be processed according to the service information, including:
judging whether service information corresponding to the service dimension set exists in a cache database;
if yes, acquiring service information corresponding to the service dimension set from a cache database, and processing the document task to be processed according to the service information;
if not, acquiring service information corresponding to the service dimension set from a service database, storing the service dimension set and the corresponding service information into a cache database in a key value pair mode, and processing the document task to be processed according to the service information; wherein the service dimension set is a key and the service information is a value.
Optionally, the target business dimension is selected from one or more business dimensions in the set of business dimensions.
Optionally, the target service dimension is a user identifier.
In addition, according to another aspect of the embodiment of the present invention, there is provided an apparatus for processing a document task, including:
The grabbing module is used for grabbing a document task set to be processed corresponding to the target service dimension from the task database by taking the target service dimension as a query condition; the document task set to be processed comprises at least one document task to be processed;
the processing module is used for acquiring service information corresponding to the service dimension set from a cache database or a service database according to the service dimension set of the document task to be processed for each document task to be processed if the document task set to be processed exists, and processing the document task to be processed according to the service information; wherein the set of business dimensions includes the target business dimension; and if the document task set to be processed does not exist, deleting the service information corresponding to the target service dimension stored in the cache database.
Optionally, the processing module is further configured to:
setting the target service dimension as null, taking the target service dimension as null as a query condition, and randomly grabbing a document task to be processed from a task database;
acquiring a target service dimension of the document task to be processed;
and taking the target service dimension of the document task to be processed as a query condition, and capturing the residual document task to be processed corresponding to the target service dimension from the task database, thereby obtaining a document task set to be processed.
Optionally, the processing module is further configured to:
and judging whether the target service dimension in the query condition is empty, if so, assigning the target service dimension in the query condition as the target service dimension of the document task to be processed, taking the target service dimension of the document task to be processed as the query condition, and capturing the rest document task to be processed corresponding to the target service dimension from the task database.
Optionally, the processing module is further configured to:
if the document task set to be processed does not exist, continuing to judge whether the target service dimension in the query condition is empty or not;
if not, deleting the service information corresponding to the target service dimension stored in the cache database;
if yes, ending.
Optionally, the processing module is further configured to:
judging whether service information corresponding to the service dimension set exists in a cache database;
if yes, acquiring service information corresponding to the service dimension set from a cache database, and processing the document task to be processed according to the service information;
if not, acquiring service information corresponding to the service dimension set from a service database, storing the service dimension set and the corresponding service information into a cache database in a key value pair mode, and processing the document task to be processed according to the service information; wherein the service dimension set is a key and the service information is a value.
Optionally, the target business dimension is selected from one or more business dimensions in the set of business dimensions.
Optionally, the target service dimension is a user identifier.
According to another aspect of an embodiment of the present invention, there is also provided an electronic device including:
one or more processors;
storage means for storing one or more programs,
the one or more processors implement the method of any of the embodiments described above when the one or more programs are executed by the one or more processors.
According to another aspect of an embodiment of the present invention, there is also provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method according to any of the embodiments described above.
One embodiment of the above invention has the following advantages or benefits: the technical means that the target business dimension is used as a query condition, a to-be-processed bill task set corresponding to the target business dimension is grabbed from a task database, if the to-be-processed bill task set exists, business information corresponding to the business dimension set is acquired from a cache database or a business database according to the business dimension set of the to-be-processed bill task and the to-be-processed bill task is processed, and if the to-be-processed bill task set does not exist, the business information corresponding to the target business dimension stored in the cache database is deleted, so that the technical problems that the same cache data is put into the cache database and deleted from the cache database for multiple times in the prior art are solved. The embodiment of the invention can reduce the number of the cache keys and the total data in the cache database, reduce the storage space of the cache database, and also can avoid the problem that the same key is repeatedly stored in and deleted from the cache database in the calculation process.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a production operating system and a billing system;
FIG. 2 is a schematic diagram of a charging flow in the prior art;
FIG. 3 is a schematic diagram of the main flow of a method of processing document tasks according to an embodiment of the invention;
FIG. 4 is a schematic illustration of the main flow of a method of processing document tasks according to one referenceable embodiment of the invention;
FIG. 5 is a schematic diagram of the major modules of an apparatus for handling document tasks according to an embodiment of the invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 7 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Taking charging service as an example, a logistics company provides warehouse allocation and value added service for clients, makes different quotations for the clients based on the service, and charges a certain fee. These customers often have a relatively large data volume and pay a very troublesome fee per settlement, and therefore, settlement is generally performed in a non-settlement manner, and fee settlement is performed at a certain period, for example, a monthly settlement. The billing system calculates the cost of all customers for month on month 1. In calculating the fee, the information of the quotation and discount of the customer needs to be queried first, and the information is generally configured according to certain fixed dimensions, such as article type (large article, medium article, small article, etc.), article charging classification, temperature layer (normal temperature, refrigeration, freezing, etc.).
As shown in fig. 1, after the production operation system generates production operation, a charging bill is generated, and the charging bill is sent to the charging system; the charging system receives the charging bill, generates a bill task to be charged, and stores the charging bill and the bill task to be charged in a database. As shown in fig. 2, the monthly initial billing system will make statistics (data of whole month is counted according to dimensions of single quantity, weight, volume, number of pieces, etc.) and calculate fees for all billing documents of the previous month. Such as the month 6 of 2020, accounting and billing documents generated by 2020-05-01 to 2020-05-31. When charging, the quotation information of the customer needs to be queried first, namely price query. In order to improve price inquiring efficiency, the client quotation information is stored in a cache database, and whether the quotation information exists or not is firstly inquired from the cache database. The cache key contains business dimensions such as customer code, document type, business date, offer dimension, etc. As for the client C1, the service occurrence date: 2020-05-01, document type: s (sales outlet), bid dimension: article type (different service fees are charged according to different article types, and the quotation of different clients can have different quotation dimensions), and the article type: GT001 (small piece), cache key is C-S-20200501-GT001. The charging system inquires a bill task to be charged in the database, judges whether the bill task to be charged exists or not, if not, the monthly calculation is completed, if so, the charging is executed, and the charging returns to the process after the completion of the charging; if the bill task to be charged does not exist, the charging is completed.
Therefore, there are at least the following problems in the prior art:
1) The document quantity is large, more service information needs to be cached, and the cache database needs to delete the cache data frequently to ensure the availability of space;
2) The same cache key is scattered at a plurality of time points, for example, when cache data of the cache key=k1 is used at a certain time point, the key may be already cleared from the cache when the next time point of the key is used, and the phenomenon that the same cache data is put into the cache database and cleared from the cache database for a plurality of times occurs;
3) The system cannot actively delete the cache, but can only wait for expiration or insufficient space to passively clear the cache.
FIG. 3 is a schematic diagram of the main flow of a method of processing document tasks according to an embodiment of the invention. As an embodiment of the present invention, as shown in fig. 3, the method for processing a document task may include:
and step 301, capturing a document task set to be processed corresponding to the target service dimension from a task database by taking the target service dimension as a query condition.
In an embodiment of the present invention, the target business dimension may be selected from one or more business dimensions in the set of business dimensions, the set of business dimensions being determined by the business dimensions included in the document task. Taking a charging bill task as an example, the service dimension set may include a user identifier, a bill type, a service date, an offer dimension, and the like, and the target service dimension may be a user identifier (such as a client code) or a bill type. Alternatively, the target service dimension may be one service dimension, or may be a combination of multiple service dimensions, such as a user identifier and a service date, which is not limited by the embodiment of the present invention.
According to the method and the device, the target service dimension is used as a query condition, and the to-be-processed bill task set corresponding to the target service dimension is grabbed from the task database, wherein the to-be-processed bill task set comprises at least one to-be-processed bill task. For example, a user identifier of a certain user is used as a query condition, and a task set of the document to be processed corresponding to the user identifier is obtained from a task database, wherein the task set of the document to be processed includes all documents to be processed of the user (i.e. the processing state of the document is to be processed).
Optionally, step 301 may include: setting the target service dimension as null, taking the target service dimension as null as a query condition, and randomly grabbing a document task to be processed from a task database; acquiring a target service dimension of the document task to be processed; and taking the target service dimension of the document task to be processed as a query condition, and capturing the residual document task to be processed corresponding to the target service dimension from the task database, thereby obtaining a document task set to be processed. In the embodiment of the invention, the target service dimension is set to be empty, and the target service dimension is set to be empty, so that a document task to be processed can be randomly grasped from the task database, then the target service dimension, such as a user identification of a certain user, is extracted from the document task to be processed, and finally the user identification is used as a query condition, and the rest document task to be processed corresponding to the user identification is grasped continuously from the task database, so that a document task set to be processed is obtained. Therefore, the document task set to be processed comprises all document tasks to be processed corresponding to the user identifier.
Optionally, capturing the remaining document tasks to be processed corresponding to the target service dimension from the task database by taking the target service dimension of the document tasks to be processed as a query condition, including: and judging whether the target service dimension in the query condition is empty, if so, assigning the target service dimension in the query condition as the target service dimension of the document task to be processed, taking the target service dimension of the document task to be processed as the query condition, and capturing the rest document task to be processed corresponding to the target service dimension from the task database. In the process of taking the target service dimension of a document task to be processed as a query condition, firstly, querying whether the target service dimension in the condition is empty, if so, assigning the target service dimension in the query condition as the target service dimension of the document task to be processed, taking a user identifier of a certain user as an example, assigning the target service dimension in the query condition as the user identifier, and then taking the user identifier as the query condition, continuously capturing the rest document task to be processed corresponding to the user identifier from a task database; and if the document task is not empty, continuously grabbing the document task to be processed corresponding to the query condition from the task database based on the query condition.
Step 302, if the document task set to be processed exists, for each document task to be processed, acquiring service information corresponding to the service dimension set from a cache database or a service database according to the service dimension set of the document task to be processed, and processing the document task to be processed according to the service information.
The target business dimension may be selected from one or more business dimensions in the set of business dimensions, as described in step 301, the set of business dimensions being determined by the business dimensions contained in the document job, such that the set of business dimensions includes the target business dimension.
Optionally, acquiring service information corresponding to the service dimension set from a cache database or a service database, and processing the document task to be processed according to the service information, including: judging whether service information corresponding to the service dimension set exists in a cache database; if yes, acquiring service information corresponding to the service dimension set from a cache database, and processing the document task to be processed according to the service information; if not, acquiring service information corresponding to the service dimension set from a service database, storing the service dimension set and the corresponding service information into a cache database in a key value pair mode, and processing the document task to be processed according to the service information; wherein the service dimension set is a key, and the service information is a value.
Taking charging service as an example, service dimensions such as customer codes, bill types, service dates, quotation dimensions and the like in the service dimension set can be obtained from a bill task to be processed, and the charging system obtains corresponding service information from the cache database according to the service dimension set. The key (i.e. service dimension set) includes service dimensions such as a customer code, a document type, a service date, a quotation dimension, etc., and the value (i.e. service information) is quotation, discount information, etc. of the customer. And if the service information corresponding to the service dimension set is not queried from the cache database, acquiring the service information corresponding to the service dimension set from the service database, and storing the service dimension set and the service information corresponding to the service dimension set into the cache database in a key value form.
And step 303, deleting the service information corresponding to the target service dimension stored in the cache database if the document task set to be processed does not exist.
If the document task set to be processed, which is grabbed from the task database, does not exist, the fact that the document task to be processed, which meets the query condition, does not exist in the task database is indicated, so that the service information corresponding to the target service dimension stored in the cache database can be deleted, and the cache data can be actively deleted, so that the cache space is prevented from being occupied.
Optionally, step 303 may include: if the document task set to be processed does not exist, continuing to judge whether the target service dimension in the query condition is empty or not; if not, deleting the service information corresponding to the target service dimension stored in the cache database; if yes, ending. In the embodiment of the invention, if the document task set to be processed, which is grabbed from the task database, does not exist and the target service dimension in the query condition is empty, the document task in the task database is in a completed state, and the document task to be processed does not exist, so that the calculation can be ended; if the document task set to be processed, which is grabbed from the task database, does not exist and the target service dimension in the query condition is not empty, the fact that the document task to be processed taking the target service dimension as the query condition does not exist in the task database is indicated, so that service information corresponding to the target service dimension stored in the cache database can be deleted, and the cache data can be actively deleted, so that the cache space is prevented from being occupied, the total amount of the cache data is reduced, the space of a cache server occupied by the cache data is saved, and the cost is reduced.
According to the embodiment of the invention, the document tasks to be processed corresponding to the same service dimension (such as the same user identification, the same service date and the like) are intensively processed in a certain shorter time by extracting the document tasks with coarser granularity of one layer, so that the cache data corresponding to the service dimension can be ensured to be intensively used; moreover, the point in time when the cache data is no longer being used can also be predicted, thereby actively clearing the invalid cache data. Therefore, the embodiment of the invention can improve the hit probability of the data in the cache database and ensure that the data in the cache database are all effective data.
It should be noted that the granularity value of the coarser layer needs to be selected according to the specific service scenario. For example, in charging services, the user identity is an important piece of polling feature data, i.e. the key of the cache. If other obvious characteristics exist in a certain system, the system can be used as an element for related inquiry of other information, and data can be classified according to the characteristics.
According to the various embodiments described above, it can be seen that the technical means of capturing the to-be-processed bill task set corresponding to the target service dimension from the task database by taking the target service dimension as a query condition, if the to-be-processed bill task set exists, acquiring service information corresponding to the service dimension set from the cache database or the service database according to the service dimension set of the to-be-processed bill task, and processing the to-be-processed bill task, if the to-be-processed bill task set does not exist, deleting the service information corresponding to the target service dimension stored in the cache database, thereby solving the technical problems of putting the same cache data into the cache database and deleting the same cache data from the cache database for multiple times in the prior art. The embodiment of the invention can reduce the number of the cache keys and the total data in the cache database, reduce the storage space of the cache database, and also can avoid the problem that the same key is repeatedly stored in and deleted from the cache database in the calculation process.
Taking the billing service as an example, a plurality of clients are generating service at each time point within one month, so documents entering the billing system accumulate over time. When the month is calculated, if the bill task of the same customer is treated as a batch until the bill task of the customer is calculated, and then the bill task of the next customer is treated, the data in the cache database can be the customer quotation and discount information which are being treated at the same time point in the same time period. FIG. 4 is a schematic diagram of the main flow of a method of processing document tasks according to one referenceable embodiment of the invention. As yet another embodiment of the present invention, as shown in fig. 4, the method for processing a document task may include:
in step 401, the client code in the query condition is set to null, i.e. the client code is not used as the query condition.
And step 402, taking the customer code as blank as a query condition, and randomly grabbing the bill task of the state to be charged from the database.
Step 403, judging whether a bill task in a state to be charged exists; if yes, go to step 404; if not, go to step 408.
And step 404, if the bill task T in the state to be charged exists, inquiring, and acquiring quotation information corresponding to the bill task T in the state to be charged from a cache database or a service database.
Specifically, if quotation information corresponding to a bill task T in a state to be charged exists in the cache database, acquiring the quotation information from the cache database; if the quotation information corresponding to the bill task T in the state to be charged does not exist in the cache database, the quotation information corresponding to the bill task T in the state to be charged is acquired from the service database, and then the quotation information is stored in the cache database in a key value pair mode. The cache key contains business dimensions such as customer code, document type, business date, offer dimension, etc. As for the client C1, the service occurrence date: 2020-05-01, document type: s (sales outlet), bid dimension: article type (different service fees are charged according to different article types, and the quotation of different clients can have different quotation dimensions), and the article type: GT001 (small piece), cache key is C-S-20200501-GT001.
And 405, charging, namely processing a bill task T of a state to be charged according to the acquired quotation information.
Step 406, determining whether the client code in the query condition is null: if yes, go to step 407; if not, step 402 is performed.
In step 407, if the client code in the query condition is null, the client code in the query condition is assigned as the client code of the document task T in the state to be charged, i.e. the client code in the query condition=the client code of the document task T in the state to be charged.
Step 408, determining whether the client code of the query condition is empty; if yes, the calculation is completed. If not, go to step 409.
And 409, if the client code in the query condition is not null, the client charging is considered to be completed, and the cached data of the client is deleted.
Since the billing time of all documents of a customer is completed in a short time, typically in a few minutes to a few hours, it is ensured that the cached data of a customer exists only in a short time period.
It should be noted that the same client data can be split according to finer granularity, such as client code+date+quotation granularity, and the purpose of reducing the use space of the cache database can be achieved. The cache keys also contain other service dimensions, but the total amount is not too large, the problem that a large number of keys exist in the cache database at the same time does not occur, and therefore the use amount of the cache database space has reached the reduction of the data level.
In addition, the specific implementation of the method for processing document tasks according to the present invention is described in detail in the above method for processing document tasks, and thus the description thereof will not be repeated here.
FIG. 5 is a schematic diagram of main modules of an apparatus for processing document tasks according to an embodiment of the present invention, and as shown in FIG. 5, the apparatus 500 for processing document tasks includes a grabbing module 501 and a processing module 502; the grabbing module 501 is configured to grab a task set of a document to be processed corresponding to a target service dimension from a task database with the target service dimension as a query condition; the document task set to be processed comprises at least one document task to be processed; the processing module 502 is configured to obtain, for each document task to be processed, service information corresponding to a service dimension set of the document task to be processed from a cache database or a service database according to the service dimension set of the document task to be processed, and process the document task to be processed according to the service information if the document task set to be processed exists; wherein the set of business dimensions includes the target business dimension; and if the document task set to be processed does not exist, deleting the service information corresponding to the target service dimension stored in the cache database.
Optionally, the processing module 502 is further configured to:
setting the target service dimension as null, taking the target service dimension as null as a query condition, and randomly grabbing a document task to be processed from a task database;
Acquiring a target service dimension of the document task to be processed;
and taking the target service dimension of the document task to be processed as a query condition, and capturing the residual document task to be processed corresponding to the target service dimension from the task database, thereby obtaining a document task set to be processed.
Optionally, the processing module 502 is further configured to:
and judging whether the target service dimension in the query condition is empty, if so, assigning the target service dimension in the query condition as the target service dimension of the document task to be processed, taking the target service dimension of the document task to be processed as the query condition, and capturing the rest document task to be processed corresponding to the target service dimension from the task database.
Optionally, the processing module 502 is further configured to:
if the document task set to be processed does not exist, continuing to judge whether the target service dimension in the query condition is empty or not;
if not, deleting the service information corresponding to the target service dimension stored in the cache database;
if yes, ending.
Optionally, the processing module 502 is further configured to:
judging whether service information corresponding to the service dimension set exists in a cache database;
If yes, acquiring service information corresponding to the service dimension set from a cache database, and processing the document task to be processed according to the service information;
if not, acquiring service information corresponding to the service dimension set from a service database, storing the service dimension set and the corresponding service information into a cache database in a key value pair mode, and processing the document task to be processed according to the service information; wherein the service dimension set is a key and the service information is a value.
Optionally, the target business dimension is selected from one or more business dimensions in the set of business dimensions.
Optionally, the target service dimension is a user identifier.
According to the various embodiments described above, it can be seen that the technical means of capturing the to-be-processed bill task set corresponding to the target service dimension from the task database by taking the target service dimension as a query condition, if the to-be-processed bill task set exists, acquiring service information corresponding to the service dimension set from the cache database or the service database according to the service dimension set of the to-be-processed bill task, and processing the to-be-processed bill task, if the to-be-processed bill task set does not exist, deleting the service information corresponding to the target service dimension stored in the cache database, thereby solving the technical problems of putting the same cache data into the cache database and deleting the same cache data from the cache database for multiple times in the prior art. The embodiment of the invention can reduce the number of the cache keys and the total data in the cache database, reduce the storage space of the cache database, and also can avoid the problem that the same key is repeatedly stored in and deleted from the cache database in the calculation process.
The details of the implementation of the device for processing document tasks according to the present invention are described in the above method for processing document tasks, and thus the description thereof will not be repeated here.
FIG. 6 illustrates an exemplary system architecture 600 to which a method of processing document tasks or an apparatus for processing document tasks of embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 is used as a medium to provide communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 605 via the network 604 using the terminal devices 601, 602, 603 to receive or send messages, etc. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 601, 602, 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using terminal devices 601, 602, 603. The background management server can analyze and other data such as the received article information inquiry request and feed back the processing result to the terminal equipment.
It should be noted that, the method for processing a document task provided in the embodiment of the present invention is generally executed by the server 605, and accordingly, the device for processing a document task is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, there is illustrated a schematic diagram of a computer system 700 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, ROM 702, and RAM703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 701.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer programs according to various embodiments of the present invention. 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). It should also be noted that, 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 or flowchart illustration, and combinations of blocks in the block diagrams 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.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor comprises a grabbing module and a processing module, wherein the names of the modules do not in some cases constitute a limitation of the module itself.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, implement the method of: taking a target service dimension as a query condition, and capturing a document task set to be processed corresponding to the target service dimension from a task database; if the document task set to be processed exists, for each document task to be processed, acquiring service information corresponding to the service dimension set from a cache database or a service database according to the service dimension set of the document task to be processed, and processing the document task to be processed according to the service information; and if the document task set to be processed does not exist, deleting the service information corresponding to the target service dimension stored in the cache database.
According to the technical scheme of the embodiment of the invention, the target business dimension is used as a query condition, the to-be-processed bill task set corresponding to the target business dimension is captured from the task database, if the to-be-processed bill task set exists, the business information corresponding to the business dimension set is acquired from the cache database or the business database according to the business dimension set of the to-be-processed bill task, and the to-be-processed bill task is processed, if the to-be-processed bill task set does not exist, the technical means of deleting the business information corresponding to the target business dimension stored in the cache database is adopted, so that the technical problems that the same cache data is put into the cache database and deleted from the cache database for multiple times in the prior art are solved. The embodiment of the invention can reduce the number of the cache keys and the total data in the cache database, reduce the storage space of the cache database, and also can avoid the problem that the same key is repeatedly stored in and deleted from the cache database in the calculation process.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (9)

1. A method of processing document tasks, comprising:
taking a target service dimension as a query condition, and capturing a document task set to be processed corresponding to the target service dimension from a task database; the document task set to be processed comprises at least one document task to be processed;
if the document task set to be processed exists, for each document task to be processed, acquiring service information corresponding to the service dimension set from a cache database or a service database according to the service dimension set of the document task to be processed, and processing the document task to be processed according to the service information; wherein the set of business dimensions includes the target business dimension;
if the document task set to be processed does not exist, deleting the service information corresponding to the target service dimension stored in the cache database;
Taking a target service dimension as a query condition, capturing a document task set to be processed corresponding to the target service dimension from a task database, wherein the document task set to be processed comprises:
setting the target service dimension as null, taking the target service dimension as null as a query condition, and randomly grabbing a document task to be processed from a task database;
acquiring a target service dimension of the document task to be processed;
and taking the target service dimension of the document task to be processed as a query condition, and capturing the residual document task to be processed corresponding to the target service dimension from the task database, thereby obtaining a document task set to be processed.
2. The method according to claim 1, wherein capturing the remaining document tasks to be processed corresponding to the target service dimension from the task database with the target service dimension of the document tasks to be processed as a query condition comprises:
and judging whether the target service dimension in the query condition is empty, if so, assigning the target service dimension in the query condition as the target service dimension of the document task to be processed, taking the target service dimension of the document task to be processed as the query condition, and capturing the rest document task to be processed corresponding to the target service dimension from the task database.
3. The method of claim 2, wherein deleting the service information corresponding to the target service dimension stored in the cache database if the pending document task set does not exist comprises:
if the document task set to be processed does not exist, continuing to judge whether the target service dimension in the query condition is empty or not;
if not, deleting the service information corresponding to the target service dimension stored in the cache database;
if yes, ending.
4. The method of claim 1, wherein obtaining service information corresponding to the service dimension set from a cache database or a service database, and processing the document task to be processed according to the service information, comprises:
judging whether service information corresponding to the service dimension set exists in a cache database;
if yes, acquiring service information corresponding to the service dimension set from a cache database, and processing the document task to be processed according to the service information;
if not, acquiring service information corresponding to the service dimension set from a service database, storing the service dimension set and the corresponding service information into a cache database in a key value pair mode, and processing the document task to be processed according to the service information; wherein the service dimension set is a key and the service information is a value.
5. The method of claim 1, wherein the target business dimension is selected from one or more business dimensions in the set of business dimensions.
6. The method of claim 5, wherein the target service dimension is a user identification.
7. An apparatus for processing document tasks, comprising:
the grabbing module is used for grabbing a document task set to be processed corresponding to the target service dimension from the task database by taking the target service dimension as a query condition; the document task set to be processed comprises at least one document task to be processed;
the processing module is used for acquiring service information corresponding to the service dimension set from a cache database or a service database according to the service dimension set of the document task to be processed for each document task to be processed if the document task set to be processed exists, and processing the document task to be processed according to the service information; wherein the set of business dimensions includes the target business dimension; if the document task set to be processed does not exist, deleting the service information corresponding to the target service dimension stored in the cache database;
The grabbing module is also used for:
setting the target service dimension as null, taking the target service dimension as null as a query condition, and randomly grabbing a document task to be processed from a task database;
acquiring a target service dimension of the document task to be processed;
and taking the target service dimension of the document task to be processed as a query condition, and capturing the residual document task to be processed corresponding to the target service dimension from the task database, thereby obtaining a document task set to be processed.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more processors implement the method of any of claims 1-6 when the one or more programs are executed by the one or more processors.
9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
CN202110003778.8A 2021-01-04 2021-01-04 Method and device for processing bill task Active CN113761077B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110003778.8A CN113761077B (en) 2021-01-04 2021-01-04 Method and device for processing bill task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110003778.8A CN113761077B (en) 2021-01-04 2021-01-04 Method and device for processing bill task

Publications (2)

Publication Number Publication Date
CN113761077A CN113761077A (en) 2021-12-07
CN113761077B true CN113761077B (en) 2023-11-03

Family

ID=78786321

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110003778.8A Active CN113761077B (en) 2021-01-04 2021-01-04 Method and device for processing bill task

Country Status (1)

Country Link
CN (1) CN113761077B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008224A (en) * 2019-03-08 2019-07-12 阿里巴巴集团控股有限公司 A kind of db transaction processing method and processing device
CN110502536A (en) * 2019-06-26 2019-11-26 中电万维信息技术有限责任公司 Method, apparatus and storage medium based on cache database verification business uniqueness
CN110990439A (en) * 2019-12-13 2020-04-10 深圳前海环融联易信息科技服务有限公司 Cache-based quick query method and device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6759922B2 (en) * 2016-09-20 2020-09-23 富士ゼロックス株式会社 Image processing equipment and programs

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008224A (en) * 2019-03-08 2019-07-12 阿里巴巴集团控股有限公司 A kind of db transaction processing method and processing device
CN110502536A (en) * 2019-06-26 2019-11-26 中电万维信息技术有限责任公司 Method, apparatus and storage medium based on cache database verification business uniqueness
CN110990439A (en) * 2019-12-13 2020-04-10 深圳前海环融联易信息科技服务有限公司 Cache-based quick query method and device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
关于分布式异构数据库数据同步系统的研究;李萍;;电大理工(01);全文 *

Also Published As

Publication number Publication date
CN113761077A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
CN111047243B (en) Method and device for determining logistics distribution cost
CN110738436B (en) Method and device for determining available inventory
CN110473036B (en) Method and device for generating order number
CN108074003B (en) Prediction information pushing method and device
CN112884405A (en) Inquiry system and scheduling method thereof
CN109949064B (en) Open interface call charging method and device
CN113379258A (en) Inventory management method and device
CN112884181A (en) Quota information processing method and device
CN113783924A (en) Method and device for processing access request
CN113761077B (en) Method and device for processing bill task
CN113761565A (en) Data desensitization method and apparatus
CN110895777A (en) Method and device for processing overtime service list
CN115983907A (en) Data recommendation method and device, electronic equipment and computer readable medium
CN113535769B (en) Method and device for inquiring information
CN110956514A (en) Method and device for generating order information
CN113496386A (en) Method and device for combined charging
CN113762819A (en) Channel scheduling method and device
WO2020011129A1 (en) Method and apparatus for managing offline article information, medium, and electronic device
CN112581154A (en) Settlement processing method and device
CN115981910B (en) Method, apparatus, electronic device and computer readable medium for processing exception request
CN114756556B (en) Method, device, electronic equipment and computer readable medium for processing account data
CN113780612A (en) Method and device for optimizing purchasing data
CN109558964B (en) Method and device for establishing business map
CN116415550A (en) Method and device for generating single number of electronic face sheet
CN116245632A (en) Method, apparatus, device and computer readable medium for interacting data

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
GR01 Patent grant
GR01 Patent grant