High-speed train seat selection method and seat selection system based on cache

By using a high-speed cache to store high-speed rail information and utilizing a distributed locking mechanism in the high-speed rail train seat selection system, the problems of data synchronization delay and unintuitive display in the existing seat selection system have been solved. This has enabled accurate display of real-time seat data and efficient seat selection, thus improving the passenger ticket purchase experience.

CN120849428APending Publication Date: 2025-10-28CHINA ACADEMY OF RAILWAY SCI CORP LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510971830.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

The existing high-speed rail seat selection system cannot support passengers to complete the seat selection operation by themselves. It has problems such as cross-system data synchronization delay, unintuitive display method and algorithm not adapted to dynamic grouping scenarios, which affect the passenger travel experience.

Method used

By storing high-speed rail information in a high-speed cache and leveraging the cache's fast read/write capabilities, the caching and computation of high-speed rail information are separated. This provides real-time seat data and ensures seat locking through a distributed locking mechanism, thereby improving the scalability and processing efficiency of the seat selection system.

Benefits of technology

It enables real-time updates and intuitive display of the seat selection interface, reduces response latency and high load issues, and improves the ticket purchasing experience and satisfaction of passengers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120849428A_ABST
    Figure CN120849428A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of railway traffic, and discloses a high-speed train seat selection method and system based on a high-speed cache, electronic equipment and a computer readable storage medium, and the method comprises the steps: obtaining high-speed train information in a passenger ticket system, and storing the high-speed train information in the high-speed cache; determining seat data based on the high-speed rail information in the cache, and sending the seat data to the terminal; and in response to ticket buying information returned by the terminal, locking a corresponding seat in the passenger ticket system. According to the invention, the fast read-write capability of the cache is utilized, so that the separation of cache and calculation of the high-speed rail information is realized, the expandability and the processing efficiency of the seat selection system are improved, and the seat state change can be quickly responded. Meanwhile, the seat data is determined and sent to the terminal based on the data in the cache, so that real-time updating and visual display of a seat selection interface are realized, passengers can make seat selection decisions according to accurate seat information, and ticket buying experience and satisfaction of the passengers are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of railway transportation, and more specifically, to a high-speed train seat selection method, seat selection system, electronic equipment, and computer-readable storage medium based on high-speed caching. Background Technology

[0002] With the rapid development of railway transportation, improving the passenger travel experience has become a core issue in upgrading railway passenger services. However, the current seat selection system adopts a static ticket allocation mechanism, which can only provide basic seat type selection (such as window / aisle), and cannot support passengers to complete the seat selection operation by themselves, which greatly affects the passenger travel experience. Summary of the Invention

[0003] To address one or more deficiencies in the existing technology, this invention provides a high-speed train seat selection method, seat selection system, electronic device, and computer-readable storage medium based on high-speed caching.

[0004] A high-speed train seat selection method based on high-speed caching, applied to a seat selection system, the method comprising: Retrieve high-speed rail information from the ticketing system and store it in a high-speed cache; Seat data is determined based on the high-speed rail information in the cache, and the seat data is sent to the terminal; the terminal is used to respond to ticket query operations and display a seat selection interface based on the seat data; the seat selection interface includes sold seats and unsold seats; In response to the ticketing information returned by the terminal, the corresponding seat is locked in the ticketing system.

[0005] Optionally, the seat data includes seat inventory data, seat-to-seat mapping data, seat layout data, and full seat data; the seat inventory data is used to describe the remaining ticket information for all train services; the seat-to-seat mapping data is used to describe the mapping relationship between physical seats and seats for each train service; the seat layout data is used to describe the location information of physical seats for each train service; and the full seat data is used to describe all seat information for all train services. The response to the ticket query operation, based on the seat data display of the seat selection interface, includes: The target departure and arrival stations are determined based on the ticket query operation; the target departure and arrival stations include the target origin station and the target arrival station. Based on the seat availability data at the departure and arrival stations, information on trains with unsold seats corresponding to the target departure and arrival stations is displayed. In response to the train selection operation, the target train is determined; A train undercarriage view of the target train is generated based on the seat map data; Based on the full seat data and the seat-seat mapping data, sold and unsold seats are marked in the train undercarriage view, and the seat selection interface is generated and displayed.

[0006] Optionally, the high-speed rail information includes high-speed rail train information, high-speed rail train number information, and high-speed rail seat information; The process of determining seat data based on the high-speed rail information in the cache includes: For each group of origin and destination stations, a tree-shaped index structure for remaining tickets is constructed with the origin and destination stations as the primary key. Based on the high-speed rail train number information and the high-speed rail seat information, the remaining ticket information for all trains at the origin and destination stations is determined. The seat availability data for all trains departing from and arriving at the stations is determined based on the remaining ticket information for all trains departing from and arriving at the stations. Based on the high-speed train information and the high-speed train seat information, determine the seat and seat mapping data of the departure and arrival stations; The seating chart data for the departure and arrival stations is determined based on the high-speed train information. Based on the high-speed rail seat information, determine the full data of seats at the departure and arrival stations.

[0007] Optionally, the full seat data may also include passenger information for sold seats; After marking sold and unsold seats in the train undercarriage view based on the full seat data and the seat-seat mapping data, generating and displaying the seat selection interface, the method further includes: Based on the full set of seat data, passenger information for the sold seats is marked on the seat selection interface.

[0008] Optionally, the step of locking the corresponding seat in the ticketing system in response to the ticketing information returned by the terminal includes: Analyze the ticket purchase information to determine the target seats; Invoke the distributed lock mechanism to initiate a lock request for the target seat; If the distributed locking mechanism successfully acquires the lock, the target seat will be marked as locked in the ticketing system, and the locking time and associated passenger ticketing information will be recorded.

[0009] Optionally, obtaining high-speed rail information from the ticketing system and storing it in a cache includes: Retrieve structured high-speed rail information from the relational database of the ticketing system; The structured high-speed rail information is stored in the cache as key-value pairs.

[0010] Optionally, after storing the structured high-speed rail information in the cache as key-value pairs, the method further includes: When a change is detected in the high-speed rail information in the cache, a corresponding event object is created based on the changed high-speed rail information. According to preset event handling rules, the event objects are assigned to corresponding event handlers so that each event handler processes the event objects in a predetermined order.

[0011] A seat selection system, comprising: The information acquisition module is used to acquire high-speed rail information from the ticketing system and store it in a high-speed cache; The seat determination module is used to determine seat data based on the high-speed rail information in the cache, and send the seat data to the terminal; the terminal is used to respond to the ticket query operation and display a seat selection interface based on the seat data; the seat selection interface includes sold seats and unsold seats; The seat locking module is used to lock the corresponding seat in the ticketing system in response to the ticketing information returned by the terminal.

[0012] An electronic device, comprising: A processor and a memory, the memory being used to store at least one instruction, which, when loaded and executed by the processor, implements the cache-based high-speed train seat selection method as described in any of the preceding embodiments.

[0013] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the cache-based high-speed train seat selection method as described in any of the preceding claims.

[0014] The high-speed rail seat selection method based on high-speed caching provided in this invention involves acquiring high-speed rail information from the ticketing system and storing it in a high-speed cache; determining seat data based on the high-speed rail information in the high-speed cache and sending the seat data to the terminal; and locking the corresponding seat in the ticketing system in response to the ticketing information returned by the terminal. This invention utilizes the fast read / write capabilities of the high-speed cache to separate high-speed rail information caching from computation, improving the scalability and processing efficiency of the seat selection system. It can quickly respond to changes in seat status and avoids the response delay and high load problems caused by directly accessing the ticketing system database. Simultaneously, by determining and sending seat data to the terminal based on data in the high-speed cache, the seat selection interface is updated in real time and displayed intuitively, enabling passengers to make seat selection decisions based on accurate seat information, thus improving the passenger ticketing experience and satisfaction. Attached Figure Description

[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 A flowchart illustrating a high-speed train seat selection method based on high-speed caching provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of seating chart data provided in an embodiment of the present invention; Figure 3 A flowchart illustrating a terminal-based seat selection interface for displaying seat data in an embodiment of the present invention; Figure 4 This is a schematic diagram of an interface for displaying train information with unsold seats corresponding to the target departure and arrival stations, provided by an embodiment of the present invention. Figure 5 This is a schematic diagram of a terminal display seat selection interface provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of a terminal ticketing interface provided in an embodiment of the present invention; Figure 7 for Figure 1 A flowchart illustrating an actual manifestation of S02 in a high-speed train seat selection method based on caching; Figure 8 for Figure 1 A flowchart illustrating an actual manifestation of S03 in a high-speed train seat selection method based on high-speed caching; Figure 9 This is a schematic diagram illustrating a high-speed train seat selection process based on high-speed caching, provided in an embodiment of the present invention. Figure 10 This is a schematic diagram of a seat selection system provided in an embodiment of the present invention. Detailed Implementation

[0017] To better understand the technical solution of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0018] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0019] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0020] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0021] With the rapid development of railway transportation, improving the passenger travel experience has become a core issue in upgrading railway passenger services. However, the current seat selection system adopts a static ticket allocation mechanism, which can only provide basic seat type selection (such as window / aisle), and cannot support passengers to complete the seat selection operation by themselves, which greatly affects the passenger travel experience.

[0022] The existing seat selection system has the following drawbacks: 1) Cross-system data synchronization delays reach 5-8 seconds, frequently causing "seat conflicts"; 2) Existing systems mostly use simple text lists to display seat information, which lacks intuitiveness. Passengers can only understand the general situation of the seats through text descriptions, and it is difficult to clearly determine the specific location, orientation, and other key details of the seats; 3) The algorithm is not adapted to dynamic grouping scenarios. Adding new carriages requires manual configuration of rules, which seriously affects the efficiency of seat selection during peak periods such as the Spring Festival travel rush.

[0023] Due to the technical characteristics of the railway system, such as the mixed operation of 25 different types of high-speed trains and an average of 3.2 train formation adjustments per day, existing seat selection schemes are insufficient to meet passengers' expectations for modern experiences such as millisecond-level response and immersive seat selection. Therefore, this invention provides a high-speed train seat selection method based on high-speed caching to solve the above-mentioned problems.

[0024] Please refer to Figure 1 The flowchart below illustrates a high-speed train seat selection method based on high-speed caching, provided by an embodiment of the present invention. Applied to a seat selection system, it includes the following steps: Step S01: Obtain high-speed rail information from the ticketing system and store it in the cache.

[0025] In high-speed rail seat selection scenarios, whenever a passenger inquires about tickets or selects a seat, the system needs to provide the latest seat information promptly and accurately. However, the ticketing system contains a massive amount of data that is frequently updated. If data is retrieved directly from the original database of the ticketing system for each seat selection, it will not only cause response delays due to the high load of database queries, affecting the passenger's ticket purchasing experience, but also easily lead to seat selection conflicts due to untimely data retrieval.

[0026] Therefore, in this embodiment, the high-speed rail information stored in the ticketing system is extracted through a specific data interface and synchronization mechanism and stored in a high-speed cache. A high-speed cache is a storage medium with extremely high-speed data read / write capabilities, serving as a data relay station between the ticketing system and the seat selection system, providing efficient data support for subsequent seat data processing and display, and ensuring that the seat selection system can obtain accurate high-speed rail information as quickly as possible.

[0027] In some embodiments, to improve storage and query efficiency and facilitate rapid data retrieval and use by the system, structured high-speed rail information obtained from the relational database of the ticketing system can be stored in a cache as key-value pairs. This allows the system to quickly locate and query high-speed rail information by key, reducing processing time, improving ticketing efficiency, alleviating database load, avoiding congestion and delays during peak ticketing periods, and ensuring smooth system operation. Specifically, step S01, which involves obtaining high-speed rail information from the ticketing system and storing it in a cache, may include: Step S11: Obtain structured high-speed rail information from the relational database of the ticketing system.

[0028] In this embodiment, relevant information about high-speed trains is extracted from the relational databases (such as MySQL and Oracle) used by the railway department to store ticketing data through specific data access interfaces and query statements. High-speed rail information involves numerous related data, such as trains, stations, and times. When storing data in relational databases, the data is strictly defined through structures such as tables and fields, which can clearly express these relationships and ensure the accuracy and reliability of the data.

[0029] Step S12: Store the structured high-speed rail information in a cache as key-value pairs.

[0030] In this embodiment, the high-speed rail information obtained from the relational database is converted into key-value pairs and stored in a cache. Key-value pairs are a simple data storage method, where the "key" is a unique key used to identify the data, and the "value" is the corresponding data content. This storage method allows direct location of the corresponding value through the key, eliminating the need for complex query operations and improving data retrieval speed. Furthermore, converting structured high-speed rail information into key-value pairs and storing it in a cache enables rapid data retrieval and updates, thereby improving the overall performance of the system.

[0031] In some embodiments, the key-value pair structure needs to be defined first, determining which high-speed rail information will serve as keys and which as values. For example, "train number + carriage number + seat number" can be used as the key, with the corresponding seat status and related information as the values. Then, the structured data obtained from the relational database is converted into key-value pair format using a data conversion module. After conversion, these key-value pairs are written to the cache using the API provided by the cache.

[0032] Furthermore, to ensure data consistency, a cache update mechanism can be set up so that when the data in the relational database changes, the key-value pairs in the cache are updated in a timely manner.

[0033] In some embodiments, to improve the accuracy and reliability of data updates and optimize system resource allocation and task scheduling, enabling the system to remain stable and efficient when handling large-scale concurrent data changes, a corresponding event object can be created when a change in high-speed rail information in the cache is detected. This event object is then assigned to the appropriate event handler based on preset event handling rules. The system can efficiently organize and manage the data update process, ensuring that events are processed sequentially according to a predetermined order, avoiding data update conflicts and chaos. Specifically, after executing step S12, which stores the structured high-speed rail information in key-value pairs in the cache, the following steps can also be performed: Step S13: When a change is detected in the high-speed rail information in the cache, a corresponding event object is created based on the changed high-speed rail information.

[0034] In high-speed rail ticketing systems, the real-time nature and accuracy of data are crucial. The high-speed rail information stored in the cache may change due to various reasons, such as passenger ticket purchases and train scheduling adjustments.

[0035] Therefore, in this embodiment, the system monitors the high-speed rail information stored in the cache in real time through a listening mechanism. When a change in information is detected (such as a seat status changing from "available" to "sold"), the system captures this change and creates an event object based on the changed information. The event object contains detailed information about the change, such as the changed seat, the change type, and the change time.

[0036] By listening to these changes and creating event objects, the system can ensure that every data change is captured and processed in a timely manner. This not only guarantees real-time updates of system data but also provides a basis for subsequent business logic processing (such as ticket updates and passenger notifications). Furthermore, event-driven processing improves system response speed and processing efficiency, ensuring stable operation even under high concurrency.

[0037] Step S14: According to the preset event handling rules, the event objects are assigned to the corresponding event handlers so that each event handler processes the event objects in a predetermined order.

[0038] In the complex high-speed rail ticketing system, event handling requires a high degree of organization and coordination. By assigning event objects through preset event handling rules, the system can ensure that each event is handled promptly and correctly, avoiding chaos and resource contention in event handling.

[0039] Therefore, in this embodiment, a set of rules is predefined in the system, and the created event objects are assigned to specially designed event handlers according to these rules. Each event handler is responsible for handling events of a specific type or priority, and these handlers are executed sequentially in a predetermined order to ensure that events are processed in an orderly and efficient manner. For example, when an event involves multiple business logic steps, the system will pass the event to different handlers in a predetermined order, and each handler will complete its specific task.

[0040] By assigning event objects according to predefined event handling rules, the system ensures that each event is processed promptly and correctly, avoiding chaos and resource contention in event handling. This orderly event handling process not only improves system efficiency but also ensures data consistency and integrity. Furthermore, this mechanism allows the system to flexibly handle different types of events, supports modular development and maintenance, and enhances system scalability and maintainability. When business requirements change, only the event handling rules need to be adjusted or new event handlers added, without requiring large-scale modifications to existing code.

[0041] Step S02: Determine seat data based on high-speed rail information in the cache, and send the seat data to the terminal.

[0042] The terminal is used to respond to ticket query operations and displays the seat selection interface based on the seat data; the seat selection interface includes sold seats and unsold seats.

[0043] In traditional seat selection systems, the display method is not intuitive enough, making it difficult for passengers to accurately determine which seats are available, thus reducing their ticket purchasing experience. Therefore, in this embodiment, by utilizing high-speed rail information stored in a cache, the available seat data is accurately determined and extracted, and then sent to the terminal device used by the passenger. After receiving the seat data, the terminal device can respond to the passenger's ticket query operation and intuitively display the seat distribution of the high-speed train through a graphical interface, including which seats have been sold (sold seats) and which seats are still available for purchase (unsold seats), providing passengers with a clear and intuitive reference for seat selection.

[0044] By determining seat information based on high-speed rail data stored in a cache and sending it to the terminal for display, the advantages of fast data retrieval from the cache can be fully utilized to ensure that the seat information displayed on the terminal is highly real-time and accurate. This allows passengers to obtain the correct seat information immediately when searching for tickets, thus avoiding seat selection problems caused by information lag and improving passenger satisfaction and ticket purchasing efficiency.

[0045] Step S03: In response to the ticket purchase information returned by the terminal, the corresponding seat is locked in the ticketing system.

[0046] In this embodiment, after the passenger completes seat selection and submits ticket purchase information, the system will accurately locate the selected seat in the ticketing system using a transaction mechanism based on the ticket purchase details returned by the terminal, and lock the seat. Locking the seat marks it as sold, ensuring that it cannot be sold again through other ticketing channels and avoiding seat selection conflicts in a multi-channel ticketing environment.

[0047] In some embodiments, key information such as train number, carriage number, and seat number can be extracted by parsing the ticketing information. The system then constructs a unique seat identifier based on this key information, which is used to query the corresponding seat record in the ticketing system. After finding the target seat, the system uses the transaction processing function of the ticketing system to update the seat record, changing its status from "available" to "sold," thereby locking it in.

[0048] Based on the above technical solution, the high-speed rail seat selection method based on high-speed caching provided in this embodiment of the invention obtains high-speed rail information from the ticketing system and stores it in a high-speed cache; determines seat data based on the high-speed rail information in the high-speed cache and sends the seat data to the terminal; and locks the corresponding seat in the ticketing system in response to the ticketing information returned by the terminal. This invention utilizes the fast read / write capability of the high-speed cache to separate high-speed rail information caching from computation, improving the scalability and processing efficiency of the seat selection system. It can quickly respond to changes in seat status and avoids response delays and high load problems caused by directly accessing the ticketing system database. Simultaneously, by determining and sending seat data to the terminal based on data in the high-speed cache, real-time updates and intuitive displays of the seat selection interface are achieved, enabling passengers to make seat selection decisions based on accurate seat information, thus improving the passenger's ticketing experience and satisfaction.

[0049] Based on the above embodiments, in some embodiments, the seat data may include seat inventory data, seat-to-seat mapping data, seat map data, and full seat data. Wherein: 1) Seat availability data is used to describe the remaining ticket information for all train services; For example, Table 1 shows a seat inventory data provided by an embodiment of the present invention.

[0050] Table 1 As shown in Table 1, the seat availability data describes the remaining ticket information for all trains, including those departing from and arriving at different stations.

[0051] 2) Seat and seat mapping data is used to describe the mapping relationship between physical seats and seats for each train.

[0052] For example, Table 2 shows a seat and seat mapping data provided by an embodiment of the present invention.

[0053] Table 2 As shown in Table 2, the seat and seat mapping data describes the mapping relationship between physical seats and seats for each train, where the mapping relationship between seats and seats is one-to-one or one-to-many. In some embodiments, a dynamic association matrix between physical seats and logical seats can be established, and an automatic mapping algorithm based on train model configuration (such as the seat coding rules corresponding to the 3+2 layout of second-class seats) can be used to achieve accurate matching between physical seats and internal seat information, providing a foundation for graphical display of seats and accurate seat selection.

[0054] 3) Seating map data is used to describe the physical seat location information for each train.

[0055] For example, please refer to Figure 2 This is a schematic diagram of seating chart data provided in an embodiment of the present invention. Figure 2 As shown, the seating chart data describes the location information of physical seats, including the relative positions of seats, empty seats, and aisles.

[0056] 4) Full seat data is used to describe all seat information for all train services.

[0057] For example, Table 3 shows a full set of seat data provided by an embodiment of the present invention.

[0058] Table 3 As shown in Table 3, the full seat data describes all seat information for all train services, which may include train number, carriage, seat, class of carriage, status, passenger gender, etc.

[0059] Based on this, please refer to Figure 3 This is a flowchart illustrating a seat selection interface displayed on a terminal based on seat data, provided in an embodiment of the present invention. After executing step S02, where seat data is determined based on high-speed rail information in the cache and sent to the terminal, the terminal displays a seat selection interface based on the seat data. The process may specifically include, for example: Figure 3 The steps shown are as follows: Step S21: Determine the target departure and arrival stations based on the ticket query operation.

[0060] The target originating station and the target destination station are included.

[0061] In this embodiment, the terminal can accurately identify and extract the passenger's planned departure station (target origin station) and destination station (target arrival station) based on the passenger's input ticket search criteria. This allows the terminal to filter out trains matching the itinerary from a massive amount of train information and further display the seat availability for these trains. This step helps passengers quickly focus on trains relevant to their travel plans, avoiding wasting time on irrelevant trains, thereby improving ticket purchasing efficiency and enhancing the passenger's ticket purchasing experience.

[0062] Step S22: Based on the seat availability data at the destination and departure stations, display the train information corresponding to the destination and departure stations that have unsold seats.

[0063] For example, please refer to Figure 4 This is a schematic diagram of an interface for displaying information on trains with unsold seats corresponding to the target departure and arrival stations, provided by an embodiment of the present invention.

[0064] like Figure 4As shown, after determining the passenger's target departure and arrival stations, the terminal filters and displays train information with unsold seats at those stations based on seat availability data. This step helps passengers quickly understand which trains have available seats on their specified itinerary, providing a direct basis for their subsequent train selection and seat reservation.

[0065] By filtering out trains with unsold seats through the existing data on departure and arrival stations, the interference of irrelevant information can be effectively reduced, thereby improving the efficiency of passenger searches, ensuring that passengers pay attention to trains with available tickets, and avoiding invalid searches or seat selection conflicts caused by inaccurate information.

[0066] Step S23: In response to the train selection operation, determine the target train.

[0067] In high-speed rail travel, after passengers find multiple train options through ticket searches, they often consider factors such as their travel time preferences, train duration, departure and arrival times to ultimately determine the train that best suits their needs. When a passenger selects a specific train on the terminal, the terminal can capture and recognize this action, thereby locking onto the selected train and providing the passenger with detailed seating information related to that train, such as seat layout, and the distribution of sold and unsold seats.

[0068] Step S24: Generate a train undercarriage view of the target train number based on the seat map data.

[0069] In this embodiment, after a passenger selects a target train, the terminal can find the train's undercarriage view in the seating chart data that includes all trains. The train undercarriage view shows in detail the seating arrangement of each carriage, including the seat's location, type (such as window, aisle, three-seater, two-seater, etc.), and orientation, making it easy for passengers to intuitively understand the train's seating distribution.

[0070] Step S25: Based on the full seat data and seat-seat mapping data, mark the sold and unsold seats in the train undercarriage view, generate and display the seat selection interface.

[0071] In traditional high-speed rail ticketing systems, passengers often only see basic information such as train number, time, and number of remaining tickets, lacking an intuitive understanding of the seating layout inside the train. This forces passengers to rely on simple textual descriptions or experience when choosing seats, making it difficult to make accurate selections based on personal preferences (such as window seats or aisle seats).

[0072] Therefore, in this embodiment, based on the generated train undercarriage view, the system further marks which seats have been sold (sold seats) and which seats are still available (unsold seats) in the view using full seat data and seat-to-seat mapping data. Through this intuitive marking method, the system presents passengers with a clear and accurate seat selection interface, allowing them to understand the real-time status of each seat on the train at a glance and quickly make seat selection decisions. This intuitive display not only improves the efficiency of seat selection for passengers but also reduces seat selection errors or repeated searches caused by unclear information, thus enhancing the overall ticket purchasing experience.

[0073] In some embodiments, to enable passengers to more intuitively understand the specific details of sold seats and thus fully consider the impact of surrounding passengers when selecting seats, passenger information for sold seats can be included in the full seat data and marked on the seat selection interface. This provides passengers with a more comprehensive and personalized seat selection reference. That is, after performing step S25, the following steps can also be performed: Step S26: Based on the full seat data, mark the passenger information of sold seats in the seat selection interface.

[0074] For example, please refer to Figure 5 This is a schematic diagram of a terminal display seat selection interface provided in an embodiment of the present invention.

[0075] like Figure 5 As shown, the generated seat selection interface not only displays the sold and unsold status of seats, but also further displays relevant information about passengers in sold seats. This information can include the passenger's seat number and gender. This labeling method allows passengers to more intuitively understand the specific details of sold seats, enhancing the information richness and usability of the seat selection interface.

[0076] Please refer to Figure 6 This is a schematic diagram of a terminal ticketing interface provided in an embodiment of the present invention. Figure 6 As shown, after selecting a seat on the seat selection screen, the user will be redirected to the ticket purchase page to make a payment. After payment is completed, the system will respond to the ticket purchase information returned by the terminal and lock the corresponding seat in the ticketing system.

[0077] Based on the above technical solution, this embodiment can determine the target departure and arrival stations based on ticket query operations, and display train information with unsold seats according to the seat availability data of departure and arrival stations, helping passengers quickly filter out trains that meet their needs and are available for purchase. Simultaneously, it can generate an intuitive seat selection interface in response to train selection operations, achieving refined management of seat information, providing passengers with a more intuitive, detailed, and accurate seat display, and improving passengers' seat selection experience and ticket purchase satisfaction.

[0078] Based on the above embodiments, in some embodiments, high-speed rail information may include high-speed rail train information, high-speed rail train number information, and high-speed rail seat information, wherein: High-speed train information mainly describes the characteristics of the train itself, which may include information such as train type, train carriages, and seating chart; High-speed rail train information involves specific train operation plans, which may include train numbers, train formations, train stops, train dispatch orders, and other information. The high-speed rail seat information describes the details of each seat, which may include information such as train seats, seat availability, and seat mapping table.

[0079] Based on this, please refer to Figure 7 ,for Figure 1 A flowchart illustrating one practical manifestation of S02 in a high-speed train seat selection method based on caching is provided. (See attached flowchart.) Figure 7 As shown, the step S02 mentioned in determining seat data based on high-speed rail information in the cache can specifically include the following steps: Step S31: For each group of origin and destination stations, construct a tree-shaped index structure of remaining tickets with the origin and destination stations as the primary key, and determine the remaining ticket information of all trains at the origin and destination stations based on the high-speed rail train number information and high-speed rail seat information.

[0080] In this embodiment, the system constructs a tree-like index structure for each pair of origin and destination stations (such as Beijing to Shanghai, Shanghai to Guangzhou, etc.) using the origin and destination stations as unique identifiers (primary keys). This structure can efficiently store and query the train numbers and remaining ticket information corresponding to each origin and destination station. By integrating high-speed rail train information (such as train number, stops, and travel time) and high-speed rail seat information (such as seat number and seat status), the system can accurately determine the sales status of each seat in all trains at each origin and destination station, thereby providing passengers with real-time and accurate remaining ticket data.

[0081] Step S32: Determine the seat availability data for all trains at the origin and destination stations based on the remaining ticket information for all trains at the origin and destination stations.

[0082] In this embodiment, after constructing a tree-shaped index structure for remaining tickets and obtaining the remaining ticket information for all trains at each departure and arrival station, the remaining ticket information is summarized and organized to generate seat availability data for departure and arrival stations. This seat availability data, organized by departure and arrival station, records in detail the remaining quantity of each seat type for all trains at each departure and arrival station, such as the number of remaining tickets for first-class, second-class, and business-class seats.

[0083] Step S33: Determine the seat and seat mapping data of the departure and arrival stations based on the high-speed train information and high-speed train seat information.

[0084] In this embodiment, after determining the origin and destination stations, seat-to-seat mapping data for the origin and destination stations can be established using high-speed train information (including train type, train carriages, seat layout, etc.) and high-speed train seat information (including train seats, seat availability, seat mapping table, etc.). Seat-to-seat mapping data 1 associates each physical seat on the train with a seat identifier within the system, ensuring that the system can accurately identify and manage the information of each seat.

[0085] Step S34: Determine the seating chart data for departure and arrival stations based on the high-speed train information.

[0086] In this embodiment, a graphical seating chart can be generated from the seating information in the high-speed train. The seating chart data is organized by carriage and describes in detail the location, type (such as window, aisle, three-seater, two-seater, etc.) and layout of the seats in each carriage.

[0087] Step S35: Determine the full set of seats for departure and arrival stations based on the high-speed rail seat information.

[0088] In this embodiment, by integrating high-speed rail seat information (including train seats, seat inventory, seat mapping table, etc.), full seat data is generated. The full seat data can describe all seat information for all trains, which may include train number, carriage, seat, class of seats, status, passenger gender, etc.

[0089] Based on the above technical solution, this embodiment constructs a tree-shaped index structure for remaining tickets and uses this as a basis to determine the remaining ticket information and seat inventory data for each departure and arrival station. This enables a rapid and accurate reflection of the remaining ticket situation for each train, greatly improving the response speed and accuracy of remaining ticket queries. Simultaneously, by determining seat-to-seat mapping data, seat map data, and full seat data, it provides comprehensive and accurate data support for the seat selection interface in a multi-dimensional and all-encompassing manner.

[0090] Please refer to Figure 8 ,for Figure 1 The flowchart illustrates one practical implementation of step S03 in a high-speed rail train seat selection method based on high-speed caching. In some embodiments, step S03, which involves locking the corresponding seat in the ticketing system in response to the ticketing information returned by the terminal, can specifically be as follows: Figure 3 The steps shown are as follows: Step S41: Analyze the ticket purchase information and determine the target seat.

[0091] In this embodiment, after receiving the ticket purchase information returned by the terminal, the system analyzes and processes this information to identify the specific seat selected by the passenger. The ticket purchase information typically includes key information such as train number, carriage number, and seat number. By parsing this information, the system accurately locates the specific seat the passenger wishes to purchase.

[0092] Step S42: Invoke the distributed lock mechanism to initiate a lock request for the target seat.

[0093] In this embodiment, after parsing the ticket purchase information and determining the target seat, the system invokes a distributed lock mechanism to ensure the accuracy and uniqueness of seat allocation and prevent multiple requests from simultaneously modifying the state of the same seat. A distributed lock is a mechanism in a distributed system that coordinates access to shared resources by multiple nodes. Through this mechanism, the system can ensure that only one request can successfully lock the target seat at a time, thereby avoiding problems such as overselling or incorrect seat allocation caused by concurrent operations.

[0094] In high-speed rail ticketing scenarios, especially during peak periods like holidays or for popular train routes, a large number of passengers may simultaneously attempt to purchase the same seat. Without an effective locking mechanism, multiple requests might modify the seat status concurrently, leading to the same seat being sold multiple times and causing overselling. By invoking a distributed locking mechanism, the system can ensure that the locking operation for each seat is atomic, meaning that only one request can successfully lock a seat at a time. This guarantees the fairness and accuracy of seat allocation and maintains the system's data consistency and integrity.

[0095] In some embodiments, mature distributed lock tools or frameworks can be selected, such as Redis-based distributed locks. After receiving a ticket purchase request and resolving the target seat, the system generates a unique lock identifier, typically using the unique identifier of the target seat as the key, and initiates a lock request to the Redis server. The Redis server sets the lock according to the request and returns the locking result. If the locking fails, the system immediately returns an error message to the passenger, indicating that the seat is already occupied and suggesting that they choose another seat.

[0096] Furthermore, to prevent deadlocks, the system can set an expiration time for the lock, ensuring that the lock is automatically released in extreme circumstances. Simultaneously, the system can record relevant log information about locking operations for subsequent querying, auditing, and troubleshooting.

[0097] Step S43: If the distributed lock mechanism successfully acquires the lock, the target seat is marked as locked in the ticketing system, and the locking time and associated passenger ticketing information are recorded.

[0098] In this embodiment, after the distributed locking mechanism successfully locks the target seat, the system updates the seat's status to "locked" in the ticketing system's database to prevent other requests from purchasing the seat again. Simultaneously, the system records the specific time of the lock and related passenger information, such as passenger name, ID number, and contact information. This information will be used for subsequent ticketing processing and passenger services.

[0099] Marking seats as locked ensures they cannot be requested by other passengers, thus preventing overbooking. Secondly, recording the lock time and passenger information provides essential data support for subsequent ticketing processing. For example, if a passenger needs to modify or cancel their order, the system can quickly locate and process the corresponding seat based on this information.

[0100] Based on the above technical solution, this embodiment can solve the problem of seat competition when multiple users purchase tickets concurrently, ensuring the accuracy and fairness of seat locking. At the same time, it can guarantee the timely and accurate updating of seat status, avoiding overselling, and also provide reliable data support for subsequent ticketing management and passenger information inquiries.

[0101] Please refer to Figure 9 This is a schematic diagram illustrating a high-speed train seat selection process based on high-speed caching, provided by an embodiment of the present invention. Figure 9 As shown, this embodiment obtains high-speed rail information from the ticketing system and stores it in a high-speed cache; based on the high-speed rail information in the high-speed cache (including high-speed rail train information, high-speed rail train number information, and high-speed rail seat information), it determines seat data (including seat inventory data, seat-to-seat mapping data, seat location map data, and full seat data), and sends the seat data to terminals (including WEB terminal, APP ticketing terminal, window ticketing terminal, automatic ticketing machine, handheld device terminal, etc.); in response to the ticket purchase information returned by the terminal, it locks the corresponding seat in the ticketing system.

[0102] In some embodiments, one or more data synchronization services can be set according to the amount of data to be synchronized, so as to realize the real-time synchronization of high-speed rail information from the ticketing system to the seat selection system, support batch data synchronization, and complete the synchronization in the form of transactions to ensure data consistency; the data synchronization software realizes the conversion of relational data to non-relational data, and stores the data in the form of key-value pairs in the cache for easy querying and calculation.

[0103] The calculation engine can be configured with one or more. It senses real-time changes in high-speed rail information in the cache, generates seat data required by various ticketing channels through parallel computing, and synchronizes the calculation results to the cache in real time. During the calculation process, information such as seat reassignment and seat sharing is incorporated to correct the final data.

[0104] Seat display and selection services can be set up with one or more. A unified interface provides consistent data services to various types of railway terminals. Terminals use seat data to query train information that meets their requirements, displaying the train carriages and the availability of all seats, facilitating seat selection for passengers.

[0105] Please refer to Figure 10The diagram below illustrates the structure of a seat selection system provided in an embodiment of the present invention. The seat selection system may include: The information acquisition module 100 is used to acquire high-speed rail information from the ticketing system and store it in a high-speed cache; The seat determination module 200 is used to determine seat data based on high-speed rail information in the cache and send the seat data to the terminal; the terminal is used to respond to ticket query operations and display the seat selection interface based on the seat data; the seat selection interface includes sold seats and unsold seats; The seat locking module 300 is used to lock the corresponding seat in the ticketing system in response to the ticketing information returned by the terminal.

[0106] Based on the above embodiments, in a specific embodiment, the seat data may include seat inventory data, seat-to-seat mapping data, seat location map data, and full seat data; the seat inventory data is used to describe the remaining ticket information for all train services; the seat-to-seat mapping data is used to describe the mapping relationship between physical seats and seats for each train service; the seat location map data is used to describe the location information of physical seats for each train service; and the full seat data is used to describe the seat information for all train services. Specifically, the terminal can be used for: The target departure and arrival stations are determined based on the ticket search operation; the target departure and arrival stations include the target origin station and the target arrival station. Based on the seat availability data at departure and arrival stations, information on train services with unsold seats corresponding to the target departure and arrival stations is displayed. In response to the train selection operation, the target train is determined; Generate a train undercarriage view of the target train number based on the seat map data; Based on the full seat data and seat-seat mapping data, marked sold and unsold seats in the train undercarriage view, and generated and displayed a seat selection interface.

[0107] Based on the above embodiments, in a specific embodiment, the high-speed rail information includes high-speed rail train information, high-speed rail train number information, and high-speed rail seat information; The seat determination module 200 can be specifically used for: For each group of origin and destination stations, a tree-shaped index structure for remaining tickets is constructed with the origin and destination stations as the primary key. The remaining ticket information for all trains at the origin and destination stations is determined based on the high-speed rail train number information and the high-speed rail seat information. The seat availability data for all trains at the origin and destination stations is determined based on the remaining ticket information for all trains at the origin and destination stations. The seat and seat mapping data for departure and arrival stations are determined based on high-speed rail train information and high-speed rail seat information; Seating map data for departure and arrival stations is determined based on high-speed train information; The complete data of seats at departure and arrival stations is determined based on high-speed rail seat information.

[0108] Based on the above embodiments, in one specific embodiment, the full seat data also includes passenger information for sold seats; The terminal can also be used for: Based on the full seat data, passenger information for sold seats is marked on the seat selection interface.

[0109] Based on the above embodiments, in one specific embodiment, the seat locking module 300 can be used for: Analyze ticket purchase information to determine target seats; Invoke the distributed lock mechanism to initiate a lock request for the target seat; If the distributed lock mechanism successfully acquires the lock, the target seat will be marked as locked in the ticketing system, and the locking time and associated passenger ticketing information will be recorded.

[0110] Based on the above embodiments, in one specific embodiment, the information acquisition module 100 can be specifically used for: Retrieve structured high-speed rail information from the relational database of the passenger ticketing system; Structured high-speed rail information is stored in a cache as key-value pairs.

[0111] Based on the above embodiments, in one specific embodiment, the information acquisition module 100 can also be used for: When a change is detected in the high-speed rail information in the cache, a corresponding event object is created based on the changed high-speed rail information. According to the preset event handling rules, event objects are assigned to the corresponding event handlers so that each event handler processes the event objects in a predetermined order.

[0112] This embodiment provides an electronic device, including a processor and a memory. The memory is used to store at least one instruction. When the instruction is loaded and executed by the processor, it implements the above-mentioned high-speed train seat selection method based on high-speed cache. Its execution method and beneficial effects are similar and will not be described again here.

[0113] This invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the above-described high-speed train seat selection method based on high-speed cache. Its execution method and beneficial effects are similar and will not be described again here.

[0114] It should be noted that although the steps are described in a specific order above, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently, or even in a different order, as long as the required function can be achieved.

[0115] The above description is only a preferred 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 within the scope of protection of the present invention.

Claims

1. A method for selecting seats on high-speed trains based on high-speed caching, characterized in that, Applied to a seat selection system, the method includes: Retrieve high-speed rail information from the ticketing system and store it in a high-speed cache; Seat data is determined based on the high-speed rail information in the cache, and the seat data is sent to the terminal; the terminal is used to respond to ticket query operations and display a seat selection interface based on the seat data; the seat selection interface includes sold seats and unsold seats; In response to the ticketing information returned by the terminal, the corresponding seat is locked in the ticketing system.

2. The method according to claim 1, characterized in that, The seat data includes seat inventory data, seat-to-seat mapping data, seat location map data, and full seat data; the seat inventory data is used to describe the remaining ticket information for all train services; the seat-to-seat mapping data is used to describe the mapping relationship between physical seats and seats for each train service; and the seat location map data is used to describe the location information of physical seats for each train service. The full seat data is used to describe all seat information for all train services; The response to the ticket query operation, based on the seat data display of the seat selection interface, includes: The target departure and arrival stations are determined based on the ticket query operation; the target departure and arrival stations include the target origin station and the target arrival station. Based on the seat availability data at the departure and arrival stations, information on trains with unsold seats corresponding to the target departure and arrival stations is displayed. In response to the train selection operation, the target train is determined; A train undercarriage view of the target train is generated based on the seat map data; Based on the full seat data and the seat-seat mapping data, sold and unsold seats are marked in the train undercarriage view, and the seat selection interface is generated and displayed.

3. The method according to claim 2, characterized in that, The high-speed rail information includes high-speed rail train information, high-speed rail train number information, and high-speed rail seat information; The process of determining seat data based on the high-speed rail information in the cache includes: For each group of origin and destination stations, a tree-shaped index structure for remaining tickets is constructed with the origin and destination stations as the primary key. Based on the high-speed rail train number information and the high-speed rail seat information, the remaining ticket information for all trains at the origin and destination stations is determined. The seat availability data for all trains departing from and arriving at the stations is determined based on the remaining ticket information for all trains departing from and arriving at the stations. Based on the high-speed train information and the high-speed train seat information, determine the seat and seat mapping data of the departure and arrival stations; The seating chart data for the departure and arrival stations is determined based on the high-speed train information. Based on the high-speed rail seat information, determine the full data of seats at the departure and arrival stations.

4. The method according to claim 2, characterized in that, The full seat data also includes passenger information for sold seats; After marking sold and unsold seats in the train undercarriage view based on the full seat data and the seat-seat mapping data, generating and displaying the seat selection interface, the method further includes: Based on the full set of seat data, passenger information for the sold seats is marked on the seat selection interface.

5. The method according to claim 1, characterized in that, The step of locking the corresponding seat in the ticketing system in response to the ticketing information returned by the terminal includes: Analyze the ticket purchase information to determine the target seats; Invoke the distributed lock mechanism to initiate a lock request for the target seat; If the distributed locking mechanism successfully acquires the lock, the target seat will be marked as locked in the ticketing system, and the locking time and associated passenger ticketing information will be recorded.

6. The method according to claim 1, characterized in that, The process of obtaining high-speed rail information from the ticketing system and storing it in a cache includes: Retrieve structured high-speed rail information from the relational database of the ticketing system; The structured high-speed rail information is stored in the cache as key-value pairs.

7. The method according to claim 6, characterized in that, After storing the structured high-speed rail information in the cache as key-value pairs, the method further includes: When a change is detected in the high-speed rail information in the cache, a corresponding event object is created based on the changed high-speed rail information. According to preset event handling rules, the event objects are assigned to corresponding event handlers so that each event handler processes the event objects in a predetermined order.

8. A seat selection system, characterized in that, include: The information acquisition module is used to acquire high-speed rail information from the ticketing system and store it in a high-speed cache; The seat determination module is used to determine seat data based on the high-speed rail information in the cache, and send the seat data to the terminal; The terminal is used to respond to ticket query operations and displays a seat selection interface based on the seat data; the seat selection interface includes sold seats and unsold seats. The seat locking module is used to lock the corresponding seat in the ticketing system in response to the ticketing information returned by the terminal.

9. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store at least one instruction, which, when loaded and executed by the processor, implements the cache-based high-speed train seat selection method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the high-speed train seat selection method based on caching as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Building method of ticket pool middleware for providing ticket support, ticket purchasing and ticket locking methods

    CN104809510A

  • Seat state display method and electronic equipment

    CN113269337A