Self-service equipment yarn box logic information storage method and system, medium and equipment
By adopting distributed database and master node management mechanism in the cash box management system of self-service equipment, the problem of insufficient data security and scalability in the existing system is solved, high availability and data consistency are achieved, and business expansion and Market competition.
Patent Information
- Application Number
- CN202411528229.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing cash self-service equipment banknote management system cannot effectively ensure data security, it has a single point of failure risk and is limited in scalability, making it difficult to adapt to the growing demand for data processing.
A distributed database and master node management mechanism are adopted, each terminal establishes a database, elects the master node to manage and synchronize banknote information data, and ensures high availability and data consistency of the system through automatic failover and data consistency assurance measures.
It effectively eliminates the risk of single point of failure, improves the reliability and stability of the system, ensures data security and consistency, and supports business expansion and market competitiveness.
Smart Images

Figure CN119474203A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of computers, and in particular to a method, system, medium and device for storing logic information of a yarn box of a self-service device. Background Art
[0002] With the development of science and technology, cash self-service equipment is increasingly used in the financial field. These devices usually contain multiple cash boxes for storing cash of different currencies and denominations. In order to ensure the safety of cash and the stable operation of the equipment, an effective information storage method is needed to record and manage the logical information of the cash boxes. Existing cash self-service equipment usually uses local hard disks or centralized databases to store cash box information, but this method has the risk of single point failure. Once the local hard disk or database server has problems, the operation of the entire system will be affected. In addition, the scalability of the centralized database is also limited, making it difficult to adapt to the growing data processing needs.
[0003] For example, a Chinese patent with publication number CN108345917A discloses a cash box management system and method. A label reading device, a processor and a communication device are provided in the financial self-service device. The control center is used to send the cash box information of the cash box to be added to the processor through the communication device. The label reading device is used to read the actual cash box information stored in the label unit in the cash box to be added, and send the actual cash box information to the processor. The processor is used to determine that the actual cash box information is consistent with the cash box information sent by the main control center, and confirm that the cash box to be added is successfully transported to the outlet where the financial self-service device is located. The cash box management system and method can avoid the phenomenon that the wrong cash box is installed in the financial self-service device. The above-mentioned cash box management system and method cannot guarantee the resistance to individual failures and cannot effectively guarantee the security of the entire data.
[0004] In view of this, it is necessary to provide a method, system, medium and device for storing logical information of a yarn box of a self-service device. Summary of the invention
[0005] The present invention provides a method, system, medium and device for storing logic information of a yarn box of a self-service device, which effectively solves the problem that the existing banknote box management system cannot effectively ensure data security.
[0006] The technical solution adopted by the present invention is:
[0007] A method for storing logic information of a yarn box of a self-service device comprises the following steps:
[0008] S1. Establish a distributed database: Each terminal establishes a database to record the terminal's cash box information data;
[0009] S2. Elect a master node: elect a master node from all terminals to manage and synchronize the cash box information data of all terminals;
[0010] S3, master node management: determine whether the master node is operating normally and re-elect the master node when the master node fails;
[0011] S4, Data consistency guarantee: used to ensure data consistency between the master node and other nodes.
[0012] Furthermore, S3 specifically includes the following steps:
[0013] S31. Enable high-availability master node;
[0014] S32, information synchronization: the master node is responsible for collecting the changes in the cash box information of each terminal, synchronizing these changes to its own database, and updating the data version;
[0015] S33, Data distribution: After updating its own database, the master node is responsible for notifying other nodes of the changed data and data version to ensure that the data of all nodes remains consistent;
[0016] S33, fault monitoring: The master node needs to monitor faults, its own health status, and the status of the network and other terminals. If it is determined that there is no fault, it proceeds to the next step S4; if it is determined that there is a fault, the failover mechanism is triggered to proceed to the next step S34;
[0017] S34. After re-electing the master node, return to S31.
[0018] Furthermore, the fault in S33 is the health status of the master node itself, as well as the status of the network and other terminals.
[0019] Furthermore, the cash box information data includes the equipment number, the currency type of the cash box, the cash quantity, the denomination distribution, and the cash box status.
[0020] Furthermore, the S4 data consistency guarantee can use transaction logs and data version control to ensure that the highest version of data is used.
[0021] Furthermore, the rule for re-electing the master node in S34 is an election rule preset by the database system.
[0022] Furthermore, the election rule is round-robin, random selection or weighted selection.
[0023] Based on the self-service equipment yarn box logic information storage system, including:
[0024] Database module, used to record the cash box information data of all terminals;
[0025] The master node module is used to manage and synchronize the cash box information data of all terminals;
[0026] The master node management module is used to monitor whether the master node is operating normally and re-elect the master node when the master node fails;
[0027] The data assurance module is used to ensure the data consistency between the master node and other nodes.
[0028] A computer-readable storage medium stores a computer program, and when the computer program is processed and executed, the steps of the self-service device yarn box logic information storage method are implemented. In addition, the computer-readable storage medium can adopt any combination of one or more readable storage media, wherein the readable storage medium includes an electrical, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above.
[0029] A computer device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus:
[0030] The memory is used to store computer programs;
[0031] The processor is used to execute the steps of the self-service device yarn box logic information storage method by running the program stored in the memory. The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. The communication interface is used for communication between the above terminal and other devices. The memory may include a random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor. The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0032] Beneficial effects of the invention:
[0033] 1. This application introduces key technologies such as distributed database, master node management, and data consistency assurance, and uses distributed database to effectively eliminate the risk of single point failure. Even if a terminal or node has a problem, the system can continue to operate, thereby improving the overall reliability and stability. Through data consistency assurance, the accuracy and consistency of the data are ensured, and the security of financial transactions is guaranteed.
[0034] 2. The setting of master node management can realize the management and synchronization of key nodes of cash box information data of all terminals, ensuring the reliable operation of the cash box logical information storage method of the cash self-service equipment.
[0035] 3. Automatic failover and new master node election mechanism ensure that the system can recover quickly when the master node fails, minimizing service interruption time and improving system availability.
[0036] 4. Easy to support business expansion and market competitiveness: As the business grows and the market changes, distributed databases and high-availability architectures can more easily expand and adapt to new business needs, thereby supporting the company's long-term development and market competitiveness. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is an overall schematic diagram of the method for storing logical information of a yarn box of a self-service device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0039] like Figure 1 As shown, the first embodiment provided by the present application is a method for storing logic information of a yarn box of a self-service device, comprising the following steps:
[0040] S1. Establish a distributed database: Each terminal establishes a database to record the terminal's cash box information data;
[0041] S2. Elect a master node: elect a master node from all terminals to manage and synchronize the cash box information data of all terminals;
[0042] S3, master node management: determine whether the master node is operating normally and re-elect the master node when the master node fails;
[0043] S4, Data consistency guarantee: used to ensure data consistency between the master node and other nodes.
[0044] In the above design, key technologies such as distributed database, node election and data synchronization mechanism, failover and automatic election of new master nodes, and data consistency protection measures are introduced to improve the reliability and stability of the system, enhance data security, improve data processing efficiency, and achieve high availability.
[0045] Specifically: S3 specifically includes the following steps:
[0046] S31. Enable high-availability master node: A high-availability master node refers to the main node responsible for key business processing and data management in a high-availability system architecture.
[0047] S32, Information synchronization: The master node is responsible for collecting the changes in the cash box information of each terminal, synchronizing these changes to its own database, and updating the data version.
[0048] S33, Data distribution: After updating its own database, the master node is responsible for notifying other nodes of the changed data and data version to ensure that the data of all nodes remains consistent.
[0049] S33, fault monitoring: The master node needs to monitor faults, its own health status, and the status of the network and other terminals. If it is determined that there is no fault, it proceeds to the next step S4; if it is determined that there is a fault, the failover mechanism is triggered to proceed to the next step S34.
[0050] S34. After re-electing the master node, return to S31.
[0051] In the above design, by enabling the high-availability master node, when the original master node fails, the newly elected master node can take over the original master node, and the synchronization of the original data and the consistency of all node data can be achieved through information synchronization and data distribution. The automatic failover and new master node election mechanism ensure that the system can recover quickly when the master node fails, minimize the service interruption time, and improve the availability of the system. The high-availability architecture can be more easily expanded and adapted to new business needs, thereby supporting the company's long-term development and market competitiveness. The high-availability master node provides a powerful, flexible and reliable system architecture for the present invention, ensuring business continuity and data security.
[0052] Specifically: the fault in S33 is the health status of the master node itself, as well as the status of the network and other terminals.
[0053] In the above design, by including the health status of the main node itself, as well as the status of the network and other terminals in the monitoring scope, it is possible to complete the monitoring of the entire yarn box logical information and ensure data security.
[0054] Specifically: the cash box information data includes the equipment number, the currency type of the cash box, the amount of cash, the denomination distribution, the cash box status, etc.
[0055] In the above design, the currency type, cash quantity, denomination distribution, and cash box status of the equipment numbered cash box are included in the cash box information data, which can effectively store the cash box information and ensure that each data of the cash box can be matched one by one.
[0056] Specifically: the S4 data consistency guarantee can use transaction logs and data version control to ensure that the highest version of data is used.
[0057] In the above design, real-time data update is achieved through transaction logs and data version control to prevent data lag.
[0058] Specifically: the rule for re-electing the master node in S34 is an election rule preset by the database system.
[0059] In the above design, the preset election rules can ensure that the election of a new master node has a logical basis.
[0060] Specifically: the election rule is polling, random selection or weighted selection.
[0061] Polling refers to a computer network communication technology that is used to query the status or data of each task or device in turn among multiple tasks or devices. The polling method is that the CPU periodically issues inquiries, asking each peripheral device in sequence whether it needs its service, and providing corresponding services. When working, the polling program will send a request to the task or device, receive the response information, and process other tasks or devices in a loop according to the predetermined order. In network communication, polling can be implemented through HTTP protocol and other methods, and the client sends a request to the server at regular intervals to obtain the latest data. It has the advantages of simple implementation, easy understanding and maintenance; strong real-time performance, and can obtain the latest data in time; high reliability, ensuring that each task or device is processed in time.
[0062] Random selection is an algorithm that allows you to randomly select a number of data from a data set. These methods are very useful in statistics and data analysis, and can help generate representative samples. There are many different implementation principles for random selection algorithms, and you can choose the right algorithm based on different needs and scenarios.
[0063] Weight selection is a quantitative assignment of the importance of different aspects of a fault, taking into account the priority of triggering the fault mechanism.
[0064] The second embodiment provided by the present application is a yarn box logic information storage system based on a self-service device, comprising:
[0065] Database module, used to record the cash box information data of all terminals;
[0066] The master node module is used to manage and synchronize the cash box information data of all terminals;
[0067] The master node management module is used to monitor whether the master node is operating normally and re-elect the master node when the master node fails;
[0068] The data assurance module is used to ensure the data consistency between the master node and other nodes.
[0069] The third embodiment provided by the present application is a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is processed and executed, the steps of the self-service device yarn box logic information storage method are implemented. In addition, the computer-readable storage medium of this embodiment can adopt any combination of one or more readable storage media, wherein the readable storage medium includes an electrical, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination thereof.
[0070] The fourth embodiment provided by the present application is a computer device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus: wherein:
[0071] The memory is used to store computer programs;
[0072] The processor is used to execute the steps of the self-service equipment yarn box logic information storage method by running the program stored in the memory. As an embodiment of the present invention, the communication bus mentioned in the above terminal can be a peripheral component interconnect standard (Peripheral Component Interconnect, referred to as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, referred to as EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0073] As an implementation mode of the present invention, the communication interface is used for communication between the above-mentioned terminal and other devices.
[0074] As an embodiment of the present invention, the memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0075] As an embodiment of the present invention, the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0076] To further explain in detail, it should be understood that the above is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for storing logic information of a yarn box of a self-service device, characterized in that: The following steps are included: S1. Establish a distributed database: Each terminal establishes a database to record the terminal's cash box information data; S2. Elect a master node: elect a master node from all terminals to manage and synchronize the cash box information data of all terminals; S3, master node management: determine whether the master node is operating normally and re-elect the master node when the master node fails; S4, Data consistency guarantee: used to ensure data consistency between the master node and other nodes.
2. The method for storing logic information of a yarn box of a self-service device according to claim 1, characterized in that: The S3 specifically includes the following steps: S31. Enable high-availability master node; S32, information synchronization: the master node is responsible for collecting the changes in the cash box information of each terminal, synchronizing these changes to its own database, and updating the data version; S33, Data distribution: After updating its own database, the master node is responsible for notifying other nodes of the changed data and data version to ensure that the data of all nodes remains consistent; S33, fault monitoring: The master node needs to monitor faults, its own health status, and the status of the network and other terminals. If it is determined that there is no fault, it proceeds to the next step S4; if it is determined that there is a fault, the failover mechanism is triggered to proceed to the next step S34; S34. After re-electing the master node, return to S31.
3. The method for storing the logic information of the yarn box of the self-service equipment according to claim 2 is characterized in that: The fault in S33 is the health status of the master node itself and the status of the network and other terminals.
4. The method for storing logical information of a cash box of a self-service device according to claim 1, characterized in that: The cash box information data includes the equipment number, the currency type of the cash box, the cash quantity, the denomination distribution and the cash box status.
5. The method for storing logic information of a yarn box of a self-service device according to claim 1, characterized in that: The S4 data consistency guarantee can use transaction logs and data version control to ensure that the highest version of data is used.
6. The method for storing logic information of a yarn box of a self-service device according to claim 2, characterized in that: The rule for re-electing the master node in S34 is the election rule preset by the database system.
7. The method for storing logic information of a yarn box of a self-service device according to claim 5, characterized in that: The election rule is round robin, random selection or weighted selection.
8. Based on the self-service equipment yarn box logic information storage system, it is characterized by: include, Database module, used to record the cash box information data of all terminals; The master node module is used to manage and synchronize the cash box information data of all terminals; The master node management module is used to monitor whether the master node is operating normally and re-elect the master node when the master node fails; The data assurance module is used to ensure the data consistency between the master node and other nodes.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is processed and executed, the steps of the method for storing logic information of the yarn box of the self-service device according to any one of claims 1 to 7 are implemented.
10. A computer device, characterized in that: The method comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus: The memory is used to store computer programs; The processor is used to execute the steps of the self-service equipment yarn box logic information storage method according to any one of claims 1 to 7 by running the program stored in the memory.
Citation Information
Patent Citations
Cash box management system and method
CN108345917A
System and method for augmenting consensus election in a distributed database
US20170032010A1
Data disaster recovery method, device and system
US20190095293A1
Retaining committed transactions during database cluster replication
US20220292112A1
High availability with consensus in database systems
US20240256572A1