CN117196613B - Offline charging method, offline charging device, computer equipment and storage medium - Google Patents

Offline charging method, offline charging device, computer equipment and storage medium Download PDF

Info

Publication number
CN117196613B
CN117196613B CN202311228202.7A CN202311228202A CN117196613B CN 117196613 B CN117196613 B CN 117196613B CN 202311228202 A CN202311228202 A CN 202311228202A CN 117196613 B CN117196613 B CN 117196613B
Authority
CN
China
Prior art keywords
paid
hospital
server
user
payment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311228202.7A
Other languages
Chinese (zh)
Other versions
CN117196613A (en
Inventor
王惠莹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaotong Technology Co ltd
Original Assignee
Beijing Xiaotong Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaotong Technology Co ltd filed Critical Beijing Xiaotong Technology Co ltd
Priority to CN202311228202.7A priority Critical patent/CN117196613B/en
Publication of CN117196613A publication Critical patent/CN117196613A/en
Application granted granted Critical
Publication of CN117196613B publication Critical patent/CN117196613B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses an offline charging method, an offline charging device, computer equipment and a storage medium. The method comprises the following steps: when the user terminal to be paid is offline and the hospital server is online, receiving an offline payment code sent by the code scanning gun; uploading the offline payment code to a payment software server; if the corresponding token value exists in the token system and the balance is enough, performing deduction operation on the to-be-paid user; when the user terminal to be paid and the hospital server are both offline, the hospital server acquires a transaction request through a short-distance wireless communication technology and stores the transaction request into a local transaction record library; when the hospital server is connected to the network again, the transaction request is sent to the payment software server, and the payment operation is carried out on the user to be paid after the security verification is passed. The invention can realize payment under the condition that the user terminal to be paid is offline, and can finish transaction under the condition that the user terminal to be paid and the hospital server are offline, thereby solving the limitation that the hospital system is not allowed to be connected with an external network.

Description

Offline charging method, offline charging device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of charging management technologies, and in particular, to an offline charging method, an offline charging device, a computer device, and a storage medium.
Background
With the continuous development of medical science and technology, scales are increasingly used in medical institutions. Some common scales may help doctors evaluate patient condition and treatment outcome, thereby better guiding clinical decisions. However, these scales are typically developed and owned by copyrighters. Thus, medical institutions need to obtain the rights party's permissions to use these scales.
In practical applications, conventional licensing methods have some problems. For example, authorized use by purchase scales can create a significant economic burden for medical institutions. Meanwhile, since the price of the scale is generally high, it is difficult to entirely cover in a short time. In addition, the conventional licensing mode requires local installation, maintenance and updating of the meter.
To solve these problems, it has become an international practice in medical institutions for the amount to pay copyrighters by the number of uses. Specifically, the meter copyright party requires that a medical institution must be connected with the Internet when using the meter system, and the medical institution is connected with the copyright party through a copyright party remote server to perform online interaction, so that online use and charging of the meter are realized. In this mode, the medical institution can select the scale to be used according to the actual demand and pay corresponding fees according to the actual number of uses. This approach is more flexible and economical than the traditional licensing approach.
However, in the current hospital information system, many hospitals do not allow the system to be connected to an external network due to high attention on information security, such limitation ensures privacy and confidentiality of patient information while reducing risk of external network attack, and such limitation brings a certain inconvenience to the scale evaluation charge of the hospitals. Moreover, the conventional online payment method needs to rely on the payer and the payee to be online at the same time in order to transmit and verify transaction information in real time, and may cause interruption or failure of payment in case that the network of the payer is not good. The payer needs to maintain a stable network connection to complete the payment process, and the internal network of the hospital may be limited or capacity limited, resulting in unstable or delayed network. This makes it difficult for the payer to complete the payment on site, which causes inconvenience and delay in the meter evaluation of the charge.
Disclosure of Invention
Based on the above, an offline charging method, an offline charging device, a computer device and a storage medium are provided, so as to solve the technical problems that a payer needs to keep stable network connection to complete a payment process, and the existing hospital information system is not allowed to be connected to an external network, so that a certain inconvenience is brought to charging of a hospital.
In order to achieve the above object, the present application provides the following technical solutions:
in a first aspect, an offline charging method includes:
when a user terminal to be paid is offline and a hospital server is online, after an offline payment code generated by the user terminal to be paid is scanned by using a code scanning gun, the hospital server receives the offline payment code sent by the code scanning gun;
the hospital server uploads the offline payment code to a payment software server; the payment software server is used for sequentially comparing the token value contained in the offline payment code with information stored in a token system, creating a payment order if the token value corresponding to the offline payment code exists in the token system, and judging whether the balance of the user to be paid is enough or not; if the balance of the user to be paid is enough, performing deduction operation on the user to be paid;
the hospital server receives the payment order returned by the payment software server and sends the payment order to the hospital terminal;
when the user terminal to be paid and the hospital server are both offline, the hospital server obtains a transaction request of the user terminal to be paid through a short-distance wireless communication technology, and stores the transaction request into a local transaction record library;
when the hospital server is connected to the network again, the transaction request is sent to a payment software server, the payment software server is used for carrying out security verification on the transaction request, and if the security verification is passed, the payment deduction operation is carried out on the user to be paid.
Optionally, the method further comprises:
when a hospital server acquires a transaction request of a user terminal to be paid, the hospital server compares a transaction time stamp contained in the transaction request with the current time and judges whether the time interval recorded in the current time and the transaction time stamp exceeds a preset time interval or not;
if the preset time interval is not exceeded, the hospital server stores the transaction request into a local transaction record library;
if the preset time interval is exceeded, the hospital server outputs prompt information of transaction timeout.
Optionally, the method further comprises:
the hospital server is provided with a counter, and when the hospital server acquires a transaction request of a user terminal to be paid, the counter is increased by 1 each time, and whether the count of the counter exceeds a preset transaction frequency threshold value is judged;
if the number of times of transaction exceeds a preset transaction number threshold, outputting prompting information of limited transaction by the hospital server, and sending a verification short message to the user terminal to be paid;
and after the hospital server receives the corresponding token value replied by the user terminal to be paid according to the prompt in the check short message, the hospital server releases the transaction restriction and stores the transaction request into a local transaction record library.
Optionally, the method further comprises:
after acquiring the digital key from the scale copyright server, the hospital server verifies whether the digital key is legal or not by using a root certificate of the copyright server;
if the balance is legal, the hospital server generates a corresponding balance of the to-be-paid party of the hospital;
when using the meter in the meter software, the hospital server compares the balance of the to-be-paid party of the hospital with the single-use price of the meter;
if the balance of the to-be-paid party in the hospital is greater than or equal to the single-use price of the meter, the hospital server deducts the single-use price of the meter from the balance of the to-be-paid party in the hospital;
and if the balance of the to-be-paid party in the hospital is smaller than the single-use price of the meter, outputting a prompt that the meter software cannot be used by the hospital server.
Optionally, the generating process of the offline payment code includes:
responding to a service request of a user to be paid, wherein the user to be paid acquires information of the user to be paid, and the information of the user to be paid comprises a user identifier, a token value and a current time stamp;
the user terminal to be paid generates a first user characteristic to be paid according to the information of the user to be paid;
and the user terminal to be paid encrypts the first user characteristic to be paid to obtain a second user characteristic to be paid, generates a rule based on a standard payment code, and generates an offline payment code according to the second user characteristic to be paid.
Further optionally, the first to-be-paid user characteristic is encrypted using HMAC-SHA 256.
In a second aspect, an offline charging device includes:
the off-line payment code receiving module is used for receiving the off-line payment code sent by the code scanning gun after the off-line payment code generated by the user terminal to be paid is scanned by the code scanning gun when the user terminal to be paid is off-line and the hospital server is on-line;
the first charging module is used for uploading the offline payment code to a payment software server by the hospital server; the payment software server is used for sequentially comparing the token value contained in the offline payment code with information stored in a token system, creating a payment order if the token value corresponding to the offline payment code exists in the token system, and judging whether the balance of the user to be paid is enough or not; if the balance of the user to be paid is enough, performing deduction operation on the user to be paid;
the payment order forwarding module is used for receiving the payment order returned by the payment software server by the hospital server and sending the payment order to the hospital terminal;
the system comprises a transaction request acquisition module, a local transaction record library and a transaction request management module, wherein the transaction request acquisition module is used for acquiring a transaction request of a user terminal to be paid through a short-distance wireless communication technology when the user terminal to be paid and a hospital server are both offline, and storing the transaction request into the local transaction record library;
and the second charging module is used for sending the transaction request to a payment software server when the hospital server is connected to the network again, wherein the payment software server is used for carrying out security verification on the transaction request, and if the security verification is passed, the payment operation is carried out on the user to be paid.
In a third aspect, a computer device comprises a memory storing a computer program and a processor implementing the steps of the method of any of the first aspects when the computer program is executed.
In a fourth aspect, a computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the first aspects.
The invention has at least the following beneficial effects:
in the offline charging method provided by the embodiment of the invention, when the user terminal to be paid is offline, the offline payment code, the code scanning gun, the hospital server and the payment software server are interacted, so that the payment can be realized under the condition that the user terminal to be paid is offline, the trouble of unstable network or delay to the payment process is avoided, and the convenience and the efficiency of the payment are improved; according to the method, a local transaction record library is introduced, so that the function of storing transaction requests in an off-line state is realized; thus, even if the user terminal to be paid and the hospital server are both in an off-line state, the hospital server can still acquire the transaction request of the user to be paid through a short-distance wireless communication technology and store the transaction request into a local transaction record library; when the hospital server is connected to the network again, the transaction request can be sent to the payment software server for processing, so that the continuity and reliability of payment are ensured, and the transaction can be completed under the condition that the user terminal to be paid and the hospital server are both offline; the method not only solves the problem that the hospital system is not allowed to be connected with the external network, but also provides a flexible and efficient offline charging mode, facilitates the evaluation of the charging flow by the meter of the hospital, improves the overall efficiency and user experience, and provides a more convenient offline charging solution for the hospital.
Drawings
FIG. 1 is a schematic diagram of an application environment of an offline charging method according to an embodiment of the present invention;
FIG. 2 is a flow chart of an offline charging method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an offline payment code generation process according to an embodiment of the present invention;
FIG. 4 is a flow chart of a payer bill offline transaction according to an embodiment of the invention;
FIG. 5 is a flow chart of a dual offline transaction of a payer and a payee according to an embodiment of the invention;
FIG. 6 is a flow chart of a payer, payee dual offline transaction replenishment in accordance with one embodiment of the present invention;
FIG. 7 is a schematic flow chart of a method for realizing charging and deducting fees according to volume to a hospital by a copyright party under the condition that a hospital server is not connected with the Internet in one embodiment of the invention;
FIG. 8 is a block diagram of a module architecture of an offline charging device according to an embodiment of the present invention;
fig. 9 is an internal structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The offline charging method provided by the application can be applied to an application environment shown in fig. 1. The hospital server 101 communicates with the code scanning gun 102, the payment software server 104 and the meter copyright server 105 through a network, and the code scanning gun 102 is used for scanning a payment two-dimensional code on the user terminal 103 to be paid. The user terminal 103 to be paid can be, but not limited to, various smart phones, tablet computers and portable wearable devices, and the hospital server 101, the payment software server 104 and the meter copyrighter server 105 can be implemented by independent servers or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, an offline charging method is provided, and the method is applied to the hospital server 101 in fig. 1 for illustration, and includes the following steps:
s1, when a user terminal to be paid is offline and a hospital server is online, after an offline payment code generated by the user terminal to be paid is scanned by using a code scanning gun, the hospital server receives the offline payment code sent by the code scanning gun.
Further, the generating process of the offline payment code comprises the following steps:
responding to a service request of a user to be paid, wherein the user to be paid acquires information of the user to be paid, and the information of the user to be paid comprises a user identifier, a token value and a current time stamp;
the user terminal to be paid generates a first user characteristic to be paid according to the information of the user to be paid;
the user terminal to be paid encrypts the first user characteristic to be paid to obtain a second user characteristic to be paid, generates a rule based on the standard payment code, and generates an offline payment code according to the second user characteristic to be paid.
Wherein the first to-be-paid subscriber characteristic is encrypted using HMAC-SHA 256.
In other words, referring to fig. 3, the specific steps for generating the offline payment code are as follows:
(1) And receiving a service request of a user to be paid, and acquiring current information data of the user to be paid, wherein the current information data at least comprises information such as a user identifier (user ID), a token value (a permission identifier acquired by the user after logging in the system), a current time stamp and the like.
(2) Splicing the user identification, the current time stamp and the token value in the current information material of the user to be paid into a character string to generate a first user feature to be paid and a first user feature set to be paid,
first to-be-paid user feature = user identification + current timestamp + token value.
(3) Then, encrypting by using the HMAC-SHA256 to obtain an encrypted string, and generating a second user feature to be paid and a second user feature set to be paid;
second to-pay user feature = HMAC-SHA256 (user identification + current timestamp + token value).
(4) And generating the offline payment code from the second to-be-paid user characteristic set according to the standard payment code generation rule. The payment code is disposable and updated every minute, thus avoiding the conditions of screenshot, theft, etc.
S2, uploading the offline payment code to a payment software server by the hospital server; the payment software server is used for sequentially comparing the token value contained in the offline payment code with the information stored in the token system, creating a payment order if the token value corresponding to the offline payment code exists in the token system, and judging whether the balance of the user to be paid is enough or not; and if the balance of the user to be paid is enough, performing deduction operation on the user to be paid.
And S3, the hospital server receives the payment order returned by the payment software server and sends the payment order to the hospital terminal, and the hospital terminal can display the payment order for confirmation of a user.
In other words, as shown in fig. 4, when the second user side to be paid presents the payment code, the payment code is scanned by the payee hospital using the code scanning gun and uploaded to the payee hospital server and the payment software server; and after receiving the payment code information transmitted by the second user side to be paid, the payment software server sequentially compares the payment code information with the information stored in the token system.
And if the balance of the third user to be paid is enough, continuing to pay, and generating a fourth user feature to be paid and a fourth user feature set to be paid.
The fourth to-be-paid user may pay offline, but the payee hospital server is online. And transmitting the offline fourth user information of the payer to a payment software server for verification through bridging of the online payee hospital server, and carrying out single offline charging.
S4, when the user terminal to be paid and the hospital server are both offline, the hospital server obtains the transaction request of the user terminal to be paid through a short-distance wireless communication technology, and stores the transaction request into a local transaction record library.
The short-range wireless communication technology may specifically be bluetooth or NFC technology.
And S5, when the hospital server is connected to the network again, the transaction request is sent to the payment software server, the payment software server is used for carrying out security verification on the transaction request, and if the security verification is passed, the payment deduction operation is carried out on the user to be paid.
Further, the method further comprises:
when the hospital server acquires a transaction request of a user terminal to be paid, the hospital server compares a transaction time stamp contained in the transaction request with the current time and judges whether a time interval recorded in the current time and the transaction time stamp exceeds a preset time interval or not;
if the preset time interval is not exceeded, the hospital server stores the transaction request into a local transaction record library;
if the preset time interval is exceeded, the hospital server outputs prompt information of transaction timeout.
The transaction request may include, among other things, a payment amount, an identification of the user terminal to be paid, a transaction timestamp, a transaction number, an encrypted signature, and the like.
When the hospital server receives the transaction request sent by the user terminal to be paid, the information of the transaction time stamp is extracted, the server compares the transaction time stamp with the current time, and the time interval between the transaction time stamp and the current time is calculated. The server sets a preset time interval threshold in advance for judging whether the transaction is overtime. This time interval may be fixed, such as 4 hours.
The server determines whether the current time and the time interval recorded in the transaction timestamp exceed a preset time interval, and if the time interval does not exceed the preset time interval, the transaction is still within the validity period. And if the preset time interval is not exceeded, the hospital server stores the transaction request into a local transaction record library and continues to process the subsequent payment flow. If the time interval exceeds the preset time interval, the hospital server outputs a prompt message of overtime of the transaction to the user terminal to be paid, and informs that the transaction has overtime, and the transaction may need to be reinitiated or other operations may need to be taken.
Further, the method further comprises:
the hospital server is provided with a counter, and when the hospital server acquires the transaction request of the user terminal to be paid, the counter is increased by 1 each time, and whether the count of the counter exceeds a preset transaction frequency threshold value is judged;
if the transaction number exceeds the preset transaction number threshold, the hospital server outputs prompting information of limited transaction and sends a verification short message to a user terminal to be paid;
and after the hospital server receives the corresponding token value replied by the user terminal to be paid according to the prompt in the check short message, the hospital server releases the transaction limit and stores the transaction request into a local transaction record library.
In other words, special cases of offline payments also include: the payer and payee are off-line. For example: when the user takes the bus, the payment code of the bus is used for payment. However, some bus collection systems are not online in real time, and may be networked after one trip of a bus is completed, or may be networked at the end of a day, and fee deduction is performed only when the bus collection system is networked.
In order to solve the problem that the transaction can be completed under the offline condition of both parties, referring to fig. 5, the fourth user feature set of the to-be-paid party is stored in the local transaction record library, and the payment is deducted when the security verification can be performed, and after the security verification is passed, the fifth user feature set of the to-be-paid party and the fifth user feature set of the to-be-paid party are generated.
In addition, as shown in fig. 6, the fifth to-be-paid user feature set is limited in terms of "transaction time" and "transaction times", the fifth to-be-paid user feature set time is limited to 4 hours, the times are limited to 10 times, and when the "offline available times" are consumed, the sixth to-be-paid user feature and the sixth to-be-paid user feature set are generated.
When the payment code of the sixth to-be-paid user exceeds the transaction limit time or the limit times of use, the hospital payee server sends a short message offline check code to the sixth to-be-paid user in a short message mode, and the user releases the limit after replying corresponding token value information according to the prompt.
And simultaneously synchronizing the balance of the client of the sixth to-be-paid user with the balance of the server of the hospital payee through the token value information, so that the balance of the client of the sixth to-be-paid user is kept consistent with the balance of the server of the hospital payee.
Further, the method further comprises:
after acquiring the digital key from the scale copyright server, the hospital server verifies whether the digital key is legal or not by using a root certificate of the copyright server;
if the balance is legal, the hospital server generates a corresponding balance of the to-be-paid party of the hospital;
when using the meter in the meter software, the hospital server compares the balance of the to-be-paid party of the hospital with the single-use price of the meter;
if the balance of the to-be-paid party in the hospital is greater than or equal to the single-use price of the meter, the hospital server deducts the single-use price of the meter from the balance of the to-be-paid party in the hospital;
and if the balance of the to-be-paid party in the hospital is smaller than the single-use price of the meter, outputting a prompt that the meter software cannot be used by the hospital server.
In other words, referring to fig. 7, the copyright party can still charge the fee in volume to the hospital without connecting to the internet:
interfacing hospital management end software with scale software of a copyright party, and generating an encrypted digital key by a copyright party server;
verifying whether the digital key of the hospital management end software is legal or not by utilizing the root certificate of the copyright side server; if the verification is passed, generating a signature feature set of the user of the to-be-paid party in the hospital and a signature feature set of the user of the to-be-paid party in the hospital;
comparing the balance corresponding to the copyrights server with the single-use price through the signature characteristics of the user of the to-be-paid party in the hospital; if the software balance is greater than or equal to the single-use price of the meter, the charging is successful.
Under the condition that the hospital server is not networked, the docking of the hospital management software end and the meter software can be realized by installing the meter software SDK package on the hospital management software end. The SDK package can be encrypted through a physical medium (such as a USB encryption Key) so as to ensure the security of the SDK package; only after the correct physical medium is held and decryption is successful, the available SDK package content can be obtained, unauthorized access and use of the SDK package are prevented, and only authorized hospitals can use the metering software. Or after paying in the hospital, the copyright party sends the SDK package to the hospital, and the hospital installs the SDK package to the hospital management software end by itself, so that the balance can be updated.
In the case where the hospital server is not connected to the internet, the copyright party may choose to deliver the encrypted digital key to the hospital server via a physical medium (e.g., USB storage device) or other off-line means. After receiving the encrypted digital key provided by the copyright party, the hospital server can use the key for encrypted communication. When interfacing with the copyrighted scale software, the hospital server can use the digital key to encrypt and decrypt the communication data, thereby ensuring the security and integrity of the data.
In the offline charging method provided by the embodiment of the invention, the user can still pay under the condition of no network by using the combination of the offline payment code, the payment software server and the local transaction record library, and the problem of double offline transactions of a payer and a payee under the network-free environment is solved.
The method introduces a local transaction record library, and realizes the function of storing transaction requests in an off-line state; in this way, even if both the user terminal to be paid and the hospital server are offline, the transaction request can be acquired, stored, and synchronized to the payment software server after the hospital server is reconnected to the network, so that the transaction can be completed with both the user terminal to be paid and the hospital server offline.
The method not only solves the problem that the hospital system is not allowed to be connected with the external network, but also provides a flexible and efficient offline charging mode, facilitates the evaluation of the charging flow by the meter of the hospital, improves the overall efficiency and user experience, and provides a more convenient offline charging solution for the hospital.
The method provided by the embodiment of the invention solves the problem that the copyright party can still charge and deduct fees to the hospital according to the using times under the condition that the hospital is not connected with the Internet, and solves the problem of double offline transactions of the payment party and the collection party of the user under the network-free environment.
It should be understood that, although the steps in the flowcharts of fig. 2-7 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in FIGS. 2-7 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 8, an offline charging device is provided, including the following program modules:
the offline payment code receiving module 801 is configured to, when the user terminal to be paid is offline and the hospital server is online, receive the offline payment code sent by the code scanning gun after scanning the offline payment code generated by the user terminal to be paid by using the code scanning gun;
a first charging module 802 for the hospital server to upload the offline payment code to the payment software server; the payment software server is used for sequentially comparing the token value contained in the offline payment code with the information stored in the token system, creating a payment order if the token value corresponding to the offline payment code exists in the token system, and judging whether the balance of the user to be paid is enough or not; if the balance of the user to be paid is enough, performing deduction operation on the user to be paid;
the payment order forwarding module 803 is configured to receive a payment order returned by the payment software server by using the hospital server, and send the payment order to the hospital terminal;
the transaction request acquisition module 804 is configured to, when both the user terminal to be paid and the hospital server are offline, acquire a transaction request of the user terminal to be paid by the hospital server through a short-distance wireless communication technology, and store the transaction request in the local transaction record library;
and a second charging module 805, when the hospital server is connected to the network again, for sending the transaction request to a payment software server, wherein the payment software server is used for performing security verification on the transaction request, and performing deduction operation on the user to be paid if the security verification is passed.
For a specific definition of an offline charging device, reference may be made to the definition of an offline charging method hereinabove, and the description thereof will not be repeated here. Each of the modules in the offline charging device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a meter evaluation intelligent offline charging system is provided, the system comprising:
the specific steps for generating the offline payment code are described in detail below with reference to fig. 3.
The acquisition module is used for responding to the service request of the user to be paid and acquiring the current information data of all the users to be paid; the current information material at least comprises information such as a user identifier (user ID), a token value (a permission identifier acquired by a user after logging in the system), a current timestamp and the like.
And the anti-damage module encrypts the original string by using the HMAC-SHA256 based on the existing database data, and generates an offline payment code according to standard payment code generation rules after the encrypted string is obtained. The payment code is disposable and updated once per minute. Thus, the conditions of screenshot, theft and the like are avoided.
An offline charging module (refer to fig. 2), when the second user side to be paid presents the payment code, the payment code is scanned by the hospital of the payee using a code scanning gun and uploaded to the hospital server of the payee; after receiving the payment code information transmitted by the second user side to be paid, the server sequentially compares the payment code information with the information stored in the token system; and if the comparison is passed, creating a payment order, generating a third user feature to be paid and a third user feature set to be paid, and returning the third user feature set to be paid to the receiving party hospital server order information. And if the balance of the third to-be-paid user is enough, continuing to pay, and generating a fourth to-be-paid user characteristic and a fourth to-be-paid user characteristic set.
In order to solve the problem that the transaction can be completed under the condition that both sides can be offline, the characteristics set of the fourth user to be paid is stored in a local transaction record library, and deduction is performed when the security verification can be performed, and after the security verification is passed, the characteristics set of the fifth user to be paid and the characteristics set of the fifth user to be paid are generated (refer to fig. 3).
The specific steps of the two-offline transaction of the payor and payee are described in detail below with reference to fig. 4.
Limiting the feature set of the fifth to-be-paid user in terms of transaction time and transaction times, limiting the time of the feature set of the fifth to-be-paid user to 4 hours, limiting the times to 10 times, and generating the feature set of the sixth to-be-paid user and the feature set of the sixth to-be-paid user when the offline available times are consumed.
When the payment code of the sixth to-be-paid user exceeds the transaction limit time or the use times limit, the hospital payee server sends a short message offline check code to the sixth to-be-paid user in a short message mode, and the user releases the limit after replying corresponding token value information according to the prompt.
And simultaneously synchronizing the balance of the client of the user to be paid with the balance of the server of the hospital payee through the token value information, so that the balance of the client of the user to be paid is kept consistent with the balance of the server of the hospital payee.
The system further comprises:
before the system is used, a group of encrypted digital key digital strings are obtained from a copyright party, and a root certificate of a copyright party server is utilized to verify whether a digital key of the hospital management end software is legal or not; if the verification is passed, the signature features of the user of the to-be-paid party in the hospital and the signature feature set of the user of the to-be-paid party in the hospital are generated.
And the monitoring module is used for generating a corresponding balance of a to-be-paid party of the hospital through decrypting the language, recharging the meter software, and automatically starting the monitoring module to serve when the meter software is used by the hospital for a patient, and comparing the software balance with the single-use price of the software. If the balance of the software is greater than or equal to the single-use price of the meter, the system enters the next step, otherwise, arrearages are prompted, and the meter software cannot be used.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 9. 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 includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. 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 an offline charging method.
It will be appreciated by those skilled in the art that the structure shown in fig. 9 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the computer device to which the present application applies, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided, including a memory and a processor, the memory having stored therein a computer program, involving all or part of the flow of the methods of the embodiments described above.
In one embodiment, a computer readable storage medium having a computer program stored thereon is provided, involving all or part of the flow of the methods of the embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (8)

1. An offline charging method, comprising:
when a user terminal to be paid is offline and a hospital server is online, after an offline payment code generated by the user terminal to be paid is scanned by using a code scanning gun, the hospital server receives the offline payment code sent by the code scanning gun;
the hospital server uploads the offline payment code to a payment software server; the payment software server is used for sequentially comparing the token value contained in the offline payment code with information stored in a token system, creating a payment order if the token value corresponding to the offline payment code exists in the token system, and judging whether the balance of the user to be paid is enough or not; if the balance of the user to be paid is enough, performing deduction operation on the user to be paid;
the hospital server receives the payment order returned by the payment software server and sends the payment order to the hospital terminal;
when the user terminal to be paid and the hospital server are both offline, the hospital server obtains a transaction request of the user terminal to be paid through a short-distance wireless communication technology, and stores the transaction request into a local transaction record library;
when the hospital server is connected to the network again, the transaction request is sent to a payment software server, the payment software server is used for carrying out security verification on the transaction request, and if the security verification is passed, the payment operation is carried out on the user to be paid;
the method further comprises the steps of:
after acquiring the digital key from the scale copyright server, the hospital server verifies whether the digital key is legal or not by using a root certificate of the copyright server;
if the balance is legal, the hospital server generates a corresponding balance of the to-be-paid party of the hospital;
when using the meter in the meter software, the hospital server compares the balance of the to-be-paid party of the hospital with the single-use price of the meter;
if the balance of the to-be-paid party in the hospital is greater than or equal to the single-use price of the meter, the hospital server deducts the single-use price of the meter from the balance of the to-be-paid party in the hospital;
if the balance of the to-be-paid party in the hospital is smaller than the single-use price of the meter, the hospital server outputs a prompt that the meter software cannot be used;
under the condition that a hospital server is not networked, the docking of the hospital management software end and the meter software is realized by installing the meter software SDK package on the hospital management software end; encrypting the SDK package through a physical medium to ensure the security of the SDK package; only after the correct physical medium is held and decryption is successful, the available SDK package content can be obtained, unauthorized access and use of the SDK package are prevented, and only authorized hospitals can use the metering software.
2. The offline charging method according to claim 1, characterized in that the method further comprises:
when a hospital server acquires a transaction request of a user terminal to be paid, the hospital server compares a transaction time stamp contained in the transaction request with the current time and judges whether the time interval recorded in the current time and the transaction time stamp exceeds a preset time interval or not;
if the preset time interval is not exceeded, the hospital server stores the transaction request into a local transaction record library;
if the preset time interval is exceeded, the hospital server outputs prompt information of transaction timeout.
3. The offline charging method according to claim 1, characterized in that the method further comprises:
the hospital server is provided with a counter, and when the hospital server acquires a transaction request of a user terminal to be paid, the counter is increased by 1 each time, and whether the count of the counter exceeds a preset transaction frequency threshold value is judged;
if the number of times of transaction exceeds a preset transaction number threshold, outputting prompting information of limited transaction by the hospital server, and sending a verification short message to the user terminal to be paid;
and after the hospital server receives the corresponding token value replied by the user terminal to be paid according to the prompt in the check short message, the hospital server releases the transaction restriction and stores the transaction request into a local transaction record library.
4. The offline charging method according to claim 1, wherein the generation process of the offline payment code comprises:
responding to a service request of a user to be paid, wherein the user to be paid acquires information of the user to be paid, and the information of the user to be paid comprises a user identifier, a token value and a current time stamp;
the user terminal to be paid generates a first user characteristic to be paid according to the information of the user to be paid;
and the user terminal to be paid encrypts the first user characteristic to be paid to obtain a second user characteristic to be paid, generates a rule based on a standard payment code, and generates an offline payment code according to the second user characteristic to be paid.
5. The offline charging method according to claim 4, wherein the first user feature to be paid is encrypted using HMAC-SHA 256.
6. An offline charging device, comprising:
the off-line payment code receiving module is used for receiving the off-line payment code sent by the code scanning gun after the off-line payment code generated by the user terminal to be paid is scanned by the code scanning gun when the user terminal to be paid is off-line and the hospital server is on-line;
the first charging module is used for uploading the offline payment code to a payment software server by the hospital server; the payment software server is used for sequentially comparing the token value contained in the offline payment code with information stored in a token system, creating a payment order if the token value corresponding to the offline payment code exists in the token system, and judging whether the balance of the user to be paid is enough or not; if the balance of the user to be paid is enough, performing deduction operation on the user to be paid;
the payment order forwarding module is used for receiving the payment order returned by the payment software server by the hospital server and sending the payment order to the hospital terminal;
the system comprises a transaction request acquisition module, a local transaction record library and a transaction request management module, wherein the transaction request acquisition module is used for acquiring a transaction request of a user terminal to be paid through a short-distance wireless communication technology when the user terminal to be paid and a hospital server are both offline, and storing the transaction request into the local transaction record library;
the second charging module is used for sending the transaction request to a payment software server when the hospital server is connected to the network again, wherein the payment software server is used for carrying out security verification on the transaction request, and if the security verification is passed, the payment operation is carried out on the user to be paid;
after acquiring the digital key from the scale copyright server, the hospital server verifies whether the digital key is legal or not by using a root certificate of the copyright server;
if the balance is legal, the hospital server generates a corresponding balance of the to-be-paid party of the hospital;
when using the meter in the meter software, the hospital server compares the balance of the to-be-paid party of the hospital with the single-use price of the meter;
if the balance of the to-be-paid party in the hospital is greater than or equal to the single-use price of the meter, the hospital server deducts the single-use price of the meter from the balance of the to-be-paid party in the hospital;
if the balance of the to-be-paid party in the hospital is smaller than the single-use price of the meter, the hospital server outputs a prompt that the meter software cannot be used;
under the condition that a hospital server is not networked, the docking of the hospital management software end and the meter software is realized by installing the meter software SDK package on the hospital management software end; encrypting the SDK package through a physical medium to ensure the security of the SDK package; only after the correct physical medium is held and decryption is successful, the available SDK package content can be obtained, unauthorized access and use of the SDK package are prevented, and only authorized hospitals can use the metering software.
7. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 5.
CN202311228202.7A 2023-09-21 2023-09-21 Offline charging method, offline charging device, computer equipment and storage medium Active CN117196613B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311228202.7A CN117196613B (en) 2023-09-21 2023-09-21 Offline charging method, offline charging device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311228202.7A CN117196613B (en) 2023-09-21 2023-09-21 Offline charging method, offline charging device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117196613A CN117196613A (en) 2023-12-08
CN117196613B true CN117196613B (en) 2024-03-15

Family

ID=88997730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311228202.7A Active CN117196613B (en) 2023-09-21 2023-09-21 Offline charging method, offline charging device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117196613B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110119944A (en) * 2019-04-19 2019-08-13 苏州智康信息科技股份有限公司 Wisdom hospital Mobile barcode payment and settlement method and system, storage medium and terminal
CN110163598A (en) * 2019-05-24 2019-08-23 广东飞企互联科技股份有限公司 Mobile offline electronic payment method and mobile offline electronic payment system
CN110175838A (en) * 2019-05-24 2019-08-27 广东飞企互联科技股份有限公司 Offline barcode scanning method of payment and offline barcode scanning payment mechanism
CN111062724A (en) * 2019-11-22 2020-04-24 陈晓晖 Double-off-line account transfer transaction method and system
CN111401881A (en) * 2016-09-20 2020-07-10 徐蔚 Digital currency payment method and device based on coding medium and mobile terminal
CN113065857A (en) * 2021-04-25 2021-07-02 青岛海链数字科技有限公司 Data processing method, device, equipment, medium and product in payment process
CN113383356A (en) * 2019-05-08 2021-09-10 深圳市欢太科技有限公司 Offline payment method and device, electronic equipment and storage medium
CN114511306A (en) * 2020-11-17 2022-05-17 如般量子科技有限公司 Digital currency-based one-time key anonymous double-off-line transaction method and system
CN115564414A (en) * 2022-08-22 2023-01-03 昆明理工大学 Digital currency double-off-line transaction method and system
CN116151827A (en) * 2023-04-04 2023-05-23 北京银联金卡科技有限公司 Digital wallet safety frame and double off-line transaction method based on safety frame

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111401881A (en) * 2016-09-20 2020-07-10 徐蔚 Digital currency payment method and device based on coding medium and mobile terminal
CN110119944A (en) * 2019-04-19 2019-08-13 苏州智康信息科技股份有限公司 Wisdom hospital Mobile barcode payment and settlement method and system, storage medium and terminal
CN113383356A (en) * 2019-05-08 2021-09-10 深圳市欢太科技有限公司 Offline payment method and device, electronic equipment and storage medium
CN110163598A (en) * 2019-05-24 2019-08-23 广东飞企互联科技股份有限公司 Mobile offline electronic payment method and mobile offline electronic payment system
CN110175838A (en) * 2019-05-24 2019-08-27 广东飞企互联科技股份有限公司 Offline barcode scanning method of payment and offline barcode scanning payment mechanism
CN111062724A (en) * 2019-11-22 2020-04-24 陈晓晖 Double-off-line account transfer transaction method and system
CN114511306A (en) * 2020-11-17 2022-05-17 如般量子科技有限公司 Digital currency-based one-time key anonymous double-off-line transaction method and system
CN113065857A (en) * 2021-04-25 2021-07-02 青岛海链数字科技有限公司 Data processing method, device, equipment, medium and product in payment process
CN115564414A (en) * 2022-08-22 2023-01-03 昆明理工大学 Digital currency double-off-line transaction method and system
CN116151827A (en) * 2023-04-04 2023-05-23 北京银联金卡科技有限公司 Digital wallet safety frame and double off-line transaction method based on safety frame

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Privacy-preserving offline mobile payment protocol based on NFC;Aye Mi San;2016 International Computer Science and Engineering Conference (ICSEC);20170223;全文 *
基于无证书签密技术的NFC移动支付方案;柳毅等;计算机应用研究;20191130;第3373-3377页 *

Also Published As

Publication number Publication date
CN117196613A (en) 2023-12-08

Similar Documents

Publication Publication Date Title
KR102044751B1 (en) Method for providing reward according to user authentication based on blockchain
JP6942136B2 (en) How to be implemented by the blockchain for the control and distribution of digital content
EP3549082B1 (en) System and method for information protection
WO2020103566A1 (en) Blockchain certificate storage method and apparatus, and computer device
JP5766199B2 (en) Secure mobile payment processing
JP2022545145A (en) Dynamic off-chain digital currency transaction processing
CN110599323B (en) Resource processing method and processing equipment
CN103729942A (en) Method and system for transmitting transmission key from terminal server to key server
CN108668277B (en) Method and equipment for sharing and acquiring information
KR101976027B1 (en) Method for generating and backing up electric wallet and user terminal and server using the same
JPH1139219A (en) Data-to-be-verified generating device, data verifying device, and medium recording verified data generating program
CN103186850A (en) Method, equipment and system for acquiring payment document
CN109474420A (en) A kind of private key backup method and relevant device
CN115114658B (en) Verifiable data transaction method, device, equipment and medium based on blockchain
CN110599140B (en) Digital currency verification method and system
US20130036160A1 (en) License issuing system, client terminal, server, and license issuing method
KR102085997B1 (en) Method and system for real estate transaction service based on block chain
KR101120059B1 (en) Billing verifying apparatus, billing apparatus and method for cloud computing environment
CN111259075B (en) Medical information generation method, device, equipment and storage medium based on blockchain
CN117196613B (en) Offline charging method, offline charging device, computer equipment and storage medium
CN111199486A (en) Data processing method and device based on block chain network and storage medium
CN115691775A (en) Palm self-service discharge quick settlement method and equipment
JP2008123069A (en) Transfer system using communication between portable terminals, method, first financial institution server, second financial institution server, and program
CN110276693B (en) Insurance claim settlement method and system
KR102503987B1 (en) System providing data analysis services based on block chain and method of operation of system

Legal Events

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