A method and system for managing user notifications based on flight information
By isolating physical flight segments using flight segment identifiers, generating event summaries, and verifying chain evidence, the problem of terminal notification display status being affected by the order of operation command messages is solved, and the synchronization and consistency update of terminal and server status are achieved.
Patent Information
- Application Number
- CN202611423021.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-11-20
AI Technical Summary
During air operations, the terminal notification display status of the same flight segment is affected by the arrival order of operation instruction messages, resulting in delays, repetitions, or changes in order, making it difficult to determine the current operation instruction and making it difficult for the terminal to keep its status synchronized with the server.
Physical segments are isolated by segment identifiers, event summaries are generated and the current chain head is determined. After receiving the notification envelope, the user terminal temporarily stores and verifies the chain evidence to ensure that delays, duplications or changes in order in the message channel do not affect the consistency of the notification display status.
This ensures that the notification status of the same flight segment corresponds to the current operating instructions stored on the server, improving the verifiability and consistency of the notification update process and avoiding display content confusion caused by changes in the order of message arrival.
Smart Images

Figure CN123145305A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of aviation traffic information technology, and more specifically, to a user notification management method and system based on flight information. Background Technology
[0002] During air travel, information such as boarding gate, boarding start time, boarding end time, and operational status may change depending on the flight segment's operational status. Related systems typically generate update events via the operational interface and then send notifications to user terminals subscribed to that flight segment via message channels. Under conditions of terminal offline, network fluctuations, low-power wake-up, queue backlog, or cross-channel retransmission, multiple messages for the same flight segment may be delayed, duplicated, or have changed arrival order. Common terminal handling methods include displaying messages in the order they were received or performing a simple comparison based on the generation time carried by the messages.
[0003] The order in which messages arrive does not necessarily correspond to the operational order of events in a flight segment. Relying solely on the terminal's reception time is insufficient to reflect the current state saved by the server at the verification time. Time records from different systems may also be affected by time zone configuration, synchronization status, and transmission jitter. Folding or setting expiration dates for message channels can reduce backlog, but it cannot prove that a particular arriving message still corresponds to the current operational instruction. Therefore, older messages may overwrite newly displayed messages, making it difficult for user terminals on the same flight segment to determine which current operational instruction should be submitted and displayed. Summary of the Invention
[0004] This invention provides a user notification management method and system based on flight information, solving the technical problem in related technologies of how to avoid the terminal notification display status of the same flight segment being affected by the arrival order of operation instruction messages.
[0005] In a first aspect, the present invention provides a user notification management method based on flight information, applied to scenarios where operational instruction events for physical flight segments reach user terminals via message channels, including: The server distinguishes physical segments based on segment identifiers, generates event digests associated with previous digests according to the event order of operation command events within the same physical segment, and determines the current chain head; The server sends a notification envelope corresponding to the current chain head to the user terminals that have subscribed to the physical flight segment. After receiving the notification envelope, the user terminal temporarily stores the notification envelope and sends the notification envelope and local chain state to the server; The server generates chain evidence and confirmation envelopes from the local chain state to the current chain head based on the current chain head when tracing back to the source. The user terminal verifies the continuity of the chain evidence and the progression of the confirmation envelope relative to the local chain state. When the verification is successful, it atomically updates the local chain state and replaces the valid notification of the physical segment with the running instructions in the confirmation envelope.
[0006] Furthermore, the server distinguishes physical flight segments based on flight segment identifiers, including: Receive the flight segment identifier, source event number, generation time, reception time, and operation instructions from the airport operation interface or airline operation interface; The flight segment identifier is generated based on the operating flight number, planned operation date, departure airport, and arrival airport. The integrity of the format of the flight segment identifier, the source event number, the generation time, the reception time, and the operation instruction is verified, and the independent event chain is located by the flight segment identifier.
[0007] Furthermore, the server generates event digests associated with preceding digests according to the event order of operational command events within the same physical flight segment, and determines the current chain head, including: The transmission delay is determined based on the receiving time and the generating time, and the freshness weight is determined based on the transmission delay and a preset delay scale. The sorting key is determined based on the source event number and the freshness weight. Events within the same physical segment are ordered according to the sorting key, and the running instruction event corresponding to the largest sorting key is taken as the current chain head. The event digest is generated in the order of fixed fields of the segment identifier, the source event number, the operation command, the generation time, and the preceding digest, so that the event digest of each operation command event is associated with the event digest of the previous operation command event in the event sequence, wherein the preceding digest of the first operation command event is a fixed string of all zero bytes.
[0008] Furthermore, the server sends a notification envelope corresponding to the current chain head to the user terminals subscribed to the physical flight segment, including: The notification envelope is formed using the segment identifier, sorting key, operation command, and event summary of the current chain leader; The notification envelope is sent to the user terminal via the message channel corresponding to the subscription relationship of the physical flight segment.
[0009] Further, after receiving the notification envelope, the user terminal temporarily stores the notification envelope and sends the notification envelope and local chain state to the server, including: The notification envelope is received by the push receiving thread of the user terminal, written into the temporary storage area, and the valid notification is maintained. Read the local chain state corresponding to the flight segment identifier and recording the accepted sorting key and event summary, and send the temporarily stored notification envelope and the local chain state to the server.
[0010] Furthermore, the server generates chain evidence and confirmation envelopes from the local chain state to the current chain head based on the current chain head during the homing process, including: The starting point of the evidence is determined based on the accepted event summary recorded in the local chain state, and an ordered set of evidence data is formed from the starting point of the evidence to the current chain head in the order of the events. Each item in the ordered evidence data set includes the flight segment identifier, the source event number, the operation command, the generation time, and the event summary, with the event summary of the previous item serving as the preorder summary of the next item; The confirmation envelope is formed using the segment identifier, sorting key, operation command, event summary, and chain evidence of the current chain leader.
[0011] Furthermore, the user terminal verifies the continuity of the chain evidence and the progression of the confirmation envelope relative to the local chain state, including: Verify that the segment identifier of the confirmation envelope is consistent with the physical segment subscribed by the user terminal, recalculate the chain evidence item by item according to the generation relationship of the event digest, and verify that the final event digest obtained by recalculation is consistent with the event digest in the confirmation envelope. The sorting key in the confirmation envelope is compared with the sorting key in the local chain state, and a submission token is generated based on the verification result of the chain evidence and the comparison result of the sorting key.
[0012] Furthermore, upon successful verification, the user terminal atomically updates the local chain state and replaces the valid notification of the physical flight segment with the execution instructions in the confirmation envelope, including: When the chain evidence is continuous and the sort key of the confirmation envelope strictly advances relative to the sort key in the local chain state, the sort key and event digest in the confirmation envelope are written in the same local database transaction, and the valid notification of the physical segment is replaced with the run instruction in the confirmation envelope.
[0013] The beneficial effects of this invention are as follows: This invention isolates operational events of different physical flight segments using flight segment identifiers, forms event order through source event numbers and freshness weights, and preserves continuous relationships using event digests associated with preceding digests; after a notification envelope arrives at the user terminal, it only triggers a return to the source. The server generates chain evidence and a confirmation envelope according to the current chain head at the verification time. The terminal only updates its local chain state and valid notifications within the same transaction when both continuous chain verification and strict progress are simultaneously established. Therefore, delays, duplications, backlogs, and changes in arrival order in the message channel no longer individually determine the content visible to the user, and late-arriving envelopes are unlikely to overwrite newer notifications that have already been submitted; the synchronous update of the status and displayed content of the same flight segment ensures that terminal notifications correspond to the current operational instructions stored on the server, and improves the verifiability and consistency of the notification status update process for the same flight segment.
[0014] Secondly, the present invention provides a user notification management system based on flight information, comprising: The event summary generation module distinguishes physical flight segments based on flight segment identifiers, generates event summaries associated with previous summaries according to the event order of operation command events within the same physical flight segment, and determines the current chain head; The notification envelope sending module sends a notification envelope corresponding to the current chain head to user terminals that have subscribed to the physical flight segment. The envelope temporary storage and return module allows the user terminal to receive the notification envelope, temporarily store the notification envelope, and send the notification envelope and local chain state to the server. The chain evidence generation module, wherein the server generates chain evidence and confirmation envelope from the local chain state to the current chain head based on the current chain head when returning to the source; The chain state verification and update module verifies the continuity of the chain evidence and the advancement relationship of the confirmation envelope relative to the local chain state. When the verification is successful, it atomically updates the local chain state and replaces the valid notification of the physical segment with the running instructions in the confirmation envelope.
[0015] Thirdly, the present invention provides a computer-readable storage medium comprising a computer program, wherein the computer program, when executed, controls a server on which the computer-readable storage medium resides to implement the steps of the method described in the first aspect. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart of the user notification management method based on flight information provided by the present invention; Figure 2 This is a flowchart of the chain-state verification update provided by the present invention; Figure 3 This is a schematic diagram of a data interaction scenario in the user notification management system provided by the present invention. Detailed Implementation
[0018] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.
[0019] It should be noted that, unless otherwise defined, the technical or scientific terms used in one or more embodiments of the present invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in one or more embodiments of the present invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" indicate that the element or object preceding the term encompasses the elements or objects listed following the term and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0020] like Figure 1 As shown, a user notification management method based on flight information is applied to scenarios where operational command events for physical flight segments reach user terminals via message channels. The method includes the following steps: Step S1: The server distinguishes physical segments based on the segment identifier, generates event digests associated with previous digests according to the event order of the operation instruction events within the same physical segment, and determines the current chain head; Step S2: The server sends a notification envelope corresponding to the current chain head to the user terminal that subscribed to the physical flight segment; Step S3: After receiving the notification envelope, the user terminal temporarily stores the notification envelope and sends the notification envelope and local chain state to the server. Step S4: The server generates chain evidence and confirmation envelope from the local chain state to the current chain head based on the current chain head when returning to the source. In step S5, the user terminal verifies the continuity of the chain evidence and the progression of the confirmation envelope relative to the local chain state. When the verification is successful, the local chain state is atomically updated, and the valid notification of the physical segment is replaced with the running instructions in the confirmation envelope.
[0021] In one embodiment of the present invention, step S1 includes: In step S101, the server receives the flight segment identifier, source event number, generation time, reception time, and operation instructions from the airport operation interface or the airline operation interface.
[0022] Specifically, the server receives operational events through the airport operational data interface or the airline operational data interface. After the interface message arrives at the access service, the access service reads the fields and saves the original message and the parsing result in the same reception record. The source event number is a monotonically increasing integer assigned by the upstream system to operational command events within the same physical segment. It is collected from the sequence number field of the operational event message. The same source event number indicates a retransmission copy of the same business event. Different physical segments maintain their own source event number sequences. The generation time is the second-level Unix timestamp written into the event message when the upstream system generates the operational command event. The reception time is the second-level Unix timestamp recorded by the server clock when the server completely receives the event message. If the message is transmitted in fragments, the reception time is the time when the last complete fragment arrives and is reassembled. The operational command is a UTF8 encoded data frame provided by the operational interface, which fixedly includes the boarding gate, boarding start time, boarding end time, and operational status code, and serves as the input of the event summary and the source of valid notification content.
[0023] Step S102: The flight segment identifier is generated based on the carrier flight number, planned operation date, departure airport and arrival airport. The integrity of the format of the flight segment identifier, the source event number, the generation time, the reception time and the operation instruction is verified, and the independent event chain is located by the flight segment identifier.
[0024] A segment identifier is a fixed-length string that uniquely points to a physical segment. The server standardizes the case of the letters in the flight number and removes leading and trailing whitespace. The planned operation date is represented by the calendar date agreed upon by the interface, and the departure and arrival airports are represented by the standard airport codes provided by the interface. The segments are then standardized and combined according to the fixed field order of the flight number, planned operation date, departure airport, and arrival airport, as well as the character set and field length agreed upon by the interface. Different display numbers generated by code sharing are grouped into the same segment identifier when corresponding to the same flight number, planned operation date, departure airport, and arrival airport. Different events such as return trips, cross-day trips, or different departure and arrival airports form different segment identifiers.
[0025] The server verifies the existence of all necessary fields, whether the character length conforms to the interface definition, whether the source event number is an integer, whether the generation and receiving times are parsable, and whether the fixed fields of the execution command are complete and whether the data type conforms to the interface definition. If any necessary field is missing or of incorrect type, the server writes the corresponding record to the exception record area and excludes that record from the determination of the event sequence and the current chain head. After the verification is passed, the server uses the flight segment identifier as the partition key to locate the independent event chain, so that the data of one physical flight segment is not mixed with the data of other physical flight segments.
[0026] Step S103: Calculate the transmission delay based on the receiving time and the generating time.
[0027] Specifically, the formula for calculating the transmission delay is as follows: in, This represents the transmission delay of the i-th operational command event within the same physical flight segment. This indicates the time of receipt of the i-th operational command event within the same physical flight segment. This indicates the generation time of the i-th operational command event within the same physical flight segment.
[0028] Transmission latency represents the number of seconds that elapse from the generation of the same running instruction event to its complete reception by the server. The server converts the generation and reception times into second-level Unix timestamps in the same time zone before performing the calculation and saves the original time values. When the calculation result is negative, the server retains the corresponding record in the exception record area for interface verification and excludes the record from the event sequence and the determination of the current chain head. When the calculation result is zero, the transmission latency is treated as zero seconds.
[0029] Step S104: Obtain a preset delay scale, and calculate the freshness weight based on the transmission delay and the delay scale.
[0030] The latency scale represents the time scale of normal transmission fluctuations on the same interface link, in seconds. During deployment, complete historical event samples with non-negative transmission latency within the last 30 natural days of the interface link can be selected, sorted by transmission latency from smallest to largest, and the 95th percentile is taken as the calibration value. If the sample is insufficient, the sampling period is extended until at least 1000 events are covered. For operating interfaces that aim for second-level push, the latency scale is preferably 60 to 300 seconds. For example, if the 95th percentile of the historical sample is 120 seconds, the latency scale is set to 120 seconds. The scale is recalibrated after the interface path or clock synchronization strategy changes.
[0031] Specifically, the formula for calculating the freshness weight is as follows: in, This represents the freshness weight of the i-th operational instruction event within the same physical flight segment. This represents the transmission delay of the i-th operational command event within the same physical flight segment. Indicates the time delay scale.
[0032] The freshness weight represents the degree of attenuation of the retransmitted copy relative to the interface transmission delay. It is used for disambiguation of events with the same source event number. This value is dimensionless. The input transmission delay and delay scale are both in seconds, and the delay scale is positive. When the transmission delay is zero, the freshness weight is one. When the transmission delay is positive, the freshness weight is greater than zero and less than one, and it decreases monotonically as the transmission delay increases. This process does not change the service master order between different source event numbers.
[0033] Step S105: Calculate the sorting key based on the source event number and the freshness weight, and form the event order within the same physical segment according to the sorting key, with the running instruction event corresponding to the largest sorting key as the current chain head.
[0034] Specifically, the formula for calculating the sorting key is as follows: in, The sorting key represents the i-th operational command event within the same physical flight segment. This represents the source event number of the i-th operational command event within the same physical flight segment. This represents the freshness weight of the i-th operational instruction event within the same physical flight segment.
[0035] The sort key represents the comparable order of operational command events within the same physical segment, and this value is dimensionless. The source event number provides the business master order of the integer part, and half of the freshness weight provides the order among retransmitted replicas of the same source event number. Since the freshness weight is no greater than one, the integer difference between different source event numbers will not be changed by the freshness weight. The server only compares the sort key within the event partition corresponding to the segment identifier and saves the largest sort key and its corresponding event summary as the current chain head. When the source event number, freshness weight, and operational command of two retransmitted replicas are the same, the server retains the already added chain record and does not generate a new chain head change.
[0036] Step S106: Calculate the event digest according to the fixed field order of the segment identifier, the source event number, the operation command, the generation time, and the preceding digest, so that the event digest of each operation command event is associated with the event digest of the previous operation command event in the event sequence, and save the current chain head and its sorting key, wherein the preceding digest of the first operation command event is a fixed string of all zero bytes.
[0037] Specifically, the formula for calculating the event summary is as follows: in, This represents the event summary of the i-th operational command event within the same physical flight segment. Indicates flight segment identification. This represents the source event number of the i-th operational command event within the same physical flight segment. The operation instruction representing the i-th operation instruction event within the same physical flight segment. This indicates the generation time of the i-th operational command event within the same physical flight segment. This represents the event summary of the preceding operational instruction event within the same physical flight segment, preceding the i-th operational instruction event. This indicates that bytes are concatenated according to a fixed field order.
[0038] The preorder digest represents the event digest of the preceding execution instruction event in the event sequence. The event digest is a 256-bit digest obtained by SHA256 processing of fixed fields. The server uses UTF8 encoding to process string fields, uses fixed-length encoding agreed upon by the interface to process integer and time fields, and uses the execution interface data frame definition to determine field boundaries. The server and user terminal deploy consistent encoding rules. The first execution instruction event uses 32 bytes of all zeros as the preorder digest, and other execution instruction events use the event digest immediately preceding the previous one. The SHA256 output is a 32-byte digest value.
[0039] The server stores event records using the flight segment identifier as the partition key. Each record stores at least the source event number, generation time, reception time, execution command, transmission delay, freshness weight, sorting key, previous order summary, and event summary. After a new event completes verification, calculation, and summary generation, the server submits the event record and the current chain head within the same flight segment partition, enabling the back-to-source processing to read the already submitted chain head status.
[0040] It should be understood that the event summary is bound to the segment identifier, source event number, operation command, generation time, and preceding summary. When any event content or adjacent connection relationship changes, the resulting summary is recalculated according to the same field order and changes accordingly. The summary association relationship established in this way provides a data basis for the terminal to verify the event content, segment affiliation, and event continuity item by item starting from the accepted summary, and reduces the possibility of incorrect submission caused by retransmission of copies or missing intermediate events.
[0041] In one embodiment of the present invention, step S2 includes: Step S201: Read the segment identifier, sorting key, running command, and event summary of the current chain head.
[0042] The server performs the read operation after the current head record has been submitted. The segment identifier, sort key, run command, and event summary are all taken from the same current head record to avoid combining fields from different run command events in the same data frame.
[0043] Step S202: The notification envelope is formed using the flight segment identifier, the sorting key, the operation command, and the event summary.
[0044] The notification envelope is a structured data frame carried by the message channel, consisting of a segment identifier, sorting key, execution command, and event digest from the same current chain head. The segment identifier is used to locate the subscription object, the sorting key and event digest are used to associate the homing request, and the execution command retains the content of the current chain head. The server writes the above fields according to the data frame format of the message interface and sets the message type to indicate the notification envelope, so that the user terminal can distinguish it from the confirmation envelope. The notification envelope only indicates that there is a segment update to be verified, and does not allow the execution command within it to directly obtain the qualification for display.
[0045] Step S203: Send the notification envelope to the user terminal via the message channel corresponding to the subscription relationship of the physical flight segment.
[0046] The server queries the subscription relationship based on the flight segment identifier and sends the notification envelope to the user terminal that subscribed to the physical flight segment. The message channel can be a mobile push channel or an existing message connection between the user terminal and the server. The message platform can use the flight segment identifier as a folding key to reduce the backlog of messages for the same flight segment. However, when the user terminal receives a single notification envelope, a duplicate notification envelope, or a notification envelope whose arrival order has changed, the same source verification process is performed. This process ensures that message arrival only triggers the current status verification and does not directly determine the running instructions displayed by the user terminal.
[0047] In one embodiment of the present invention, step S3 includes: Step S301: The notification envelope is received by the push receiving thread of the user terminal.
[0048] After receiving the notification envelope, the push receiving thread of the user terminal first verifies whether the message type and flight segment identifier can be parsed according to the data frame format of the message interface; if the verification is successful, it enters the temporary storage process; if the verification fails, the data frame is not used to trigger the display of the running command.
[0049] Step S302: Write the received notification envelope into the temporary storage area and keep the valid notification.
[0050] The push receiving thread writes the notification envelope to a temporary storage area distinguished by flight segment identifier. The temporary storage area only records data to be verified and does not call the system notification creation or replacement interface. The valid notification is the notification object of the same physical flight segment currently displayed to the user terminal. Its content comes from the running instructions in the confirmation envelope that has been verified. During the writing to the temporary storage area, the user terminal continues to display the original valid notification, thereby avoiding the message arrival action directly changing the user's visible state.
[0051] Step S303: Read the local chain state corresponding to the flight segment identifier and recording the accepted sorting key and event summary.
[0052] The local chain state is a key-value record saved by the user terminal according to the segment identifier. It records at least the sort key and event digest of the most recently accepted acknowledgment envelope. The user terminal queries the local chain state with the segment identifier in the notification envelope. If the query result exists, it reads the accepted sort key and event digest. If the query result does not exist, it generates the initial local chain state for the segment. When the user terminal has never accepted the acknowledgment envelope for the physical segment, the local chain state uses the initial sort state and a 32-byte event digest of all zeros.
[0053] Step S304: Send the temporarily stored notification envelope and the local chain state to the server.
[0054] The user terminal sends the temporarily stored notification envelope and the read local chain state to the server in the same homing request. The notification envelope is used to identify the triggering source, and the local chain state is used to determine the evidence starting point for the server to construct chain evidence. If the same flight segment receives a notification envelope again before the homing request is completed, the user terminal can retain the last arrived unverified envelope in the temporary storage area or register multiple unverified envelopes in sequence, but cannot replace the valid notification with it. Each unverified envelope can trigger the homing request, and the final submission is determined by the current chain head, chain evidence, and local chain state at the time of the homing request. If the homing request fails, the user terminal keeps the valid notification and local chain state unchanged and can resend the same request according to the existing network retry policy.
[0055] In one embodiment of the present invention, step S4 includes: In step S401, the server reads the current chain head when returning to the source and determines the evidence starting point based on the accepted event digest recorded in the local chain state.
[0056] The server reads the current head of the submitted chain for the flight segment based on the flight segment identifier in the origin request, and reads the accepted event digest in the local chain state. The server searches for the event record corresponding to the accepted event digest in the event partition of the flight segment, and uses this record as the starting point of evidence. When the local chain state is in the initial state, 32 bytes of all zeros are used as the starting point of evidence. If the accepted event digest is not in the event partition of the flight segment, the server does not generate a committable confirmation result and returns a chain state mismatch status.
[0057] Step S402: Form an ordered set of evidence data from the starting point of the evidence to the current head of the chain according to the order of events, and combine the ordered set of evidence data into the chain evidence.
[0058] Chain evidence is an ordered set of evidence data that leads from the accepted event digests recorded in the local chain state to the current chain head when returning to the source. It is used to enable the user terminal to recalculate the event digests item by item according to a consistent encoding rule and confirm the continuity relationship. The server starts from the first running instruction event after the evidence starting point, reads the event records in the order of events, and reads them sequentially until the current chain head when returning to the source, while maintaining the original order of each event record. When the local chain state has already corresponded to the current chain head, the ordered evidence data set is empty. The server can still return the confirmation envelope of the current chain head, but the confirmation envelope does not meet the condition of strict advancement relative to the local chain state.
[0059] Step S403: In each item of the ordered evidence data set, set the flight segment identifier, the source event number, the operation command, the generation time, and the event summary, and use the event summary of the previous item as the preorder summary of the next item.
[0060] The server sets each field according to the records already saved in the event partition without rewriting the original fields; the first item of the ordered evidence data set uses the event digest of the evidence starting point as the preorder digest, and the second item and each subsequent item use the event digest of the item immediately preceding it as the preorder digest, so that the user terminal can recalculate the event digest item by item according to the field order, encoding rules and SHA256 processing rules in step S106.
[0061] Step S404: The confirmation envelope is formed using the segment identifier, sorting key, operation command, event summary, and chain evidence of the current chain head.
[0062] The confirmation envelope is a structured data frame formed by the server based on the currently submitted chain head when processing a homing request. It includes the segment identifier, sorting key, operation command, event digest, and chain evidence of the current chain head, and uses a different message type than the notification envelope that triggered the homing request. The event digest in the confirmation envelope is equal to the event digest of the last item of the chain evidence. When the chain evidence is empty, it is equal to the event digest of the local chain state record. After the server completes the field consistency verification, it returns the confirmation envelope. The user terminal only performs an explicit commit judgment on the confirmation envelope.
[0063] For example, the local chain records the event digest of the first execution instruction event. When the server retrieves the source, the current chain head is the third execution instruction event. The chain evidence sequentially includes the second and third execution instruction events. The second execution instruction event uses the event digest already accepted in the local chain as its preorder digest, and the third execution instruction event uses the event digest of the second execution instruction event as its preorder digest. The user terminal recalculates two items consecutively starting from the local chain. When the last event digest obtained matches the event digest in the confirmation envelope, the continuity is confirmed.
[0064] In one embodiment of the present invention, such as Figure 2 As shown, step S5 includes: Step S501: Verify that the segment identifier of the confirmation envelope is consistent with the physical segment subscribed by the user terminal.
[0065] The user terminal reads the segment identifier in the confirmation envelope and compares it with the physical segment in the local subscription record. If they are inconsistent, the user terminal will determine that the chain evidence verification fails and will not use the running instructions in the confirmation envelope. This comparison is performed between the standardized segment identifiers to avoid changes in the physical segment judgment due to differences in code-share display numbers.
[0066] Step S502: Recalculate the chain evidence item by item according to the calculation formula of the event digest described in step S106, and verify that the final event digest obtained by recalculation is consistent with the event digest in the confirmation envelope.
[0067] The user terminal uses the event digest in the local chain state as the initial pre-sequence digest and reads each item of the chain evidence sequentially. For each item, it calculates the event digest according to the fixed field order of the segment identifier, source event number, operation command, generation time, and pre-sequence digest, and the consistent encoding rules, and compares it with the event digest carried by that item. If the current item matches, the event digest of that item is used as the pre-sequence digest of the next item. If any item does not match, the event sequence is interrupted, or the segment identifier changes, the verification result is a failure. After all items pass, the user terminal compares the final event digest with the event digest in the confirmation envelope. If the two match, the final event digest is confirmed to be consistent.
[0068] Step S503: Compare the sorting key in the confirmation envelope with the sorting key in the local chain state to determine whether the confirmation envelope is strictly advanced relative to the local chain state.
[0069] When the sorting key in the confirmation envelope is greater than the sorting key in the local chain state, the user terminal determines that the confirmation envelope is strictly advanced relative to the local chain state; when the sorting key in the confirmation envelope is equal to or less than the sorting key in the local chain state, the user terminal determines that the confirmation envelope is not advanced; when receiving a notification for a certain physical segment for the first time, the local chain state uses the initial sorting state to ensure that the first confirmation envelope that passes the continuous chain verification can meet the advancement conditions.
[0070] Step S504: Calculate the submission token based on the verification result of the chain evidence and the comparison result of the sorting key.
[0071] Specifically, the formula for calculating the submission mark is as follows: in, Indicates a commit flag. Indicates chain evidence, Indicates the local chain state. This indicates confirmation of the envelope. This indicates that the verification process covers the continuity of event digests from the local chain state to the current chain head corresponding to the confirmation envelope, the consistency of flight segment identifiers, and the consistency of the final event digest. This indicates that the sorting key of the confirmation envelope strictly advances relative to the local chain state. This means that if both conditions are true, one condition is taken, and otherwise zero is taken.
[0072] The commit flag is a Boolean value generated based on the chain evidence verification result and the sort key comparison result. The user terminal combines the segment identifier consistency result, the chain evidence item-by-item recalculation result, the final event digest consistency result, and the sort key strict advancement result into a commit judgment. The commit flag is set to one when all the above conditions are met, and the commit flag is set to zero when any condition is not met. When the late notification envelope triggers the homing request, the server returns the current chain head at the time of homing, and the user terminal still judges whether the chain head has made actual progress based on the local chain state.
[0073] Step S505: When the commit flag is 1, write the sort key and event digest in the confirmation envelope into the same local database transaction, and replace the valid notification of the physical segment with the run instruction in the confirmation envelope.
[0074] When the commit flag is set to 1, the user terminal initiates a local database transaction, writes the sort key and event summary in the confirmation envelope using the flight segment identifier as the primary key, and generates new valid notification content using the execution instructions in the confirmation envelope. The database write and notification replacement registration for the same physical flight segment are registered in the same transaction commit process, and the transaction is committed after all operations are successful. If any write or replacement operation fails, the transaction is rolled back, and the original local chain state and the original valid notification remain unchanged.
[0075] Step S506: When the submission flag is zero, retain the valid notification and clear the temporarily stored notification envelope.
[0076] When the submission flag is set to zero, the user terminal does not modify the local chain state, does not replace valid notifications, and clears the temporary notification envelope corresponding to this homing request; the clearing operation is located by the temporary record identifier and does not affect other pending verification envelopes that arrive subsequently in the same physical segment; for notification envelopes that arrive repeatedly, have the same sort key, or have a sort key less than the local chain state, their homing results do not meet the strict advancement conditions, and the user terminal continues to display the valid notifications that have already been submitted.
[0077] For example, if the same physical flight segment generates the original gate event, the first change event, and the final change event sequentially, and the user terminal is in a low-power state, the message channel may back up, causing the notification envelope for the final change event to arrive first. The user terminal temporarily stores this notification envelope and sends it back to the source. The server uses the final change event as the current chain head to return chain evidence and a confirmation envelope. After the user terminal verifies the final change event, it submits the final change event. Subsequently, the notification envelope for the first change event arrives and triggers a back-to-source event. The server still returns the confirmation envelope corresponding to the final change event. The sort key of this confirmation envelope is equal to the local chain state, the commit flag is set to zero, and the user terminal retains the valid notification corresponding to the final change event.
[0078] It should be noted that the chain evidence provides the necessary fields from the locally accepted event digest to the current chain head in the order of events. The user terminal recalculates and checks the final event digest item by item from the local chain state, which can simultaneously verify the event content, flight segment attribution and link continuity. This mechanism allows the user terminal to confirm the acceptable current chain head based on the continuous event records stored by the server, rather than inferring the current state based on the arrival order of individual notification envelopes.
[0079] Furthermore, the local chain state stores the most recently accepted sort key and event summary, confirming that the envelope only generates a commit flag when the continuous chain verification passes and the sort key is strictly advanced; the user terminal writes a new local chain state in the same database transaction and replaces the valid notification for the same physical segment, so that the status record and the user-visible content form the same commit result; if any operation in the transaction fails, both remain in their original state after rollback. If the late notification envelope triggers the origin again and the current chain head returned by the server is equal to the local chain state, the strict advancement condition is not met, thereby reducing intermediate states where the status record and the valid notification are inconsistent.
[0080] Based on the same inventive concept, embodiments of the present invention provide a user notification management system based on flight information, including: The event summary generation module distinguishes physical flight segments based on flight segment identifiers, generates event summaries associated with previous summaries according to the event order of operation command events within the same physical flight segment, and determines the current chain head; The notification envelope sending module sends a notification envelope corresponding to the current chain head to user terminals that have subscribed to the physical flight segment. The envelope temporary storage and return module allows the user terminal to receive the notification envelope, temporarily store the notification envelope, and send the notification envelope and local chain state to the server. The chain evidence generation module, wherein the server generates chain evidence and confirmation envelope from the local chain state to the current chain head based on the current chain head when tracing back to the source; The chain state verification and update module verifies the continuity of the chain evidence and the advancement relationship of the confirmation envelope relative to the local chain state. When the verification is successful, it atomically updates the local chain state and replaces the valid notification of the physical segment with the running instructions in the confirmation envelope.
[0081] like Figure 3As shown, this system can be deployed on flight notification servers and user terminals with flight service applications installed. After the airport operation interface or airline operation interface generates a gate, boarding time, or operation status update event, the server forms an event sequence and event summary according to the physical flight segment and sends a notification envelope to the subscribing terminal. The terminal writes the envelope to the temporary storage area and then accesses the server with its local chain state to obtain the chain evidence and confirmation envelope corresponding to the current chain head at the time of retrieval. After successful verification, the local record and system notification are updated. The server can add event records partitioned by flight segment to the existing operation event access service, and the terminal can save the local chain state in the existing local database by flight segment identifier. The message platform is not required to guarantee that messages of the same flight segment arrive in order.
[0082] For example, on the same physical flight segment, an operational instruction is first generated to change the boarding gate from A12 to B06, followed by another operational instruction to change the boarding gate to C18 and update the boarding deadline. After the terminal restores its network connection, it receives the notification envelope for the latter event first. After verification via source lookup, it displays C18 and the updated boarding deadline. When the notification envelope for the former event arrives later, it still triggers source lookup, but the current chain head returned by the server remains unchanged, confirming that the envelope is no longer advancing relative to the local chain state, and the terminal maintains the valid notification corresponding to C18. This application process can be used for operating conditions such as weak network reconnection, low-power wake-up, push retransmission, and queue backlog.
[0083] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described user notification management method based on flight information.
[0084] The technical solutions of the present invention have been described in detail above with reference to specific embodiments. However, the above embodiments are only used to illustrate the technical concept and technical solutions of the present invention and do not constitute a limitation on the scope of protection of the present invention. Those skilled in the art can make various modifications, alterations, equivalent substitutions, or other forms of adjustment based on the above embodiments without departing from the technical concept and basic principles of the present invention. All changes or improvements made based on the technical content disclosed in the present invention that do not depart from the technical concept and essence of the present invention should fall within the scope of protection defined by the claims of the present invention.
Claims
1. A user notification management method based on flight information, applied to scenarios where operational command events for physical flight segments reach user terminals via message channels, characterized in that, The method includes: The server distinguishes physical segments based on segment identifiers, generates event digests associated with previous digests according to the event order of operation command events within the same physical segment, and determines the current chain head; The server sends a notification envelope corresponding to the current chain head to the user terminal that has subscribed to the physical flight segment. After receiving the notification envelope, the user terminal temporarily stores the notification envelope and sends the notification envelope and local chain state to the server; The server generates chain evidence and confirmation envelopes that connect the local chain state to the current chain head based on the current chain head when tracing back to the source. The user terminal verifies the continuity of the chain evidence and the progression of the confirmation envelope relative to the local chain state. When the verification is successful, it atomically updates the local chain state and replaces the valid notification of the physical segment with the running instructions in the confirmation envelope.
2. The user notification management method based on flight information according to claim 1, characterized in that, The server distinguishes physical flight segments based on flight segment identifiers, including: Receive the flight segment identifier, source event number, generation time, reception time, and operation instructions from the airport operation interface or airline operation interface; The flight segment identifier is generated based on the operating flight number, planned operation date, departure airport, and arrival airport. The integrity of the format of the flight segment identifier, the source event number, the generation time, the reception time, and the operation instruction is verified, and the independent event chain is located by the flight segment identifier.
3. The user notification management method based on flight information according to claim 1, characterized in that, The server generates event digests associated with preceding digests according to the event sequence of operational command events within the same physical flight segment, and determines the current chain head, including: The transmission delay is determined based on the receiving time and the generating time, and the freshness weight is determined based on the transmission delay and a preset delay scale. The sorting key is determined based on the source event number and the freshness weight. Events within the same physical segment are ordered according to the sorting key, and the running instruction event corresponding to the largest sorting key is taken as the current chain head. The event digest is generated in the order of fixed fields of the segment identifier, the source event number, the operation command, the generation time, and the preceding digest, so that the event digest of each operation command event is associated with the event digest of the previous operation command event in the event sequence, wherein the preceding digest of the first operation command event is a fixed string of all zero bytes.
4. The user notification management method based on flight information according to claim 1, characterized in that, The server sends a notification envelope corresponding to the current chain head to user terminals subscribed to the physical flight segment, including: The notification envelope is formed using the segment identifier, sorting key, operation command, and event summary of the current chain leader; The notification envelope is sent to the user terminal via the message channel corresponding to the subscription relationship of the physical flight segment.
5. The user notification management method based on flight information according to claim 1, characterized in that, After receiving the notification envelope, the user terminal temporarily stores the notification envelope and sends the notification envelope and local chain state to the server, including: The notification envelope is received by the push receiving thread of the user terminal, written into the temporary storage area, and the valid notification is maintained. Read the local chain state corresponding to the flight segment identifier and recording the accepted sorting key and event summary, and send the temporarily stored notification envelope and the local chain state to the server.
6. The user notification management method based on flight information according to claim 1, characterized in that, The server generates chain evidence and confirmation envelopes from the local chain state to the current chain head based on the current chain head during the homing process, including: The starting point of the evidence is determined based on the accepted event summary recorded in the local chain state, and an ordered set of evidence data is formed from the starting point of the evidence to the current chain head in the order of the events. Each item in the ordered evidence data set includes the flight segment identifier, the source event number, the operation command, the generation time, and the event summary, with the event summary of the previous item serving as the preorder summary of the next item; The confirmation envelope is formed using the segment identifier, sorting key, operation command, event summary, and chain evidence of the current chain leader.
7. The user notification management method based on flight information according to claim 1, characterized in that, The user terminal verifies the continuity of the chain evidence and the progression of the confirmation envelope relative to the local chain state, including: Verify that the segment identifier of the confirmation envelope is consistent with the physical segment subscribed by the user terminal, recalculate the chain evidence item by item according to the generation relationship of the event digest, and verify that the final event digest obtained by recalculation is consistent with the event digest in the confirmation envelope. The sorting key in the confirmation envelope is compared with the sorting key in the local chain state, and a submission token is generated based on the verification result of the chain evidence and the comparison result of the sorting key.
8. The user notification management method based on flight information according to claim 1, characterized in that, When the user terminal passes verification, it atomically updates the local chain state and replaces the valid notification of the physical flight segment with the execution instructions in the confirmation envelope, including: When the chain evidence is continuous and the sort key of the confirmation envelope strictly advances relative to the sort key in the local chain state, the sort key and event digest in the confirmation envelope are written in the same local database transaction, and the valid notification of the physical segment is replaced with the run instruction in the confirmation envelope.
9. A user notification management system based on flight information, characterized in that, The steps of performing the method according to any one of claims 1 to 8 include: The event summary generation module distinguishes physical flight segments based on flight segment identifiers, generates event summaries associated with previous summaries according to the event order of operation command events within the same physical flight segment, and determines the current chain head; The notification envelope sending module sends a notification envelope corresponding to the current chain head to user terminals that have subscribed to the physical flight segment. The envelope temporary storage and return module allows the user terminal to receive the notification envelope, temporarily store the notification envelope, and send the notification envelope and local chain state to the server. The chain evidence generation module, wherein the server generates chain evidence and confirmation envelope from the local chain state to the current chain head based on the current chain head when tracing back to the source; The chain state verification and update module verifies the continuity of the chain evidence and the advancement relationship of the confirmation envelope relative to the local chain state. When the verification is successful, it atomically updates the local chain state and replaces the valid notification of the physical segment with the running instructions in the confirmation envelope.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program that, when executed, controls the server where the computer-readable storage medium is located to implement the steps of the method according to any one of claims 1 to 8.
