CN115221532A - Method and system for storing resource bill data, computer equipment and storage medium - Google Patents
Method and system for storing resource bill data, computer equipment and storage medium Download PDFInfo
- Publication number
- CN115221532A CN115221532A CN202110426627.3A CN202110426627A CN115221532A CN 115221532 A CN115221532 A CN 115221532A CN 202110426627 A CN202110426627 A CN 202110426627A CN 115221532 A CN115221532 A CN 115221532A
- Authority
- CN
- China
- Prior art keywords
- resource
- data
- request
- bill
- real
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000012546 transfer Methods 0.000 claims abstract description 103
- 238000012545 processing Methods 0.000 claims abstract description 24
- 230000001360 synchronised effect Effects 0.000 claims description 61
- 238000012795 verification Methods 0.000 claims description 48
- 230000005540 biological transmission Effects 0.000 claims description 24
- 230000008569 process Effects 0.000 claims description 18
- 238000013475 authorization Methods 0.000 claims description 16
- 238000012790 confirmation Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 15
- 230000000977 initiatory effect Effects 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 18
- 230000006870 function Effects 0.000 description 6
- 230000003993 interaction Effects 0.000 description 6
- 238000013500 data storage Methods 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 208000019901 Anxiety disease Diseases 0.000 description 1
- 230000036506 anxiety Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2471—Distributed queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/45—Structures or tools for the administration of authentication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/08—Payment architectures
- G06Q20/10—Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
- G06Q20/102—Bill distribution or payments
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Data Mining & Analysis (AREA)
- Computer Hardware Design (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Development Economics (AREA)
- Computing Systems (AREA)
- Economics (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Computational Linguistics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application relates to a method, a system, a computer device and a storage medium for storing resource bill data. The method comprises the following steps: receiving a data write-in request generated after the service end completes the resource transfer of the resource transfer party; if the request amount of the received data writing request reaches a preset peak value, caching the data writing request; obtaining user bills corresponding to the cached partial data writing request in batches, and carrying out ticket checking processing on the user bills obtained in batches through a ticket checking system in sequence; when the ticket checking processing is passed, acquiring an encryption key from the key system, and encrypting the resource bill data carried by the partial data writing request based on the encryption key; and acquiring the identity of an authorized member user having a social relationship with the resource transfer party, and performing associated storage on the encrypted resource bill data and the identity so that the social application corresponding to the authorized member user queries the resource bill data based on the identity. The method can avoid the loss of the bill data and improve the safety of the bill data.
Description
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, a system, a computer device, and a storage medium for storing resource billing data.
Background
With the continuous development of internet technology, more and more users process various services through intelligent terminals, for example, in some application scenarios, the users transfer some numerical resources to other users, or may receive some numerical resources transferred by other users, and when the service processing is completed, the generated billing data is stored in the MySQL database. However, when a large number of data write requests occur, the problem of loss of the billing data may be caused, and the data security of the billing data cannot be guaranteed.
Disclosure of Invention
In view of the foregoing, there is a need to provide a method, a system, a computer device and a storage medium for storing resource billing data, which can avoid the loss of the billing data and improve the security of the billing data.
A method of storing resource billing data, the method comprising:
receiving a data write-in request generated after the service end completes the resource transfer of the resource transfer party; the resource is a numerical resource which initiates a transfer request through a social application corresponding to the resource transfer party;
if the request amount of the received data writing request reaches a preset peak value, caching the data writing request;
obtaining user bills corresponding to the cached partial data writing request in batches, and sequentially checking the user bills obtained in batches through a ticket checking system;
when the ticket checking processing is passed, an encryption key is obtained from a key system, and the resource bill data carried by the partial data writing request is encrypted based on the encryption key;
and acquiring an identity of an authorized member user having a social relationship with the resource transfer party, and performing associated storage on the encrypted resource bill data and the identity so as to enable a social application corresponding to the authorized member user to inquire the resource bill data based on the identity.
A system for storage of resource billing data, the system comprising:
the transparent transmission module is used for receiving a data write-in request generated after the service end completes the resource transfer of the resource transfer party; the resource is a numerical resource which initiates a transfer request through a social application corresponding to the resource transfer party; if the request amount of the received data writing request reaches a preset peak value, caching the data writing request;
the safety module is used for acquiring user bills corresponding to part of cached data write requests in batches and sequentially checking the user bills acquired in batches through a bill checking system; when the ticket checking processing is passed, an encryption key is obtained from a key system, and the resource bill data carried by the partial data writing request is encrypted based on the encryption key;
and the storage module is used for acquiring the identity of an authorized member user having a social relationship with the resource transfer party, and storing the encrypted resource bill data in association with the identity so as to enable the social application corresponding to the authorized member user to inquire the resource bill data based on the identity.
In one embodiment, the transparent transmission module is further configured to send the data write request to a standby server if a request amount of a currently received new data write request does not reach the preset peak value or a local load amount does not reach a preset calculated amount, so that the standby server synchronizes resource bill data carried by the data write request to a standby database.
In one embodiment of the foregoing, the pass-through module is further configured to cache the data write request to an in-memory database; and the memory database also stores real-name state information used for verifying whether real-name authentication is performed.
In one embodiment, the transferring resource comprises a transfer-in resource; the system further comprises:
the real-name verification module is used for receiving a real-name verification request sent by the service end before the service end is transferred into the resource; searching real name state information of a resource transfer party according to the real name verification request in an internal memory database; if the real-name state information of the resource transfer-in party is not found, forwarding the real-name verification request to an authentication server, and when the authentication server determines that the resource transfer-in party is not authenticated by the real-name, acquiring the real-name authentication information of the resource transfer-in party, and storing the real-name state information generated based on the real-name authentication information in the memory database; if the real-name state information of the resource transfer party is found, returning confirmation information of real-name authentication to the service end, so that the service end transfers to the resource after receiving the confirmation information.
In one embodiment, the unvarnished transmission module is further configured to send resource billing prompt information to the social account of the authorized member user; receiving a resource bill query request sent by a social application corresponding to the authorized member user; the resource bill query request is generated by responding to the trigger operation of the resource bill prompt message by the social application corresponding to the authorized member user; when the identity is read from the resource bill query request, reading stored resource bill data according to the identity; and sending the resource billing data to the social account so as to display the resource billing data through a social application corresponding to the authorized member user.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving a data write-in request generated after the service end completes the resource transfer of the resource transfer party; the resource is a numerical resource which initiates a transfer request through a social application corresponding to the resource transfer party;
if the request quantity of the received data writing request reaches a preset peak value, caching the data writing request;
obtaining user bills corresponding to the cached partial data writing request in batches, and sequentially checking the user bills obtained in batches through a ticket checking system;
when the ticket checking processing is passed, an encryption key is obtained from a key system, and the resource bill data carried by the partial data writing request is encrypted based on the encryption key;
and acquiring an identity of an authorized member user having a social relationship with the resource transfer party, and performing associated storage on the encrypted resource bill data and the identity so as to enable a social application corresponding to the authorized member user to inquire the resource bill data based on the identity.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a data write-in request generated after the service end completes the resource transfer of the resource transfer party; the resource is a numerical resource which initiates a transfer request through a social application corresponding to the resource transfer party;
if the request quantity of the received data writing request reaches a preset peak value, caching the data writing request;
obtaining user bills corresponding to the cached partial data writing request in batches, and sequentially checking the user bills obtained in batches through a ticket checking system;
when ticket checking processing is passed, an encryption key is obtained from a key system, and the resource bill data carried by the partial data writing request is encrypted based on the encryption key;
and acquiring an identity of an authorized member user having a social relationship with the resource transfer party, and performing associated storage on the encrypted resource bill data and the identity so as to enable a social application corresponding to the authorized member user to inquire the resource bill data based on the identity.
According to the method, the system, the computer equipment and the storage medium for storing the resource bill data, after a data write-in request which is generated by a service end after transferring resources and carries the resource bill data is received, whether the request quantity of the received data write-in request reaches a preset peak value is judged, and if the request quantity reaches the preset peak value, the received data write-in request is cached, so that the condition that overload occurs to a connection pool of a distributed database due to excessive data write-in requests is avoided, and the problem that the resource bill data are lost can be effectively avoided. In addition, the cached partial data is acquired in batches, the user bills corresponding to the data writing request are acquired, and the user bills acquired in batches are subjected to ticket checking processing through the ticket checking system in sequence, so that the safety of the resource bill data can be improved; and when the ticket checking process is passed, the encryption key is obtained from the key system, the resource bill data carried by the partial data writing request is encrypted based on the encryption key, and the encrypted resource bill data and the identity of the authorized member user are stored in an associated manner, so that the security of the resource bill data is further ensured, the authorized member user can check the resource bill data, the flexibility of checking the resource bill data is improved, and the authorized member user can conveniently monitor the resource transfer of the resource transfer party.
Drawings
FIG. 1 is a diagram of an application environment of a method for storing resource billing data in accordance with one embodiment;
FIG. 2 is a schematic flow chart diagram illustrating a method for storing resource billing data in accordance with one embodiment;
FIG. 3 is a schematic diagram of an interface for red envelope transmission and reception according to an embodiment;
fig. 4 is a schematic flow chart illustrating an application scenario of the resource billing data storage method applied to the red envelope service in one embodiment;
FIG. 5 is a schematic flow chart diagram illustrating the synchronization steps of the resource billing data in one embodiment;
FIG. 6 is a flowchart illustrating the real name verification step in one embodiment;
FIG. 7 is a flowchart illustrating an application scenario in which the real-name authentication scheme is applied to the red envelope service in one embodiment;
FIG. 8 is a diagram illustrating a system configuration composed of a service end, a primary server, and a backup server in one embodiment;
FIG. 9 is a schematic diagram illustrating the flow limiting and peak clipping operations performed by the pass-through module in accordance with one embodiment;
FIG. 10 is a schematic diagram of the security module validating tickets, encrypting and storing data in one embodiment;
FIG. 11 is a diagram illustrating a reconciliation module in accordance with an embodiment;
FIG. 12 is a schematic diagram of data synchronization between a primary room and a standby room in one embodiment;
FIG. 13 is a block diagram of a system for storing resource billing data in one embodiment;
fig. 14 is a block diagram of a configuration of a storage system of resource bill data in another embodiment;
FIG. 15 is a diagram of an internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
The resource bill data storage method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. In the application environment, a service end 102, a main server 104 and a standby server 106 are included. The service end 102, the main server 104 and the standby server 106 may be connected in a network communication manner to form a distributed system, where the distributed system may be a blockchain system, and the main server 104 and the standby server 106 may be nodes on two different blockchains, respectively. Referring to fig. 1, fig. 1 is an alternative structural diagram of a distributed system applied to a blockchain system according to an embodiment of the present invention, and the distributed system is formed by a service end 102 and a plurality of servers (i.e., a primary server 104 and a standby server 106). A Peer-To-Peer (P2P) network is formed among the service end 102, the main server 104 and the standby server 106, and the P2P Protocol is an application layer Protocol operating on a Transmission Control Protocol (TCP).
The service end 102 is configured to generate resource billing data after completing resource transfer, and generate a data write request according to the resource billing data to request the main server to store the resource billing data.
The main server 104 is configured to, after receiving a data write request sent by the service end 102, determine whether a request amount for receiving the data write request is greater than or equal to a preset peak value, and if so, cache the data write request; obtaining user bills corresponding to the cached partial data writing request in batches, and carrying out ticket checking processing on the user bills obtained in batches through a ticket checking system in sequence; when the ticket checking processing is passed, acquiring an encryption key from the key system, and encrypting the resource bill data carried by the partial data writing request based on the encryption key; and acquiring an identity of an authorized member user having a social relationship with the resource transfer party, and performing associated storage on the encrypted resource bill data and the identity so that the authorized member user can inquire the resource bill data based on the identity. In addition, the main server 104 is further configured to synchronize the resource billing data carried in the data write request to the standby server 106 after the data write request is cached, if the request amount of the new data write request does not reach the preset peak value or the local load amount of the main server 104 does not reach the preset calculated amount.
And the standby server 106 is used for synchronizing the resource bill data carried by the data writing request to the standby database.
It should be noted that the service end 102, the main server 104, and the standby server 106 may be independent physical servers, may also be a server cluster formed by a plurality of physical servers, and may be cloud servers providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content Delivery Network (CDN), and a big data and artificial intelligence platform.
In one embodiment, as shown in fig. 2, a method for storing resource billing data is provided, which is described by taking the method as an example applied to the main server 104 (hereinafter referred to as a server) in fig. 1, and includes the following steps:
s202, receiving a data write-in request generated after the service end completes the resource transfer of the resource transfer party; the resource is a numerical resource for initiating a transfer request through a social application corresponding to the resource transfer party.
Wherein, the service end may be a server for processing the resource transfer service. The resource transfer service comprises a resource transfer-in service and a resource transfer-out service, the resource transfer-out service comprises services of red packet sending, account transferring initiating, payment initiating and the like, and the resource transfer-in service comprises services of red packet receiving, account transferring receiving, payment receiving and the like.
The data write request carries resource billing data, which may be billing data generated by the service end after completing resource transfer and used for recording resource transfer conditions, including a service name, a resource transfer amount, transfer time, an identifier of a resource transfer-out party, and an identifier of a resource transfer-in party.
The data write request is a request generated by the service end after the resource bill data is generated, and is used for requesting the server to store the resource bill data. The data write request may carry original resource billing data; in addition, in order to ensure data security, the service end may carry a hash value of the resource bill data when generating the data write request.
The social application may refer to an application program for performing network social contact, and a resource transfer service may be initiated through the social application, as shown in the left diagram of fig. 3, a red envelope service, a transfer service, and the like are initiated in a session page of the social application.
In one embodiment, when receiving a resource transfer request initiated by a terminal, a service end determines the number of currently received resource transfer requests, and if the number of the resource transfer requests reaches a preset threshold, data write requests which are generated after resources are transferred and carry resource bill data can be sent to a server in batches, so that the problem that resource bill data stored in the server is abnormal due to excessive short-time resource transfer times during a holiday resource transfer peak period is avoided.
S204, if the request amount of the received data writing request reaches a preset peak value, caching the data writing request.
The request amount refers to the number of data write requests received in a unit time, such as the number of data write requests received in a short time (1 second). Because the request amount of the data writing requests reaches a preset peak value, all the data writing requests cannot be processed within a short time, and at the moment, the data writing requests can be cached and then processed in batches.
In an embodiment, if the request amount for receiving the data write request reaches a preset peak value, the server may also suspend receiving the data write request initiated by the service end. Specifically, the server sends a pause instruction to the service end, where the pause instruction may carry a pause duration, so as to instruct the service end to stop sending the data write request to the server within the pause duration, and after the pause duration is exceeded, the data write request may continue to be sent to the server.
In one embodiment, S204 may specifically include: the server caches the data write-in request to the memory database; the memory database also stores real name state information used for verifying whether real name authentication is carried out.
The memory database may refer to a database in which real-name state information is directly stored in a memory for operation. In practical application, the memory database may be a Redis database, a FastDB database, or an SQLite database, where the Redis database is used to store non-relational data, and data reading occurs in a memory, and the reading speed is fast. The FastDB database is an application-oriented database that provides a flexible and convenient interface for external devices to read data. The SQLite database is a light relational database, and occupies small hardware resources.
In one embodiment, different types of feedback information may be initiated in different application scenarios. After S204, the method further includes: the server sends prompt information that the data writing request is processed to the service end, so that the service end can be informed of the completion of the processing even if the processing is not completed currently, and the data writing request can be processed even if the service is not busy, thereby being beneficial to reducing the anxiety feeling of waiting of a user; or sending an error code for prompting that the data writing request is not processed currently to the service end.
And S206, acquiring the cached part of data in batches and writing the user bills corresponding to the request, and checking the user bills acquired in batches through the ticket checking system in sequence.
The user ticket may include user login status information or authorization confirmation information. The login status information may be status information of the user logging in the social application, including login address, login time, and login frequency. The authorization confirmation information may be confirmation information issued by the terminal for the user to authorize the resource billing data, for example, the user clicks a "confirm" button on a H5 page popped up by the social application, so as to generate the authorization confirmation information for granting the resource billing data to be processed.
The ticket checking system can be a system on the social application side for verifying whether the user on the terminal side allows processing of the resource billing data, and can also be a system on the server side for verifying whether the user on the terminal side allows processing of the resource billing data.
Because the request quantity of the data writing requests reaches a preset peak value, all the data writing requests cannot be processed simultaneously in a short time, and at the moment, the data writing requests can be processed in batches, namely user bills corresponding to part of the cached data writing requests are obtained in batches, the user bills obtained in batches are subjected to ticket checking processing through the ticket checking system in sequence, and then S208 is executed.
In one embodiment, the user ticket includes user login status information; the above step of sequentially performing ticket checking processing on the user tickets obtained in batches through the ticket checking system may specifically include: when the server acquires user login state information corresponding to partial data write-in requests in batches, the server sequentially sends the user login state information acquired in batches to the ticket checking system, so that the ticket checking system acquires and returns a user authorization state according to the user login state information; and determining whether the ticket checking process is passed or not according to the authorization state of the user.
In another embodiment, the server initiates a ticket checking request to the ticket checking system, so that the ticket checking system acquires user login state information corresponding to part of the data writing request, and acquires and returns a user authorization state according to the user login state information; and determining whether the ticket checking process is passed or not according to the authorization state of the user. The server is associated with the ticket checking system, and only when the server passes the ticket checking process, the resource bill data can be processed, so that the safety of the resource bill data can be effectively ensured.
And S208, when the ticket checking process passes, acquiring an encryption key from the key system, and encrypting the resource bill data carried by the partial data writing request based on the encryption key.
The key system may be a system for managing encryption keys and decryption keys, and when the number of encryption keys and decryption keys is insufficient, new encryption keys and decryption keys may be generated immediately. The encryption key and the decryption key are a key pair, the encryption key is used for data encryption, and the decryption key is used for data decryption of encrypted data.
The encryption key for encrypting the resource billing data may be a public key, that is, the server obtains the public key from the key system, and encrypts the resource billing data carried by the partial data write request based on the public key. When the resource bill data is read, the encrypted resource bill data can be decrypted only by obtaining the matched private key.
S210, obtaining the identity of the authorized member user who has social relation with the resource transfer party, and storing the encrypted resource bill data and the identity in an associated manner, so that the social application corresponding to the authorized member user queries the resource bill data based on the identity.
Wherein the authorized member user may be: and the social contact persons authorized by the resource transfer party, such as family persons of the resource transfer party, can view the resource bill data and have a specific relationship. The identity identifier may be information for identifying an identity of an authorized member user, and specifically may be an identity number, a mobile communication number, a social application account number, or the like of the authorized member user.
In one embodiment, the server may establish an association relationship between the encrypted resource billing data and the identity, and then store the resource billing data and the association relationship in the distributed database, so that when the authorized member user needs to view the resource billing data, the resource billing data may be searched from the distributed database based on the identity of the authorized member user.
Among them, the distributed database may refer to: a plurality of physically distributed data storage units are connected by a high-speed computer network to form a logically unified database, such as a MySQL database.
In one embodiment, after S210, the server sends a resource billing hint message to the social account of the authorized member user; receiving a resource bill query request sent by a social application corresponding to an authorized member user; the resource bill inquiry request is generated by the social application corresponding to the authorized member user responding to the trigger operation of the resource bill prompt message; when the identity is read from the resource bill query request, reading the stored resource bill data according to the identity; and sending the resource billing data to the social account so as to display the resource billing data through a social application corresponding to the authorized member user.
Where a social account may refer to an account for network socialization that the member user is authorized to register with the social application. The terminal of the authorized member user can receive the resource bill prompting information sent by the server through the social account, and the terminal generates a resource bill query request when detecting the triggering operation of the resource bill prompting information.
The resource billing prompting message may be a message for prompting the authorized member user that the resource transferor initiated the resource transfer and generated resource billing data. The resource bill prompting message may be displayed on an entry page of the social application, where the entry page is an entry into a conversation page or an information detail page, for example, a friend of the resource transfer party receives a red packet, a list of the entry page displays the red packet prompting message, and when the resource transfer party clicks or touches the list, the entry enters the conversation page for conversation with the friend.
In one embodiment, the server may merge part of the data write requests obtained and cached in batch, and then store the encrypted resource billing data in the part of the data write requests in the distributed database at one time, so as to greatly reduce input/output (I/O) times and improve storage efficiency.
In order to more clearly understand the above method for storing resource bill data, the method is described with reference to a specific red packet sending application scenario, which is as follows:
as shown in the left diagram of fig. 3, when the resource transfer-out party triggers an operation of sending a red packet through a social application of the sending end (i.e., a terminal of the resource transfer-out party), that is, triggers an operation of sending a red packet to the resource receiving party through a "red packet" button in a session page of the social application, at this time, the sending end generates a red packet sending request and sends the red packet to the service end. And after receiving the red packet sending request, the service end generates a red packet message and sends the red packet message to the Xiaoming. After xiaoming receives the red envelope information through the social application and clicks on pickup (as shown in the right diagram of fig. 3), the business end transfers the funds in the red envelope to the xiaoming resource account. After the fund transfer is completed, the service end generates fund billing data, and then sends a data write request carrying the fund billing data to the server, so as to perform a process of storing the fund billing data, which is specifically shown in fig. 4:
s402, the sending end transmits a red packet sending request to the service end.
S404, the service terminal transmits a request based on the red packet and transfers funds in the red packet to the small and clear resource account.
Specifically, after receiving a red packet sending request, the service end generates a red packet message and sends the red packet message to the xiaoming, and when the xiaoming receives the red packet message through the social application and clicks to pick up, the service end transfers funds in the red packet to a resource account of the xiaoming.
And S406, after the fund transfer is completed, the business terminal generates fund bill data.
S408, the service end sends a data write-in request carrying the fund bill data to the server
S410, after receiving a data writing request sent by a service end, a server firstly judges whether the request quantity of all data writing requests received in the time period reaches a preset score, and if the request quantity reaches a preset peak value, the server caches the data writing request.
S412, the server acquires user login state information corresponding to the cached partial data write-in request in batches.
The partial data write request may include a data write request corresponding to a red packet received by the Xiaoming.
And S414, the server checks the user bills acquired in batches sequentially through the bill checking system.
And S416, the server acquires the encryption key and encrypts the resource bill data carried by the partial data writing request based on the encryption key.
S418, the server stores the encrypted fund billing data in a distributed database.
In addition, the server can also obtain the identification of the authorized member user, and stores the encrypted fund bill data in association with the identification.
In the embodiment, after a data write request which is generated by a service end after transferring resources and carries resource bill data is received, whether the request quantity of the received data write request reaches a preset peak value is judged, and if the request quantity of the received data write request reaches the preset peak value, the received data write request is cached, so that the condition that overload occurs to a connection pool of a distributed database due to excessive data write requests is avoided, and the problem that the resource bill data is lost can be effectively avoided. In addition, the cached partial data are acquired in batches, the user bills corresponding to the writing request are sequentially checked through the ticket checking system, and therefore the safety of the resource bill data can be improved; and when the ticket checking process is passed, the encryption key is obtained from the key system, the resource bill data carried by the partial data writing request is encrypted based on the encryption key, and the encrypted resource bill data and the identity of the authorized member user are stored in an associated manner, so that the security of the resource bill data is further ensured, the authorized member user can check the resource bill data, the flexibility of checking the resource bill data is improved, and the authorized member user can conveniently monitor the resource transfer of the resource transfer party.
In one embodiment, the server may also back up the resource billing data, as shown in fig. 5, the method further includes:
and S502, acquiring a system log for recording bill storage information.
The system log may specifically be an op _ log, and may be configured to record storage information of the resource billing data, such as a service number, a service type, generation time, an amount of transferred resources, and the like corresponding to the resource billing data.
S504, obtaining the bill data of the resource to be synchronized according to the bill storage information in the system log.
The resource billing data to be synchronized may refer to the resource billing data to be synchronized, including the resource billing data carried in the data write request.
In one embodiment, the server parses the system log to obtain the bill storage information, and then obtains the corresponding resource bill data to be synchronized from the distributed database according to the bill storage information.
S506, a synchronous inquiry request for whether to synchronize is sent to the index system, so that the index system can determine whether the standby database stores the bill data of the resource to be synchronized.
In one embodiment, when acquiring the resource bill data to be synchronized, the server generates a synchronous query request for whether to synchronize according to the resource bill data to be synchronized, wherein the synchronous query request may carry a keyword or a data number of the resource bill data to be synchronized, and then sends the synchronous query request to the indexing system. When the index system receives the synchronous inquiry request, whether resource bill data matched with the key words or the data numbers in the synchronous inquiry request exist or not is searched in the standby database. If the resource bill data matched with the key words or the data numbers exist, the resource bill data to be synchronized is stored in the standby database; and if the resource bill data matched with the key words or the data numbers do not exist, the resource bill data to be synchronized is not stored in the standby database.
And S508, when the standby database is determined not to store the resource bill data to be synchronized, synchronizing the resource bill data to be synchronized to the standby database.
Specifically, the server can send the resource bill data to be synchronized to the standby server through the transparent transmission module, or send the data write request carrying the resource bill data to be synchronized to the standby server, the standby server obtains the user bill of the user corresponding to the resource bill data to be synchronized, and the user bill is checked through the bill checking system; and when the ticket checking process is passed, acquiring an encryption key from the key system, encrypting the resource bill data to be synchronized based on the encryption key, and then storing the encrypted resource bill data to be synchronized in a standby database, wherein the standby database can also be a distributed database.
In one embodiment, the server may further synchronize the resource bill data to be synchronized to the service database, so that the service end reconciles the resource bill data of the service end with the resource bill data in the service database, so as to ensure correctness of the data. Specifically, the server writes the resource bill data to be synchronized into a bill file; and synchronizing the bill file to the service database so that the service end can perform reconciliation on the resource bill data generated by transferring the resources and the data in the bill file synchronized to the service database, and updating the data in the reconciliation bill file according to the generated resource bill data when the data in the bill file is determined to be inconsistent with the generated resource bill data. Wherein the business database may be a relational database.
In addition, if the hash value of the resource bill data is stored in the service database, the service end may compare the hash value of the resource bill data generated by transferring the resource with the hash value stored in the service database, and update the hash value in the service database according to the generated resource bill data when it is determined that the hash value in the service database is inconsistent with the hash value of the generated resource bill data.
In the embodiment, the resource bill data to be synchronized, which is not synchronized into the standby database, is synchronized, so that the reliability of resource bill data storage and the availability of services can be improved. In addition, the resource bill data to be synchronized is synchronized to the business database, so that the account checking capability can be provided, and when the comparison is inconsistent, the data in the business database is updated, so that the correctness of the resource bill data is guaranteed.
In one embodiment, after S204, the method further comprises: and if the request quantity of the currently received new data writing request does not reach a preset peak value or the local load quantity does not reach a preset calculated quantity, the server sends the data writing request to the standby server so that the standby server synchronizes resource bill data carried by the data writing request to the standby database.
The server determines that the request quantity of the received new data writing request does not reach a preset peak value or the local load quantity does not reach a preset calculated quantity through the transparent transmission module, the data writing request is asynchronously sent to the transparent transmission module of the standby server through the transparent transmission module, the transparent transmission module of the standby server transmits the data writing request to the safety module, the safety module of the standby server conducts ticket checking processing on a user bill corresponding to the data writing request through a ticket checking system, when the ticket checking processing is passed, an encryption key is obtained from the key system, resource bill data carried by the data writing request are encrypted based on the encryption key, and then the encrypted resource bill data are stored in a distributed database on the side of the standby server.
In the above embodiment, when the data writing request is in a business peak, the resource bill data carried by the data writing request may be asynchronously written into the standby database, so that the computing pressure of the server may be reduced, and it may be ensured that the resource bill data carried by the data writing request may be written into the distributed database.
In one embodiment, transferring the resource includes transferring into the resource; as shown in fig. 6, before S202, the method further includes:
s602, receiving a real name verification request sent by the service end before transferring into the resource.
The real-name verification request can be used for requesting whether the resource transfer-in party has real-name authentication. For example, the service end sends the real-name verification request to the server, so that the server verifies whether the resource transfer-in party has performed real-name authentication according to the real-name verification request. For example, when the service end receives a red packet receiving request about the user a, the service end generates a real name verification request based on the red packet receiving request to verify whether the user a has performed real name authentication.
The resource transferring party is the user who receives the resource transferred by the resource transferring party, and the resource transferring party is the user who transfers the resource.
In one embodiment, when receiving a resource transfer-in request for each receiving end (i.e., a terminal of a resource transfer-in party), a service end first determines the number of currently received resource transfer-in requests, and stops sending a real-name verification request to a server if the number of the resource transfer-in requests reaches a preset threshold, and directly transfers the resource specified by the resource transfer-in request to a resource account of the resource transfer-in party. And if the quantity of the resource transfer-in requests does not reach a preset threshold value, sending a real-name verification request to the server, so that the server verifies whether the resource transfer-in party carries out real-name authentication. The embodiment can avoid the problem that resource transfer is abnormal due to excessive short-time resource transfer times in the holiday resource transfer peak period.
And S604, searching the real-name state information of the resource transfer party in the memory database according to the real-name verification request.
The memory database may refer to a database in which real-name state information is directly stored in a memory for operation. In practical application, the memory database may be a Redis database, a FastDB database, or an SQLite database, where the Redis database is used to store non-relational data, and data reading occurs in a memory, and the reading speed is fast.
The real-name state information may be state information used for indicating that the resource transfer party has performed real-name authentication, and may include real-name authentication information (such as an identity card code, a face image, and the like) of the resource transfer party; the real-name status information may also include status information indicating real-name authentication generated based on the real-name authentication information, such as a number, a character, or a combination of a number and a character, such as 1 indicating real-name authentication is performed, and 0 or null (i.e., no real-name status information) indicating that real-name authentication is not performed.
In one embodiment, the server reads the identification information of the resource transfer-in party from the real-name verification request, and searches the real-name state information of the resource transfer-in party in the memory database according to the identification information in the real-name verification request. When the real-name state information of the resource transfer-in party is found, the resource transfer-in party is indicated to be subjected to real-name authentication; when the real-name state information of the resource transfer-in party is not found, the server does not determine whether the resource transfer-in party carries out real-name authentication, and at the moment, a real-name verification request needs to be sent to the authentication server so that the authentication server can judge whether the resource transfer-in party carries out real-name authentication. By the embodiment, the real-name verification request is forwarded to the authentication server only under the condition that the server does not determine whether the resource transfer party carries out real-name authentication or not, so that the interaction amount between the server and the authentication server can be greatly reduced, the real-name state verification efficiency is improved, and the resource transfer efficiency is also improved.
S606, if the real-name state information of the resource transfer-in party is not found, the real-name verification request is forwarded to the authentication server, when the authentication server determines that the resource transfer-in party is not authenticated by the real name, the real-name authentication information of the resource transfer-in party is collected, and the real-name state information generated based on the real-name authentication information is stored in the memory database.
The real-name authentication information may be identity information about the resource transfer-in party uploaded by the resource transfer-in party through the receiving end, such as at least one of a name, an address, an identity card image, an identity card number, a face image and a fingerprint of the resource transfer-in party.
In an embodiment, the step of collecting real-name authentication information of the resource transfer-in party when the authentication server determines that the resource transfer-in party is not authenticated by the real name may specifically include: when the authentication server determines that the resource transfer-in party is not authenticated by the real name, the server sends feedback information for prompting real name authentication to the service end so that the service end sends a real name authentication request to the receiving end to collect the real name authentication information of the resource transfer-in party; and receiving real-name authentication information which is originated from the service end and aims at the resource transfer-in party.
The authentication server can judge whether the resource transfer-in party carries out real-name authentication or not by judging whether the real-name authentication information of the resource transfer-in party is stored or not. The feedback information may be used to prompt the resource transfer-in party to perform real-name authentication, for example, when the service end receives the feedback information, the service end sends a real-name authentication request carrying the feedback information to the receiving end, so that the receiving end displays the feedback information after receiving the real-name authentication request, so as to prompt the resource transfer-in party to perform real-name authentication before receiving the resource.
After the resource transfer-in party uploads the real-name authentication information through the receiving end, the server receives the uploaded real-name authentication information, and the server verifies the real-name authentication information on one hand to determine whether the real-name authentication information is real information of the resource transfer-in party or not; on the other hand, when the real-name authentication information is determined to be the real information of the resource transferring party, the real-name state information aiming at the resource transferring party is generated based on the real-name authentication information, and then the real-name state information is stored in the memory database. In addition, when the real-name state information is stored, the index identification of the resource transfer party can be stored at the same time, such as the identification card code, the name or the communication signal of the resource transfer party.
In another embodiment, when the authentication server determines that the resource transfer party has real-name authentication, real-name authentication information of the real-name authentication is acquired from the authentication server; and generating real-name state information based on the real-name authentication information, and storing the real-name state information in the memory database. Therefore, when a real-name verification request of the resource transfer-in party is received next time, the real-name state information of the resource transfer-in party can be searched from the memory database.
In one embodiment, if the real-name state information of the resource transfer-in party is not found and the service end initiates a real-name authentication request to the terminal of the resource transfer-in party, the real-name authentication request is stored in the relational database as the running-line information, so that when account checking is needed, the running-line information stored in the relational database is compared with the real-name authentication information stored in the authentication server to find the abnormal resource transfer-in party. For example, the real-name authentication is not performed at the authentication server, but a real-name authentication request is not initiated to request the resource transfer party performing the real-name authentication, so that the information indicating that the resource transfer party has been authenticated in the server is inaccurate. It should be noted that whether the resource transferring party is authenticated by real name or not usually depends on the result verified by the authentication server. The relational database can be SQL Server, mySQL, oracle, etc.
S608, if the real-name state information of the resource transfer party is found, the confirmation information of real-name authentication is returned to the service end, so that the service end transfers the resource after receiving the confirmation information.
If the real-name state information of the resource transfer-in party is found, the resource transfer-in party is indicated to be subjected to real-name authentication, and at the moment, a real-name verification request does not need to be sent to the authentication server.
Specifically, if the real-name state information of the resource transfer-in party is found, the server returns confirmation information that the resource transfer-in party has performed real-name authentication to the service end, so that the service end transfers the resource specified by the resource transfer-in request to the resource account of the resource transfer-in party.
In one embodiment, if the real-name state information of the resource transfer-in party is found, the confirmation information of real-name authentication is stored in the relational database as the flow information, so that when account checking is needed, the flow information stored in the relational database is compared with the real-name authentication information stored in the authentication server to find the abnormal resource transfer-in party.
In order to more clearly understand the above method for storing resource billing data, the description is made in conjunction with a specific application scenario of a red envelope, which is as follows:
as shown in fig. 3, when the resource transfer-out party triggers an operation of sending a red packet through the sending end (i.e. the terminal of the resource transfer-out party), that is, triggers an operation of sending a red packet to the resource receiving party through a "red packet" button in a session page of the social application, at this time, the sending end generates a red packet sending request and sends the red packet to the service end. After receiving the red packet sending request, the service end generates a red packet message and sends the red packet message to the xiaoming, when the xiaoming receives the red packet message through the social application and clicks to get, a red packet getting request is also generated, after receiving the red packet getting request, the service end generates an real name verification request to initiate real name verification, and specifically, the real name verification process is as shown in fig. 7:
s702, the receiving end sends a small and clear red packet getting request to the service server.
S704, the service server generates a real-name verification request based on the red packet getting request.
S706, the service server sends a real name verification request to the verification server.
And S708, after receiving the real name verification request, the verification server searches whether the real name state information is small or not in the memory server.
And S710, if the Xiaoming real-name state information is found, transferring the money in the red packet to the Xiaoming resource account.
And S712, if the small and clear real-name state information is not found, forwarding the real-name verification request to the authentication server.
S714, when the authentication server does not store the small and clear real-name authentication information, it determines that the small and clear real-name authentication is not performed.
And S716, when the Xiaoming and the unfixed real name authentication are determined, the verification server sends a real name authentication request carrying feedback information to the receiving end.
S718, after receiving the real-name authentication request, the receiving end displays feedback information to prompt the user to perform real-name authentication.
S720, after the receiving end obtains the small and clear real-name authentication information, the real-name authentication information is uploaded to an authentication server and a verification server.
After receiving the Xiaoming real-name authentication information, the verification server generates Xiaoming real-name state information based on the real-name authentication information, and stores the real-name state information in the memory database.
And S722, after determining that the Xiaoming performs real-name authentication, the service server transfers the money in the red envelope to the Xiaoming resource account.
Specifically, a red envelope is transferred to the minuscule resource account based on the amount specified by the red envelope pickup request.
Through the embodiment, after the real-name verification request generated based on the resource transfer-in request is received, the real-name state information of the resource transfer-in party is searched in the memory database, and the real-name verification request is forwarded to the authentication server to request the authentication server to perform verification only when the real-name state information of the resource transfer-in party is not searched, namely whether the resource transfer-in party performs real-name authentication is not determined, so that the interaction amount between the server and the authentication server can be greatly reduced, the real-name state verification efficiency is improved, and the resource transfer-in efficiency is also improved. In addition, if the real-name state information of the resource transfer-in party is found, the real-name authentication of the resource transfer-in party is shown, and at the moment, the confirmation information of the real-name authentication is directly returned to the service end, so that the service end transfers the resource specified by the resource transfer-in request, the interaction with the authentication server is not needed, and the resource transfer-in efficiency is improved.
As an example, an application scenario in which the method for storing resource billing data is applied to a red packet service is described as an example. First, a system structure related to an application scenario of the red envelope service is introduced, and as shown in fig. 8, the system includes a service end, a main server (i.e., a server in a main room), and a standby server (i.e., a server in a standby room).
The service end mainly comprises a service module, and the service module can be used for executing the red packet service and executing other services.
In addition, the main server mainly comprises a transparent transmission module, a reconciliation module, a storage module, a safety module and other modules. The following mainly introduces a passthrough module, a reconciliation module and a security module, wherein:
(1) Transparent transmission module
The core function of the transparent transmission module is to transmit data read-write requests (including data read requests and data write requests) of a service end, and the provided capability includes:
limiting the current, namely ensuring that the system operates in a capacity range, and refusing service when a data read-write request exceeds the capacity of the system;
peak clipping, namely when the data read-write request exceeds the system capacity, caching the excessive request and reducing the system pressure;
checking the ticket, namely verifying the user ticket of the request source to determine the validity;
index interaction, namely firstly inquiring indexes during inquiry and then acquiring full data from a storage side;
and (4) data synchronization, namely after the main server finishes data writing, synchronizing the data to the standby server.
As shown in fig. 9, the flow of limiting current and peak clipping for the transparent transmission module is specifically as follows:
1) The service end synchronizes the data writing request to the transparent transmission module, and performs the following processing for the request quantity of the received data writing request:
current limiting: when the data writing request exceeds the system capacity, returning failure information to the service end;
peak clipping: for the processing of holiday (such as spring festival) period, when the request exceeds the preset peak clipping value but is smaller than the current limiting value, the received data write request is buffered, and success information is returned to the service end, or in some other scenarios, a specific error code can be returned to the service end.
2) And other modules: and during the low peak period, the peak clipping request is written back to the transparent transmission module.
(2) Security module
The core function of the security module is to implement a read-write mechanism and ensure data consistency, and the additional functions include repairing when an exception occurs in the write-in process, adding, deleting, modifying and checking data of the storage layer, and encrypting the data of the bill, as shown in fig. 10, which are specifically described as follows:
1) The transparent transmission module synchronizes the data writing request to the security module;
2) The safety module sends the data writing request to a ticket checking system for checking the ticket;
3) After the ticket checking is passed, the security module acquires an encryption key in a key system;
4) The security module uses the key to encrypt data and then writes the billing data into the distributed database.
(2) Account checking module
The service end performs reconciliation on the reconciliation sheet data through the reconciliation module, so as to ensure the correctness of the final data, as shown in fig. 11, the reconciliation process is as follows:
1) The account checking module acquires an op _ log of a write-in operation from the security module;
wherein the op _ log is a system log.
2) Analyzing the op _ log, and then, according to the analysis result, billing data;
3) Sending a request to an index system, confirming whether the index system has the bill data, and sending a data write-in request if the bill data does not exist;
4) Verifying whether the database of the standby machine room contains the account data or not, and if not, writing in the database;
5) Writing the bill data existing in the op _ log into a corresponding file, and synchronizing the file into a relational database;
in addition, the business end can also carry out reconciliation on the bill data generated by the business end and the data in the relational database, and if the data are inconsistent, the data in the relational database are updated.
(4) Master and slave computer room data synchronization
For the database in the main machine room, the bill data can be written into the database in real time, and when the business is in a low-peak period, the bill data is synchronized to the standby machine room by the transparent transmission module, as shown in fig. 12.
Through the scheme of the embodiment, the following technical effects can be achieved:
firstly, a transparent transmission module is introduced to provide the current limiting/peak clipping capability, prevent the system overload and improve the availability; secondly, the availability is further improved in a way of mutual backup of the data of the main machine room and the standby machine room; thirdly, a safety module is introduced to provide a ticket checking function and a data encryption function, so that the safety of the system is improved; and finally, by introducing the account checking module, the account checking capability is provided, and the correctness of the data is guaranteed.
It should be understood that although the steps in the flowcharts of fig. 2, 4-7 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not limited to being performed in the exact order illustrated and, unless explicitly stated herein, may be performed in other orders. Moreover, at least some of the steps in fig. 2, 4-7 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternatively with other steps or at least some of the steps or stages in other steps.
In one embodiment, as shown in fig. 13, there is provided a system for storing resource billing data, which may be a part of a computer device using a software module or a hardware module, or a combination of the two, and specifically includes: a pass-through module 1302, a security module 1304, and a storage module 1306, wherein:
a transparent transmission module 1302, configured to receive a data write request generated by a service end after completing resource transfer of a resource transfer party; the resource is a numerical resource which initiates a transfer request through a social application corresponding to a resource transfer party; if the request quantity of the received data writing request reaches a preset peak value, caching the data writing request;
the safety module 1304 is used for acquiring user bills corresponding to the cached partial data writing requests in batches, and checking the user bills acquired in batches through the ticket checking system in sequence; when the ticket checking processing is passed, acquiring an encryption key from the key system, and encrypting the resource bill data carried by the partial data writing request based on the encryption key;
the storage module 1306 is configured to obtain an identity of an authorized member user who has a social relationship with the resource transfer party, and store the encrypted resource billing data in association with the identity, so that a social application corresponding to the authorized member user queries the resource billing data based on the identity.
In one embodiment, the pass-through module 1302 is further configured to send resource billing prompting information to the social account of the authorized member user; receiving a resource bill query request sent by a social application corresponding to an authorized member user; the resource bill inquiry request is generated by the social application corresponding to the authorized member user responding to the trigger operation of the resource bill prompt message; when reading the identity from the resource bill query request, reading the stored resource bill data according to the identity; and sending the resource billing data to the social account so as to display the resource billing data through a social application corresponding to the authorized member user.
In the embodiment, after a data write request which is generated by a service end after transferring resources and carries resource bill data is received, whether the request quantity of the received data write request reaches a preset peak value is judged, and if the request quantity of the received data write request reaches the preset peak value, the received data write request is cached, so that the condition that overload occurs to a connection pool of a distributed database due to excessive data write requests is avoided, and the problem that the resource bill data is lost can be effectively avoided. In addition, the cached partial data are acquired in batches, the user bills corresponding to the writing request are sequentially checked through the ticket checking system, and therefore the safety of the resource bill data can be improved; and when the ticket checking process is passed, the encryption key is obtained from the key system, the resource bill data carried by the partial data writing request is encrypted based on the encryption key, and the encrypted resource bill data and the identity of the authorized member user are stored in an associated manner, so that the security of the resource bill data is further ensured, the authorized member user can check the resource bill data, the flexibility of checking the resource bill data is improved, and the authorized member user can conveniently monitor the resource transfer of the resource transfer party.
In one embodiment, the user ticket includes user login status information; the security module 1304 is further configured to, when obtaining user login state information corresponding to the partial data write request in batches, sequentially send the user login state information obtained in batches to the ticket checking system, so that the ticket checking system obtains and returns a user authorization state according to the user login state information; or, initiating a ticket checking request to the ticket checking system so that the ticket checking system acquires user login state information corresponding to a part of data writing request, and acquires and returns a user authorization state according to the user login state information; and determining whether the ticket checking process is passed or not according to the authorization state of the user.
In one embodiment, as shown in fig. 14, the system further comprises:
a reconciliation module 1408, configured to obtain a system log for recording bill storage information; acquiring bill data of resources to be synchronized according to bill storage information in a system log; the resource bill data to be synchronized comprises resource bill data carried by the data writing request; sending a synchronous inquiry request for synchronizing or not to an index system so that the index system determines whether the standby database stores the bill data of the resources to be synchronized or not; and when the standby database is determined not to store the resource bill data to be synchronized, synchronizing the resource bill data to be synchronized to the standby database.
In one embodiment, the reconciliation module 1408 is further configured to write the resource billing data to be synchronized into a billing file; and synchronizing the bill file to the service database so that the service end can perform reconciliation on the resource bill data generated by transferring the resources and the data in the bill file synchronized to the service database, and updating the data in the reconciliation bill file according to the generated resource bill data when the data in the bill file is determined to be inconsistent with the generated resource bill data.
In the embodiment, the resource bill data to be synchronized, which is not synchronized into the standby database, is synchronized, so that the reliability of resource bill data storage and the availability of services can be improved. In addition, the resource bill data to be synchronized is synchronized to the business database, so that the account checking capability can be provided, and when the comparison is inconsistent, the data in the business database is updated, so that the correctness of the resource bill data is guaranteed.
In an embodiment, the transparent transmission module 1302 is further configured to send a prompt message that the data write request has been processed to the service end; or sending an error code for prompting that the data writing request is not processed currently to the service end.
In an embodiment, the transparent transmission module 1302 is further configured to send the data write request to the standby server if the request amount of the currently received new data write request does not reach a preset peak value or the local load amount does not reach a preset calculated amount, so that the standby server synchronizes the resource bill data carried by the data write request to the standby database.
In one embodiment, the transparent transmission module 1302 is further configured to cache the data write request to the in-memory database; the memory database also stores real name state information used for verifying whether real name authentication is carried out.
In the above embodiment, when the data writing request is in a business peak, the resource bill data carried by the data writing request may be asynchronously written into the standby database, so that the computing pressure of the server may be reduced, and it may be ensured that the resource bill data carried by the data writing request may be written into the distributed database.
In one embodiment, transferring the resource includes transferring into the resource; as shown in fig. 14, the system further includes:
the real-name verification module 1410 is used for receiving a real-name verification request sent by the service end before transferring to the resource; searching real-name state information of a resource transfer-in party according to the real-name verification request in an internal storage database; if the real-name state information of the resource transfer-in party is not found, forwarding a real-name verification request to the authentication server, collecting the real-name authentication information of the resource transfer-in party when the authentication server determines that the resource transfer-in party is not authenticated by the real name, and storing the real-name state information generated based on the real-name authentication information in a memory database; if the real-name state information of the resource transfer party is found, returning confirmation information of real-name authentication to the service end, so that the service end transfers the resource after receiving the confirmation information.
Through the embodiment, after the real-name verification request generated based on the resource transfer-in request is received, the real-name state information of the resource transfer-in party is searched in the memory database, and the real-name verification request is forwarded to the authentication server to request the authentication server to perform verification only when the real-name state information of the resource transfer-in party is not searched, namely whether the resource transfer-in party performs real-name authentication is not determined, so that the interaction amount between the server and the authentication server can be greatly reduced, the real-name state verification efficiency is improved, and the resource transfer-in efficiency is also improved. In addition, if the real-name state information of the resource transferring-in party is found, the real-name authentication of the resource transferring-in party is shown, and at the moment, confirmation information of the real-name authentication is directly returned to the service end, so that the service end transfers the resource specified by the resource transferring-in request, interaction with an authentication server is not needed, and the resource transferring-in efficiency is improved.
Specific limitations of the storage system for the resource billing data can be referred to the above limitations on the storage method for the resource billing data, and are not described herein again. The respective modules in the storage system of the resource billing data described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 15. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store resource billing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of storing resource billing data.
Those skilled in the art will appreciate that the architecture shown in fig. 15 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.
Claims (15)
1. A method for storing resource billing data, the method comprising:
receiving a data write-in request generated after the service end completes the resource transfer of the resource transfer party; the resource is a numerical resource which initiates a transfer request through a social application corresponding to the resource transfer party;
if the request quantity of the received data writing request reaches a preset peak value, caching the data writing request;
obtaining user bills corresponding to the cached partial data writing request in batches, and sequentially checking the user bills obtained in batches through a ticket checking system;
when the ticket checking processing is passed, an encryption key is obtained from a key system, and the resource bill data carried by the partial data writing request is encrypted based on the encryption key;
and acquiring an identity of an authorized member user having a social relationship with the resource transfer party, and performing associated storage on the encrypted resource bill data and the identity so as to enable a social application corresponding to the authorized member user to inquire the resource bill data based on the identity.
2. The method of claim 1, wherein the user ticket includes user login status information; the sequentially checking the user bills acquired in batches through the ticket checking system comprises the following steps:
when user login state information corresponding to the partial data writing request is obtained in batches, the user login state information obtained in batches is sent to the ticket checking system in sequence, so that the ticket checking system obtains and returns a user authorization state according to the user login state information; or initiating a ticket checking request to the ticket checking system so that the ticket checking system acquires user login state information corresponding to the partial data writing request, and acquires and returns a user authorization state according to the user login state information;
and determining whether the ticket checking process is passed or not according to the user authorization state.
3. The method of claim 1, further comprising:
acquiring a system log for recording bill storage information;
acquiring bill data of the resource to be synchronized according to bill storage information in the system log; the resource bill data to be synchronized comprises the resource bill data carried by the data write request;
sending a synchronous inquiry request for synchronizing or not to an index system so that the index system determines whether a standby database stores the resource bill data to be synchronized or not;
and when the standby database is determined not to store the resource bill data to be synchronized, synchronizing the resource bill data to be synchronized to the standby database.
4. The method of claim 3, further comprising:
writing the resource bill data to be synchronized into a bill file;
and synchronizing the bill file to a service database so that the service end performs reconciliation on resource bill data generated by resource transfer and data in the bill file synchronized to the service database, and updating the data in the bill file according to the generated resource bill data when the data in the bill file is determined to be inconsistent with the generated resource bill data.
5. The method of claim 1, wherein after the caching the data write request, the method further comprises:
sending prompt information that the data writing request is processed to the service end; or,
and sending an error code for prompting that the data writing request is not processed currently to the service end.
6. The method of any of claims 1 to 5, wherein after the caching the data write request, the method further comprises:
and if the request quantity of the currently received new data writing request does not reach the preset peak value or the local load quantity does not reach the preset calculated quantity, sending the data writing request to a standby server so that the standby server synchronizes resource bill data carried by the data writing request to a standby database.
7. The method of any of claims 1 to 5, wherein the caching the data write request comprises:
caching the data write-in request to a memory database; and the memory database also stores real-name state information used for verifying whether real-name authentication is performed.
8. The method of claim 7, wherein transferring resources comprises transferring resources; before receiving a data write request which is generated by the service terminal after transferring the resource and carries resource bill data, the method further comprises:
receiving a real-name verification request sent by the service end before the service end is switched into the resource;
searching real-name state information of a resource transfer-in party according to the real-name verification request in an internal memory database;
if the real-name state information of the resource transfer-in party is not found, forwarding the real-name verification request to an authentication server, and when the authentication server determines that the resource transfer-in party is not authenticated by the real-name, acquiring the real-name authentication information of the resource transfer-in party, and storing the real-name state information generated based on the real-name authentication information in the memory database;
and if the real-name state information of the resource transfer-in party is found, returning confirmation information of real-name authentication to the service end, so that the service end transfers to the resource after receiving the confirmation information.
9. The method of any one of claims 1 to 5, wherein after storing the encrypted resource billing data in association with the identity, the method further comprises:
sending resource bill prompting information to the social account of the authorized member user;
receiving a resource bill query request sent by a social application corresponding to the authorized member user; the resource bill query request is generated by the social application corresponding to the authorized member user responding to the trigger operation of the resource bill prompt message;
when the identity is read from the resource bill query request, reading stored resource bill data according to the identity;
and sending the resource billing data to the social account so as to display the resource billing data through a social application corresponding to the authorized member user.
10. A system for storing resource billing data, the system comprising:
the transparent transmission module is used for receiving a data write-in request generated after the service end completes the resource transfer of the resource transfer party; the resource is a numerical resource which initiates a transfer request through a social application corresponding to the resource transfer party; if the request quantity of the received data writing request reaches a preset peak value, caching the data writing request;
the safety module is used for acquiring user bills corresponding to the cached partial data writing requests in batches, and checking the user bills acquired in batches through the ticket checking system in sequence; when ticket checking processing is passed, an encryption key is obtained from a key system, and the resource bill data carried by the partial data writing request is encrypted based on the encryption key;
and the storage module is used for acquiring the identity of an authorized member user having a social relationship with the resource transfer party, and storing the encrypted resource bill data in association with the identity so as to enable the social application corresponding to the authorized member user to inquire the resource bill data based on the identity.
11. The system of claim 10, wherein the user ticket includes user login status information; the safety module is further used for sequentially sending the user login state information obtained in batches to the ticket checking system when the user login state information corresponding to the partial data writing request is obtained in batches, so that the ticket checking system can obtain and return a user authorization state according to the user login state information; or initiating a ticket checking request to the ticket checking system so that the ticket checking system acquires user login state information corresponding to the partial data writing request, and acquires and returns a user authorization state according to the user login state information; and determining whether the ticket checking process is passed or not according to the user authorization state.
12. The system of claim 10, further comprising:
the account checking module is used for acquiring a system log for recording bill storage information; acquiring bill data of the resources to be synchronized according to bill storage information in the system log; the resource bill data to be synchronized comprises resource bill data carried by the data writing request; sending a synchronous inquiry request for synchronizing or not to an index system so that the index system determines whether a standby database stores the resource bill data to be synchronized or not; and when the standby database is determined not to store the resource bill data to be synchronized, synchronizing the resource bill data to be synchronized to the standby database.
13. The system of claim 12, wherein the reconciliation module is further configured to write the resource billing data to be synchronized into a billing file; and synchronizing the bill file to a service database so that the service end performs reconciliation on the resource bill data generated by transferring the resources and the data in the bill file synchronized to the service database, and updating the data in the bill file according to the generated resource bill data when the data in the bill file is determined to be inconsistent with the generated resource bill data.
14. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any one of claims 1 to 9 when executing the computer program.
15. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110426627.3A CN115221532A (en) | 2021-04-20 | 2021-04-20 | Method and system for storing resource bill data, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110426627.3A CN115221532A (en) | 2021-04-20 | 2021-04-20 | Method and system for storing resource bill data, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115221532A true CN115221532A (en) | 2022-10-21 |
Family
ID=83604524
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110426627.3A Pending CN115221532A (en) | 2021-04-20 | 2021-04-20 | Method and system for storing resource bill data, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115221532A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117094722A (en) * | 2023-10-19 | 2023-11-21 | 深圳薪汇科技有限公司 | Security supervision method and system for online payment |
-
2021
- 2021-04-20 CN CN202110426627.3A patent/CN115221532A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117094722A (en) * | 2023-10-19 | 2023-11-21 | 深圳薪汇科技有限公司 | Security supervision method and system for online payment |
CN117094722B (en) * | 2023-10-19 | 2024-01-30 | 深圳薪汇科技有限公司 | Security supervision method and system for online payment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20240264983A1 (en) | Decentralized database associating public keys and communications addresses | |
CN108681965B (en) | Block chain network transaction processing method and device for offline node | |
JP7530890B2 (en) | Distributed Ledgers for Cryptographic Digital Identities | |
CN110163004B (en) | Block chain generation method, related equipment and system | |
US11425571B2 (en) | Device configuration method, apparatus and system | |
CN108683668B (en) | Resource checking method, device, storage medium and equipment in content distribution network | |
KR102065993B1 (en) | Systems and methods to verify ownership of a telephone number and to track ownership reassignments | |
JP2023542681A (en) | Integrating device identity into blockchain permission frameworks | |
CN113255014B (en) | Data processing method based on block chain and related equipment | |
KR20220140775A (en) | distributed database | |
CN111523142B (en) | Data processing method, device, electronic equipment and medium | |
US11829411B2 (en) | Data recovery method and apparatus, electronic device, and storage medium | |
US20240275600A1 (en) | Secure element, method for registering tokens, and token reference register | |
CN113129008B (en) | Data processing method, device, computer readable medium and electronic equipment | |
CN115221532A (en) | Method and system for storing resource bill data, computer equipment and storage medium | |
US20230306443A1 (en) | Method and system for establishing digital identity in international trade | |
CN117010889A (en) | Data processing method, device, equipment, medium and product | |
US20230222509A1 (en) | Method, terminal, and coin register for transmitting electronic coin data sets | |
CN110490005B (en) | Method, device and computer readable storage medium for processing resource transfer request | |
US11271920B2 (en) | Method and system for account security of recycled phone numbers | |
CN116055051A (en) | Data processing method based on block chain network and related equipment | |
CN113890753A (en) | Digital identity management method, device, system, computer equipment and storage medium | |
CN115842866A (en) | Data processing method and device, computer readable medium and electronic equipment | |
CN114499896B (en) | Real name authentication method and system based on block chain | |
CN111800256B (en) | Old people two-dimensional code electronic license application method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40074969 Country of ref document: HK |
|
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |