CN113850685A - Method, apparatus, server and medium for real-time tally - Google Patents

Method, apparatus, server and medium for real-time tally Download PDF

Info

Publication number
CN113850685A
CN113850685A CN202111127135.0A CN202111127135A CN113850685A CN 113850685 A CN113850685 A CN 113850685A CN 202111127135 A CN202111127135 A CN 202111127135A CN 113850685 A CN113850685 A CN 113850685A
Authority
CN
China
Prior art keywords
data
database
settlement
preset cache
preset
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
CN202111127135.0A
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.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian 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 Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202111127135.0A priority Critical patent/CN113850685A/en
Publication of CN113850685A publication Critical patent/CN113850685A/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
    • G06Q40/08Insurance
    • 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/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • 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
    • 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/2457Query processing with adaptation to user needs
    • G06F16/24578Query processing with adaptation to user needs using ranking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • Computational Linguistics (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments of the present disclosure disclose methods, apparatuses, servers, and media for real-time accounting. One embodiment of the method comprises: responding to a received accounting request, and sending a message queue delay message corresponding to the accounting request, wherein the accounting request comprises an accounting amount; in response to the fact that the message queue delays the completion of the sending of the message, updating the quota data corresponding to the calculation request from a preset cache; and updating corresponding data in the database corresponding to the preset cache according to the updated quota data. The implementation method improves the performance and response timeliness of the system on the premise of ensuring the data consistency.

Description

Method, apparatus, server and medium for real-time tally
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method, an apparatus, a server, and a medium for real-time adjustment.
Background
With the development of computer technology, the application of the method in the field of intelligent medical treatment is more and more. In the business scenario of health insurance claim settlement, the claim settlement rules are often very complex, and the limit rules and period calculation are very many.
In the prior art, health insurance claims are based on the mode that a user pays first, then the claims data is checked manually through post-reporting, and then the claims payment amount is issued. In the prior art, when the settlement calculation is carried out on a claim, the time is usually required to wait for a certain time due to complex rules of the settlement and performance bottlenecks of a database, so that the requirement of scenes such as medicine purchasing settlement and the like on timeliness cannot be met.
Disclosure of Invention
Embodiments of the present disclosure propose methods, apparatuses, servers, and media for real-time justification.
In a first aspect, an embodiment of the present disclosure provides a method for real-time adjustment, where the method includes: responding to the received reason calculation request, and sending a message queue delay message corresponding to the reason calculation request, wherein the reason calculation request comprises an reason calculation amount; updating the quota data corresponding to the calculation request from a preset cache in response to the fact that the message queue delay message is determined to be sent completely; and updating corresponding data in a database corresponding to the preset cache according to the updated quota data.
In some embodiments, the quota data in the preset cache is obtained by the following steps: acquiring policy identification and claim content information corresponding to the policy identification, wherein the claim content information comprises at least one of the following items: claim settlement limit, claim settlement times and claim-free limit; generating current quota data according to the claim content information and a preset claim rule, wherein the current quota data is related to at least one of the following items: periodic limit, claim settlement personnel information and claim settlement history.
In some embodiments, the policy identifier and the claim content information corresponding to the policy identifier are stored by using a Map, keys stored by the Map are generated according to the policy period value and the insured life identifier corresponding to the policy identifier, and the value stored by the Map is generated according to the claim content information.
In some embodiments, the updating, according to the updated quota data, corresponding data in a database corresponding to the preset cache includes: selecting data which are not subjected to library falling from a preset cache for library falling; and in response to determining that the database dropping is successful, deleting the database dropping successful data from the preset cache.
In some embodiments, the updating, according to the updated quota data, corresponding data in a database corresponding to the preset cache, further includes: in response to determining that the database dropping fails, obtaining a message queue delay message corresponding to the database dropping failed data; reading non-database falling data indicated by message queue delay messages corresponding to database falling failure data from a preset cache; and writing the read database data which does not fall into the database corresponding to the preset cache.
In some embodiments, the method further comprises: and in response to the fact that the corresponding data in the database is completely updated, triggering whether the corresponding data in the database is consistent with the updated quota data in the preset cache or not through a binlog log of MySQL.
In some embodiments, the method further comprises: and in response to the fact that the corresponding data in the database are completely updated, checking whether the corresponding data in the database are consistent with the updated quota data in the preset cache according to a preset time interval.
In some embodiments, the foregoing rational computation request is generated by: acquiring a drug purchasing settlement page; and generating an settlement request according to the medicine purchasing settlement page and a preset settlement rule.
In a second aspect, an embodiment of the present disclosure provides an apparatus for real-time adjustment, the apparatus including: the sending unit is configured to respond to the received reason calculation request, and send a message queue delay message corresponding to the reason calculation request, wherein the reason calculation request comprises an reason calculation amount; the cache updating unit is configured to respond to the fact that the message queue delay message is sent completely, and update the quota data corresponding to the calculation request from a preset cache; and the database updating unit is configured to update corresponding data in the database corresponding to the preset cache according to the updated quota data.
In some embodiments, the quota data in the preset cache is obtained by the following steps: acquiring policy identification and claim content information corresponding to the policy identification, wherein the claim content information comprises at least one of the following items: claim settlement limit, claim settlement times and claim-free limit; generating current quota data according to the claim content information and a preset claim rule, wherein the current quota data is related to at least one of the following items: periodic limit, claim settlement personnel information and claim settlement history.
In some embodiments, the policy identifier and the claim content information corresponding to the policy identifier are stored by using a Map, keys stored by the Map are generated according to the policy period value and the insured life identifier corresponding to the policy identifier, and the value stored by the Map is generated according to the claim content information.
In some embodiments, the database updating unit is further configured to: selecting data which are not subjected to library falling from a preset cache for library falling; and in response to determining that the database dropping is successful, deleting the database dropping successful data from the preset cache.
In some embodiments, the database updating unit is further configured to: in response to determining that the database dropping fails, obtaining a message queue delay message corresponding to the database dropping failed data; reading non-database falling data indicated by message queue delay messages corresponding to database falling failure data from a preset cache; and writing the read database data which does not fall into the database corresponding to the preset cache.
In some embodiments, the apparatus further comprises: and the single checking unit is configured to trigger checking whether the corresponding data in the database is consistent with the updated quota data in the preset cache or not through a binlog log of MySQL in response to the fact that the corresponding data in the database is determined to be updated.
In some embodiments, the apparatus further comprises: and the timing verification unit is configured to respond to the fact that the corresponding data in the database is completely updated, and verify whether the corresponding data in the database is consistent with the updated quota data in the preset cache or not according to the preset time interval.
In some embodiments, the foregoing rational computation request is generated by: acquiring a drug purchasing settlement page; and generating an settlement request according to the medicine purchasing settlement page and a preset settlement rule.
In a third aspect, an embodiment of the present disclosure provides a server, including: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, which when executed by a processor implements the method as described in any of the implementations of the first aspect.
According to the method, the device, the server and the medium for real-time settlement calculation, data in the preset cache are updated in real time and the database is asynchronously stored, so that one-time settlement can be completed only through cache operation without depending on the performance bottleneck of the database, and the performance and response timeliness of a system are greatly improved. And moreover, by sending the message queue delay message first, a message queue compensation mechanism can be provided when the subsequent asynchronous storage of the database fails, so that the final consistency of the data is ensured.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for real-time justification according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a method for real-time justification according to an embodiment of the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a method for real-time justification according to the present disclosure;
FIG. 5 is a schematic block diagram of one embodiment of an apparatus for real-time tally according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary architecture 100 to which the disclosed method for real-time justification or apparatus for real-time justification may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 interact with a server 105 via a network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, an insurance claim application, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting human-computer interaction, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, such as a background server providing support for insurance claim applications on the terminal devices 101, 102, 103. The background server can analyze and process the received calculation request, execute corresponding processing (for example, updating the quota data) according to the request, and feed back the generated processing result (for example, the updated quota data) to the terminal device.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the method for real-time adjustment provided by the embodiment of the present disclosure is generally performed by the server 105, and accordingly, the device for real-time adjustment is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for real-time justification according to the present disclosure is shown. The method for real-time adjustment comprises the following steps:
step 201, in response to receiving the accounting request, sending a message queue delay message corresponding to the accounting request.
In this embodiment, in response to receiving the accounting request, the execution main body (e.g., the server 105 shown in fig. 1) of the method for real-time accounting may transmit the message queue delay message corresponding to the accounting request through a wired connection or a wireless connection. The adjustment request may include an adjustment amount. The message queue delay message corresponding to the settlement request may generally include data of the non-fallen databases related to the settlement request, such as the data of the claim settlement case, the journal data of the settlement quota alteration log, and the like.
In some optional implementations of this embodiment, the calculation processing request may be generated by:
first, a drug purchase settlement page is obtained.
In these implementations, the execution body may first acquire a purchase settlement page. The purchase settlement page may include the amount of the medicine.
And secondly, generating an settlement request according to the medicine purchasing settlement page and a preset settlement rule.
In these implementations, the executing body may generate an settlement request according to the drug purchase settlement page acquired in the first step and a preset settlement rule. The settlement request may include an amount that can be settled in the amount of the medicine.
Based on the optional implementation mode, the scheme can be applied to real-time settlement and compensation of health insurance in settlement of medicine purchasing, so that the requirement on timeliness during settlement of medicine purchasing orders is met.
Step 202, in response to determining that the message queue delay message is sent completely, updating the quota data corresponding to the accounting request from a preset cache.
In this embodiment, in response to determining that the message queue has finished sending the delayed message, the execution main body may update the quota data corresponding to the accounting request from the preset cache in various manners. As an example, the execution subject may perform, in real time, a deduction of the cache amount from a preset cache according to the adjustment amount included in the adjustment request.
In some optional implementation manners of this embodiment, the quota data in the preset cache may be obtained through the following steps:
firstly, acquiring policy identification and claim settlement content information corresponding to the policy identification.
In these implementations, the claim content information can include at least one of: claim amount, claim times and claim-free amount.
And secondly, generating current quota data according to the claim content information and preset claim rules.
In these implementations, the current credit data is typically associated with at least one of: periodic limit, claim settlement personnel information and claim settlement history.
Based on the optional implementation mode, the scheme enriches the generation mode of the quota data in the cache, so that the scheme can flexibly adapt to various claim settlement rules and improve the universality of the scheme.
Optionally, based on the optional implementation manner, the policy identifier and the claim settlement content information corresponding to the policy identifier are stored by using a Map. The key (key) stored by the Map can be generated according to the policy period value and the insured person identifier corresponding to the policy identifier. The value (value) stored in the Map may be generated according to the claim content information.
As an example, the Map key may be the period value (month/year/quarter) + insured certificate number. Map value may be a remaining quota. For example, in the 5 th month of 2021, an insurance policy (insurance policy number 100100100) and an insured person, the upper limit of the claim settlement is 5000 yuan. If the insured life certificate number is 123456, no claims have yet occurred for that month. Then the key of the Map of the claim amount in the cache content is 202105_123456, and the value is 5000. Other claim settlement times, Map of the exempt quota. Moreover, since claims are generated with the insurance policy as the primary dimension, the policy identification can be a key to the cache corresponding to the settlement request.
Based on the optional implementation mode, the Map mode is adopted in the scheme, so that the flexibility of storage can be guaranteed to the maximum extent. Since the period value is determined by time, the data amount thereof dynamically increases to a large order as time goes by. If the field is used directly for management, all the periods of the field need to be generated from the beginning, resulting in a very large number of fields. Moreover, since claims do not necessarily occur every cycle, and the data of the quota of claims is usually sparse, it is meaningless to maintain these fields all together. Therefore, compared with the fields which are hard coded, the scheme adopts the Map mode to store, so that the flexibility is ensured, and the storage efficiency is improved.
In some optional implementation manners of this embodiment, the executing entity may further send the updated quota data in the preset cache to a sending end corresponding to the accounting request.
Step 203, updating the corresponding data in the database corresponding to the preset cache according to the updated quota data.
In this embodiment, according to the credit data updated in step 202, the execution subject may update the corresponding data in the database corresponding to the preset cache in various ways. As an example, after the data is cached and updated, the execution subject may asynchronously store the data in the cache, so as to update the corresponding data in the database corresponding to the preset cache.
In some optional implementation manners of this embodiment, according to the updated quota data, the execution main body may update corresponding data in the database corresponding to the preset cache according to the following steps:
firstly, selecting data which are not subjected to library dropping from a preset cache for library dropping.
In these implementations, the execution subject may first select data that is not subjected to library dropping from a preset cache for library dropping. As an example, the execution subject may select data from the preset cache, compare the selected data with corresponding data in the database in various ways (e.g., compare a timestamp or a power of the data), and determine whether the selected data falls into the database.
And secondly, in response to the fact that the database dropping is successful, deleting the database dropping successful data from the preset cache.
In these implementations, in response to determining that the database dropping in the first step is successful, the execution subject may delete the successfully dropped data from the preset cache.
Based on the optional implementation mode, the data dropping can be asynchronously carried out after the cache is updated in real time, so that the data consistency is ensured as far as possible while the response real-time performance is improved.
Optionally, based on the optional implementation manner, the executing main body may further continue to perform the following steps:
and thirdly, responding to the database dropping failure, and acquiring the message queue delay message corresponding to the database dropping failure data.
In these implementations, in response to determining that the library dropping failed, the execution principal may obtain a message queue delay message corresponding to the data of the library dropping failed in the first step.
And fourthly, reading the database not falling indicated by the message queue delay message corresponding to the database falling failure data from the preset buffer.
In these implementations, the execution subject may read, from the preset buffer, non-database-dropping data indicated by the message queue delay message corresponding to the database-dropping failure data.
Fifthly, writing the read database data which does not fall into the database corresponding to the preset cache.
In these implementations, the execution subject may write the read missed bank data into a database corresponding to the preset cache.
Based on the optional implementation mode, the scheme can perform database dropping on the data of the thread pool asynchronous database dropping failure by setting the message queue delay message, so that the final consistency of the data is ensured.
In some optional implementation manners of this embodiment, the executing main body may further check, according to a preset time interval, whether the corresponding data in the database is consistent with the updated quota data in the preset cache, in response to determining that the corresponding data in the database is updated completely. The preset time interval may be, for example, one day. Therefore, every 24 hours, the execution main body can trigger a timing calibration task to verify the cache limit of the policy subjected to claim settlement in the previous day.
Based on the optional implementation mode, the scheme can perform timing calibration on whether the cache is consistent with the data in the database according to the preset time interval, so that the data consistency is ensured.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of a method for real-time rationalization according to an embodiment of the present disclosure. In the application scenario of fig. 3, user 301 uses terminal device 302 to send a rational request 304 characterizing a reimbursement 50 element to server 303. Server 303 sends a corresponding delay message 305 characterizing the reimbursement 50 element to the message queue. In response to determining that the delay message 305 is sent, the server 303 updates the quota data 306 corresponding to the adjustment request 304 from a preset cache, for example, changing the original quota 1000 to 950. According to the updated credit line data 306, the server 303 changes the credit line data (shown as 307 in the figure) corresponding to the accounting request in the database corresponding to the preset cache to 950 yuan. Optionally, the server 303 may also send the updated quota data to the terminal device 302.
At present, one of the prior art is usually based on a mode that a user pays first, then manually reviews claim settlement data through post-reporting, and then issues a claim payment amount. In the prior art, when the settlement calculation is carried out on a claim, the requirement of scenes such as medicine purchase settlement and the like on timeliness cannot be met due to the fact that the prior art is limited by complex rules of the settlement calculation and performance bottlenecks of a database. In the method provided by the embodiment of the disclosure, the data in the preset cache is updated in real time and the database is asynchronously stored, so that one claim settlement can be completed only through cache operation, the performance bottleneck of the database is not depended on, and the performance and response timeliness of the system are greatly improved. And moreover, by sending the message queue delay message first, a message queue compensation mechanism can be provided when the subsequent asynchronous storage of the database fails, so that the final consistency of the data is ensured.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for real-time justification is shown. The process 400 of the method for real-time adjustment includes the following steps:
step 401, in response to receiving the accounting request, sending a message queue delay message corresponding to the accounting request.
Step 402, in response to determining that the message queue delay message is sent completely, updating the quota data corresponding to the accounting request from a preset cache.
In some optional implementation manners of this embodiment, the quota data in the preset cache may be obtained through the following steps:
firstly, acquiring policy identification and claim settlement content information corresponding to the policy identification.
In these implementations, the claim content information can include at least one of: claim amount, claim times and claim-free amount.
And secondly, generating current quota data according to the claim content information and preset claim rules.
In these implementations, the current credit data is typically associated with at least one of: periodic limit, claim settlement personnel information and claim settlement history.
Based on the optional implementation mode, the scheme enriches the generation mode of the quota data in the cache, so that the scheme can flexibly adapt to various claim settlement rules and improve the universality of the scheme.
And step 403, updating corresponding data in the database corresponding to the preset cache according to the updated quota data.
Step 404, in response to determining that the corresponding data in the database is updated, triggering, through a binlog log of MySQL, a check whether the corresponding data in the database is consistent with the updated quota data in the preset cache.
In this embodiment, in response to determining that the corresponding data in the database is updated, an executing agent (for example, the server 105 shown in fig. 1) of the method for real-time adjustment may trigger, through a binlog log of MySQL, a check on whether the corresponding data in the database is consistent with the updated quota data in the preset cache.
Steps 401 to 403 are respectively consistent with steps 201 to 203 and their optional implementations in the foregoing embodiment, and the above descriptions for steps 201 to 203 and their optional implementations also apply to steps 401 to 403, which are not described herein again.
As can be seen from fig. 4, the flow 400 of the method for real-time adjustment in this embodiment represents a step of triggering, through the binlog log of MySQL, a check on whether the corresponding data in the database is consistent with the updated quota data in the preset cache, in response to determining that the corresponding data in the database is updated completely. Therefore, according to the scheme described in this embodiment, after the claim database is asynchronously stored each time, whether the cache limit is correct or not is triggered and checked through the binlog log of MySQL, so that data consistency is ensured.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of an apparatus for real-time calculation, which corresponds to the method embodiment shown in fig. 2 or fig. 4, and which may be applied in various electronic devices.
As shown in fig. 5, the apparatus 500 for real-time calculation according to the present embodiment includes a sending unit 501, a buffer updating unit 502, and a database updating unit 503. The sending unit 501 is configured to send a message queue delay message corresponding to an accounting request in response to receiving the accounting request, where the accounting request includes an accounting amount; a cache updating unit 502 configured to update the quota data corresponding to the accounting request from a preset cache in response to determining that the message queue delay message is sent; the database updating unit 503 is configured to update the corresponding data in the database corresponding to the preset cache according to the updated quota data.
In the present embodiment, in the apparatus 500 for real-time adjustment: the specific processing of the sending unit 501, the cache updating unit 502 and the database updating unit 503 and the technical effects thereof can refer to the related descriptions of step 201, step 202 and step 203 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementation manners of this embodiment, the quota data in the preset cache may be obtained through the following steps: acquiring policy identification and claim content information corresponding to the policy identification, wherein the claim content information may include at least one of the following: claim settlement limit, claim settlement times and claim-free limit; generating current quota data according to the claim content information and a preset claim rule, wherein the current quota data can be related to at least one of the following items: periodic limit, claim settlement personnel information and claim settlement history.
In some optional implementation manners of this embodiment, the policy identifier and the claim content information corresponding to the policy identifier may be stored by using a Map, a key stored by the Map may be generated according to the policy period value and the insured person identifier corresponding to the policy identifier, and a value stored by the Map may be generated according to the claim content information.
In some optional implementations of this embodiment, the database updating unit 503 may be further configured to: selecting data which are not subjected to library falling from a preset cache for library falling; and in response to determining that the database dropping is successful, deleting the database dropping successful data from the preset cache.
In some optional implementations of this embodiment, the database updating unit may be further configured to: in response to determining that the database dropping fails, obtaining a message queue delay message corresponding to the database dropping failed data; reading non-database falling data indicated by message queue delay messages corresponding to database falling failure data from a preset cache; and writing the read database data which does not fall into the database corresponding to the preset cache.
In some optional implementations of this embodiment, the apparatus 500 for real-time adjustment may further include: and the single checking unit is configured to trigger checking whether the corresponding data in the database is consistent with the updated quota data in the preset cache or not through a binlog log of MySQL in response to the fact that the corresponding data in the database is determined to be updated.
In some optional implementations of this embodiment, the apparatus 500 for real-time adjustment may further include: and the timing verification unit is configured to respond to the fact that the corresponding data in the database is completely updated, and verify whether the corresponding data in the database is consistent with the updated quota data in the preset cache or not according to the preset time interval.
In some optional implementations of this embodiment, the calculation processing request may be generated by: acquiring a drug purchasing settlement page; and generating an settlement request according to the medicine purchasing settlement page and the preset settlement rules.
According to the device provided by the embodiment of the disclosure, the data in the preset cache is updated in real time through the cache updating unit 502, and the database is asynchronously stored through the database updating unit 503, so that one-time claim settlement can be completed only through cache operation, the performance bottleneck of the database is not depended on, and the performance and response timeliness of the system are greatly improved. Moreover, the sending unit 501 sends the message queue delay message first, and can provide a message queue compensation mechanism when the subsequent asynchronous database storage fails, so that the final consistency of the data is ensured.
Referring now to FIG. 6, a block diagram of an electronic device (e.g., the server of FIG. 1) 600 suitable for implementing embodiments of the present application is shown. The terminal device in the embodiments of the present application may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present application.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 embodiments of the disclosure, 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 embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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: electrical wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the server; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: responding to the received reason calculation request, and sending a message queue delay message corresponding to the reason calculation request, wherein the reason calculation request comprises an reason calculation amount; updating the quota data corresponding to the calculation request from a preset cache in response to the fact that the message queue delay message is determined to be sent completely; and updating corresponding data in a database corresponding to the preset cache according to the updated quota data.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as "C", Python, or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor comprises a sending unit, a cache updating unit and a database updating unit. The names of these units do not form a limitation on the unit itself under certain circumstances, for example, the sending unit may also be described as a unit that sends a message queue delay message corresponding to an accounting request in response to receiving the accounting request, wherein the accounting request includes an accounting amount.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (11)

1. A method for real-time justification, comprising:
responding to a received accounting request, and sending a message queue delay message corresponding to the accounting request, wherein the accounting request comprises an accounting amount;
in response to the fact that the message queue delay message is sent completely, updating the quota data corresponding to the calculation request from a preset cache;
and updating corresponding data in a database corresponding to the preset cache according to the updated quota data.
2. The method as claimed in claim 1, wherein the credit data in the predetermined buffer is obtained by the following steps:
acquiring policy identification and claim content information corresponding to the policy identification, wherein the claim content information comprises at least one of the following items: claim settlement limit, claim settlement times and claim-free limit;
generating current quota data according to the claim settlement content information and a preset claim settlement rule, wherein the current quota data is related to at least one of the following items: periodic limit, claim settlement personnel information and claim settlement history.
3. The method according to claim 2, wherein the policy identifier and the claim content information corresponding to the policy identifier are stored using a Map, the Map stored key is generated according to the policy period value and the insured life identifier corresponding to the policy identifier, and the Map stored value is generated according to the claim content information.
4. The method of claim 1, wherein the updating the corresponding data in the database corresponding to the preset cache according to the updated quota data comprises:
selecting data which are not subjected to library dropping from the preset cache for library dropping;
and in response to determining that the database dropping is successful, deleting the database dropping successful data from the preset cache.
5. The method of claim 4, wherein the updating the corresponding data in the database corresponding to the preset cache according to the updated quota data further comprises:
in response to determining that the database dropping fails, obtaining a message queue delay message corresponding to the database dropping failed data;
reading the database dropping failure data indicated by the message queue delay message corresponding to the database dropping failure data from the preset cache;
and writing the read database data which does not fall into the database corresponding to the preset cache.
6. The method of claim 1, wherein the method further comprises:
and in response to the fact that the corresponding data in the database are completely updated, triggering whether the corresponding data in the database are consistent with the updated quota data in the preset cache or not through a binlog log of MySQL.
7. The method of claim 1, wherein the method further comprises:
and in response to the fact that the corresponding data in the database are completely updated, checking whether the corresponding data in the database are consistent with the updated quota data in the preset cache according to a preset time interval.
8. The method of any of claims 1-7, wherein the rationale request is generated by:
acquiring a drug purchasing settlement page;
and generating an settlement request according to the medicine purchasing settlement page and the preset settlement rule.
9. An apparatus for real-time justification, comprising:
the sending unit is configured to respond to the received reason calculation request, and send a message queue delay message corresponding to the reason calculation request, wherein the reason calculation request comprises an reason calculation amount;
the cache updating unit is configured to respond to the fact that the message queue delays the sending of the message to be finished, and update quota data corresponding to the calculation request from a preset cache;
and the database updating unit is configured to update corresponding data in the database corresponding to the preset cache according to the updated quota data.
10. A server, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202111127135.0A 2021-09-26 2021-09-26 Method, apparatus, server and medium for real-time tally Pending CN113850685A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111127135.0A CN113850685A (en) 2021-09-26 2021-09-26 Method, apparatus, server and medium for real-time tally

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111127135.0A CN113850685A (en) 2021-09-26 2021-09-26 Method, apparatus, server and medium for real-time tally

Publications (1)

Publication Number Publication Date
CN113850685A true CN113850685A (en) 2021-12-28

Family

ID=78980051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111127135.0A Pending CN113850685A (en) 2021-09-26 2021-09-26 Method, apparatus, server and medium for real-time tally

Country Status (1)

Country Link
CN (1) CN113850685A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114529301A (en) * 2022-02-21 2022-05-24 山东浪潮通软信息科技有限公司 Voucher posting method, device, equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114529301A (en) * 2022-02-21 2022-05-24 山东浪潮通软信息科技有限公司 Voucher posting method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN109299348B (en) Data query method and device, electronic equipment and storage medium
CN109766362B (en) Data processing method and device
CN112308552B (en) Method and device for ordering medical insurance medicine
CN109447635B (en) Information storage method and device for block chain
US11010200B2 (en) Finite state machine driven workflows
CN111857888A (en) Transaction processing method and device
CN109766365A (en) Run case control method, device and electronic equipment based on redis
CN111881329A (en) Account balance management method and system
CN109949064B (en) Open interface call charging method and device
CN110223179A (en) The data processing method of fund, device, system, medium
CN113850685A (en) Method, apparatus, server and medium for real-time tally
CN113379523A (en) Bill generation method, device, medium and electronic equipment
CN113242184A (en) Flow control method of distributed architecture and related equipment
CN116542585A (en) Method, device, electronic equipment and readable medium for generating commodity circulation value certificate
CN114997977A (en) Data processing method and device, electronic equipment and computer readable medium
CN114418482A (en) Order information processing method and device, electronic equipment and computer readable medium
CN110781238B (en) Client view caching method and device based on combination of Redis and Hbase
CN109741069B (en) Transaction data processing method and device, electronic equipment and readable storage medium
CN113592646A (en) Intelligent contract execution method, device and system
CN112367266A (en) Current limiting method, current limiting device, electronic equipment and computer readable medium
CN110781523A (en) Method and apparatus for processing information
CN115098453B (en) Information storage method, apparatus, electronic device, and computer readable medium
US20150262148A1 (en) Systems and methods for service request processing
CN113962782A (en) Order information processing method and device, electronic equipment and computer readable medium
CN118485220A (en) Information generation method, apparatus, electronic device and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination